From d2d19dc9dd42fbb2cd9918ac8e0a9a0028632c4b Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 17 Apr 2025 23:55:43 +0000 Subject: [PATCH] CodeGen from PR 33993 in Azure/azure-rest-api-specs Merge 0f29aee1542df13efd2ee8c1114977aaaf6e31df into 877f166d9819e61625338a9ebb9922e1fc646636 --- ...esourceManager.CognitiveServices.net8.0.cs | 790 +++++++++++++++- ...anager.CognitiveServices.netstandard2.0.cs | 790 +++++++++++++++- .../Sample_AccountCapabilityHostCollection.cs | 164 ++++ .../Sample_AccountCapabilityHostResource.cs | 113 +++ .../Sample_AccountConnectionCollection.cs | 204 +++++ .../Sample_AccountConnectionResource.cs | 123 +++ ..._AccountProjectCapabilityHostCollection.cs | 168 ++++ ...le_AccountProjectCapabilityHostResource.cs | 116 +++ ...mple_AccountProjectConnectionCollection.cs | 209 +++++ ...Sample_AccountProjectConnectionResource.cs | 126 +++ ...mple_CognitiveServicesAccountCollection.cs | 26 +- ...tiveServicesAccountDeploymentCollection.cs | 20 +- ...nitiveServicesAccountDeploymentResource.cs | 12 +- ...Sample_CognitiveServicesAccountResource.cs | 34 +- ...gnitiveServicesCommitmentPlanCollection.cs | 20 +- ...CognitiveServicesCommitmentPlanResource.cs | 12 +- ...gnitiveServicesDeletedAccountCollection.cs | 12 +- ...CognitiveServicesDeletedAccountResource.cs | 8 +- ...nitiveServicesEncryptionScopeCollection.cs | 10 +- ...ognitiveServicesEncryptionScopeResource.cs | 6 +- ...icesPrivateEndpointConnectionCollection.cs | 16 +- ...rvicesPrivateEndpointConnectionResource.cs | 8 +- ...mitmentPlanAccountAssociationCollection.cs | 20 +- ...ommitmentPlanAccountAssociationResource.cs | 12 +- .../Sample_CommitmentPlanCollection.cs | 20 +- .../Samples/Sample_CommitmentPlanResource.cs | 12 +- .../Sample_DefenderForAISettingCollection.cs | 10 +- .../Sample_DefenderForAISettingResource.cs | 4 +- ...ecurityPerimeterConfigurationCollection.cs | 8 +- ...kSecurityPerimeterConfigurationResource.cs | 4 +- .../Samples/Sample_ProjectCollection.cs | 246 +++++ .../Samples/Sample_ProjectResource.cs | 116 +++ .../Samples/Sample_RaiBlocklistCollection.cs | 10 +- .../Sample_RaiBlocklistItemCollection.cs | 10 +- .../Sample_RaiBlocklistItemResource.cs | 6 +- .../Samples/Sample_RaiBlocklistResource.cs | 10 +- .../Sample_RaiContentFilterCollection.cs | 8 +- .../Sample_RaiContentFilterResource.cs | 2 +- .../Samples/Sample_RaiPolicyCollection.cs | 34 +- .../Samples/Sample_RaiPolicyResource.cs | 30 +- .../Sample_SubscriptionResourceExtensions.cs | 38 +- .../AccountCapabilityHostCollection.cs | 415 +++++++++ ...untCapabilityHostResource.Serialization.cs | 26 + .../AccountCapabilityHostResource.cs | 347 +++++++ .../Generated/AccountConnectionCollection.cs | 503 +++++++++++ ...AccountConnectionResource.Serialization.cs | 26 + .../Generated/AccountConnectionResource.cs | 344 +++++++ .../AccountProjectCapabilityHostCollection.cs | 415 +++++++++ ...ectCapabilityHostResource.Serialization.cs | 26 + .../AccountProjectCapabilityHostResource.cs | 348 ++++++++ .../AccountProjectConnectionCollection.cs | 503 +++++++++++ ...ProjectConnectionResource.Serialization.cs | 26 + .../AccountProjectConnectionResource.cs | 345 +++++++ .../ArmCognitiveServicesModelFactory.cs | 667 +++++++++++++- .../CapabilityHostData.Serialization.cs | 234 +++++ .../src/Generated/CapabilityHostData.cs | 86 ++ .../CognitiveServicesAccountCollection.cs | 20 +- ...tiveServicesAccountDeploymentCollection.cs | 20 +- ...nitiveServicesAccountDeploymentResource.cs | 28 +- .../CognitiveServicesAccountResource.cs | 287 +++++- ...gnitiveServicesCommitmentPlanCollection.cs | 20 +- ...CognitiveServicesCommitmentPlanResource.cs | 28 +- ...gnitiveServicesDeletedAccountCollection.cs | 12 +- ...CognitiveServicesDeletedAccountResource.cs | 8 +- ...nitiveServicesEncryptionScopeCollection.cs | 20 +- ...ognitiveServicesEncryptionScopeResource.cs | 24 +- ...icesPrivateEndpointConnectionCollection.cs | 16 +- ...rvicesPrivateEndpointConnectionResource.cs | 8 +- ...mitmentPlanAccountAssociationCollection.cs | 20 +- ...ommitmentPlanAccountAssociationResource.cs | 24 +- .../src/Generated/CommitmentPlanCollection.cs | 20 +- .../src/Generated/CommitmentPlanResource.cs | 24 +- ...ertiesV2BasicResourceData.Serialization.cs | 234 +++++ ...ConnectionPropertiesV2BasicResourceData.cs | 98 ++ .../DefenderForAISettingCollection.cs | 20 +- .../Generated/DefenderForAISettingResource.cs | 20 +- .../Extensions/CognitiveServicesExtensions.cs | 159 +++- .../MockableCognitiveServicesArmClient.cs | 60 ++ ...eCognitiveServicesResourceGroupResource.cs | 8 +- ...leCognitiveServicesSubscriptionResource.cs | 56 +- .../AccountCapabilityHostOperationSource.cs | 36 + ...untProjectCapabilityHostOperationSource.cs | 36 + .../ProjectOperationSource.cs | 36 + ...hTypeConnectionProperties.Serialization.cs | 519 +++++++++++ .../Models/AADAuthTypeConnectionProperties.cs | 43 + ...hTypeConnectionProperties.Serialization.cs | 550 ++++++++++++ .../AccessKeyAuthTypeConnectionProperties.cs | 49 + ...hTypeConnectionProperties.Serialization.cs | 553 ++++++++++++ .../AccountKeyAuthTypeConnectionProperties.cs | 60 ++ ...yAuthConnectionProperties.Serialization.cs | 553 ++++++++++++ .../Models/ApiKeyAuthConnectionProperties.cs | 81 ++ .../Generated/Models/CapabilityHostKind.cs | 48 + .../CapabilityHostProperties.Serialization.cs | 597 +++++++++++++ .../Models/CapabilityHostProperties.cs | 69 ++ .../Models/CapabilityHostProvisioningState.cs | 63 ++ ...ServicesAccountProperties.Serialization.cs | 160 ++++ .../CognitiveServicesAccountProperties.cs | 27 +- .../ConnectionAccessKey.Serialization.cs | 204 +++++ .../Generated/Models/ConnectionAccessKey.cs | 71 ++ .../ConnectionAccountKey.Serialization.cs | 170 ++++ .../Generated/Models/ConnectionAccountKey.cs | 66 ++ .../Models/ConnectionApiKey.Serialization.cs | 170 ++++ .../src/Generated/Models/ConnectionApiKey.cs | 66 ++ .../Generated/Models/ConnectionAuthType.cs | 81 ++ .../Generated/Models/ConnectionCategory.cs | 360 ++++++++ .../src/Generated/Models/ConnectionGroup.cs | 66 ++ ...ConnectionManagedIdentity.Serialization.cs | 204 +++++ .../Models/ConnectionManagedIdentity.cs | 71 ++ .../Models/ConnectionOAuth2.Serialization.cs | 405 +++++++++ .../src/Generated/Models/ConnectionOAuth2.cs | 116 +++ ...ectionPersonalAccessToken.Serialization.cs | 170 ++++ .../Models/ConnectionPersonalAccessToken.cs | 66 ++ .../ConnectionPropertiesV2.Serialization.cs | 473 ++++++++++ .../Models/ConnectionPropertiesV2.cs | 132 +++ ...esourceArmPaginatedResult.Serialization.cs | 219 +++++ ...ertiesV2BasicResourceArmPaginatedResult.cs | 70 ++ ...onnectionServicePrincipal.Serialization.cs | 234 +++++ .../Models/ConnectionServicePrincipal.cs | 76 ++ ...tionSharedAccessSignature.Serialization.cs | 170 ++++ .../Models/ConnectionSharedAccessSignature.cs | 66 ++ .../ConnectionUpdateContent.Serialization.cs | 133 +++ .../Models/ConnectionUpdateContent.cs | 74 ++ ...onnectionUsernamePassword.Serialization.cs | 238 +++++ .../Models/ConnectionUsernamePassword.cs | 76 ++ .../Models/CustomKeys.Serialization.cs | 200 +++++ .../src/Generated/Models/CustomKeys.cs | 67 ++ ...mKeysConnectionProperties.Serialization.cs | 553 ++++++++++++ .../Models/CustomKeysConnectionProperties.cs | 65 ++ ...hTypeConnectionProperties.Serialization.cs | 550 ++++++++++++ ...gedIdentityAuthTypeConnectionProperties.cs | 49 + .../Generated/Models/ManagedPERequirement.cs | 54 ++ .../src/Generated/Models/ManagedPEStatus.cs | 54 ++ .../Models/NetworkInjections.Serialization.cs | 227 +++++ .../src/Generated/Models/NetworkInjections.cs | 77 ++ ...hTypeConnectionProperties.Serialization.cs | 519 +++++++++++ .../NoneAuthTypeConnectionProperties.cs | 43 + ...hTypeConnectionProperties.Serialization.cs | 550 ++++++++++++ .../OAuth2AuthTypeConnectionProperties.cs | 55 ++ ...hTypeConnectionProperties.Serialization.cs | 553 ++++++++++++ .../Models/PATAuthTypeConnectionProperties.cs | 60 ++ .../Models/ProjectListResult.Serialization.cs | 219 +++++ .../src/Generated/Models/ProjectListResult.cs | 70 ++ .../Models/ProjectProperties.Serialization.cs | 335 +++++++ .../src/Generated/Models/ProjectProperties.cs | 87 ++ .../src/Generated/Models/RaiPolicyMode.cs | 2 +- .../Generated/Models/RaiPolicyProperties.cs | 4 +- .../Models/ResourceBase.Serialization.cs | 253 ++++++ .../src/Generated/Models/ResourceBase.cs | 72 ++ ...hTypeConnectionProperties.Serialization.cs | 553 ++++++++++++ .../Models/SASAuthTypeConnectionProperties.cs | 60 ++ .../src/Generated/Models/ScenarioType.cs | 51 ++ .../Models/ServiceAccountProvisioningState.cs | 3 + ...hTypeConnectionProperties.Serialization.cs | 550 ++++++++++++ ...cePrincipalAuthTypeConnectionProperties.cs | 49 + ...ownConnectionPropertiesV2.Serialization.cs | 519 +++++++++++ .../Models/UnknownConnectionPropertiesV2.cs | 42 + .../Generated/Models/UserOwnedAmlWorkspace.cs | 10 +- ...hTypeConnectionProperties.Serialization.cs | 550 ++++++++++++ ...amePasswordAuthTypeConnectionProperties.cs | 49 + ...ecurityPerimeterConfigurationCollection.cs | 16 +- ...kSecurityPerimeterConfigurationResource.cs | 8 +- .../src/Generated/ProjectCollection.cs | 493 ++++++++++ .../Generated/ProjectData.Serialization.cs | 376 ++++++++ .../src/Generated/ProjectData.cs | 94 ++ .../ProjectResource.Serialization.cs | 26 + .../src/Generated/ProjectResource.cs | 844 ++++++++++++++++++ .../src/Generated/RaiBlocklistCollection.cs | 20 +- .../Generated/RaiBlocklistItemCollection.cs | 20 +- .../src/Generated/RaiBlocklistItemResource.cs | 24 +- .../src/Generated/RaiBlocklistResource.cs | 36 +- .../Generated/RaiContentFilterCollection.cs | 16 +- .../src/Generated/RaiContentFilterResource.cs | 4 +- .../src/Generated/RaiPolicyCollection.cs | 20 +- .../src/Generated/RaiPolicyResource.cs | 24 +- .../AccountCapabilityHostsRestOperations.cs | 334 +++++++ .../AccountConnectionRestOperations.cs | 665 ++++++++++++++ .../RestOperations/AccountsRestOperations.cs | 2 +- ...gnitiveServicesManagementRestOperations.cs | 2 +- .../CommitmentPlansRestOperations.cs | 2 +- .../CommitmentTiersRestOperations.cs | 2 +- .../DefenderForAISettingsRestOperations.cs | 2 +- .../DeletedAccountsRestOperations.cs | 2 +- .../DeploymentsRestOperations.cs | 2 +- .../EncryptionScopesRestOperations.cs | 2 +- ...ationBasedModelCapacitiesRestOperations.cs | 2 +- .../ModelCapacitiesRestOperations.cs | 2 +- .../RestOperations/ModelsRestOperations.cs | 2 +- ...tyPerimeterConfigurationsRestOperations.cs | 2 +- ...rivateEndpointConnectionsRestOperations.cs | 2 +- .../PrivateLinkResourcesRestOperations.cs | 2 +- .../ProjectCapabilityHostsRestOperations.cs | 358 ++++++++ .../ProjectConnectionRestOperations.cs | 709 +++++++++++++++ .../RestOperations/ProjectsRestOperations.cs | 617 +++++++++++++ .../RaiBlocklistItemsRestOperations.cs | 2 +- .../RaiBlocklistsRestOperations.cs | 2 +- .../RaiContentFiltersRestOperations.cs | 2 +- .../RaiPoliciesRestOperations.cs | 2 +- .../ResourceSkusRestOperations.cs | 2 +- .../RestOperations/UsagesRestOperations.cs | 2 +- .../src/autorest.md | 2 +- sdk/storage/ci.yml | 2 + 201 files changed, 28148 insertions(+), 613 deletions(-) create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountCapabilityHostCollection.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountCapabilityHostResource.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountConnectionCollection.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountConnectionResource.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountProjectCapabilityHostCollection.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountProjectCapabilityHostResource.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountProjectConnectionCollection.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountProjectConnectionResource.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_ProjectCollection.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_ProjectResource.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountCapabilityHostCollection.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountCapabilityHostResource.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountCapabilityHostResource.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountConnectionCollection.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountConnectionResource.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountConnectionResource.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountProjectCapabilityHostCollection.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountProjectCapabilityHostResource.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountProjectCapabilityHostResource.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountProjectConnectionCollection.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountProjectConnectionResource.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountProjectConnectionResource.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CapabilityHostData.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CapabilityHostData.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ConnectionPropertiesV2BasicResourceData.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ConnectionPropertiesV2BasicResourceData.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/LongRunningOperation/AccountCapabilityHostOperationSource.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/LongRunningOperation/AccountProjectCapabilityHostOperationSource.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/LongRunningOperation/ProjectOperationSource.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/AADAuthTypeConnectionProperties.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/AADAuthTypeConnectionProperties.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/AccessKeyAuthTypeConnectionProperties.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/AccessKeyAuthTypeConnectionProperties.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/AccountKeyAuthTypeConnectionProperties.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/AccountKeyAuthTypeConnectionProperties.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ApiKeyAuthConnectionProperties.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ApiKeyAuthConnectionProperties.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CapabilityHostKind.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CapabilityHostProperties.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CapabilityHostProperties.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CapabilityHostProvisioningState.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionAccessKey.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionAccessKey.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionAccountKey.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionAccountKey.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionApiKey.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionApiKey.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionAuthType.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionCategory.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionGroup.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionManagedIdentity.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionManagedIdentity.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionOAuth2.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionOAuth2.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionPersonalAccessToken.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionPersonalAccessToken.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionPropertiesV2.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionPropertiesV2.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionPropertiesV2BasicResourceArmPaginatedResult.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionPropertiesV2BasicResourceArmPaginatedResult.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionServicePrincipal.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionServicePrincipal.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionSharedAccessSignature.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionSharedAccessSignature.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionUpdateContent.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionUpdateContent.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionUsernamePassword.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionUsernamePassword.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CustomKeys.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CustomKeys.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CustomKeysConnectionProperties.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CustomKeysConnectionProperties.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ManagedIdentityAuthTypeConnectionProperties.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ManagedIdentityAuthTypeConnectionProperties.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ManagedPERequirement.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ManagedPEStatus.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/NetworkInjections.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/NetworkInjections.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/NoneAuthTypeConnectionProperties.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/NoneAuthTypeConnectionProperties.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/OAuth2AuthTypeConnectionProperties.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/OAuth2AuthTypeConnectionProperties.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/PATAuthTypeConnectionProperties.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/PATAuthTypeConnectionProperties.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ProjectListResult.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ProjectListResult.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ProjectProperties.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ProjectProperties.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ResourceBase.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ResourceBase.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/SASAuthTypeConnectionProperties.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/SASAuthTypeConnectionProperties.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ScenarioType.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ServicePrincipalAuthTypeConnectionProperties.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ServicePrincipalAuthTypeConnectionProperties.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/UnknownConnectionPropertiesV2.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/UnknownConnectionPropertiesV2.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/UsernamePasswordAuthTypeConnectionProperties.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/UsernamePasswordAuthTypeConnectionProperties.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ProjectCollection.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ProjectData.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ProjectData.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ProjectResource.Serialization.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ProjectResource.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/AccountCapabilityHostsRestOperations.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/AccountConnectionRestOperations.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/ProjectCapabilityHostsRestOperations.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/ProjectConnectionRestOperations.cs create mode 100644 sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/ProjectsRestOperations.cs diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/api/Azure.ResourceManager.CognitiveServices.net8.0.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/api/Azure.ResourceManager.CognitiveServices.net8.0.cs index 5b1b46e31d4c..1ab52a83d195 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/api/Azure.ResourceManager.CognitiveServices.net8.0.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/api/Azure.ResourceManager.CognitiveServices.net8.0.cs @@ -1,5 +1,150 @@ namespace Azure.ResourceManager.CognitiveServices { + public partial class AccountCapabilityHostCollection : Azure.ResourceManager.ArmCollection + { + protected AccountCapabilityHostCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string capabilityHostName, Azure.ResourceManager.CognitiveServices.CapabilityHostData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string capabilityHostName, Azure.ResourceManager.CognitiveServices.CapabilityHostData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AccountCapabilityHostResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AccountCapabilityHostResource() { } + public virtual Azure.ResourceManager.CognitiveServices.CapabilityHostData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string capabilityHostName) { 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.CognitiveServices.CapabilityHostData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.CapabilityHostData 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.CognitiveServices.CapabilityHostData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CognitiveServices.CapabilityHostData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AccountConnectionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AccountConnectionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string connectionName, Azure.ResourceManager.CognitiveServices.ConnectionPropertiesV2BasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string connectionName, Azure.ResourceManager.CognitiveServices.ConnectionPropertiesV2BasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string target = null, string category = null, bool? includeAll = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string target = null, string category = null, bool? includeAll = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string connectionName, 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 AccountConnectionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AccountConnectionResource() { } + public virtual Azure.ResourceManager.CognitiveServices.ConnectionPropertiesV2BasicResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string connectionName) { 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.CognitiveServices.ConnectionPropertiesV2BasicResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.ConnectionPropertiesV2BasicResourceData 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.Response Update(Azure.ResourceManager.CognitiveServices.Models.ConnectionUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.CognitiveServices.Models.ConnectionUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AccountProjectCapabilityHostCollection : Azure.ResourceManager.ArmCollection + { + protected AccountProjectCapabilityHostCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string capabilityHostName, Azure.ResourceManager.CognitiveServices.CapabilityHostData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string capabilityHostName, Azure.ResourceManager.CognitiveServices.CapabilityHostData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AccountProjectCapabilityHostResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AccountProjectCapabilityHostResource() { } + public virtual Azure.ResourceManager.CognitiveServices.CapabilityHostData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string projectName, string capabilityHostName) { 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.CognitiveServices.CapabilityHostData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.CapabilityHostData 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.CognitiveServices.CapabilityHostData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CognitiveServices.CapabilityHostData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AccountProjectConnectionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AccountProjectConnectionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string connectionName, Azure.ResourceManager.CognitiveServices.ConnectionPropertiesV2BasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string connectionName, Azure.ResourceManager.CognitiveServices.ConnectionPropertiesV2BasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string target = null, string category = null, bool? includeAll = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string target = null, string category = null, bool? includeAll = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string connectionName, 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 AccountProjectConnectionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AccountProjectConnectionResource() { } + public virtual Azure.ResourceManager.CognitiveServices.ConnectionPropertiesV2BasicResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string projectName, string connectionName) { 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.CognitiveServices.ConnectionPropertiesV2BasicResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.ConnectionPropertiesV2BasicResourceData 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.Response Update(Azure.ResourceManager.CognitiveServices.Models.ConnectionUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.CognitiveServices.Models.ConnectionUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class CapabilityHostData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CapabilityHostData(Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProperties properties) { } + public Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.CapabilityHostData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.CapabilityHostData 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 CognitiveServicesAccountCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected CognitiveServicesAccountCollection() { } @@ -104,6 +249,12 @@ protected CognitiveServicesAccountResource() { } 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 Azure.Response GetAccountCapabilityHost(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAccountCapabilityHostAsync(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CognitiveServices.AccountCapabilityHostCollection GetAccountCapabilityHosts() { throw null; } + public virtual Azure.Response GetAccountConnection(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAccountConnectionAsync(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CognitiveServices.AccountConnectionCollection GetAccountConnections() { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetCognitiveServicesAccountDeployment(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetCognitiveServicesAccountDeploymentAsync(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -129,6 +280,9 @@ protected CognitiveServicesAccountResource() { } public virtual Azure.ResourceManager.CognitiveServices.NetworkSecurityPerimeterConfigurationCollection GetNetworkSecurityPerimeterConfigurations() { throw null; } public virtual Azure.Pageable GetPrivateLinkResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetPrivateLinkResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetProject(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetProjectAsync(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CognitiveServices.ProjectCollection GetProjects() { throw null; } public virtual Azure.Response GetRaiBlocklist(string raiBlocklistName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetRaiBlocklistAsync(string raiBlocklistName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.CognitiveServices.RaiBlocklistCollection GetRaiBlocklists() { throw null; } @@ -308,6 +462,10 @@ public static partial class CognitiveServicesExtensions public static System.Threading.Tasks.Task> CheckDomainAvailabilityAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesDomainAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Pageable CheckSkuAvailability(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesSkuAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable CheckSkuAvailabilityAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesSkuAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.CognitiveServices.AccountCapabilityHostResource GetAccountCapabilityHostResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.CognitiveServices.AccountConnectionResource GetAccountConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.CognitiveServices.AccountProjectCapabilityHostResource GetAccountProjectCapabilityHostResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.CognitiveServices.AccountProjectConnectionResource GetAccountProjectConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetCognitiveServicesAccount(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetCognitiveServicesAccountAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.CognitiveServices.CognitiveServicesAccountDeploymentResource GetCognitiveServicesAccountDeploymentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -341,6 +499,7 @@ public static partial class CognitiveServicesExtensions public static Azure.Pageable GetModels(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetModelsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.CognitiveServices.NetworkSecurityPerimeterConfigurationResource GetNetworkSecurityPerimeterConfigurationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.CognitiveServices.ProjectResource GetProjectResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CognitiveServices.RaiBlocklistItemResource GetRaiBlocklistItemResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CognitiveServices.RaiBlocklistResource GetRaiBlocklistResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetRaiContentFilter(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string filterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -514,6 +673,17 @@ protected CommitmentPlanResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.CognitiveServices.CommitmentPlanData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CognitiveServices.CommitmentPlanData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class ConnectionPropertiesV2BasicResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectionPropertiesV2BasicResourceData(Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2 properties) { } + public Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2 Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.ConnectionPropertiesV2BasicResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.ConnectionPropertiesV2BasicResourceData 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 DefenderForAISettingCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected DefenderForAISettingCollection() { } @@ -610,6 +780,67 @@ protected NetworkSecurityPerimeterConfigurationResource() { } 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 ProjectCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ProjectCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string projectName, Azure.ResourceManager.CognitiveServices.ProjectData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string projectName, Azure.ResourceManager.CognitiveServices.ProjectData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string projectName, 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 projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string projectName, 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 ProjectData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ProjectData(Azure.Core.AzureLocation location) { } + public Azure.ETag? ETag { get { throw null; } } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.CognitiveServices.Models.ProjectProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.ProjectData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.ProjectData 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 ProjectResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ProjectResource() { } + public virtual Azure.ResourceManager.CognitiveServices.ProjectData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string projectName) { 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 Azure.Response GetAccountProjectCapabilityHost(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAccountProjectCapabilityHostAsync(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CognitiveServices.AccountProjectCapabilityHostCollection GetAccountProjectCapabilityHosts() { throw null; } + public virtual Azure.Response GetAccountProjectConnection(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAccountProjectConnectionAsync(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CognitiveServices.AccountProjectConnectionCollection GetAccountProjectConnections() { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.CognitiveServices.ProjectData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.ProjectData 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.CognitiveServices.ProjectData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CognitiveServices.ProjectData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class RaiBlocklistCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected RaiBlocklistCollection() { } @@ -829,6 +1060,10 @@ namespace Azure.ResourceManager.CognitiveServices.Mocking public partial class MockableCognitiveServicesArmClient : Azure.ResourceManager.ArmResource { protected MockableCognitiveServicesArmClient() { } + public virtual Azure.ResourceManager.CognitiveServices.AccountCapabilityHostResource GetAccountCapabilityHostResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.CognitiveServices.AccountConnectionResource GetAccountConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.CognitiveServices.AccountProjectCapabilityHostResource GetAccountProjectCapabilityHostResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.CognitiveServices.AccountProjectConnectionResource GetAccountProjectConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CognitiveServices.CognitiveServicesAccountDeploymentResource GetCognitiveServicesAccountDeploymentResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CognitiveServices.CognitiveServicesAccountResource GetCognitiveServicesAccountResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CognitiveServices.CognitiveServicesCommitmentPlanResource GetCognitiveServicesCommitmentPlanResource(Azure.Core.ResourceIdentifier id) { throw null; } @@ -839,6 +1074,7 @@ protected MockableCognitiveServicesArmClient() { } public virtual Azure.ResourceManager.CognitiveServices.CommitmentPlanResource GetCommitmentPlanResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CognitiveServices.DefenderForAISettingResource GetDefenderForAISettingResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CognitiveServices.NetworkSecurityPerimeterConfigurationResource GetNetworkSecurityPerimeterConfigurationResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.CognitiveServices.ProjectResource GetProjectResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CognitiveServices.RaiBlocklistItemResource GetRaiBlocklistItemResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CognitiveServices.RaiBlocklistResource GetRaiBlocklistResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CognitiveServices.RaiContentFilterResource GetRaiContentFilterResource(Azure.Core.ResourceIdentifier id) { throw null; } @@ -891,6 +1127,16 @@ protected MockableCognitiveServicesSubscriptionResource() { } } namespace Azure.ResourceManager.CognitiveServices.Models { + public partial class AADAuthTypeConnectionProperties : Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AADAuthTypeConnectionProperties() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.AADAuthTypeConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.AADAuthTypeConnectionProperties 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 AbusePenalty : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AbusePenalty() { } @@ -922,12 +1168,51 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.CognitiveServices.Models.AbusePenaltyAction left, Azure.ResourceManager.CognitiveServices.Models.AbusePenaltyAction right) { throw null; } public override string ToString() { throw null; } } + public partial class AccessKeyAuthTypeConnectionProperties : Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AccessKeyAuthTypeConnectionProperties() { } + public Azure.ResourceManager.CognitiveServices.Models.ConnectionAccessKey Credentials { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.AccessKeyAuthTypeConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.AccessKeyAuthTypeConnectionProperties 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 AccountKeyAuthTypeConnectionProperties : Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AccountKeyAuthTypeConnectionProperties() { } + public string CredentialsKey { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.AccountKeyAuthTypeConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.AccountKeyAuthTypeConnectionProperties 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 ApiKeyAuthConnectionProperties : Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ApiKeyAuthConnectionProperties() { } + public string CredentialsKey { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.ApiKeyAuthConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.ApiKeyAuthConnectionProperties 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 static partial class ArmCognitiveServicesModelFactory { + public static Azure.ResourceManager.CognitiveServices.Models.AADAuthTypeConnectionProperties AADAuthTypeConnectionProperties(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory? category = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup? group = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement?), Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?)) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.AbusePenalty AbusePenalty(Azure.ResourceManager.CognitiveServices.Models.AbusePenaltyAction? action = default(Azure.ResourceManager.CognitiveServices.Models.AbusePenaltyAction?), float? rateLimitPercentage = default(float?), System.DateTimeOffset? expiration = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.AccessKeyAuthTypeConnectionProperties AccessKeyAuthTypeConnectionProperties(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory? category = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup? group = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement?), Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), Azure.ResourceManager.CognitiveServices.Models.ConnectionAccessKey credentials = null) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.AccountKeyAuthTypeConnectionProperties AccountKeyAuthTypeConnectionProperties(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory? category = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup? group = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement?), Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), string credentialsKey = null) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.ApiKeyAuthConnectionProperties ApiKeyAuthConnectionProperties(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory? category = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup? group = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement?), Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), string credentialsKey = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.AvailableCognitiveServicesSku AvailableCognitiveServicesSku(string resourceType = null, string name = null, string tier = null, string kind = null, System.Collections.Generic.IEnumerable locations = null, System.Collections.Generic.IEnumerable restrictions = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.CalculateModelCapacityResult CalculateModelCapacityResult(Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesAccountDeploymentModel model = null, string skuName = null, Azure.ResourceManager.CognitiveServices.Models.CalculateModelCapacityResultEstimatedCapacity estimatedCapacity = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.CalculateModelCapacityResultEstimatedCapacity CalculateModelCapacityResultEstimatedCapacity(int? value = default(int?), int? deployableValue = default(int?)) { throw null; } + public static Azure.ResourceManager.CognitiveServices.CapabilityHostData CapabilityHostData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProperties properties = null) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProperties CapabilityHostProperties(string description = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IEnumerable aiServicesConnections = null, Azure.ResourceManager.CognitiveServices.Models.CapabilityHostKind? capabilityHostKind = default(Azure.ResourceManager.CognitiveServices.Models.CapabilityHostKind?), string customerSubnet = null, Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProvisioningState? provisioningState = default(Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProvisioningState?), System.Collections.Generic.IEnumerable storageConnections = null, System.Collections.Generic.IEnumerable threadStorageConnections = null, System.Collections.Generic.IEnumerable vectorStoreConnections = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.CognitiveServicesAccountData CognitiveServicesAccountData(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), string kind = null, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesSku sku = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesAccountProperties properties = null, Azure.ETag? etag = default(Azure.ETag?)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.CognitiveServices.CognitiveServicesAccountDeploymentData CognitiveServicesAccountDeploymentData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesSku sku, Azure.ETag? etag, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesAccountDeploymentProperties properties) { throw null; } @@ -942,7 +1227,9 @@ public static partial class ArmCognitiveServicesModelFactory [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesAccountModel CognitiveServicesAccountModel(string format, string name, string version, string source, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountCallRateLimit callRateLimit, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesAccountDeploymentModel baseModel, bool? isDefaultVersion, System.Collections.Generic.IEnumerable skus, int? maxCapacity, System.Collections.Generic.IDictionary capabilities, System.Collections.Generic.IDictionary finetuneCapabilities, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountModelDeprecationInfo deprecation, Azure.ResourceManager.CognitiveServices.Models.ModelLifecycleStatus? lifecycleStatus, Azure.ResourceManager.Models.SystemData systemData) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesAccountModel CognitiveServicesAccountModel(string publisher = null, string format = null, string name = null, string version = null, string source = null, Azure.Core.ResourceIdentifier sourceAccount = null, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountCallRateLimit callRateLimit = null, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesAccountDeploymentModel baseModel = null, bool? isDefaultVersion = default(bool?), System.Collections.Generic.IEnumerable skus = null, int? maxCapacity = default(int?), System.Collections.Generic.IDictionary capabilities = null, System.Collections.Generic.IDictionary finetuneCapabilities = null, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountModelDeprecationInfo deprecation = null, Azure.ResourceManager.CognitiveServices.Models.ModelLifecycleStatus? lifecycleStatus = default(Azure.ResourceManager.CognitiveServices.Models.ModelLifecycleStatus?), Azure.ResourceManager.Models.SystemData systemData = null) { throw null; } - public static Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesAccountProperties CognitiveServicesAccountProperties(Azure.ResourceManager.CognitiveServices.Models.ServiceAccountProvisioningState? provisioningState = default(Azure.ResourceManager.CognitiveServices.Models.ServiceAccountProvisioningState?), string endpoint = null, System.Collections.Generic.IEnumerable capabilities = null, bool? isMigrated = default(bool?), string migrationToken = null, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesSkuChangeInfo skuChangeInfo = null, string customSubDomainName = null, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesNetworkRuleSet networkAcls = null, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountEncryptionProperties encryption = null, System.Collections.Generic.IEnumerable userOwnedStorage = null, Azure.ResourceManager.CognitiveServices.Models.UserOwnedAmlWorkspace amlWorkspace = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.CognitiveServices.Models.ServiceAccountPublicNetworkAccess?), Azure.ResourceManager.CognitiveServices.Models.ServiceAccountApiProperties apiProperties = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.CognitiveServices.Models.ServiceAccountCallRateLimit callRateLimit = null, bool? enableDynamicThrottling = default(bool?), Azure.ResourceManager.CognitiveServices.Models.ServiceAccountQuotaLimit quotaLimit = null, bool? restrictOutboundNetworkAccess = default(bool?), System.Collections.Generic.IEnumerable allowedFqdnList = null, bool? disableLocalAuth = default(bool?), System.Collections.Generic.IReadOnlyDictionary endpoints = null, bool? restore = default(bool?), System.DateTimeOffset? deletedOn = default(System.DateTimeOffset?), string scheduledPurgeDate = null, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesMultiRegionSettings locations = null, System.Collections.Generic.IEnumerable commitmentPlanAssociations = null, Azure.ResourceManager.CognitiveServices.Models.AbusePenalty abusePenalty = null, Azure.ResourceManager.CognitiveServices.Models.RaiMonitorConfig raiMonitorConfig = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesAccountProperties CognitiveServicesAccountProperties(Azure.ResourceManager.CognitiveServices.Models.ServiceAccountProvisioningState? provisioningState, string endpoint, System.Collections.Generic.IEnumerable capabilities, bool? isMigrated, string migrationToken, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesSkuChangeInfo skuChangeInfo, string customSubDomainName, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesNetworkRuleSet networkAcls, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountEncryptionProperties encryption, System.Collections.Generic.IEnumerable userOwnedStorage, Azure.ResourceManager.CognitiveServices.Models.UserOwnedAmlWorkspace amlWorkspace, System.Collections.Generic.IEnumerable privateEndpointConnections, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountPublicNetworkAccess? publicNetworkAccess, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountApiProperties apiProperties, System.DateTimeOffset? createdOn, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountCallRateLimit callRateLimit, bool? enableDynamicThrottling, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountQuotaLimit quotaLimit, bool? restrictOutboundNetworkAccess, System.Collections.Generic.IEnumerable allowedFqdnList, bool? disableLocalAuth, System.Collections.Generic.IReadOnlyDictionary endpoints, bool? restore, System.DateTimeOffset? deletedOn, string scheduledPurgeDate, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesMultiRegionSettings locations, System.Collections.Generic.IEnumerable commitmentPlanAssociations, Azure.ResourceManager.CognitiveServices.Models.AbusePenalty abusePenalty, Azure.ResourceManager.CognitiveServices.Models.RaiMonitorConfig raiMonitorConfig) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesAccountProperties CognitiveServicesAccountProperties(Azure.ResourceManager.CognitiveServices.Models.ServiceAccountProvisioningState? provisioningState = default(Azure.ResourceManager.CognitiveServices.Models.ServiceAccountProvisioningState?), string endpoint = null, System.Collections.Generic.IEnumerable capabilities = null, bool? isMigrated = default(bool?), string migrationToken = null, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesSkuChangeInfo skuChangeInfo = null, string customSubDomainName = null, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesNetworkRuleSet networkAcls = null, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountEncryptionProperties encryption = null, System.Collections.Generic.IEnumerable userOwnedStorage = null, Azure.ResourceManager.CognitiveServices.Models.UserOwnedAmlWorkspace amlWorkspace = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.CognitiveServices.Models.ServiceAccountPublicNetworkAccess?), Azure.ResourceManager.CognitiveServices.Models.ServiceAccountApiProperties apiProperties = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.CognitiveServices.Models.ServiceAccountCallRateLimit callRateLimit = null, bool? enableDynamicThrottling = default(bool?), Azure.ResourceManager.CognitiveServices.Models.ServiceAccountQuotaLimit quotaLimit = null, bool? restrictOutboundNetworkAccess = default(bool?), System.Collections.Generic.IEnumerable allowedFqdnList = null, bool? disableLocalAuth = default(bool?), System.Collections.Generic.IReadOnlyDictionary endpoints = null, bool? restore = default(bool?), System.DateTimeOffset? deletedOn = default(System.DateTimeOffset?), string scheduledPurgeDate = null, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesMultiRegionSettings locations = null, System.Collections.Generic.IEnumerable commitmentPlanAssociations = null, Azure.ResourceManager.CognitiveServices.Models.AbusePenalty abusePenalty = null, Azure.ResourceManager.CognitiveServices.Models.RaiMonitorConfig raiMonitorConfig = null, Azure.ResourceManager.CognitiveServices.Models.NetworkInjections networkInjections = null, bool? allowProjectManagement = default(bool?), string defaultProject = null, System.Collections.Generic.IEnumerable associatedProjects = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesAccountProperties CognitiveServicesAccountProperties(Azure.ResourceManager.CognitiveServices.Models.ServiceAccountProvisioningState? provisioningState, string endpoint, System.Collections.Generic.IEnumerable capabilities, bool? isMigrated, string migrationToken, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesSkuChangeInfo skuChangeInfo, string customSubDomainName, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesNetworkRuleSet networkAcls, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountEncryptionProperties encryption, System.Collections.Generic.IEnumerable userOwnedStorage, System.Collections.Generic.IEnumerable privateEndpointConnections, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountPublicNetworkAccess? publicNetworkAccess, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountApiProperties apiProperties, System.DateTimeOffset? createdOn, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountCallRateLimit callRateLimit, bool? enableDynamicThrottling, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountQuotaLimit quotaLimit, bool? restrictOutboundNetworkAccess, System.Collections.Generic.IEnumerable allowedFqdnList, bool? disableLocalAuth, System.Collections.Generic.IReadOnlyDictionary endpoints, bool? restore, System.DateTimeOffset? deletedOn, string scheduledPurgeDate, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesMultiRegionSettings locations, System.Collections.Generic.IEnumerable commitmentPlanAssociations, Azure.ResourceManager.CognitiveServices.Models.AbusePenalty abusePenalty) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesAccountSku CognitiveServicesAccountSku(Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesSku sku = null) { throw null; } @@ -975,15 +1262,25 @@ public static partial class ArmCognitiveServicesModelFactory public static Azure.ResourceManager.CognitiveServices.Models.CommitmentPlanProperties CommitmentPlanProperties(Azure.ResourceManager.CognitiveServices.Models.CommitmentPlanProvisioningState? provisioningState = default(Azure.ResourceManager.CognitiveServices.Models.CommitmentPlanProvisioningState?), System.Guid? commitmentPlanGuid = default(System.Guid?), Azure.ResourceManager.CognitiveServices.Models.ServiceAccountHostingModel? hostingModel = default(Azure.ResourceManager.CognitiveServices.Models.ServiceAccountHostingModel?), string planType = null, Azure.ResourceManager.CognitiveServices.Models.CommitmentPeriod current = null, bool? autoRenew = default(bool?), Azure.ResourceManager.CognitiveServices.Models.CommitmentPeriod next = null, Azure.ResourceManager.CognitiveServices.Models.CommitmentPeriod last = null, System.Collections.Generic.IEnumerable provisioningIssues = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.CommitmentQuota CommitmentQuota(long? quantity = default(long?), string unit = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.CommitmentTier CommitmentTier(string kind = null, string skuName = null, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountHostingModel? hostingModel = default(Azure.ResourceManager.CognitiveServices.Models.ServiceAccountHostingModel?), string planType = null, string tier = null, int? maxCount = default(int?), Azure.ResourceManager.CognitiveServices.Models.CommitmentQuota quota = null, Azure.ResourceManager.CognitiveServices.Models.CommitmentCost cost = null) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2 ConnectionPropertiesV2(string authType = null, Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory? category = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup? group = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement?), Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?)) { throw null; } + public static Azure.ResourceManager.CognitiveServices.ConnectionPropertiesV2BasicResourceData ConnectionPropertiesV2BasicResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2 properties = null) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.CustomKeysConnectionProperties CustomKeysConnectionProperties(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory? category = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup? group = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement?), Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), System.Collections.Generic.IDictionary credentialsKeys = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.DefenderForAISettingData DefenderForAISettingData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ETag? etag = default(Azure.ETag?), System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.CognitiveServices.Models.DefenderForAISettingState? state = default(Azure.ResourceManager.CognitiveServices.Models.DefenderForAISettingState?)) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.ManagedIdentityAuthTypeConnectionProperties ManagedIdentityAuthTypeConnectionProperties(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory? category = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup? group = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement?), Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), Azure.ResourceManager.CognitiveServices.Models.ConnectionManagedIdentity credentials = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.ModelCapacityListResultValueItem ModelCapacityListResultValueItem(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.CognitiveServices.Models.ModelSkuCapacityProperties properties = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.NetworkSecurityPerimeterConfigurationData NetworkSecurityPerimeterConfigurationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.CognitiveServices.Models.NetworkSecurityPerimeterConfigurationProperties properties = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.NetworkSecurityPerimeterConfigurationProperties NetworkSecurityPerimeterConfigurationProperties(string provisioningState = null, System.Collections.Generic.IEnumerable provisioningIssues = null, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesNetworkSecurityPerimeter networkSecurityPerimeter = null, Azure.ResourceManager.CognitiveServices.Models.NetworkSecurityPerimeterConfigurationAssociationInfo resourceAssociation = null, Azure.ResourceManager.CognitiveServices.Models.NetworkSecurityPerimeterProfileInfo profile = null) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.NoneAuthTypeConnectionProperties NoneAuthTypeConnectionProperties(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory? category = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup? group = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement?), Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?)) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.OAuth2AuthTypeConnectionProperties OAuth2AuthTypeConnectionProperties(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory? category = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup? group = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement?), Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), Azure.ResourceManager.CognitiveServices.Models.ConnectionOAuth2 credentials = null) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.PATAuthTypeConnectionProperties PATAuthTypeConnectionProperties(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory? category = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup? group = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement?), Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), string credentialsPat = null) { throw null; } + public static Azure.ResourceManager.CognitiveServices.ProjectData ProjectData(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.CognitiveServices.Models.ProjectProperties properties = null, Azure.ETag? etag = default(Azure.ETag?)) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.ProjectProperties ProjectProperties(Azure.ResourceManager.CognitiveServices.Models.ServiceAccountProvisioningState? provisioningState = default(Azure.ResourceManager.CognitiveServices.Models.ServiceAccountProvisioningState?), string displayName = null, string description = null, System.Collections.Generic.IReadOnlyDictionary endpoints = null, bool? isDefault = default(bool?)) { throw null; } public static Azure.ResourceManager.CognitiveServices.RaiBlocklistData RaiBlocklistData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ETag? etag = default(Azure.ETag?), System.Collections.Generic.IDictionary tags = null, string raiBlocklistDescription = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.RaiBlocklistItemData RaiBlocklistItemData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ETag? etag = default(Azure.ETag?), System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.CognitiveServices.Models.RaiBlocklistItemProperties properties = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.RaiContentFilterData RaiContentFilterData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.CognitiveServices.Models.RaiContentFilterProperties properties = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.RaiPolicyData RaiPolicyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ETag? etag = default(Azure.ETag?), System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.CognitiveServices.Models.RaiPolicyProperties properties = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.RaiPolicyProperties RaiPolicyProperties(Azure.ResourceManager.CognitiveServices.Models.RaiPolicyType? policyType = default(Azure.ResourceManager.CognitiveServices.Models.RaiPolicyType?), Azure.ResourceManager.CognitiveServices.Models.RaiPolicyMode? mode = default(Azure.ResourceManager.CognitiveServices.Models.RaiPolicyMode?), string basePolicyName = null, System.Collections.Generic.IEnumerable contentFilters = null, System.Collections.Generic.IEnumerable customBlocklists = null) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.SASAuthTypeConnectionProperties SASAuthTypeConnectionProperties(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory? category = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup? group = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement?), Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), string credentialsSas = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.ServiceAccountApiKeys ServiceAccountApiKeys(string key1 = null, string key2 = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.ServiceAccountCallRateLimit ServiceAccountCallRateLimit(float? count = default(float?), float? renewalPeriod = default(float?), System.Collections.Generic.IEnumerable rules = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.ServiceAccountQuotaLimit ServiceAccountQuotaLimit(float? count = default(float?), float? renewalPeriod = default(float?), System.Collections.Generic.IEnumerable rules = null) { throw null; } @@ -991,6 +1288,8 @@ public static partial class ArmCognitiveServicesModelFactory public static Azure.ResourceManager.CognitiveServices.Models.ServiceAccountThrottlingRule ServiceAccountThrottlingRule(string key = null, float? renewalPeriod = default(float?), float? count = default(float?), float? minCount = default(float?), bool? isDynamicThrottlingEnabled = default(bool?), System.Collections.Generic.IEnumerable matchPatterns = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.ServiceAccountUsage ServiceAccountUsage(Azure.ResourceManager.CognitiveServices.Models.ServiceAccountUsageUnitType? unit = default(Azure.ResourceManager.CognitiveServices.Models.ServiceAccountUsageUnitType?), Azure.ResourceManager.CognitiveServices.Models.ServiceAccountUsageMetricName name = null, string quotaPeriod = null, double? limit = default(double?), double? currentValue = default(double?), string nextResetTime = null, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountQuotaUsageStatus? status = default(Azure.ResourceManager.CognitiveServices.Models.ServiceAccountQuotaUsageStatus?)) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.ServiceAccountUsageMetricName ServiceAccountUsageMetricName(string value = null, string localizedValue = null) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.ServicePrincipalAuthTypeConnectionProperties ServicePrincipalAuthTypeConnectionProperties(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory? category = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup? group = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement?), Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), Azure.ResourceManager.CognitiveServices.Models.ConnectionServicePrincipal credentials = null) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.UsernamePasswordAuthTypeConnectionProperties UsernamePasswordAuthTypeConnectionProperties(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory? category = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup? group = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement?), Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), Azure.ResourceManager.CognitiveServices.Models.ConnectionUsernamePassword credentials = null) { throw null; } } public partial class AvailableCognitiveServicesSku : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -1059,6 +1358,62 @@ 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 CapabilityHostKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CapabilityHostKind(string value) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.CapabilityHostKind Agents { get { throw null; } } + public bool Equals(Azure.ResourceManager.CognitiveServices.Models.CapabilityHostKind 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.CognitiveServices.Models.CapabilityHostKind left, Azure.ResourceManager.CognitiveServices.Models.CapabilityHostKind right) { throw null; } + public static implicit operator Azure.ResourceManager.CognitiveServices.Models.CapabilityHostKind (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CognitiveServices.Models.CapabilityHostKind left, Azure.ResourceManager.CognitiveServices.Models.CapabilityHostKind right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CapabilityHostProperties : Azure.ResourceManager.CognitiveServices.Models.ResourceBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CapabilityHostProperties() { } + public System.Collections.Generic.IList AiServicesConnections { get { throw null; } set { } } + public Azure.ResourceManager.CognitiveServices.Models.CapabilityHostKind? CapabilityHostKind { get { throw null; } set { } } + public string CustomerSubnet { get { throw null; } set { } } + public Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IList StorageConnections { get { throw null; } set { } } + public System.Collections.Generic.IList ThreadStorageConnections { get { throw null; } set { } } + public System.Collections.Generic.IList VectorStoreConnections { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.CapabilityHostProperties 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 CapabilityHostProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CapabilityHostProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProvisioningState 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.CognitiveServices.Models.CapabilityHostProvisioningState left, Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProvisioningState left, Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } public partial class CognitiveServicesAccountDeploymentModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public CognitiveServicesAccountDeploymentModel() { } @@ -1177,13 +1532,16 @@ public partial class CognitiveServicesAccountProperties : System.ClientModel.Pri public CognitiveServicesAccountProperties() { } public Azure.ResourceManager.CognitiveServices.Models.AbusePenalty AbusePenalty { get { throw null; } } public System.Collections.Generic.IList AllowedFqdnList { get { throw null; } } + public bool? AllowProjectManagement { get { throw null; } set { } } public Azure.ResourceManager.CognitiveServices.Models.UserOwnedAmlWorkspace AmlWorkspace { get { throw null; } set { } } public Azure.ResourceManager.CognitiveServices.Models.ServiceAccountApiProperties ApiProperties { get { throw null; } set { } } + public System.Collections.Generic.IList AssociatedProjects { get { throw null; } } public Azure.ResourceManager.CognitiveServices.Models.ServiceAccountCallRateLimit CallRateLimit { get { throw null; } } public System.Collections.Generic.IReadOnlyList Capabilities { get { throw null; } } public System.Collections.Generic.IReadOnlyList CommitmentPlanAssociations { get { throw null; } } public System.DateTimeOffset? CreatedOn { get { throw null; } } public string CustomSubDomainName { get { throw null; } set { } } + public string DefaultProject { get { throw null; } set { } } public System.DateTimeOffset? DeletedOn { get { throw null; } } public bool? DisableLocalAuth { get { throw null; } set { } } public bool? EnableDynamicThrottling { get { throw null; } set { } } @@ -1194,6 +1552,7 @@ public CognitiveServicesAccountProperties() { } public Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesMultiRegionSettings Locations { get { throw null; } set { } } public string MigrationToken { get { throw null; } set { } } public Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesNetworkRuleSet NetworkAcls { get { throw null; } set { } } + public Azure.ResourceManager.CognitiveServices.Models.NetworkInjections NetworkInjections { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList PrivateEndpointConnections { get { throw null; } } public Azure.ResourceManager.CognitiveServices.Models.ServiceAccountProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.CognitiveServices.Models.ServiceAccountPublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } @@ -1796,6 +2155,251 @@ 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 ConnectionAccessKey : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectionAccessKey() { } + public string AccessKeyId { get { throw null; } set { } } + public string SecretAccessKey { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.ConnectionAccessKey System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.ConnectionAccessKey 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 ConnectionCategory : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConnectionCategory(string value) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AdlsGen2 { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AIServices { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AmazonMws { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AmazonRdsForOracle { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AmazonRdsForSqlServer { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AmazonRedshift { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AmazonS3Compatible { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory ApiKey { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AzureBlob { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AzureDatabricksDeltaLake { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AzureDataExplorer { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AzureMariaDb { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AzureMySqlDb { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AzureOneLake { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AzureOpenAI { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AzurePostgresDb { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AzureSqlDb { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AzureSqlMi { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AzureSynapseAnalytics { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AzureTableStorage { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory BingLLMSearch { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Cassandra { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory CognitiveSearch { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory CognitiveService { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Concur { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory ContainerRegistry { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory CosmosDb { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory CosmosDbMongoDbApi { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Couchbase { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory CustomKeys { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Db2 { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Drill { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Dynamics { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory DynamicsAx { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory DynamicsCrm { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Elasticsearch { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Eloqua { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory FileServer { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory FtpServer { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory GenericContainerRegistry { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory GenericHttp { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory GenericRest { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Git { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory GoogleAdWords { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory GoogleBigQuery { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory GoogleCloudStorage { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Greenplum { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Hbase { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Hdfs { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Hive { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Hubspot { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Impala { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Informix { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Jira { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Magento { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory ManagedOnlineEndpoint { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory MariaDb { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Marketo { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory MicrosoftAccess { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory MongoDbAtlas { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory MongoDbV2 { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory MySql { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Netezza { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory ODataRest { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Odbc { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Office365 { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory OpenAI { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Oracle { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory OracleCloudStorage { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory OracleServiceCloud { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory PayPal { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Phoenix { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Pinecone { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory PostgreSql { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Presto { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory PythonFeed { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory QuickBooks { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Redis { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Responsys { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory S3 { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Salesforce { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory SalesforceMarketingCloud { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory SalesforceServiceCloud { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory SapBw { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory SapCloudForCustomer { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory SapEcc { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory SapHana { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory SapOpenHub { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory SapTable { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Serp { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Serverless { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory ServiceNow { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Sftp { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory SharePointOnlineList { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Shopify { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Snowflake { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Spark { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory SqlServer { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Square { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Sybase { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Teradata { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Vertica { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory WebTable { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Xero { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Zoho { get { throw null; } } + public bool Equals(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory 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.CognitiveServices.Models.ConnectionCategory left, Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory right) { throw null; } + public static implicit operator Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory left, Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ConnectionGroup : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConnectionGroup(string value) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup Azure { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup AzureAI { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup Database { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup File { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup GenericProtocol { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup NoSQL { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup ServicesAndApps { get { throw null; } } + public bool Equals(Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup 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.CognitiveServices.Models.ConnectionGroup left, Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup right) { throw null; } + public static implicit operator Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup left, Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ConnectionManagedIdentity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectionManagedIdentity() { } + public string ClientId { get { throw null; } set { } } + public string ResourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.ConnectionManagedIdentity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.ConnectionManagedIdentity 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 ConnectionOAuth2 : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectionOAuth2() { } + public System.Uri AuthUri { get { throw null; } set { } } + public System.Guid? ClientId { get { throw null; } set { } } + public string ClientSecret { get { throw null; } set { } } + public string DeveloperToken { get { throw null; } set { } } + public string Password { get { throw null; } set { } } + public string RefreshToken { get { throw null; } set { } } + public System.Guid? TenantId { get { throw null; } set { } } + public string Username { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.ConnectionOAuth2 System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.ConnectionOAuth2 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 ConnectionPropertiesV2 : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected ConnectionPropertiesV2() { } + public Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory? Category { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier CreatedByWorkspaceArmId { get { throw null; } } + public string Error { get { throw null; } set { } } + public System.DateTimeOffset? ExpiryOn { get { throw null; } set { } } + public Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup? Group { get { throw null; } } + public bool? IsSharedToAll { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Metadata { get { throw null; } } + public Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement? PeRequirement { get { throw null; } set { } } + public Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus? PeStatus { get { throw null; } set { } } + public System.Collections.Generic.IList SharedUserList { get { throw null; } } + public string Target { get { throw null; } set { } } + public bool? UseWorkspaceManagedIdentity { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2 System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.ConnectionPropertiesV2 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 ConnectionServicePrincipal : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectionServicePrincipal() { } + public string ClientId { get { throw null; } set { } } + public string ClientSecret { get { throw null; } set { } } + public System.Guid? TenantId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.ConnectionServicePrincipal System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.ConnectionServicePrincipal 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 ConnectionUpdateContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectionUpdateContent() { } + public Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2 Properties { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.ConnectionUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.ConnectionUpdateContent 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 ConnectionUsernamePassword : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectionUsernamePassword() { } + public string Password { get { throw null; } set { } } + public string SecurityToken { get { throw null; } set { } } + public string Username { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.ConnectionUsernamePassword System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.ConnectionUsernamePassword 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 CustomBlocklistConfig : Azure.ResourceManager.CognitiveServices.Models.RaiBlocklistConfig, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public CustomBlocklistConfig() { } @@ -1807,6 +2411,17 @@ 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 CustomKeysConnectionProperties : Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CustomKeysConnectionProperties() { } + public System.Collections.Generic.IDictionary CredentialsKeys { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.CustomKeysConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.CustomKeysConnectionProperties 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 DefenderForAISettingState : System.IEquatable { @@ -1897,6 +2512,55 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.CognitiveServices.Models.EncryptionScopeState left, Azure.ResourceManager.CognitiveServices.Models.EncryptionScopeState right) { throw null; } public override string ToString() { throw null; } } + public partial class ManagedIdentityAuthTypeConnectionProperties : Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ManagedIdentityAuthTypeConnectionProperties() { } + public Azure.ResourceManager.CognitiveServices.Models.ConnectionManagedIdentity Credentials { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.ManagedIdentityAuthTypeConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.ManagedIdentityAuthTypeConnectionProperties 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 ManagedPERequirement : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ManagedPERequirement(string value) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement NotApplicable { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement NotRequired { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement Required { get { throw null; } } + public bool Equals(Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement 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.CognitiveServices.Models.ManagedPERequirement left, Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement right) { throw null; } + public static implicit operator Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement left, Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ManagedPEStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ManagedPEStatus(string value) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus Active { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus Inactive { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus NotApplicable { get { throw null; } } + public bool Equals(Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus 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.CognitiveServices.Models.ManagedPEStatus left, Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus left, Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus right) { throw null; } + public override string ToString() { throw null; } + } public partial class ModelCapacityCalculatorWorkload : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ModelCapacityCalculatorWorkload() { } @@ -1968,6 +2632,19 @@ 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 NetworkInjections : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NetworkInjections() { } + public Azure.ResourceManager.CognitiveServices.Models.ScenarioType? Scenario { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier SubnetArmId { get { throw null; } set { } } + public bool? UseMicrosoftManagedNetwork { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.NetworkInjections System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.NetworkInjections 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 NetworkSecurityPerimeterAccessRule : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public NetworkSecurityPerimeterAccessRule() { } @@ -2064,6 +2741,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 NoneAuthTypeConnectionProperties : Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NoneAuthTypeConnectionProperties() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.NoneAuthTypeConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.NoneAuthTypeConnectionProperties 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 NspAccessRuleDirection : System.IEquatable { @@ -2082,6 +2769,28 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.CognitiveServices.Models.NspAccessRuleDirection left, Azure.ResourceManager.CognitiveServices.Models.NspAccessRuleDirection right) { throw null; } public override string ToString() { throw null; } } + public partial class OAuth2AuthTypeConnectionProperties : Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OAuth2AuthTypeConnectionProperties() { } + public Azure.ResourceManager.CognitiveServices.Models.ConnectionOAuth2 Credentials { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.OAuth2AuthTypeConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.OAuth2AuthTypeConnectionProperties 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 PATAuthTypeConnectionProperties : Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PATAuthTypeConnectionProperties() { } + public string CredentialsPat { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.PATAuthTypeConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.PATAuthTypeConnectionProperties 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 PatchResourceTagsAndSku : Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesPatchResourceTags, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public PatchResourceTagsAndSku() { } @@ -2093,6 +2802,21 @@ 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 ProjectProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ProjectProperties() { } + public string Description { get { throw null; } set { } } + public string DisplayName { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyDictionary Endpoints { get { throw null; } } + public bool? IsDefault { get { throw null; } } + public Azure.ResourceManager.CognitiveServices.Models.ServiceAccountProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.ProjectProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.ProjectProperties 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 RaiBlocklistConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public RaiBlocklistConfig() { } @@ -2270,6 +2994,47 @@ 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 ResourceBase : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ResourceBase() { } + public string Description { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.ResourceBase System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.ResourceBase 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 SASAuthTypeConnectionProperties : Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SASAuthTypeConnectionProperties() { } + public string CredentialsSas { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.SASAuthTypeConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.SASAuthTypeConnectionProperties 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 ScenarioType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ScenarioType(string value) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.ScenarioType Agent { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ScenarioType None { get { throw null; } } + public bool Equals(Azure.ResourceManager.CognitiveServices.Models.ScenarioType 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.CognitiveServices.Models.ScenarioType left, Azure.ResourceManager.CognitiveServices.Models.ScenarioType right) { throw null; } + public static implicit operator Azure.ResourceManager.CognitiveServices.Models.ScenarioType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CognitiveServices.Models.ScenarioType left, Azure.ResourceManager.CognitiveServices.Models.ScenarioType right) { throw null; } + public override string ToString() { throw null; } + } public partial class ServiceAccountApiKeys : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ServiceAccountApiKeys() { } @@ -2402,6 +3167,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly int _dummyPrimitive; public ServiceAccountProvisioningState(string value) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.ServiceAccountProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ServiceAccountProvisioningState Canceled { get { throw null; } } public static Azure.ResourceManager.CognitiveServices.Models.ServiceAccountProvisioningState Creating { get { throw null; } } public static Azure.ResourceManager.CognitiveServices.Models.ServiceAccountProvisioningState Deleting { get { throw null; } } public static Azure.ResourceManager.CognitiveServices.Models.ServiceAccountProvisioningState Failed { get { throw null; } } @@ -2561,6 +3327,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 ServicePrincipalAuthTypeConnectionProperties : Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ServicePrincipalAuthTypeConnectionProperties() { } + public Azure.ResourceManager.CognitiveServices.Models.ConnectionServicePrincipal Credentials { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.ServicePrincipalAuthTypeConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.ServicePrincipalAuthTypeConnectionProperties 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 TrustedServicesByPassSelection : System.IEquatable { @@ -2579,6 +3356,17 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.CognitiveServices.Models.TrustedServicesByPassSelection left, Azure.ResourceManager.CognitiveServices.Models.TrustedServicesByPassSelection right) { throw null; } public override string ToString() { throw null; } } + public partial class UsernamePasswordAuthTypeConnectionProperties : Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UsernamePasswordAuthTypeConnectionProperties() { } + public Azure.ResourceManager.CognitiveServices.Models.ConnectionUsernamePassword Credentials { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.UsernamePasswordAuthTypeConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.UsernamePasswordAuthTypeConnectionProperties 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 UserOwnedAmlWorkspace : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public UserOwnedAmlWorkspace() { } diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/api/Azure.ResourceManager.CognitiveServices.netstandard2.0.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/api/Azure.ResourceManager.CognitiveServices.netstandard2.0.cs index 5b1b46e31d4c..1ab52a83d195 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/api/Azure.ResourceManager.CognitiveServices.netstandard2.0.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/api/Azure.ResourceManager.CognitiveServices.netstandard2.0.cs @@ -1,5 +1,150 @@ namespace Azure.ResourceManager.CognitiveServices { + public partial class AccountCapabilityHostCollection : Azure.ResourceManager.ArmCollection + { + protected AccountCapabilityHostCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string capabilityHostName, Azure.ResourceManager.CognitiveServices.CapabilityHostData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string capabilityHostName, Azure.ResourceManager.CognitiveServices.CapabilityHostData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AccountCapabilityHostResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AccountCapabilityHostResource() { } + public virtual Azure.ResourceManager.CognitiveServices.CapabilityHostData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string capabilityHostName) { 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.CognitiveServices.CapabilityHostData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.CapabilityHostData 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.CognitiveServices.CapabilityHostData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CognitiveServices.CapabilityHostData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AccountConnectionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AccountConnectionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string connectionName, Azure.ResourceManager.CognitiveServices.ConnectionPropertiesV2BasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string connectionName, Azure.ResourceManager.CognitiveServices.ConnectionPropertiesV2BasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string target = null, string category = null, bool? includeAll = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string target = null, string category = null, bool? includeAll = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string connectionName, 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 AccountConnectionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AccountConnectionResource() { } + public virtual Azure.ResourceManager.CognitiveServices.ConnectionPropertiesV2BasicResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string connectionName) { 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.CognitiveServices.ConnectionPropertiesV2BasicResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.ConnectionPropertiesV2BasicResourceData 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.Response Update(Azure.ResourceManager.CognitiveServices.Models.ConnectionUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.CognitiveServices.Models.ConnectionUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AccountProjectCapabilityHostCollection : Azure.ResourceManager.ArmCollection + { + protected AccountProjectCapabilityHostCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string capabilityHostName, Azure.ResourceManager.CognitiveServices.CapabilityHostData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string capabilityHostName, Azure.ResourceManager.CognitiveServices.CapabilityHostData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AccountProjectCapabilityHostResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AccountProjectCapabilityHostResource() { } + public virtual Azure.ResourceManager.CognitiveServices.CapabilityHostData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string projectName, string capabilityHostName) { 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.CognitiveServices.CapabilityHostData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.CapabilityHostData 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.CognitiveServices.CapabilityHostData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CognitiveServices.CapabilityHostData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class AccountProjectConnectionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AccountProjectConnectionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string connectionName, Azure.ResourceManager.CognitiveServices.ConnectionPropertiesV2BasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string connectionName, Azure.ResourceManager.CognitiveServices.ConnectionPropertiesV2BasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string target = null, string category = null, bool? includeAll = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string target = null, string category = null, bool? includeAll = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string connectionName, 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 AccountProjectConnectionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AccountProjectConnectionResource() { } + public virtual Azure.ResourceManager.CognitiveServices.ConnectionPropertiesV2BasicResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string projectName, string connectionName) { 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.CognitiveServices.ConnectionPropertiesV2BasicResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.ConnectionPropertiesV2BasicResourceData 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.Response Update(Azure.ResourceManager.CognitiveServices.Models.ConnectionUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.CognitiveServices.Models.ConnectionUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class CapabilityHostData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CapabilityHostData(Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProperties properties) { } + public Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.CapabilityHostData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.CapabilityHostData 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 CognitiveServicesAccountCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected CognitiveServicesAccountCollection() { } @@ -104,6 +249,12 @@ protected CognitiveServicesAccountResource() { } 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 Azure.Response GetAccountCapabilityHost(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAccountCapabilityHostAsync(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CognitiveServices.AccountCapabilityHostCollection GetAccountCapabilityHosts() { throw null; } + public virtual Azure.Response GetAccountConnection(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAccountConnectionAsync(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CognitiveServices.AccountConnectionCollection GetAccountConnections() { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetCognitiveServicesAccountDeployment(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetCognitiveServicesAccountDeploymentAsync(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -129,6 +280,9 @@ protected CognitiveServicesAccountResource() { } public virtual Azure.ResourceManager.CognitiveServices.NetworkSecurityPerimeterConfigurationCollection GetNetworkSecurityPerimeterConfigurations() { throw null; } public virtual Azure.Pageable GetPrivateLinkResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetPrivateLinkResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetProject(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetProjectAsync(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CognitiveServices.ProjectCollection GetProjects() { throw null; } public virtual Azure.Response GetRaiBlocklist(string raiBlocklistName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetRaiBlocklistAsync(string raiBlocklistName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.CognitiveServices.RaiBlocklistCollection GetRaiBlocklists() { throw null; } @@ -308,6 +462,10 @@ public static partial class CognitiveServicesExtensions public static System.Threading.Tasks.Task> CheckDomainAvailabilityAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesDomainAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Pageable CheckSkuAvailability(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesSkuAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable CheckSkuAvailabilityAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesSkuAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.CognitiveServices.AccountCapabilityHostResource GetAccountCapabilityHostResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.CognitiveServices.AccountConnectionResource GetAccountConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.CognitiveServices.AccountProjectCapabilityHostResource GetAccountProjectCapabilityHostResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.CognitiveServices.AccountProjectConnectionResource GetAccountProjectConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetCognitiveServicesAccount(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetCognitiveServicesAccountAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.CognitiveServices.CognitiveServicesAccountDeploymentResource GetCognitiveServicesAccountDeploymentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -341,6 +499,7 @@ public static partial class CognitiveServicesExtensions public static Azure.Pageable GetModels(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetModelsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.CognitiveServices.NetworkSecurityPerimeterConfigurationResource GetNetworkSecurityPerimeterConfigurationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.CognitiveServices.ProjectResource GetProjectResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CognitiveServices.RaiBlocklistItemResource GetRaiBlocklistItemResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CognitiveServices.RaiBlocklistResource GetRaiBlocklistResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetRaiContentFilter(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string filterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -514,6 +673,17 @@ protected CommitmentPlanResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.CognitiveServices.CommitmentPlanData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CognitiveServices.CommitmentPlanData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class ConnectionPropertiesV2BasicResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectionPropertiesV2BasicResourceData(Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2 properties) { } + public Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2 Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.ConnectionPropertiesV2BasicResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.ConnectionPropertiesV2BasicResourceData 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 DefenderForAISettingCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected DefenderForAISettingCollection() { } @@ -610,6 +780,67 @@ protected NetworkSecurityPerimeterConfigurationResource() { } 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 ProjectCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ProjectCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string projectName, Azure.ResourceManager.CognitiveServices.ProjectData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string projectName, Azure.ResourceManager.CognitiveServices.ProjectData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string projectName, 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 projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string projectName, 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 ProjectData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ProjectData(Azure.Core.AzureLocation location) { } + public Azure.ETag? ETag { get { throw null; } } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.CognitiveServices.Models.ProjectProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.ProjectData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.ProjectData 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 ProjectResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ProjectResource() { } + public virtual Azure.ResourceManager.CognitiveServices.ProjectData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string projectName) { 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 Azure.Response GetAccountProjectCapabilityHost(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAccountProjectCapabilityHostAsync(string capabilityHostName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CognitiveServices.AccountProjectCapabilityHostCollection GetAccountProjectCapabilityHosts() { throw null; } + public virtual Azure.Response GetAccountProjectConnection(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAccountProjectConnectionAsync(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CognitiveServices.AccountProjectConnectionCollection GetAccountProjectConnections() { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.CognitiveServices.ProjectData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.ProjectData 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.CognitiveServices.ProjectData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CognitiveServices.ProjectData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class RaiBlocklistCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected RaiBlocklistCollection() { } @@ -829,6 +1060,10 @@ namespace Azure.ResourceManager.CognitiveServices.Mocking public partial class MockableCognitiveServicesArmClient : Azure.ResourceManager.ArmResource { protected MockableCognitiveServicesArmClient() { } + public virtual Azure.ResourceManager.CognitiveServices.AccountCapabilityHostResource GetAccountCapabilityHostResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.CognitiveServices.AccountConnectionResource GetAccountConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.CognitiveServices.AccountProjectCapabilityHostResource GetAccountProjectCapabilityHostResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.CognitiveServices.AccountProjectConnectionResource GetAccountProjectConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CognitiveServices.CognitiveServicesAccountDeploymentResource GetCognitiveServicesAccountDeploymentResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CognitiveServices.CognitiveServicesAccountResource GetCognitiveServicesAccountResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CognitiveServices.CognitiveServicesCommitmentPlanResource GetCognitiveServicesCommitmentPlanResource(Azure.Core.ResourceIdentifier id) { throw null; } @@ -839,6 +1074,7 @@ protected MockableCognitiveServicesArmClient() { } public virtual Azure.ResourceManager.CognitiveServices.CommitmentPlanResource GetCommitmentPlanResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CognitiveServices.DefenderForAISettingResource GetDefenderForAISettingResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CognitiveServices.NetworkSecurityPerimeterConfigurationResource GetNetworkSecurityPerimeterConfigurationResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.CognitiveServices.ProjectResource GetProjectResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CognitiveServices.RaiBlocklistItemResource GetRaiBlocklistItemResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CognitiveServices.RaiBlocklistResource GetRaiBlocklistResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.CognitiveServices.RaiContentFilterResource GetRaiContentFilterResource(Azure.Core.ResourceIdentifier id) { throw null; } @@ -891,6 +1127,16 @@ protected MockableCognitiveServicesSubscriptionResource() { } } namespace Azure.ResourceManager.CognitiveServices.Models { + public partial class AADAuthTypeConnectionProperties : Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AADAuthTypeConnectionProperties() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.AADAuthTypeConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.AADAuthTypeConnectionProperties 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 AbusePenalty : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal AbusePenalty() { } @@ -922,12 +1168,51 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.CognitiveServices.Models.AbusePenaltyAction left, Azure.ResourceManager.CognitiveServices.Models.AbusePenaltyAction right) { throw null; } public override string ToString() { throw null; } } + public partial class AccessKeyAuthTypeConnectionProperties : Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AccessKeyAuthTypeConnectionProperties() { } + public Azure.ResourceManager.CognitiveServices.Models.ConnectionAccessKey Credentials { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.AccessKeyAuthTypeConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.AccessKeyAuthTypeConnectionProperties 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 AccountKeyAuthTypeConnectionProperties : Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AccountKeyAuthTypeConnectionProperties() { } + public string CredentialsKey { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.AccountKeyAuthTypeConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.AccountKeyAuthTypeConnectionProperties 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 ApiKeyAuthConnectionProperties : Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ApiKeyAuthConnectionProperties() { } + public string CredentialsKey { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.ApiKeyAuthConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.ApiKeyAuthConnectionProperties 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 static partial class ArmCognitiveServicesModelFactory { + public static Azure.ResourceManager.CognitiveServices.Models.AADAuthTypeConnectionProperties AADAuthTypeConnectionProperties(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory? category = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup? group = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement?), Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?)) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.AbusePenalty AbusePenalty(Azure.ResourceManager.CognitiveServices.Models.AbusePenaltyAction? action = default(Azure.ResourceManager.CognitiveServices.Models.AbusePenaltyAction?), float? rateLimitPercentage = default(float?), System.DateTimeOffset? expiration = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.AccessKeyAuthTypeConnectionProperties AccessKeyAuthTypeConnectionProperties(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory? category = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup? group = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement?), Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), Azure.ResourceManager.CognitiveServices.Models.ConnectionAccessKey credentials = null) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.AccountKeyAuthTypeConnectionProperties AccountKeyAuthTypeConnectionProperties(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory? category = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup? group = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement?), Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), string credentialsKey = null) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.ApiKeyAuthConnectionProperties ApiKeyAuthConnectionProperties(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory? category = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup? group = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement?), Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), string credentialsKey = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.AvailableCognitiveServicesSku AvailableCognitiveServicesSku(string resourceType = null, string name = null, string tier = null, string kind = null, System.Collections.Generic.IEnumerable locations = null, System.Collections.Generic.IEnumerable restrictions = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.CalculateModelCapacityResult CalculateModelCapacityResult(Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesAccountDeploymentModel model = null, string skuName = null, Azure.ResourceManager.CognitiveServices.Models.CalculateModelCapacityResultEstimatedCapacity estimatedCapacity = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.CalculateModelCapacityResultEstimatedCapacity CalculateModelCapacityResultEstimatedCapacity(int? value = default(int?), int? deployableValue = default(int?)) { throw null; } + public static Azure.ResourceManager.CognitiveServices.CapabilityHostData CapabilityHostData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProperties properties = null) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProperties CapabilityHostProperties(string description = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IEnumerable aiServicesConnections = null, Azure.ResourceManager.CognitiveServices.Models.CapabilityHostKind? capabilityHostKind = default(Azure.ResourceManager.CognitiveServices.Models.CapabilityHostKind?), string customerSubnet = null, Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProvisioningState? provisioningState = default(Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProvisioningState?), System.Collections.Generic.IEnumerable storageConnections = null, System.Collections.Generic.IEnumerable threadStorageConnections = null, System.Collections.Generic.IEnumerable vectorStoreConnections = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.CognitiveServicesAccountData CognitiveServicesAccountData(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), string kind = null, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesSku sku = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesAccountProperties properties = null, Azure.ETag? etag = default(Azure.ETag?)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.CognitiveServices.CognitiveServicesAccountDeploymentData CognitiveServicesAccountDeploymentData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesSku sku, Azure.ETag? etag, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesAccountDeploymentProperties properties) { throw null; } @@ -942,7 +1227,9 @@ public static partial class ArmCognitiveServicesModelFactory [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesAccountModel CognitiveServicesAccountModel(string format, string name, string version, string source, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountCallRateLimit callRateLimit, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesAccountDeploymentModel baseModel, bool? isDefaultVersion, System.Collections.Generic.IEnumerable skus, int? maxCapacity, System.Collections.Generic.IDictionary capabilities, System.Collections.Generic.IDictionary finetuneCapabilities, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountModelDeprecationInfo deprecation, Azure.ResourceManager.CognitiveServices.Models.ModelLifecycleStatus? lifecycleStatus, Azure.ResourceManager.Models.SystemData systemData) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesAccountModel CognitiveServicesAccountModel(string publisher = null, string format = null, string name = null, string version = null, string source = null, Azure.Core.ResourceIdentifier sourceAccount = null, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountCallRateLimit callRateLimit = null, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesAccountDeploymentModel baseModel = null, bool? isDefaultVersion = default(bool?), System.Collections.Generic.IEnumerable skus = null, int? maxCapacity = default(int?), System.Collections.Generic.IDictionary capabilities = null, System.Collections.Generic.IDictionary finetuneCapabilities = null, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountModelDeprecationInfo deprecation = null, Azure.ResourceManager.CognitiveServices.Models.ModelLifecycleStatus? lifecycleStatus = default(Azure.ResourceManager.CognitiveServices.Models.ModelLifecycleStatus?), Azure.ResourceManager.Models.SystemData systemData = null) { throw null; } - public static Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesAccountProperties CognitiveServicesAccountProperties(Azure.ResourceManager.CognitiveServices.Models.ServiceAccountProvisioningState? provisioningState = default(Azure.ResourceManager.CognitiveServices.Models.ServiceAccountProvisioningState?), string endpoint = null, System.Collections.Generic.IEnumerable capabilities = null, bool? isMigrated = default(bool?), string migrationToken = null, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesSkuChangeInfo skuChangeInfo = null, string customSubDomainName = null, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesNetworkRuleSet networkAcls = null, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountEncryptionProperties encryption = null, System.Collections.Generic.IEnumerable userOwnedStorage = null, Azure.ResourceManager.CognitiveServices.Models.UserOwnedAmlWorkspace amlWorkspace = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.CognitiveServices.Models.ServiceAccountPublicNetworkAccess?), Azure.ResourceManager.CognitiveServices.Models.ServiceAccountApiProperties apiProperties = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.CognitiveServices.Models.ServiceAccountCallRateLimit callRateLimit = null, bool? enableDynamicThrottling = default(bool?), Azure.ResourceManager.CognitiveServices.Models.ServiceAccountQuotaLimit quotaLimit = null, bool? restrictOutboundNetworkAccess = default(bool?), System.Collections.Generic.IEnumerable allowedFqdnList = null, bool? disableLocalAuth = default(bool?), System.Collections.Generic.IReadOnlyDictionary endpoints = null, bool? restore = default(bool?), System.DateTimeOffset? deletedOn = default(System.DateTimeOffset?), string scheduledPurgeDate = null, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesMultiRegionSettings locations = null, System.Collections.Generic.IEnumerable commitmentPlanAssociations = null, Azure.ResourceManager.CognitiveServices.Models.AbusePenalty abusePenalty = null, Azure.ResourceManager.CognitiveServices.Models.RaiMonitorConfig raiMonitorConfig = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesAccountProperties CognitiveServicesAccountProperties(Azure.ResourceManager.CognitiveServices.Models.ServiceAccountProvisioningState? provisioningState, string endpoint, System.Collections.Generic.IEnumerable capabilities, bool? isMigrated, string migrationToken, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesSkuChangeInfo skuChangeInfo, string customSubDomainName, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesNetworkRuleSet networkAcls, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountEncryptionProperties encryption, System.Collections.Generic.IEnumerable userOwnedStorage, Azure.ResourceManager.CognitiveServices.Models.UserOwnedAmlWorkspace amlWorkspace, System.Collections.Generic.IEnumerable privateEndpointConnections, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountPublicNetworkAccess? publicNetworkAccess, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountApiProperties apiProperties, System.DateTimeOffset? createdOn, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountCallRateLimit callRateLimit, bool? enableDynamicThrottling, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountQuotaLimit quotaLimit, bool? restrictOutboundNetworkAccess, System.Collections.Generic.IEnumerable allowedFqdnList, bool? disableLocalAuth, System.Collections.Generic.IReadOnlyDictionary endpoints, bool? restore, System.DateTimeOffset? deletedOn, string scheduledPurgeDate, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesMultiRegionSettings locations, System.Collections.Generic.IEnumerable commitmentPlanAssociations, Azure.ResourceManager.CognitiveServices.Models.AbusePenalty abusePenalty, Azure.ResourceManager.CognitiveServices.Models.RaiMonitorConfig raiMonitorConfig) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesAccountProperties CognitiveServicesAccountProperties(Azure.ResourceManager.CognitiveServices.Models.ServiceAccountProvisioningState? provisioningState = default(Azure.ResourceManager.CognitiveServices.Models.ServiceAccountProvisioningState?), string endpoint = null, System.Collections.Generic.IEnumerable capabilities = null, bool? isMigrated = default(bool?), string migrationToken = null, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesSkuChangeInfo skuChangeInfo = null, string customSubDomainName = null, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesNetworkRuleSet networkAcls = null, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountEncryptionProperties encryption = null, System.Collections.Generic.IEnumerable userOwnedStorage = null, Azure.ResourceManager.CognitiveServices.Models.UserOwnedAmlWorkspace amlWorkspace = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.CognitiveServices.Models.ServiceAccountPublicNetworkAccess?), Azure.ResourceManager.CognitiveServices.Models.ServiceAccountApiProperties apiProperties = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.CognitiveServices.Models.ServiceAccountCallRateLimit callRateLimit = null, bool? enableDynamicThrottling = default(bool?), Azure.ResourceManager.CognitiveServices.Models.ServiceAccountQuotaLimit quotaLimit = null, bool? restrictOutboundNetworkAccess = default(bool?), System.Collections.Generic.IEnumerable allowedFqdnList = null, bool? disableLocalAuth = default(bool?), System.Collections.Generic.IReadOnlyDictionary endpoints = null, bool? restore = default(bool?), System.DateTimeOffset? deletedOn = default(System.DateTimeOffset?), string scheduledPurgeDate = null, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesMultiRegionSettings locations = null, System.Collections.Generic.IEnumerable commitmentPlanAssociations = null, Azure.ResourceManager.CognitiveServices.Models.AbusePenalty abusePenalty = null, Azure.ResourceManager.CognitiveServices.Models.RaiMonitorConfig raiMonitorConfig = null, Azure.ResourceManager.CognitiveServices.Models.NetworkInjections networkInjections = null, bool? allowProjectManagement = default(bool?), string defaultProject = null, System.Collections.Generic.IEnumerable associatedProjects = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesAccountProperties CognitiveServicesAccountProperties(Azure.ResourceManager.CognitiveServices.Models.ServiceAccountProvisioningState? provisioningState, string endpoint, System.Collections.Generic.IEnumerable capabilities, bool? isMigrated, string migrationToken, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesSkuChangeInfo skuChangeInfo, string customSubDomainName, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesNetworkRuleSet networkAcls, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountEncryptionProperties encryption, System.Collections.Generic.IEnumerable userOwnedStorage, System.Collections.Generic.IEnumerable privateEndpointConnections, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountPublicNetworkAccess? publicNetworkAccess, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountApiProperties apiProperties, System.DateTimeOffset? createdOn, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountCallRateLimit callRateLimit, bool? enableDynamicThrottling, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountQuotaLimit quotaLimit, bool? restrictOutboundNetworkAccess, System.Collections.Generic.IEnumerable allowedFqdnList, bool? disableLocalAuth, System.Collections.Generic.IReadOnlyDictionary endpoints, bool? restore, System.DateTimeOffset? deletedOn, string scheduledPurgeDate, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesMultiRegionSettings locations, System.Collections.Generic.IEnumerable commitmentPlanAssociations, Azure.ResourceManager.CognitiveServices.Models.AbusePenalty abusePenalty) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesAccountSku CognitiveServicesAccountSku(Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesSku sku = null) { throw null; } @@ -975,15 +1262,25 @@ public static partial class ArmCognitiveServicesModelFactory public static Azure.ResourceManager.CognitiveServices.Models.CommitmentPlanProperties CommitmentPlanProperties(Azure.ResourceManager.CognitiveServices.Models.CommitmentPlanProvisioningState? provisioningState = default(Azure.ResourceManager.CognitiveServices.Models.CommitmentPlanProvisioningState?), System.Guid? commitmentPlanGuid = default(System.Guid?), Azure.ResourceManager.CognitiveServices.Models.ServiceAccountHostingModel? hostingModel = default(Azure.ResourceManager.CognitiveServices.Models.ServiceAccountHostingModel?), string planType = null, Azure.ResourceManager.CognitiveServices.Models.CommitmentPeriod current = null, bool? autoRenew = default(bool?), Azure.ResourceManager.CognitiveServices.Models.CommitmentPeriod next = null, Azure.ResourceManager.CognitiveServices.Models.CommitmentPeriod last = null, System.Collections.Generic.IEnumerable provisioningIssues = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.CommitmentQuota CommitmentQuota(long? quantity = default(long?), string unit = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.CommitmentTier CommitmentTier(string kind = null, string skuName = null, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountHostingModel? hostingModel = default(Azure.ResourceManager.CognitiveServices.Models.ServiceAccountHostingModel?), string planType = null, string tier = null, int? maxCount = default(int?), Azure.ResourceManager.CognitiveServices.Models.CommitmentQuota quota = null, Azure.ResourceManager.CognitiveServices.Models.CommitmentCost cost = null) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2 ConnectionPropertiesV2(string authType = null, Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory? category = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup? group = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement?), Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?)) { throw null; } + public static Azure.ResourceManager.CognitiveServices.ConnectionPropertiesV2BasicResourceData ConnectionPropertiesV2BasicResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2 properties = null) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.CustomKeysConnectionProperties CustomKeysConnectionProperties(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory? category = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup? group = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement?), Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), System.Collections.Generic.IDictionary credentialsKeys = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.DefenderForAISettingData DefenderForAISettingData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ETag? etag = default(Azure.ETag?), System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.CognitiveServices.Models.DefenderForAISettingState? state = default(Azure.ResourceManager.CognitiveServices.Models.DefenderForAISettingState?)) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.ManagedIdentityAuthTypeConnectionProperties ManagedIdentityAuthTypeConnectionProperties(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory? category = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup? group = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement?), Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), Azure.ResourceManager.CognitiveServices.Models.ConnectionManagedIdentity credentials = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.ModelCapacityListResultValueItem ModelCapacityListResultValueItem(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.CognitiveServices.Models.ModelSkuCapacityProperties properties = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.NetworkSecurityPerimeterConfigurationData NetworkSecurityPerimeterConfigurationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.CognitiveServices.Models.NetworkSecurityPerimeterConfigurationProperties properties = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.NetworkSecurityPerimeterConfigurationProperties NetworkSecurityPerimeterConfigurationProperties(string provisioningState = null, System.Collections.Generic.IEnumerable provisioningIssues = null, Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesNetworkSecurityPerimeter networkSecurityPerimeter = null, Azure.ResourceManager.CognitiveServices.Models.NetworkSecurityPerimeterConfigurationAssociationInfo resourceAssociation = null, Azure.ResourceManager.CognitiveServices.Models.NetworkSecurityPerimeterProfileInfo profile = null) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.NoneAuthTypeConnectionProperties NoneAuthTypeConnectionProperties(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory? category = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup? group = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement?), Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?)) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.OAuth2AuthTypeConnectionProperties OAuth2AuthTypeConnectionProperties(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory? category = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup? group = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement?), Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), Azure.ResourceManager.CognitiveServices.Models.ConnectionOAuth2 credentials = null) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.PATAuthTypeConnectionProperties PATAuthTypeConnectionProperties(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory? category = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup? group = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement?), Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), string credentialsPat = null) { throw null; } + public static Azure.ResourceManager.CognitiveServices.ProjectData ProjectData(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.CognitiveServices.Models.ProjectProperties properties = null, Azure.ETag? etag = default(Azure.ETag?)) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.ProjectProperties ProjectProperties(Azure.ResourceManager.CognitiveServices.Models.ServiceAccountProvisioningState? provisioningState = default(Azure.ResourceManager.CognitiveServices.Models.ServiceAccountProvisioningState?), string displayName = null, string description = null, System.Collections.Generic.IReadOnlyDictionary endpoints = null, bool? isDefault = default(bool?)) { throw null; } public static Azure.ResourceManager.CognitiveServices.RaiBlocklistData RaiBlocklistData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ETag? etag = default(Azure.ETag?), System.Collections.Generic.IDictionary tags = null, string raiBlocklistDescription = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.RaiBlocklistItemData RaiBlocklistItemData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ETag? etag = default(Azure.ETag?), System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.CognitiveServices.Models.RaiBlocklistItemProperties properties = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.RaiContentFilterData RaiContentFilterData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.CognitiveServices.Models.RaiContentFilterProperties properties = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.RaiPolicyData RaiPolicyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ETag? etag = default(Azure.ETag?), System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.CognitiveServices.Models.RaiPolicyProperties properties = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.RaiPolicyProperties RaiPolicyProperties(Azure.ResourceManager.CognitiveServices.Models.RaiPolicyType? policyType = default(Azure.ResourceManager.CognitiveServices.Models.RaiPolicyType?), Azure.ResourceManager.CognitiveServices.Models.RaiPolicyMode? mode = default(Azure.ResourceManager.CognitiveServices.Models.RaiPolicyMode?), string basePolicyName = null, System.Collections.Generic.IEnumerable contentFilters = null, System.Collections.Generic.IEnumerable customBlocklists = null) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.SASAuthTypeConnectionProperties SASAuthTypeConnectionProperties(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory? category = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup? group = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement?), Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), string credentialsSas = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.ServiceAccountApiKeys ServiceAccountApiKeys(string key1 = null, string key2 = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.ServiceAccountCallRateLimit ServiceAccountCallRateLimit(float? count = default(float?), float? renewalPeriod = default(float?), System.Collections.Generic.IEnumerable rules = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.ServiceAccountQuotaLimit ServiceAccountQuotaLimit(float? count = default(float?), float? renewalPeriod = default(float?), System.Collections.Generic.IEnumerable rules = null) { throw null; } @@ -991,6 +1288,8 @@ public static partial class ArmCognitiveServicesModelFactory public static Azure.ResourceManager.CognitiveServices.Models.ServiceAccountThrottlingRule ServiceAccountThrottlingRule(string key = null, float? renewalPeriod = default(float?), float? count = default(float?), float? minCount = default(float?), bool? isDynamicThrottlingEnabled = default(bool?), System.Collections.Generic.IEnumerable matchPatterns = null) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.ServiceAccountUsage ServiceAccountUsage(Azure.ResourceManager.CognitiveServices.Models.ServiceAccountUsageUnitType? unit = default(Azure.ResourceManager.CognitiveServices.Models.ServiceAccountUsageUnitType?), Azure.ResourceManager.CognitiveServices.Models.ServiceAccountUsageMetricName name = null, string quotaPeriod = null, double? limit = default(double?), double? currentValue = default(double?), string nextResetTime = null, Azure.ResourceManager.CognitiveServices.Models.ServiceAccountQuotaUsageStatus? status = default(Azure.ResourceManager.CognitiveServices.Models.ServiceAccountQuotaUsageStatus?)) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.ServiceAccountUsageMetricName ServiceAccountUsageMetricName(string value = null, string localizedValue = null) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.ServicePrincipalAuthTypeConnectionProperties ServicePrincipalAuthTypeConnectionProperties(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory? category = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup? group = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement?), Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), Azure.ResourceManager.CognitiveServices.Models.ConnectionServicePrincipal credentials = null) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.UsernamePasswordAuthTypeConnectionProperties UsernamePasswordAuthTypeConnectionProperties(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory? category = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup? group = default(Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement?), Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), Azure.ResourceManager.CognitiveServices.Models.ConnectionUsernamePassword credentials = null) { throw null; } } public partial class AvailableCognitiveServicesSku : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -1059,6 +1358,62 @@ 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 CapabilityHostKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CapabilityHostKind(string value) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.CapabilityHostKind Agents { get { throw null; } } + public bool Equals(Azure.ResourceManager.CognitiveServices.Models.CapabilityHostKind 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.CognitiveServices.Models.CapabilityHostKind left, Azure.ResourceManager.CognitiveServices.Models.CapabilityHostKind right) { throw null; } + public static implicit operator Azure.ResourceManager.CognitiveServices.Models.CapabilityHostKind (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CognitiveServices.Models.CapabilityHostKind left, Azure.ResourceManager.CognitiveServices.Models.CapabilityHostKind right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CapabilityHostProperties : Azure.ResourceManager.CognitiveServices.Models.ResourceBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CapabilityHostProperties() { } + public System.Collections.Generic.IList AiServicesConnections { get { throw null; } set { } } + public Azure.ResourceManager.CognitiveServices.Models.CapabilityHostKind? CapabilityHostKind { get { throw null; } set { } } + public string CustomerSubnet { get { throw null; } set { } } + public Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IList StorageConnections { get { throw null; } set { } } + public System.Collections.Generic.IList ThreadStorageConnections { get { throw null; } set { } } + public System.Collections.Generic.IList VectorStoreConnections { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.CapabilityHostProperties 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 CapabilityHostProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CapabilityHostProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProvisioningState 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.CognitiveServices.Models.CapabilityHostProvisioningState left, Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProvisioningState left, Azure.ResourceManager.CognitiveServices.Models.CapabilityHostProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } public partial class CognitiveServicesAccountDeploymentModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public CognitiveServicesAccountDeploymentModel() { } @@ -1177,13 +1532,16 @@ public partial class CognitiveServicesAccountProperties : System.ClientModel.Pri public CognitiveServicesAccountProperties() { } public Azure.ResourceManager.CognitiveServices.Models.AbusePenalty AbusePenalty { get { throw null; } } public System.Collections.Generic.IList AllowedFqdnList { get { throw null; } } + public bool? AllowProjectManagement { get { throw null; } set { } } public Azure.ResourceManager.CognitiveServices.Models.UserOwnedAmlWorkspace AmlWorkspace { get { throw null; } set { } } public Azure.ResourceManager.CognitiveServices.Models.ServiceAccountApiProperties ApiProperties { get { throw null; } set { } } + public System.Collections.Generic.IList AssociatedProjects { get { throw null; } } public Azure.ResourceManager.CognitiveServices.Models.ServiceAccountCallRateLimit CallRateLimit { get { throw null; } } public System.Collections.Generic.IReadOnlyList Capabilities { get { throw null; } } public System.Collections.Generic.IReadOnlyList CommitmentPlanAssociations { get { throw null; } } public System.DateTimeOffset? CreatedOn { get { throw null; } } public string CustomSubDomainName { get { throw null; } set { } } + public string DefaultProject { get { throw null; } set { } } public System.DateTimeOffset? DeletedOn { get { throw null; } } public bool? DisableLocalAuth { get { throw null; } set { } } public bool? EnableDynamicThrottling { get { throw null; } set { } } @@ -1194,6 +1552,7 @@ public CognitiveServicesAccountProperties() { } public Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesMultiRegionSettings Locations { get { throw null; } set { } } public string MigrationToken { get { throw null; } set { } } public Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesNetworkRuleSet NetworkAcls { get { throw null; } set { } } + public Azure.ResourceManager.CognitiveServices.Models.NetworkInjections NetworkInjections { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList PrivateEndpointConnections { get { throw null; } } public Azure.ResourceManager.CognitiveServices.Models.ServiceAccountProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.CognitiveServices.Models.ServiceAccountPublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } @@ -1796,6 +2155,251 @@ 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 ConnectionAccessKey : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectionAccessKey() { } + public string AccessKeyId { get { throw null; } set { } } + public string SecretAccessKey { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.ConnectionAccessKey System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.ConnectionAccessKey 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 ConnectionCategory : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConnectionCategory(string value) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AdlsGen2 { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AIServices { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AmazonMws { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AmazonRdsForOracle { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AmazonRdsForSqlServer { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AmazonRedshift { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AmazonS3Compatible { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory ApiKey { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AzureBlob { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AzureDatabricksDeltaLake { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AzureDataExplorer { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AzureMariaDb { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AzureMySqlDb { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AzureOneLake { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AzureOpenAI { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AzurePostgresDb { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AzureSqlDb { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AzureSqlMi { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AzureSynapseAnalytics { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory AzureTableStorage { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory BingLLMSearch { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Cassandra { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory CognitiveSearch { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory CognitiveService { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Concur { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory ContainerRegistry { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory CosmosDb { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory CosmosDbMongoDbApi { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Couchbase { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory CustomKeys { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Db2 { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Drill { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Dynamics { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory DynamicsAx { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory DynamicsCrm { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Elasticsearch { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Eloqua { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory FileServer { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory FtpServer { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory GenericContainerRegistry { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory GenericHttp { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory GenericRest { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Git { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory GoogleAdWords { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory GoogleBigQuery { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory GoogleCloudStorage { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Greenplum { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Hbase { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Hdfs { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Hive { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Hubspot { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Impala { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Informix { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Jira { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Magento { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory ManagedOnlineEndpoint { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory MariaDb { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Marketo { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory MicrosoftAccess { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory MongoDbAtlas { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory MongoDbV2 { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory MySql { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Netezza { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory ODataRest { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Odbc { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Office365 { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory OpenAI { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Oracle { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory OracleCloudStorage { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory OracleServiceCloud { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory PayPal { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Phoenix { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Pinecone { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory PostgreSql { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Presto { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory PythonFeed { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory QuickBooks { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Redis { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Responsys { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory S3 { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Salesforce { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory SalesforceMarketingCloud { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory SalesforceServiceCloud { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory SapBw { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory SapCloudForCustomer { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory SapEcc { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory SapHana { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory SapOpenHub { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory SapTable { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Serp { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Serverless { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory ServiceNow { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Sftp { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory SharePointOnlineList { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Shopify { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Snowflake { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Spark { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory SqlServer { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Square { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Sybase { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Teradata { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Vertica { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory WebTable { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Xero { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory Zoho { get { throw null; } } + public bool Equals(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory 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.CognitiveServices.Models.ConnectionCategory left, Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory right) { throw null; } + public static implicit operator Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory left, Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ConnectionGroup : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ConnectionGroup(string value) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup Azure { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup AzureAI { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup Database { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup File { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup GenericProtocol { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup NoSQL { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup ServicesAndApps { get { throw null; } } + public bool Equals(Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup 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.CognitiveServices.Models.ConnectionGroup left, Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup right) { throw null; } + public static implicit operator Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup left, Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ConnectionManagedIdentity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectionManagedIdentity() { } + public string ClientId { get { throw null; } set { } } + public string ResourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.ConnectionManagedIdentity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.ConnectionManagedIdentity 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 ConnectionOAuth2 : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectionOAuth2() { } + public System.Uri AuthUri { get { throw null; } set { } } + public System.Guid? ClientId { get { throw null; } set { } } + public string ClientSecret { get { throw null; } set { } } + public string DeveloperToken { get { throw null; } set { } } + public string Password { get { throw null; } set { } } + public string RefreshToken { get { throw null; } set { } } + public System.Guid? TenantId { get { throw null; } set { } } + public string Username { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.ConnectionOAuth2 System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.ConnectionOAuth2 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 ConnectionPropertiesV2 : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected ConnectionPropertiesV2() { } + public Azure.ResourceManager.CognitiveServices.Models.ConnectionCategory? Category { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier CreatedByWorkspaceArmId { get { throw null; } } + public string Error { get { throw null; } set { } } + public System.DateTimeOffset? ExpiryOn { get { throw null; } set { } } + public Azure.ResourceManager.CognitiveServices.Models.ConnectionGroup? Group { get { throw null; } } + public bool? IsSharedToAll { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Metadata { get { throw null; } } + public Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement? PeRequirement { get { throw null; } set { } } + public Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus? PeStatus { get { throw null; } set { } } + public System.Collections.Generic.IList SharedUserList { get { throw null; } } + public string Target { get { throw null; } set { } } + public bool? UseWorkspaceManagedIdentity { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2 System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.ConnectionPropertiesV2 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 ConnectionServicePrincipal : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectionServicePrincipal() { } + public string ClientId { get { throw null; } set { } } + public string ClientSecret { get { throw null; } set { } } + public System.Guid? TenantId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.ConnectionServicePrincipal System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.ConnectionServicePrincipal 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 ConnectionUpdateContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectionUpdateContent() { } + public Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2 Properties { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.ConnectionUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.ConnectionUpdateContent 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 ConnectionUsernamePassword : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectionUsernamePassword() { } + public string Password { get { throw null; } set { } } + public string SecurityToken { get { throw null; } set { } } + public string Username { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.ConnectionUsernamePassword System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.ConnectionUsernamePassword 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 CustomBlocklistConfig : Azure.ResourceManager.CognitiveServices.Models.RaiBlocklistConfig, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public CustomBlocklistConfig() { } @@ -1807,6 +2411,17 @@ 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 CustomKeysConnectionProperties : Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CustomKeysConnectionProperties() { } + public System.Collections.Generic.IDictionary CredentialsKeys { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.CustomKeysConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.CustomKeysConnectionProperties 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 DefenderForAISettingState : System.IEquatable { @@ -1897,6 +2512,55 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.CognitiveServices.Models.EncryptionScopeState left, Azure.ResourceManager.CognitiveServices.Models.EncryptionScopeState right) { throw null; } public override string ToString() { throw null; } } + public partial class ManagedIdentityAuthTypeConnectionProperties : Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ManagedIdentityAuthTypeConnectionProperties() { } + public Azure.ResourceManager.CognitiveServices.Models.ConnectionManagedIdentity Credentials { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.ManagedIdentityAuthTypeConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.ManagedIdentityAuthTypeConnectionProperties 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 ManagedPERequirement : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ManagedPERequirement(string value) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement NotApplicable { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement NotRequired { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement Required { get { throw null; } } + public bool Equals(Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement 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.CognitiveServices.Models.ManagedPERequirement left, Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement right) { throw null; } + public static implicit operator Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement left, Azure.ResourceManager.CognitiveServices.Models.ManagedPERequirement right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ManagedPEStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ManagedPEStatus(string value) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus Active { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus Inactive { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus NotApplicable { get { throw null; } } + public bool Equals(Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus 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.CognitiveServices.Models.ManagedPEStatus left, Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus left, Azure.ResourceManager.CognitiveServices.Models.ManagedPEStatus right) { throw null; } + public override string ToString() { throw null; } + } public partial class ModelCapacityCalculatorWorkload : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ModelCapacityCalculatorWorkload() { } @@ -1968,6 +2632,19 @@ 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 NetworkInjections : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NetworkInjections() { } + public Azure.ResourceManager.CognitiveServices.Models.ScenarioType? Scenario { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier SubnetArmId { get { throw null; } set { } } + public bool? UseMicrosoftManagedNetwork { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.NetworkInjections System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.NetworkInjections 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 NetworkSecurityPerimeterAccessRule : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public NetworkSecurityPerimeterAccessRule() { } @@ -2064,6 +2741,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 NoneAuthTypeConnectionProperties : Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NoneAuthTypeConnectionProperties() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.NoneAuthTypeConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.NoneAuthTypeConnectionProperties 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 NspAccessRuleDirection : System.IEquatable { @@ -2082,6 +2769,28 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.CognitiveServices.Models.NspAccessRuleDirection left, Azure.ResourceManager.CognitiveServices.Models.NspAccessRuleDirection right) { throw null; } public override string ToString() { throw null; } } + public partial class OAuth2AuthTypeConnectionProperties : Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OAuth2AuthTypeConnectionProperties() { } + public Azure.ResourceManager.CognitiveServices.Models.ConnectionOAuth2 Credentials { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.OAuth2AuthTypeConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.OAuth2AuthTypeConnectionProperties 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 PATAuthTypeConnectionProperties : Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PATAuthTypeConnectionProperties() { } + public string CredentialsPat { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.PATAuthTypeConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.PATAuthTypeConnectionProperties 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 PatchResourceTagsAndSku : Azure.ResourceManager.CognitiveServices.Models.CognitiveServicesPatchResourceTags, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public PatchResourceTagsAndSku() { } @@ -2093,6 +2802,21 @@ 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 ProjectProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ProjectProperties() { } + public string Description { get { throw null; } set { } } + public string DisplayName { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyDictionary Endpoints { get { throw null; } } + public bool? IsDefault { get { throw null; } } + public Azure.ResourceManager.CognitiveServices.Models.ServiceAccountProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.ProjectProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.ProjectProperties 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 RaiBlocklistConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public RaiBlocklistConfig() { } @@ -2270,6 +2994,47 @@ 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 ResourceBase : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ResourceBase() { } + public string Description { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.ResourceBase System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.ResourceBase 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 SASAuthTypeConnectionProperties : Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SASAuthTypeConnectionProperties() { } + public string CredentialsSas { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.SASAuthTypeConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.SASAuthTypeConnectionProperties 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 ScenarioType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ScenarioType(string value) { throw null; } + public static Azure.ResourceManager.CognitiveServices.Models.ScenarioType Agent { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ScenarioType None { get { throw null; } } + public bool Equals(Azure.ResourceManager.CognitiveServices.Models.ScenarioType 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.CognitiveServices.Models.ScenarioType left, Azure.ResourceManager.CognitiveServices.Models.ScenarioType right) { throw null; } + public static implicit operator Azure.ResourceManager.CognitiveServices.Models.ScenarioType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CognitiveServices.Models.ScenarioType left, Azure.ResourceManager.CognitiveServices.Models.ScenarioType right) { throw null; } + public override string ToString() { throw null; } + } public partial class ServiceAccountApiKeys : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ServiceAccountApiKeys() { } @@ -2402,6 +3167,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer private readonly int _dummyPrimitive; public ServiceAccountProvisioningState(string value) { throw null; } public static Azure.ResourceManager.CognitiveServices.Models.ServiceAccountProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.CognitiveServices.Models.ServiceAccountProvisioningState Canceled { get { throw null; } } public static Azure.ResourceManager.CognitiveServices.Models.ServiceAccountProvisioningState Creating { get { throw null; } } public static Azure.ResourceManager.CognitiveServices.Models.ServiceAccountProvisioningState Deleting { get { throw null; } } public static Azure.ResourceManager.CognitiveServices.Models.ServiceAccountProvisioningState Failed { get { throw null; } } @@ -2561,6 +3327,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 ServicePrincipalAuthTypeConnectionProperties : Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ServicePrincipalAuthTypeConnectionProperties() { } + public Azure.ResourceManager.CognitiveServices.Models.ConnectionServicePrincipal Credentials { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.ServicePrincipalAuthTypeConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.ServicePrincipalAuthTypeConnectionProperties 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 TrustedServicesByPassSelection : System.IEquatable { @@ -2579,6 +3356,17 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.CognitiveServices.Models.TrustedServicesByPassSelection left, Azure.ResourceManager.CognitiveServices.Models.TrustedServicesByPassSelection right) { throw null; } public override string ToString() { throw null; } } + public partial class UsernamePasswordAuthTypeConnectionProperties : Azure.ResourceManager.CognitiveServices.Models.ConnectionPropertiesV2, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UsernamePasswordAuthTypeConnectionProperties() { } + public Azure.ResourceManager.CognitiveServices.Models.ConnectionUsernamePassword Credentials { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.CognitiveServices.Models.UsernamePasswordAuthTypeConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, 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.CognitiveServices.Models.UsernamePasswordAuthTypeConnectionProperties 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 UserOwnedAmlWorkspace : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public UserOwnedAmlWorkspace() { } diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountCapabilityHostCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountCapabilityHostCollection.cs new file mode 100644 index 000000000000..f60e02318dff --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountCapabilityHostCollection.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 Azure.ResourceManager.CognitiveServices.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.CognitiveServices.Samples +{ + public partial class Sample_AccountCapabilityHostCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateAccountCapabilityHost() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/AccountCapabilityHost/createOrUpdate.json + // this example is just showing the usage of "AccountCapabilityHosts_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 CognitiveServicesAccountResource created on azure + // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string accountName = "account-1"; + ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CognitiveServicesAccountResource cognitiveServicesAccount = client.GetCognitiveServicesAccountResource(cognitiveServicesAccountResourceId); + + // get the collection of this AccountCapabilityHostResource + AccountCapabilityHostCollection collection = cognitiveServicesAccount.GetAccountCapabilityHosts(); + + // invoke the operation + string capabilityHostName = "capabilityHostName"; + CapabilityHostData data = new CapabilityHostData(new CapabilityHostProperties + { + CustomerSubnet = "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroups/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet", + }); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, capabilityHostName, data); + AccountCapabilityHostResource 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 + CapabilityHostData 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_GetAccountCapabilityHost() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/AccountCapabilityHost/get.json + // this example is just showing the usage of "AccountCapabilityHosts_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 CognitiveServicesAccountResource created on azure + // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string accountName = "account-1"; + ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CognitiveServicesAccountResource cognitiveServicesAccount = client.GetCognitiveServicesAccountResource(cognitiveServicesAccountResourceId); + + // get the collection of this AccountCapabilityHostResource + AccountCapabilityHostCollection collection = cognitiveServicesAccount.GetAccountCapabilityHosts(); + + // invoke the operation + string capabilityHostName = "capabilityHostName"; + AccountCapabilityHostResource result = await collection.GetAsync(capabilityHostName); + + // 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 + CapabilityHostData 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 Exists_GetAccountCapabilityHost() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/AccountCapabilityHost/get.json + // this example is just showing the usage of "AccountCapabilityHosts_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 CognitiveServicesAccountResource created on azure + // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string accountName = "account-1"; + ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CognitiveServicesAccountResource cognitiveServicesAccount = client.GetCognitiveServicesAccountResource(cognitiveServicesAccountResourceId); + + // get the collection of this AccountCapabilityHostResource + AccountCapabilityHostCollection collection = cognitiveServicesAccount.GetAccountCapabilityHosts(); + + // invoke the operation + string capabilityHostName = "capabilityHostName"; + bool result = await collection.ExistsAsync(capabilityHostName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetAccountCapabilityHost() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/AccountCapabilityHost/get.json + // this example is just showing the usage of "AccountCapabilityHosts_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 CognitiveServicesAccountResource created on azure + // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string accountName = "account-1"; + ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CognitiveServicesAccountResource cognitiveServicesAccount = client.GetCognitiveServicesAccountResource(cognitiveServicesAccountResourceId); + + // get the collection of this AccountCapabilityHostResource + AccountCapabilityHostCollection collection = cognitiveServicesAccount.GetAccountCapabilityHosts(); + + // invoke the operation + string capabilityHostName = "capabilityHostName"; + NullableResponse response = await collection.GetIfExistsAsync(capabilityHostName); + AccountCapabilityHostResource 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 + CapabilityHostData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountCapabilityHostResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountCapabilityHostResource.cs new file mode 100644 index 000000000000..c1491d6e1168 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountCapabilityHostResource.cs @@ -0,0 +1,113 @@ +// 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.CognitiveServices.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.CognitiveServices.Samples +{ + public partial class Sample_AccountCapabilityHostResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetAccountCapabilityHost() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/AccountCapabilityHost/get.json + // this example is just showing the usage of "AccountCapabilityHosts_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 AccountCapabilityHostResource created on azure + // for more information of creating AccountCapabilityHostResource, please refer to the document of AccountCapabilityHostResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string accountName = "account-1"; + string capabilityHostName = "capabilityHostName"; + ResourceIdentifier accountCapabilityHostResourceId = AccountCapabilityHostResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, capabilityHostName); + AccountCapabilityHostResource accountCapabilityHost = client.GetAccountCapabilityHostResource(accountCapabilityHostResourceId); + + // invoke the operation + AccountCapabilityHostResource result = await accountCapabilityHost.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 + CapabilityHostData 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_DeleteAccountCapabilityHost() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/AccountCapabilityHost/delete.json + // this example is just showing the usage of "AccountCapabilityHosts_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 AccountCapabilityHostResource created on azure + // for more information of creating AccountCapabilityHostResource, please refer to the document of AccountCapabilityHostResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string accountName = "account-1"; + string capabilityHostName = "capabilityHostName"; + ResourceIdentifier accountCapabilityHostResourceId = AccountCapabilityHostResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, capabilityHostName); + AccountCapabilityHostResource accountCapabilityHost = client.GetAccountCapabilityHostResource(accountCapabilityHostResourceId); + + // invoke the operation + await accountCapabilityHost.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreateOrUpdateAccountCapabilityHost() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/AccountCapabilityHost/createOrUpdate.json + // this example is just showing the usage of "AccountCapabilityHosts_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 AccountCapabilityHostResource created on azure + // for more information of creating AccountCapabilityHostResource, please refer to the document of AccountCapabilityHostResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string accountName = "account-1"; + string capabilityHostName = "capabilityHostName"; + ResourceIdentifier accountCapabilityHostResourceId = AccountCapabilityHostResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, capabilityHostName); + AccountCapabilityHostResource accountCapabilityHost = client.GetAccountCapabilityHostResource(accountCapabilityHostResourceId); + + // invoke the operation + CapabilityHostData data = new CapabilityHostData(new CapabilityHostProperties + { + CustomerSubnet = "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroups/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet", + }); + ArmOperation lro = await accountCapabilityHost.UpdateAsync(WaitUntil.Completed, data); + AccountCapabilityHostResource 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 + CapabilityHostData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountConnectionCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountConnectionCollection.cs new file mode 100644 index 000000000000..3b61ecb800a3 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountConnectionCollection.cs @@ -0,0 +1,204 @@ +// 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.CognitiveServices.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.CognitiveServices.Samples +{ + public partial class Sample_AccountConnectionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateAccountConnection() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/AccountConnection/create.json + // this example is just showing the usage of "AccountConnection_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 + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this CognitiveServicesAccountResource created on azure + // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string accountName = "account-1"; + ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CognitiveServicesAccountResource cognitiveServicesAccount = client.GetCognitiveServicesAccountResource(cognitiveServicesAccountResourceId); + + // get the collection of this AccountConnectionResource + AccountConnectionCollection collection = cognitiveServicesAccount.GetAccountConnections(); + + // invoke the operation + string connectionName = "connection-1"; + ConnectionPropertiesV2BasicResourceData data = new ConnectionPropertiesV2BasicResourceData(new NoneAuthTypeConnectionProperties + { + Category = ConnectionCategory.ContainerRegistry, + ExpiryOn = DateTimeOffset.Parse("2024-03-15T14:30:00Z"), + Target = "[tartget url]", + }); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, connectionName, data); + AccountConnectionResource 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 + ConnectionPropertiesV2BasicResourceData 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_GetAccountConnection() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/AccountConnection/get.json + // this example is just showing the usage of "AccountConnection_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 CognitiveServicesAccountResource created on azure + // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string accountName = "account-1"; + ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CognitiveServicesAccountResource cognitiveServicesAccount = client.GetCognitiveServicesAccountResource(cognitiveServicesAccountResourceId); + + // get the collection of this AccountConnectionResource + AccountConnectionCollection collection = cognitiveServicesAccount.GetAccountConnections(); + + // invoke the operation + string connectionName = "connection-1"; + AccountConnectionResource result = await collection.GetAsync(connectionName); + + // 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 + ConnectionPropertiesV2BasicResourceData 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_ListAccountConnections() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/AccountConnection/list.json + // this example is just showing the usage of "AccountConnection_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 CognitiveServicesAccountResource created on azure + // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string accountName = "account-1"; + ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CognitiveServicesAccountResource cognitiveServicesAccount = client.GetCognitiveServicesAccountResource(cognitiveServicesAccountResourceId); + + // get the collection of this AccountConnectionResource + AccountConnectionCollection collection = cognitiveServicesAccount.GetAccountConnections(); + + // invoke the operation and iterate over the result + string target = "[tartget url]"; + string category = "ContainerRegistry"; + await foreach (AccountConnectionResource item in collection.GetAllAsync(target: target, category: category)) + { + // 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 + ConnectionPropertiesV2BasicResourceData 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_GetAccountConnection() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/AccountConnection/get.json + // this example is just showing the usage of "AccountConnection_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 CognitiveServicesAccountResource created on azure + // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string accountName = "account-1"; + ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CognitiveServicesAccountResource cognitiveServicesAccount = client.GetCognitiveServicesAccountResource(cognitiveServicesAccountResourceId); + + // get the collection of this AccountConnectionResource + AccountConnectionCollection collection = cognitiveServicesAccount.GetAccountConnections(); + + // invoke the operation + string connectionName = "connection-1"; + bool result = await collection.ExistsAsync(connectionName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetAccountConnection() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/AccountConnection/get.json + // this example is just showing the usage of "AccountConnection_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 CognitiveServicesAccountResource created on azure + // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string accountName = "account-1"; + ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CognitiveServicesAccountResource cognitiveServicesAccount = client.GetCognitiveServicesAccountResource(cognitiveServicesAccountResourceId); + + // get the collection of this AccountConnectionResource + AccountConnectionCollection collection = cognitiveServicesAccount.GetAccountConnections(); + + // invoke the operation + string connectionName = "connection-1"; + NullableResponse response = await collection.GetIfExistsAsync(connectionName); + AccountConnectionResource 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 + ConnectionPropertiesV2BasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountConnectionResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountConnectionResource.cs new file mode 100644 index 000000000000..b1925a12d794 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountConnectionResource.cs @@ -0,0 +1,123 @@ +// 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.CognitiveServices.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.CognitiveServices.Samples +{ + public partial class Sample_AccountConnectionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetAccountConnection() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/AccountConnection/get.json + // this example is just showing the usage of "AccountConnection_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 AccountConnectionResource created on azure + // for more information of creating AccountConnectionResource, please refer to the document of AccountConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string accountName = "account-1"; + string connectionName = "connection-1"; + ResourceIdentifier accountConnectionResourceId = AccountConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, connectionName); + AccountConnectionResource accountConnection = client.GetAccountConnectionResource(accountConnectionResourceId); + + // invoke the operation + AccountConnectionResource result = await accountConnection.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 + ConnectionPropertiesV2BasicResourceData 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_DeleteAccountConnection() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/AccountConnection/delete.json + // this example is just showing the usage of "AccountConnection_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 AccountConnectionResource created on azure + // for more information of creating AccountConnectionResource, please refer to the document of AccountConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string accountName = "account-1"; + string connectionName = "connection-1"; + ResourceIdentifier accountConnectionResourceId = AccountConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, connectionName); + AccountConnectionResource accountConnection = client.GetAccountConnectionResource(accountConnectionResourceId); + + // invoke the operation + await accountConnection.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdateAccountConnection() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/AccountConnection/update.json + // this example is just showing the usage of "AccountConnection_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 AccountConnectionResource created on azure + // for more information of creating AccountConnectionResource, please refer to the document of AccountConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string accountName = "account-1"; + string connectionName = "connection-1"; + ResourceIdentifier accountConnectionResourceId = AccountConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, connectionName); + AccountConnectionResource accountConnection = client.GetAccountConnectionResource(accountConnectionResourceId); + + // invoke the operation + ConnectionUpdateContent content = new ConnectionUpdateContent + { + Properties = new AccessKeyAuthTypeConnectionProperties + { + Credentials = new ConnectionAccessKey + { + AccessKeyId = "some_string", + SecretAccessKey = "some_string", + }, + Category = ConnectionCategory.AdlsGen2, + ExpiryOn = DateTimeOffset.Parse("2020-01-01T00:00:00Z"), + Metadata = { }, + Target = "some_string", + }, + }; + AccountConnectionResource result = await accountConnection.UpdateAsync(content); + + // 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 + ConnectionPropertiesV2BasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountProjectCapabilityHostCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountProjectCapabilityHostCollection.cs new file mode 100644 index 000000000000..2844dfa58de0 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountProjectCapabilityHostCollection.cs @@ -0,0 +1,168 @@ +// 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.CognitiveServices.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.CognitiveServices.Samples +{ + public partial class Sample_AccountProjectCapabilityHostCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateProjectCapabilityHost() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ProjectCapabilityHost/createOrUpdate.json + // this example is just showing the usage of "ProjectCapabilityHosts_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 ProjectResource created on azure + // for more information of creating ProjectResource, please refer to the document of ProjectResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string accountName = "account-1"; + string projectName = "project-1"; + ResourceIdentifier projectResourceId = ProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, projectName); + ProjectResource project = client.GetProjectResource(projectResourceId); + + // get the collection of this AccountProjectCapabilityHostResource + AccountProjectCapabilityHostCollection collection = project.GetAccountProjectCapabilityHosts(); + + // invoke the operation + string capabilityHostName = "capabilityHostName"; + CapabilityHostData data = new CapabilityHostData(new CapabilityHostProperties + { + CustomerSubnet = "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroups/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet", + }); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, capabilityHostName, data); + AccountProjectCapabilityHostResource 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 + CapabilityHostData 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_GetProjectCapabilityHost() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ProjectCapabilityHost/get.json + // this example is just showing the usage of "ProjectCapabilityHosts_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 ProjectResource created on azure + // for more information of creating ProjectResource, please refer to the document of ProjectResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string accountName = "account-1"; + string projectName = "project-1"; + ResourceIdentifier projectResourceId = ProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, projectName); + ProjectResource project = client.GetProjectResource(projectResourceId); + + // get the collection of this AccountProjectCapabilityHostResource + AccountProjectCapabilityHostCollection collection = project.GetAccountProjectCapabilityHosts(); + + // invoke the operation + string capabilityHostName = "capabilityHostName"; + AccountProjectCapabilityHostResource result = await collection.GetAsync(capabilityHostName); + + // 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 + CapabilityHostData 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 Exists_GetProjectCapabilityHost() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ProjectCapabilityHost/get.json + // this example is just showing the usage of "ProjectCapabilityHosts_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 ProjectResource created on azure + // for more information of creating ProjectResource, please refer to the document of ProjectResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string accountName = "account-1"; + string projectName = "project-1"; + ResourceIdentifier projectResourceId = ProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, projectName); + ProjectResource project = client.GetProjectResource(projectResourceId); + + // get the collection of this AccountProjectCapabilityHostResource + AccountProjectCapabilityHostCollection collection = project.GetAccountProjectCapabilityHosts(); + + // invoke the operation + string capabilityHostName = "capabilityHostName"; + bool result = await collection.ExistsAsync(capabilityHostName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetProjectCapabilityHost() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ProjectCapabilityHost/get.json + // this example is just showing the usage of "ProjectCapabilityHosts_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 ProjectResource created on azure + // for more information of creating ProjectResource, please refer to the document of ProjectResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string accountName = "account-1"; + string projectName = "project-1"; + ResourceIdentifier projectResourceId = ProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, projectName); + ProjectResource project = client.GetProjectResource(projectResourceId); + + // get the collection of this AccountProjectCapabilityHostResource + AccountProjectCapabilityHostCollection collection = project.GetAccountProjectCapabilityHosts(); + + // invoke the operation + string capabilityHostName = "capabilityHostName"; + NullableResponse response = await collection.GetIfExistsAsync(capabilityHostName); + AccountProjectCapabilityHostResource 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 + CapabilityHostData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountProjectCapabilityHostResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountProjectCapabilityHostResource.cs new file mode 100644 index 000000000000..a42f81b49200 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountProjectCapabilityHostResource.cs @@ -0,0 +1,116 @@ +// 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.CognitiveServices.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.CognitiveServices.Samples +{ + public partial class Sample_AccountProjectCapabilityHostResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetProjectCapabilityHost() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ProjectCapabilityHost/get.json + // this example is just showing the usage of "ProjectCapabilityHosts_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 AccountProjectCapabilityHostResource created on azure + // for more information of creating AccountProjectCapabilityHostResource, please refer to the document of AccountProjectCapabilityHostResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string accountName = "account-1"; + string projectName = "project-1"; + string capabilityHostName = "capabilityHostName"; + ResourceIdentifier accountProjectCapabilityHostResourceId = AccountProjectCapabilityHostResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, projectName, capabilityHostName); + AccountProjectCapabilityHostResource accountProjectCapabilityHost = client.GetAccountProjectCapabilityHostResource(accountProjectCapabilityHostResourceId); + + // invoke the operation + AccountProjectCapabilityHostResource result = await accountProjectCapabilityHost.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 + CapabilityHostData 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_DeleteProjectCapabilityHost() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ProjectCapabilityHost/delete.json + // this example is just showing the usage of "ProjectCapabilityHosts_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 AccountProjectCapabilityHostResource created on azure + // for more information of creating AccountProjectCapabilityHostResource, please refer to the document of AccountProjectCapabilityHostResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string accountName = "account-1"; + string projectName = "project-1"; + string capabilityHostName = "capabilityHostName"; + ResourceIdentifier accountProjectCapabilityHostResourceId = AccountProjectCapabilityHostResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, projectName, capabilityHostName); + AccountProjectCapabilityHostResource accountProjectCapabilityHost = client.GetAccountProjectCapabilityHostResource(accountProjectCapabilityHostResourceId); + + // invoke the operation + await accountProjectCapabilityHost.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreateOrUpdateProjectCapabilityHost() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ProjectCapabilityHost/createOrUpdate.json + // this example is just showing the usage of "ProjectCapabilityHosts_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 AccountProjectCapabilityHostResource created on azure + // for more information of creating AccountProjectCapabilityHostResource, please refer to the document of AccountProjectCapabilityHostResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string accountName = "account-1"; + string projectName = "project-1"; + string capabilityHostName = "capabilityHostName"; + ResourceIdentifier accountProjectCapabilityHostResourceId = AccountProjectCapabilityHostResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, projectName, capabilityHostName); + AccountProjectCapabilityHostResource accountProjectCapabilityHost = client.GetAccountProjectCapabilityHostResource(accountProjectCapabilityHostResourceId); + + // invoke the operation + CapabilityHostData data = new CapabilityHostData(new CapabilityHostProperties + { + CustomerSubnet = "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroups/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet", + }); + ArmOperation lro = await accountProjectCapabilityHost.UpdateAsync(WaitUntil.Completed, data); + AccountProjectCapabilityHostResource 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 + CapabilityHostData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountProjectConnectionCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountProjectConnectionCollection.cs new file mode 100644 index 000000000000..f92bcb65179b --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountProjectConnectionCollection.cs @@ -0,0 +1,209 @@ +// 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.CognitiveServices.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.CognitiveServices.Samples +{ + public partial class Sample_AccountProjectConnectionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateProjectConnection() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ProjectConnection/create.json + // this example is just showing the usage of "ProjectConnection_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 + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ProjectResource created on azure + // for more information of creating ProjectResource, please refer to the document of ProjectResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string accountName = "account-1"; + string projectName = "project-1"; + ResourceIdentifier projectResourceId = ProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, projectName); + ProjectResource project = client.GetProjectResource(projectResourceId); + + // get the collection of this AccountProjectConnectionResource + AccountProjectConnectionCollection collection = project.GetAccountProjectConnections(); + + // invoke the operation + string connectionName = "connection-1"; + ConnectionPropertiesV2BasicResourceData data = new ConnectionPropertiesV2BasicResourceData(new NoneAuthTypeConnectionProperties + { + Category = ConnectionCategory.ContainerRegistry, + ExpiryOn = DateTimeOffset.Parse("2024-03-15T14:30:00Z"), + Target = "[tartget url]", + }); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, connectionName, data); + AccountProjectConnectionResource 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 + ConnectionPropertiesV2BasicResourceData 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_GetProjectConnection() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ProjectConnection/get.json + // this example is just showing the usage of "ProjectConnection_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 ProjectResource created on azure + // for more information of creating ProjectResource, please refer to the document of ProjectResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string accountName = "account-1"; + string projectName = "project-1"; + ResourceIdentifier projectResourceId = ProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, projectName); + ProjectResource project = client.GetProjectResource(projectResourceId); + + // get the collection of this AccountProjectConnectionResource + AccountProjectConnectionCollection collection = project.GetAccountProjectConnections(); + + // invoke the operation + string connectionName = "connection-1"; + AccountProjectConnectionResource result = await collection.GetAsync(connectionName); + + // 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 + ConnectionPropertiesV2BasicResourceData 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_ListProjectConnection() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ProjectConnection/list.json + // this example is just showing the usage of "ProjectConnection_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 ProjectResource created on azure + // for more information of creating ProjectResource, please refer to the document of ProjectResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string accountName = "account-1"; + string projectName = "project-1"; + ResourceIdentifier projectResourceId = ProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, projectName); + ProjectResource project = client.GetProjectResource(projectResourceId); + + // get the collection of this AccountProjectConnectionResource + AccountProjectConnectionCollection collection = project.GetAccountProjectConnections(); + + // invoke the operation and iterate over the result + string target = "[tartget url]"; + string category = "ContainerRegistry"; + await foreach (AccountProjectConnectionResource item in collection.GetAllAsync(target: target, category: category)) + { + // 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 + ConnectionPropertiesV2BasicResourceData 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_GetProjectConnection() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ProjectConnection/get.json + // this example is just showing the usage of "ProjectConnection_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 ProjectResource created on azure + // for more information of creating ProjectResource, please refer to the document of ProjectResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string accountName = "account-1"; + string projectName = "project-1"; + ResourceIdentifier projectResourceId = ProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, projectName); + ProjectResource project = client.GetProjectResource(projectResourceId); + + // get the collection of this AccountProjectConnectionResource + AccountProjectConnectionCollection collection = project.GetAccountProjectConnections(); + + // invoke the operation + string connectionName = "connection-1"; + bool result = await collection.ExistsAsync(connectionName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetProjectConnection() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ProjectConnection/get.json + // this example is just showing the usage of "ProjectConnection_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 ProjectResource created on azure + // for more information of creating ProjectResource, please refer to the document of ProjectResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string accountName = "account-1"; + string projectName = "project-1"; + ResourceIdentifier projectResourceId = ProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, projectName); + ProjectResource project = client.GetProjectResource(projectResourceId); + + // get the collection of this AccountProjectConnectionResource + AccountProjectConnectionCollection collection = project.GetAccountProjectConnections(); + + // invoke the operation + string connectionName = "connection-1"; + NullableResponse response = await collection.GetIfExistsAsync(connectionName); + AccountProjectConnectionResource 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 + ConnectionPropertiesV2BasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountProjectConnectionResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountProjectConnectionResource.cs new file mode 100644 index 000000000000..cbc8e4e61beb --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_AccountProjectConnectionResource.cs @@ -0,0 +1,126 @@ +// 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.CognitiveServices.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.CognitiveServices.Samples +{ + public partial class Sample_AccountProjectConnectionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetProjectConnection() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ProjectConnection/get.json + // this example is just showing the usage of "ProjectConnection_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 AccountProjectConnectionResource created on azure + // for more information of creating AccountProjectConnectionResource, please refer to the document of AccountProjectConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string accountName = "account-1"; + string projectName = "project-1"; + string connectionName = "connection-1"; + ResourceIdentifier accountProjectConnectionResourceId = AccountProjectConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, projectName, connectionName); + AccountProjectConnectionResource accountProjectConnection = client.GetAccountProjectConnectionResource(accountProjectConnectionResourceId); + + // invoke the operation + AccountProjectConnectionResource result = await accountProjectConnection.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 + ConnectionPropertiesV2BasicResourceData 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_DeleteProjectConnection() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ProjectConnection/delete.json + // this example is just showing the usage of "ProjectConnection_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 AccountProjectConnectionResource created on azure + // for more information of creating AccountProjectConnectionResource, please refer to the document of AccountProjectConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string accountName = "account-1"; + string projectName = "project-1"; + string connectionName = "connection-1"; + ResourceIdentifier accountProjectConnectionResourceId = AccountProjectConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, projectName, connectionName); + AccountProjectConnectionResource accountProjectConnection = client.GetAccountProjectConnectionResource(accountProjectConnectionResourceId); + + // invoke the operation + await accountProjectConnection.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdateProjectConnection() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ProjectConnection/update.json + // this example is just showing the usage of "ProjectConnection_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 AccountProjectConnectionResource created on azure + // for more information of creating AccountProjectConnectionResource, please refer to the document of AccountProjectConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string accountName = "account-1"; + string projectName = "project-1"; + string connectionName = "connection-1"; + ResourceIdentifier accountProjectConnectionResourceId = AccountProjectConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, projectName, connectionName); + AccountProjectConnectionResource accountProjectConnection = client.GetAccountProjectConnectionResource(accountProjectConnectionResourceId); + + // invoke the operation + ConnectionUpdateContent content = new ConnectionUpdateContent + { + Properties = new AccessKeyAuthTypeConnectionProperties + { + Credentials = new ConnectionAccessKey + { + AccessKeyId = "some_string", + SecretAccessKey = "some_string", + }, + Category = ConnectionCategory.AdlsGen2, + ExpiryOn = DateTimeOffset.Parse("2020-01-01T00:00:00Z"), + Metadata = { }, + Target = "some_string", + }, + }; + AccountProjectConnectionResource result = await accountProjectConnection.UpdateAsync(content); + + // 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 + ConnectionPropertiesV2BasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesAccountCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesAccountCollection.cs index b4b16a58f07d..dbcb31abdfc9 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesAccountCollection.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesAccountCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_CognitiveServicesAccountCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAccount() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/CreateAccount.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/CreateAccount.json // this example is just showing the usage of "Accounts_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_CreateAccount() // 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 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "myResourceGroup"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -61,7 +61,7 @@ public async Task CreateOrUpdate_CreateAccount() }, UserOwnedStorage = {new ServiceAccountUserOwnedStorage { -ResourceId = new ResourceIdentifier("/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount"), +ResourceId = new ResourceIdentifier("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount"), }}, }, }; @@ -79,7 +79,7 @@ public async Task CreateOrUpdate_CreateAccount() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAccountMin() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/CreateAccountMin.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/CreateAccountMin.json // this example is just showing the usage of "Accounts_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 @@ -89,7 +89,7 @@ public async Task CreateOrUpdate_CreateAccountMin() // 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 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "myResourceGroup"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -120,7 +120,7 @@ public async Task CreateOrUpdate_CreateAccountMin() [Ignore("Only validating compilation of examples")] public async Task Get_GetAccount() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetAccount.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetAccount.json // this example is just showing the usage of "Accounts_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 @@ -130,7 +130,7 @@ public async Task Get_GetAccount() // 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 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "myResourceGroup"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -153,7 +153,7 @@ public async Task Get_GetAccount() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListAccountsByResourceGroup() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListAccountsByResourceGroup.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ListAccountsByResourceGroup.json // this example is just showing the usage of "Accounts_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 @@ -163,7 +163,7 @@ public async Task GetAll_ListAccountsByResourceGroup() // 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 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "myResourceGroup"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -188,7 +188,7 @@ public async Task GetAll_ListAccountsByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_GetAccount() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetAccount.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetAccount.json // this example is just showing the usage of "Accounts_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 @@ -198,7 +198,7 @@ public async Task Exists_GetAccount() // 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 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "myResourceGroup"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -217,7 +217,7 @@ public async Task Exists_GetAccount() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetAccount() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetAccount.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetAccount.json // this example is just showing the usage of "Accounts_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 @@ -227,7 +227,7 @@ public async Task GetIfExists_GetAccount() // 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 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "myResourceGroup"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesAccountDeploymentCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesAccountDeploymentCollection.cs index ff40f98f12be..da7e7bc6b993 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesAccountDeploymentCollection.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesAccountDeploymentCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CognitiveServicesAccountDeploymentCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PutDeployment() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/PutDeployment.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/PutDeployment.json // this example is just showing the usage of "Deployments_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 @@ -30,7 +30,7 @@ public async Task CreateOrUpdate_PutDeployment() // this example assumes you already have this CognitiveServicesAccountResource created on azure // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource - string subscriptionId = "subscriptionId"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; string accountName = "accountName"; ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); @@ -71,7 +71,7 @@ public async Task CreateOrUpdate_PutDeployment() [Ignore("Only validating compilation of examples")] public async Task Get_GetDeployment() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetDeployment.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetDeployment.json // this example is just showing the usage of "Deployments_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 @@ -81,7 +81,7 @@ public async Task Get_GetDeployment() // this example assumes you already have this CognitiveServicesAccountResource created on azure // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource - string subscriptionId = "subscriptionId"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; string accountName = "accountName"; ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); @@ -105,7 +105,7 @@ public async Task Get_GetDeployment() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListDeployments() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListDeployments.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ListDeployments.json // this example is just showing the usage of "Deployments_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 @@ -115,7 +115,7 @@ public async Task GetAll_ListDeployments() // this example assumes you already have this CognitiveServicesAccountResource created on azure // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource - string subscriptionId = "subscriptionId"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; string accountName = "accountName"; ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); @@ -141,7 +141,7 @@ public async Task GetAll_ListDeployments() [Ignore("Only validating compilation of examples")] public async Task Exists_GetDeployment() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetDeployment.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetDeployment.json // this example is just showing the usage of "Deployments_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 @@ -151,7 +151,7 @@ public async Task Exists_GetDeployment() // this example assumes you already have this CognitiveServicesAccountResource created on azure // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource - string subscriptionId = "subscriptionId"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; string accountName = "accountName"; ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); @@ -171,7 +171,7 @@ public async Task Exists_GetDeployment() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetDeployment() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetDeployment.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetDeployment.json // this example is just showing the usage of "Deployments_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 @@ -181,7 +181,7 @@ public async Task GetIfExists_GetDeployment() // this example assumes you already have this CognitiveServicesAccountResource created on azure // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource - string subscriptionId = "subscriptionId"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; string accountName = "accountName"; ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesAccountDeploymentResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesAccountDeploymentResource.cs index 2f6dada3ea8d..bda9225fca73 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesAccountDeploymentResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesAccountDeploymentResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CognitiveServicesAccountDeploymentResource [Ignore("Only validating compilation of examples")] public async Task Get_GetDeployment() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetDeployment.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetDeployment.json // this example is just showing the usage of "Deployments_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_GetDeployment() // this example assumes you already have this CognitiveServicesAccountDeploymentResource created on azure // for more information of creating CognitiveServicesAccountDeploymentResource, please refer to the document of CognitiveServicesAccountDeploymentResource - string subscriptionId = "subscriptionId"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; string accountName = "accountName"; string deploymentName = "deploymentName"; @@ -51,7 +51,7 @@ public async Task Get_GetDeployment() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteDeployment() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/DeleteDeployment.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/DeleteDeployment.json // this example is just showing the usage of "Deployments_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_DeleteDeployment() // this example assumes you already have this CognitiveServicesAccountDeploymentResource created on azure // for more information of creating CognitiveServicesAccountDeploymentResource, please refer to the document of CognitiveServicesAccountDeploymentResource - string subscriptionId = "subscriptionId"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; string accountName = "accountName"; string deploymentName = "deploymentName"; @@ -78,7 +78,7 @@ public async Task Delete_DeleteDeployment() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateDeployment() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/UpdateDeployment.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/UpdateDeployment.json // this example is just showing the usage of "Deployments_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 @@ -117,7 +117,7 @@ public async Task Update_UpdateDeployment() [Ignore("Only validating compilation of examples")] public async Task GetSkus_ListDeploymentSkus() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListDeploymentSkus.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ListDeploymentSkus.json // this example is just showing the usage of "Deployments_ListSkus" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesAccountResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesAccountResource.cs index 7143bc67263a..fec324a442cb 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesAccountResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesAccountResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CognitiveServicesAccountResource [Ignore("Only validating compilation of examples")] public async Task Get_GetAccount() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetAccount.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetAccount.json // this example is just showing the usage of "Accounts_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_GetAccount() // this example assumes you already have this CognitiveServicesAccountResource created on azure // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource - string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "myResourceGroup"; string accountName = "myAccount"; ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); @@ -50,7 +50,7 @@ public async Task Get_GetAccount() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteAccount() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/DeleteAccount.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/DeleteAccount.json // this example is just showing the usage of "Accounts_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_DeleteAccount() // this example assumes you already have this CognitiveServicesAccountResource created on azure // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource - string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "myResourceGroup"; string accountName = "PropTest01"; ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); @@ -76,7 +76,7 @@ public async Task Delete_DeleteAccount() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateAccount() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/UpdateAccount.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/UpdateAccount.json // this example is just showing the usage of "Accounts_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_UpdateAccount() // this example assumes you already have this CognitiveServicesAccountResource created on azure // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource - string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "bvttest"; string accountName = "bingSearch"; ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); @@ -111,7 +111,7 @@ public async Task Update_UpdateAccount() [Ignore("Only validating compilation of examples")] public async Task GetKeys_ListKeys() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListKeys.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ListKeys.json // this example is just showing the usage of "Accounts_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 @@ -121,7 +121,7 @@ public async Task GetKeys_ListKeys() // this example assumes you already have this CognitiveServicesAccountResource created on azure // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource - string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "myResourceGroup"; string accountName = "myAccount"; ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); @@ -137,7 +137,7 @@ public async Task GetKeys_ListKeys() [Ignore("Only validating compilation of examples")] public async Task RegenerateKey_RegenerateKeys() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/RegenerateKey.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/RegenerateKey.json // this example is just showing the usage of "Accounts_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 @@ -147,7 +147,7 @@ public async Task RegenerateKey_RegenerateKeys() // this example assumes you already have this CognitiveServicesAccountResource created on azure // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource - string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "myResourceGroup"; string accountName = "myAccount"; ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); @@ -164,7 +164,7 @@ public async Task RegenerateKey_RegenerateKeys() [Ignore("Only validating compilation of examples")] public async Task GetSkus_ListSKUs() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListSkus.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ListSkus.json // this example is just showing the usage of "Accounts_ListSkus" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 +174,7 @@ public async Task GetSkus_ListSKUs() // this example assumes you already have this CognitiveServicesAccountResource created on azure // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource - string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "myResourceGroup"; string accountName = "myAccount"; ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); @@ -193,7 +193,7 @@ public async Task GetSkus_ListSKUs() [Ignore("Only validating compilation of examples")] public async Task GetUsages_GetUsages() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetUsages.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetUsages.json // this example is just showing the usage of "Accounts_ListUsages" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 GetUsages_GetUsages() [Ignore("Only validating compilation of examples")] public async Task GetModels_ListAccountModels() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListAccountModels.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ListAccountModels.json // this example is just showing the usage of "Accounts_ListModels" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -232,7 +232,7 @@ public async Task GetModels_ListAccountModels() // this example assumes you already have this CognitiveServicesAccountResource created on azure // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource - string subscriptionId = "subscriptionId"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; string accountName = "accountName"; ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); @@ -251,7 +251,7 @@ public async Task GetModels_ListAccountModels() [Ignore("Only validating compilation of examples")] public async Task GetPrivateLinkResources_ListPrivateLinkResources() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListPrivateLinkResources.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-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 @@ -261,7 +261,7 @@ public async Task GetPrivateLinkResources_ListPrivateLinkResources() // this example assumes you already have this CognitiveServicesAccountResource created on azure // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource - string subscriptionId = "{subscription-id}"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "res6977"; string accountName = "sto2527"; ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesCommitmentPlanCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesCommitmentPlanCollection.cs index bc2fce52f2b6..1323ce94efca 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesCommitmentPlanCollection.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesCommitmentPlanCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_CognitiveServicesCommitmentPlanCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateCommitmentPlan() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/CreateSharedCommitmentPlan.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/CreateSharedCommitmentPlan.json // this example is just showing the usage of "CommitmentPlans_CreateOrUpdatePlan" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 CreateOrUpdate_CreateCommitmentPlan() // 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 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -71,7 +71,7 @@ public async Task CreateOrUpdate_CreateCommitmentPlan() [Ignore("Only validating compilation of examples")] public async Task Get_GetCommitmentPlan() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetSharedCommitmentPlan.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetSharedCommitmentPlan.json // this example is just showing the usage of "CommitmentPlans_GetPlan" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 Get_GetCommitmentPlan() // 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 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -104,7 +104,7 @@ public async Task Get_GetCommitmentPlan() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListCommitmentPlansByResourceGroup() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListSharedCommitmentPlansByResourceGroup.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ListSharedCommitmentPlansByResourceGroup.json // this example is just showing the usage of "CommitmentPlans_ListPlansByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -114,7 +114,7 @@ public async Task GetAll_ListCommitmentPlansByResourceGroup() // 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 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -139,7 +139,7 @@ public async Task GetAll_ListCommitmentPlansByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_GetCommitmentPlan() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetSharedCommitmentPlan.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetSharedCommitmentPlan.json // this example is just showing the usage of "CommitmentPlans_GetPlan" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 Exists_GetCommitmentPlan() // 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 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -168,7 +168,7 @@ public async Task Exists_GetCommitmentPlan() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetCommitmentPlan() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetSharedCommitmentPlan.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetSharedCommitmentPlan.json // this example is just showing the usage of "CommitmentPlans_GetPlan" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -178,7 +178,7 @@ public async Task GetIfExists_GetCommitmentPlan() // 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 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesCommitmentPlanResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesCommitmentPlanResource.cs index e79122b3253d..bde76aa3147c 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesCommitmentPlanResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesCommitmentPlanResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CognitiveServicesCommitmentPlanResource [Ignore("Only validating compilation of examples")] public async Task Get_GetCommitmentPlan() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetSharedCommitmentPlan.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetSharedCommitmentPlan.json // this example is just showing the usage of "CommitmentPlans_GetPlan" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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_GetCommitmentPlan() // this example assumes you already have this CognitiveServicesCommitmentPlanResource created on azure // for more information of creating CognitiveServicesCommitmentPlanResource, please refer to the document of CognitiveServicesCommitmentPlanResource - string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; string commitmentPlanName = "commitmentPlanName"; ResourceIdentifier cognitiveServicesCommitmentPlanResourceId = CognitiveServicesCommitmentPlanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, commitmentPlanName); @@ -50,7 +50,7 @@ public async Task Get_GetCommitmentPlan() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteCommitmentPlan() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/DeleteSharedCommitmentPlan.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/DeleteSharedCommitmentPlan.json // this example is just showing the usage of "CommitmentPlans_DeletePlan" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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_DeleteCommitmentPlan() // this example assumes you already have this CognitiveServicesCommitmentPlanResource created on azure // for more information of creating CognitiveServicesCommitmentPlanResource, please refer to the document of CognitiveServicesCommitmentPlanResource - string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; string commitmentPlanName = "commitmentPlanName"; ResourceIdentifier cognitiveServicesCommitmentPlanResourceId = CognitiveServicesCommitmentPlanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, commitmentPlanName); @@ -76,7 +76,7 @@ public async Task Delete_DeleteCommitmentPlan() [Ignore("Only validating compilation of examples")] public async Task Update_CreateCommitmentPlan() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/UpdateSharedCommitmentPlan.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/UpdateSharedCommitmentPlan.json // this example is just showing the usage of "CommitmentPlans_UpdatePlan" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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_CreateCommitmentPlan() // this example assumes you already have this CognitiveServicesCommitmentPlanResource created on azure // for more information of creating CognitiveServicesCommitmentPlanResource, please refer to the document of CognitiveServicesCommitmentPlanResource - string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; string commitmentPlanName = "commitmentPlanName"; ResourceIdentifier cognitiveServicesCommitmentPlanResourceId = CognitiveServicesCommitmentPlanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, commitmentPlanName); diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesDeletedAccountCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesDeletedAccountCollection.cs index 4cecb23e7f95..fc2a97c4c0cb 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesDeletedAccountCollection.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesDeletedAccountCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CognitiveServicesDeletedAccountCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetAccount() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetDeletedAccount.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetDeletedAccount.json // this example is just showing the usage of "DeletedAccounts_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_GetAccount() // 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 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -54,7 +54,7 @@ public async Task Get_GetAccount() [Ignore("Only validating compilation of examples")] public async Task Exists_GetAccount() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetDeletedAccount.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetDeletedAccount.json // this example is just showing the usage of "DeletedAccounts_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 @@ -64,7 +64,7 @@ public async Task Exists_GetAccount() // 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 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -84,7 +84,7 @@ public async Task Exists_GetAccount() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetAccount() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetDeletedAccount.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetDeletedAccount.json // this example is just showing the usage of "DeletedAccounts_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 GetIfExists_GetAccount() // 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 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesDeletedAccountResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesDeletedAccountResource.cs index 7451818d5891..42de42d120c8 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesDeletedAccountResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesDeletedAccountResource.cs @@ -19,7 +19,7 @@ public partial class Sample_CognitiveServicesDeletedAccountResource [Ignore("Only validating compilation of examples")] public async Task Get_GetAccount() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetDeletedAccount.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetDeletedAccount.json // this example is just showing the usage of "DeletedAccounts_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 @@ -29,7 +29,7 @@ public async Task Get_GetAccount() // this example assumes you already have this CognitiveServicesDeletedAccountResource created on azure // for more information of creating CognitiveServicesDeletedAccountResource, please refer to the document of CognitiveServicesDeletedAccountResource - string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; AzureLocation location = new AzureLocation("westus"); string resourceGroupName = "myResourceGroup"; string accountName = "myAccount"; @@ -50,7 +50,7 @@ public async Task Get_GetAccount() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteAccount() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/PurgeDeletedAccount.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/PurgeDeletedAccount.json // this example is just showing the usage of "DeletedAccounts_Purge" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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_DeleteAccount() // this example assumes you already have this CognitiveServicesDeletedAccountResource created on azure // for more information of creating CognitiveServicesDeletedAccountResource, please refer to the document of CognitiveServicesDeletedAccountResource - string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; AzureLocation location = new AzureLocation("westus"); string resourceGroupName = "myResourceGroup"; string accountName = "PropTest01"; diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesEncryptionScopeCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesEncryptionScopeCollection.cs index 809ba8f55a17..d2a8e4f23929 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesEncryptionScopeCollection.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesEncryptionScopeCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CognitiveServicesEncryptionScopeCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PutEncryptionScope() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/PutEncryptionScope.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/PutEncryptionScope.json // this example is just showing the usage of "EncryptionScopes_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 @@ -70,7 +70,7 @@ public async Task CreateOrUpdate_PutEncryptionScope() [Ignore("Only validating compilation of examples")] public async Task Get_GetEncryptionScope() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetEncryptionScope.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetEncryptionScope.json // this example is just showing the usage of "EncryptionScopes_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 @@ -104,7 +104,7 @@ public async Task Get_GetEncryptionScope() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListEncryptionScopes() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListEncryptionScopes.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ListEncryptionScopes.json // this example is just showing the usage of "EncryptionScopes_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 @@ -140,7 +140,7 @@ public async Task GetAll_ListEncryptionScopes() [Ignore("Only validating compilation of examples")] public async Task Exists_GetEncryptionScope() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetEncryptionScope.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetEncryptionScope.json // this example is just showing the usage of "EncryptionScopes_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 @@ -170,7 +170,7 @@ public async Task Exists_GetEncryptionScope() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetEncryptionScope() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetEncryptionScope.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetEncryptionScope.json // this example is just showing the usage of "EncryptionScopes_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/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesEncryptionScopeResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesEncryptionScopeResource.cs index 3ce8f0f68f5d..b74883765955 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesEncryptionScopeResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesEncryptionScopeResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CognitiveServicesEncryptionScopeResource [Ignore("Only validating compilation of examples")] public async Task Get_GetEncryptionScope() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetEncryptionScope.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetEncryptionScope.json // this example is just showing the usage of "EncryptionScopes_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_GetEncryptionScope() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteEncryptionScope() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/DeleteEncryptionScope.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/DeleteEncryptionScope.json // this example is just showing the usage of "EncryptionScopes_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_DeleteEncryptionScope() [Ignore("Only validating compilation of examples")] public async Task Update_PutEncryptionScope() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/PutEncryptionScope.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/PutEncryptionScope.json // this example is just showing the usage of "EncryptionScopes_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/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesPrivateEndpointConnectionCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesPrivateEndpointConnectionCollection.cs index a87cbceb5179..ec0063eeeeae 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesPrivateEndpointConnectionCollection.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesPrivateEndpointConnectionCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_CognitiveServicesPrivateEndpointConnectionCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetPrivateEndpointConnection() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetPrivateEndpointConnection.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-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 @@ -29,7 +29,7 @@ public async Task Get_GetPrivateEndpointConnection() // this example assumes you already have this CognitiveServicesAccountResource created on azure // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource - string subscriptionId = "{subscription-id}"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "res6977"; string accountName = "sto2527"; ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); @@ -53,7 +53,7 @@ public async Task Get_GetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetPrivateEndpointConnection() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListPrivateEndpointConnections.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ListPrivateEndpointConnections.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 @@ -63,7 +63,7 @@ public async Task GetAll_GetPrivateEndpointConnection() // this example assumes you already have this CognitiveServicesAccountResource created on azure // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource - string subscriptionId = "{subscription-id}"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "res6977"; string accountName = "sto2527"; ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); @@ -89,7 +89,7 @@ public async Task GetAll_GetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Exists_GetPrivateEndpointConnection() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetPrivateEndpointConnection.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-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 @@ -99,7 +99,7 @@ public async Task Exists_GetPrivateEndpointConnection() // this example assumes you already have this CognitiveServicesAccountResource created on azure // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource - string subscriptionId = "{subscription-id}"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "res6977"; string accountName = "sto2527"; ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); @@ -119,7 +119,7 @@ public async Task Exists_GetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetPrivateEndpointConnection() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetPrivateEndpointConnection.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-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 @@ -129,7 +129,7 @@ public async Task GetIfExists_GetPrivateEndpointConnection() // this example assumes you already have this CognitiveServicesAccountResource created on azure // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource - string subscriptionId = "{subscription-id}"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "res6977"; string accountName = "sto2527"; ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesPrivateEndpointConnectionResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesPrivateEndpointConnectionResource.cs index f702bb074b4c..d6f62ec1c838 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesPrivateEndpointConnectionResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CognitiveServicesPrivateEndpointConnectionResource.cs @@ -19,7 +19,7 @@ public partial class Sample_CognitiveServicesPrivateEndpointConnectionResource [Ignore("Only validating compilation of examples")] public async Task Get_GetPrivateEndpointConnection() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetPrivateEndpointConnection.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-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 @@ -29,7 +29,7 @@ public async Task Get_GetPrivateEndpointConnection() // this example assumes you already have this CognitiveServicesPrivateEndpointConnectionResource created on azure // for more information of creating CognitiveServicesPrivateEndpointConnectionResource, please refer to the document of CognitiveServicesPrivateEndpointConnectionResource - string subscriptionId = "{subscription-id}"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "res6977"; string accountName = "sto2527"; string privateEndpointConnectionName = "{privateEndpointConnectionName}"; @@ -50,7 +50,7 @@ public async Task Get_GetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Delete_DeletePrivateEndpointConnection() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/DeletePrivateEndpointConnection.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-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 @@ -60,7 +60,7 @@ public async Task Delete_DeletePrivateEndpointConnection() // this example assumes you already have this CognitiveServicesPrivateEndpointConnectionResource created on azure // for more information of creating CognitiveServicesPrivateEndpointConnectionResource, please refer to the document of CognitiveServicesPrivateEndpointConnectionResource - string subscriptionId = "{subscription-id}"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "res6977"; string accountName = "sto2527"; string privateEndpointConnectionName = "{privateEndpointConnectionName}"; diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CommitmentPlanAccountAssociationCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CommitmentPlanAccountAssociationCollection.cs index 45edccc03684..2593a82bff6d 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CommitmentPlanAccountAssociationCollection.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CommitmentPlanAccountAssociationCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_CommitmentPlanAccountAssociationCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PutCommitmentPlan() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/CreateSharedCommitmentPlanAssociation.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/CreateSharedCommitmentPlanAssociation.json // this example is just showing the usage of "CommitmentPlans_CreateOrUpdateAssociation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -29,7 +29,7 @@ public async Task CreateOrUpdate_PutCommitmentPlan() // this example assumes you already have this CognitiveServicesCommitmentPlanResource created on azure // for more information of creating CognitiveServicesCommitmentPlanResource, please refer to the document of CognitiveServicesCommitmentPlanResource - string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; string commitmentPlanName = "commitmentPlanName"; ResourceIdentifier cognitiveServicesCommitmentPlanResourceId = CognitiveServicesCommitmentPlanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, commitmentPlanName); @@ -58,7 +58,7 @@ public async Task CreateOrUpdate_PutCommitmentPlan() [Ignore("Only validating compilation of examples")] public async Task Get_GetCommitmentPlan() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetSharedCommitmentPlanAssociation.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetSharedCommitmentPlanAssociation.json // this example is just showing the usage of "CommitmentPlans_GetAssociation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 Get_GetCommitmentPlan() // this example assumes you already have this CognitiveServicesCommitmentPlanResource created on azure // for more information of creating CognitiveServicesCommitmentPlanResource, please refer to the document of CognitiveServicesCommitmentPlanResource - string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; string commitmentPlanName = "commitmentPlanName"; ResourceIdentifier cognitiveServicesCommitmentPlanResourceId = CognitiveServicesCommitmentPlanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, commitmentPlanName); @@ -92,7 +92,7 @@ public async Task Get_GetCommitmentPlan() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListCommitmentPlans() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListSharedCommitmentPlanAssociations.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ListSharedCommitmentPlanAssociations.json // this example is just showing the usage of "CommitmentPlans_ListAssociations" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -102,7 +102,7 @@ public async Task GetAll_ListCommitmentPlans() // this example assumes you already have this CognitiveServicesCommitmentPlanResource created on azure // for more information of creating CognitiveServicesCommitmentPlanResource, please refer to the document of CognitiveServicesCommitmentPlanResource - string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; string commitmentPlanName = "commitmentPlanName"; ResourceIdentifier cognitiveServicesCommitmentPlanResourceId = CognitiveServicesCommitmentPlanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, commitmentPlanName); @@ -128,7 +128,7 @@ public async Task GetAll_ListCommitmentPlans() [Ignore("Only validating compilation of examples")] public async Task Exists_GetCommitmentPlan() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetSharedCommitmentPlanAssociation.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetSharedCommitmentPlanAssociation.json // this example is just showing the usage of "CommitmentPlans_GetAssociation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -138,7 +138,7 @@ public async Task Exists_GetCommitmentPlan() // this example assumes you already have this CognitiveServicesCommitmentPlanResource created on azure // for more information of creating CognitiveServicesCommitmentPlanResource, please refer to the document of CognitiveServicesCommitmentPlanResource - string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; string commitmentPlanName = "commitmentPlanName"; ResourceIdentifier cognitiveServicesCommitmentPlanResourceId = CognitiveServicesCommitmentPlanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, commitmentPlanName); @@ -158,7 +158,7 @@ public async Task Exists_GetCommitmentPlan() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetCommitmentPlan() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetSharedCommitmentPlanAssociation.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetSharedCommitmentPlanAssociation.json // this example is just showing the usage of "CommitmentPlans_GetAssociation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 GetIfExists_GetCommitmentPlan() // this example assumes you already have this CognitiveServicesCommitmentPlanResource created on azure // for more information of creating CognitiveServicesCommitmentPlanResource, please refer to the document of CognitiveServicesCommitmentPlanResource - string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; string commitmentPlanName = "commitmentPlanName"; ResourceIdentifier cognitiveServicesCommitmentPlanResourceId = CognitiveServicesCommitmentPlanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, commitmentPlanName); diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CommitmentPlanAccountAssociationResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CommitmentPlanAccountAssociationResource.cs index 5ce8b3e170f5..c669348603b3 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CommitmentPlanAccountAssociationResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CommitmentPlanAccountAssociationResource.cs @@ -19,7 +19,7 @@ public partial class Sample_CommitmentPlanAccountAssociationResource [Ignore("Only validating compilation of examples")] public async Task Get_GetCommitmentPlan() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetSharedCommitmentPlanAssociation.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetSharedCommitmentPlanAssociation.json // this example is just showing the usage of "CommitmentPlans_GetAssociation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -29,7 +29,7 @@ public async Task Get_GetCommitmentPlan() // this example assumes you already have this CommitmentPlanAccountAssociationResource created on azure // for more information of creating CommitmentPlanAccountAssociationResource, please refer to the document of CommitmentPlanAccountAssociationResource - string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; string commitmentPlanName = "commitmentPlanName"; string commitmentPlanAssociationName = "commitmentPlanAssociationName"; @@ -50,7 +50,7 @@ public async Task Get_GetCommitmentPlan() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteCommitmentPlan() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/DeleteSharedCommitmentPlanAssociation.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/DeleteSharedCommitmentPlanAssociation.json // this example is just showing the usage of "CommitmentPlans_DeleteAssociation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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_DeleteCommitmentPlan() // this example assumes you already have this CommitmentPlanAccountAssociationResource created on azure // for more information of creating CommitmentPlanAccountAssociationResource, please refer to the document of CommitmentPlanAccountAssociationResource - string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; string commitmentPlanName = "commitmentPlanName"; string commitmentPlanAssociationName = "commitmentPlanAssociationName"; @@ -77,7 +77,7 @@ public async Task Delete_DeleteCommitmentPlan() [Ignore("Only validating compilation of examples")] public async Task Update_PutCommitmentPlan() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/CreateSharedCommitmentPlanAssociation.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/CreateSharedCommitmentPlanAssociation.json // this example is just showing the usage of "CommitmentPlans_CreateOrUpdateAssociation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -87,7 +87,7 @@ public async Task Update_PutCommitmentPlan() // this example assumes you already have this CommitmentPlanAccountAssociationResource created on azure // for more information of creating CommitmentPlanAccountAssociationResource, please refer to the document of CommitmentPlanAccountAssociationResource - string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; string commitmentPlanName = "commitmentPlanName"; string commitmentPlanAssociationName = "commitmentPlanAssociationName"; diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CommitmentPlanCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CommitmentPlanCollection.cs index 60bbb77a5b31..f9c553edf7a4 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CommitmentPlanCollection.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CommitmentPlanCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CommitmentPlanCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PutCommitmentPlan() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/PutCommitmentPlan.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/PutCommitmentPlan.json // this example is just showing the usage of "CommitmentPlans_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 @@ -30,7 +30,7 @@ public async Task CreateOrUpdate_PutCommitmentPlan() // this example assumes you already have this CognitiveServicesAccountResource created on azure // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource - string subscriptionId = "subscriptionId"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; string accountName = "accountName"; ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); @@ -68,7 +68,7 @@ public async Task CreateOrUpdate_PutCommitmentPlan() [Ignore("Only validating compilation of examples")] public async Task Get_GetCommitmentPlan() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetCommitmentPlan.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetCommitmentPlan.json // this example is just showing the usage of "CommitmentPlans_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 @@ -78,7 +78,7 @@ public async Task Get_GetCommitmentPlan() // this example assumes you already have this CognitiveServicesAccountResource created on azure // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource - string subscriptionId = "subscriptionId"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; string accountName = "accountName"; ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); @@ -102,7 +102,7 @@ public async Task Get_GetCommitmentPlan() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListCommitmentPlans() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListCommitmentPlans.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ListCommitmentPlans.json // this example is just showing the usage of "CommitmentPlans_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 @@ -112,7 +112,7 @@ public async Task GetAll_ListCommitmentPlans() // this example assumes you already have this CognitiveServicesAccountResource created on azure // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource - string subscriptionId = "subscriptionId"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; string accountName = "accountName"; ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); @@ -138,7 +138,7 @@ public async Task GetAll_ListCommitmentPlans() [Ignore("Only validating compilation of examples")] public async Task Exists_GetCommitmentPlan() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetCommitmentPlan.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetCommitmentPlan.json // this example is just showing the usage of "CommitmentPlans_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 Exists_GetCommitmentPlan() // this example assumes you already have this CognitiveServicesAccountResource created on azure // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource - string subscriptionId = "subscriptionId"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; string accountName = "accountName"; ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); @@ -168,7 +168,7 @@ public async Task Exists_GetCommitmentPlan() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetCommitmentPlan() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetCommitmentPlan.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetCommitmentPlan.json // this example is just showing the usage of "CommitmentPlans_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 @@ -178,7 +178,7 @@ public async Task GetIfExists_GetCommitmentPlan() // this example assumes you already have this CognitiveServicesAccountResource created on azure // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource - string subscriptionId = "subscriptionId"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; string accountName = "accountName"; ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CommitmentPlanResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CommitmentPlanResource.cs index c00ea462a2aa..0b597bf5407e 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CommitmentPlanResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_CommitmentPlanResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CommitmentPlanResource [Ignore("Only validating compilation of examples")] public async Task Get_GetCommitmentPlan() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetCommitmentPlan.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetCommitmentPlan.json // this example is just showing the usage of "CommitmentPlans_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_GetCommitmentPlan() // this example assumes you already have this CommitmentPlanResource created on azure // for more information of creating CommitmentPlanResource, please refer to the document of CommitmentPlanResource - string subscriptionId = "subscriptionId"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; string accountName = "accountName"; string commitmentPlanName = "commitmentPlanName"; @@ -51,7 +51,7 @@ public async Task Get_GetCommitmentPlan() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteCommitmentPlan() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/DeleteCommitmentPlan.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/DeleteCommitmentPlan.json // this example is just showing the usage of "CommitmentPlans_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_DeleteCommitmentPlan() // this example assumes you already have this CommitmentPlanResource created on azure // for more information of creating CommitmentPlanResource, please refer to the document of CommitmentPlanResource - string subscriptionId = "subscriptionId"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; string accountName = "accountName"; string commitmentPlanName = "commitmentPlanName"; @@ -78,7 +78,7 @@ public async Task Delete_DeleteCommitmentPlan() [Ignore("Only validating compilation of examples")] public async Task Update_PutCommitmentPlan() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/PutCommitmentPlan.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/PutCommitmentPlan.json // this example is just showing the usage of "CommitmentPlans_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 @@ -88,7 +88,7 @@ public async Task Update_PutCommitmentPlan() // this example assumes you already have this CommitmentPlanResource created on azure // for more information of creating CommitmentPlanResource, please refer to the document of CommitmentPlanResource - string subscriptionId = "subscriptionId"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; string resourceGroupName = "resourceGroupName"; string accountName = "accountName"; string commitmentPlanName = "commitmentPlanName"; diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_DefenderForAISettingCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_DefenderForAISettingCollection.cs index 5599f369f4d0..d5a6cd345229 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_DefenderForAISettingCollection.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_DefenderForAISettingCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_DefenderForAISettingCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PutDefenderForAISetting() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/PutDefenderForAISetting.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/PutDefenderForAISetting.json // this example is just showing the usage of "DefenderForAISettings_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_PutDefenderForAISetting() [Ignore("Only validating compilation of examples")] public async Task Get_GetDefenderForAISetting() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetDefenderForAISetting.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetDefenderForAISetting.json // this example is just showing the usage of "DefenderForAISettings_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_GetDefenderForAISetting() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListDefenderForAISetting() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListDefenderForAISetting.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ListDefenderForAISetting.json // this example is just showing the usage of "DefenderForAISettings_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_ListDefenderForAISetting() [Ignore("Only validating compilation of examples")] public async Task Exists_GetDefenderForAISetting() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetDefenderForAISetting.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetDefenderForAISetting.json // this example is just showing the usage of "DefenderForAISettings_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_GetDefenderForAISetting() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetDefenderForAISetting() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetDefenderForAISetting.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetDefenderForAISetting.json // this example is just showing the usage of "DefenderForAISettings_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/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_DefenderForAISettingResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_DefenderForAISettingResource.cs index 5003e2b07273..93299f2a9021 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_DefenderForAISettingResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_DefenderForAISettingResource.cs @@ -20,7 +20,7 @@ public partial class Sample_DefenderForAISettingResource [Ignore("Only validating compilation of examples")] public async Task Get_GetDefenderForAISetting() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetDefenderForAISetting.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetDefenderForAISetting.json // this example is just showing the usage of "DefenderForAISettings_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_GetDefenderForAISetting() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateDefenderForAISetting() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/UpdateDefenderForAISetting.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/UpdateDefenderForAISetting.json // this example is just showing the usage of "DefenderForAISettings_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/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs index 0ff592031c27..99557a051fb7 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_NetworkSecurityPerimeterConfigurationCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetNetworkSecurityPerimeterConfigurations() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetNetworkSecurityPerimeterConfigurations.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetNetworkSecurityPerimeterConfigurations.json // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_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_GetNetworkSecurityPerimeterConfigurations() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListNetworkSecurityPerimeterConfigurations() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListNetworkSecurityPerimeterConfigurations.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ListNetworkSecurityPerimeterConfigurations.json // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_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_ListNetworkSecurityPerimeterConfigurations() [Ignore("Only validating compilation of examples")] public async Task Exists_GetNetworkSecurityPerimeterConfigurations() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetNetworkSecurityPerimeterConfigurations.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetNetworkSecurityPerimeterConfigurations.json // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_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_GetNetworkSecurityPerimeterConfigurations() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetNetworkSecurityPerimeterConfigurations() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetNetworkSecurityPerimeterConfigurations.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetNetworkSecurityPerimeterConfigurations.json // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_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/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs index aa326b846beb..6cc532302a73 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs @@ -19,7 +19,7 @@ public partial class Sample_NetworkSecurityPerimeterConfigurationResource [Ignore("Only validating compilation of examples")] public async Task Get_GetNetworkSecurityPerimeterConfigurations() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetNetworkSecurityPerimeterConfigurations.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetNetworkSecurityPerimeterConfigurations.json // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_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_GetNetworkSecurityPerimeterConfigurations() [Ignore("Only validating compilation of examples")] public async Task Reconcile_ReconcileNetworkSecurityPerimeterConfigurations() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ReconcileNetworkSecurityPerimeterConfigurations.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ReconcileNetworkSecurityPerimeterConfigurations.json // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_Reconcile" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_ProjectCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_ProjectCollection.cs new file mode 100644 index 000000000000..08087b6ad1be --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_ProjectCollection.cs @@ -0,0 +1,246 @@ +// 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.CognitiveServices.Models; +using Azure.ResourceManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.CognitiveServices.Samples +{ + public partial class Sample_ProjectCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateProject() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/CreateProject.json + // this example is just showing the usage of "Projects_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 + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this CognitiveServicesAccountResource created on azure + // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "myResourceGroup"; + string accountName = "testCreate1"; + ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CognitiveServicesAccountResource cognitiveServicesAccount = client.GetCognitiveServicesAccountResource(cognitiveServicesAccountResourceId); + + // get the collection of this ProjectResource + ProjectCollection collection = cognitiveServicesAccount.GetProjects(); + + // invoke the operation + string projectName = "testProject1"; + ProjectData data = new ProjectData(new AzureLocation("West US")) + { + Identity = new ManagedServiceIdentity("SystemAssigned"), + Properties = new ProjectProperties + { + DisplayName = "p1", + Description = "Description of this project", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, projectName, data); + ProjectResource 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 + ProjectData 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_CreateProjectMin() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/CreateProjectMin.json + // this example is just showing the usage of "Projects_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 + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this CognitiveServicesAccountResource created on azure + // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "myResourceGroup"; + string accountName = "testCreate1"; + ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CognitiveServicesAccountResource cognitiveServicesAccount = client.GetCognitiveServicesAccountResource(cognitiveServicesAccountResourceId); + + // get the collection of this ProjectResource + ProjectCollection collection = cognitiveServicesAccount.GetProjects(); + + // invoke the operation + string projectName = "testProject1"; + ProjectData data = new ProjectData(new AzureLocation("West US")) + { + Identity = new ManagedServiceIdentity("SystemAssigned"), + Properties = new ProjectProperties(), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, projectName, data); + ProjectResource 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 + ProjectData 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_GetProject() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetProject.json + // this example is just showing the usage of "Projects_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 CognitiveServicesAccountResource created on azure + // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "myResourceGroup"; + string accountName = "myAccount"; + ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CognitiveServicesAccountResource cognitiveServicesAccount = client.GetCognitiveServicesAccountResource(cognitiveServicesAccountResourceId); + + // get the collection of this ProjectResource + ProjectCollection collection = cognitiveServicesAccount.GetProjects(); + + // invoke the operation + string projectName = "myProject"; + ProjectResource result = await collection.GetAsync(projectName); + + // 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 + ProjectData 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_ListProject() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ListProjects.json + // this example is just showing the usage of "Projects_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 CognitiveServicesAccountResource created on azure + // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "myResourceGroup"; + string accountName = "myAccount"; + ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CognitiveServicesAccountResource cognitiveServicesAccount = client.GetCognitiveServicesAccountResource(cognitiveServicesAccountResourceId); + + // get the collection of this ProjectResource + ProjectCollection collection = cognitiveServicesAccount.GetProjects(); + + // invoke the operation and iterate over the result + await foreach (ProjectResource 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 + ProjectData 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_GetProject() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetProject.json + // this example is just showing the usage of "Projects_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 CognitiveServicesAccountResource created on azure + // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "myResourceGroup"; + string accountName = "myAccount"; + ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CognitiveServicesAccountResource cognitiveServicesAccount = client.GetCognitiveServicesAccountResource(cognitiveServicesAccountResourceId); + + // get the collection of this ProjectResource + ProjectCollection collection = cognitiveServicesAccount.GetProjects(); + + // invoke the operation + string projectName = "myProject"; + bool result = await collection.ExistsAsync(projectName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetProject() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetProject.json + // this example is just showing the usage of "Projects_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 CognitiveServicesAccountResource created on azure + // for more information of creating CognitiveServicesAccountResource, please refer to the document of CognitiveServicesAccountResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "myResourceGroup"; + string accountName = "myAccount"; + ResourceIdentifier cognitiveServicesAccountResourceId = CognitiveServicesAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + CognitiveServicesAccountResource cognitiveServicesAccount = client.GetCognitiveServicesAccountResource(cognitiveServicesAccountResourceId); + + // get the collection of this ProjectResource + ProjectCollection collection = cognitiveServicesAccount.GetProjects(); + + // invoke the operation + string projectName = "myProject"; + NullableResponse response = await collection.GetIfExistsAsync(projectName); + ProjectResource 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 + ProjectData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_ProjectResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_ProjectResource.cs new file mode 100644 index 000000000000..101304981751 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_ProjectResource.cs @@ -0,0 +1,116 @@ +// 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.CognitiveServices.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.CognitiveServices.Samples +{ + public partial class Sample_ProjectResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetProject() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetProject.json + // this example is just showing the usage of "Projects_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 ProjectResource created on azure + // for more information of creating ProjectResource, please refer to the document of ProjectResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "myResourceGroup"; + string accountName = "myAccount"; + string projectName = "myProject"; + ResourceIdentifier projectResourceId = ProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, projectName); + ProjectResource project = client.GetProjectResource(projectResourceId); + + // invoke the operation + ProjectResource result = await project.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 + ProjectData 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_DeleteProject() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/DeleteProject.json + // this example is just showing the usage of "Projects_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 ProjectResource created on azure + // for more information of creating ProjectResource, please refer to the document of ProjectResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "myResourceGroup"; + string accountName = "PropTest01"; + string projectName = "myProject"; + ResourceIdentifier projectResourceId = ProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, projectName); + ProjectResource project = client.GetProjectResource(projectResourceId); + + // invoke the operation + await project.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdateProject() + { + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/UpdateProjects.json + // this example is just showing the usage of "Projects_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 ProjectResource created on azure + // for more information of creating ProjectResource, please refer to the document of ProjectResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "bvttest"; + string accountName = "bingSearch"; + string projectName = "projectName"; + ResourceIdentifier projectResourceId = ProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, projectName); + ProjectResource project = client.GetProjectResource(projectResourceId); + + // invoke the operation + ProjectData data = new ProjectData(new AzureLocation("global")) + { + Properties = new ProjectProperties + { + Description = "new description.", + }, + }; + ArmOperation lro = await project.UpdateAsync(WaitUntil.Completed, data); + ProjectResource 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 + ProjectData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiBlocklistCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiBlocklistCollection.cs index a6f43c7c4acd..3c1e2784b494 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiBlocklistCollection.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiBlocklistCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_RaiBlocklistCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PutRaiBlocklist() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/PutRaiBlocklist.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/PutRaiBlocklist.json // this example is just showing the usage of "RaiBlocklists_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 @@ -58,7 +58,7 @@ public async Task CreateOrUpdate_PutRaiBlocklist() [Ignore("Only validating compilation of examples")] public async Task Get_GetRaiBlocklist() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetRaiBlocklist.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetRaiBlocklist.json // this example is just showing the usage of "RaiBlocklists_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 @@ -92,7 +92,7 @@ public async Task Get_GetRaiBlocklist() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListBlocklists() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListBlocklists.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ListBlocklists.json // this example is just showing the usage of "RaiBlocklists_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 @@ -128,7 +128,7 @@ public async Task GetAll_ListBlocklists() [Ignore("Only validating compilation of examples")] public async Task Exists_GetRaiBlocklist() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetRaiBlocklist.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetRaiBlocklist.json // this example is just showing the usage of "RaiBlocklists_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 @@ -158,7 +158,7 @@ public async Task Exists_GetRaiBlocklist() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetRaiBlocklist() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetRaiBlocklist.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetRaiBlocklist.json // this example is just showing the usage of "RaiBlocklists_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/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiBlocklistItemCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiBlocklistItemCollection.cs index a6b42192cbb1..219f1b02611c 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiBlocklistItemCollection.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiBlocklistItemCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_RaiBlocklistItemCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PutRaiBlocklistItem() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/PutRaiBlocklistItem.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/PutRaiBlocklistItem.json // this example is just showing the usage of "RaiBlocklistItems_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_PutRaiBlocklistItem() [Ignore("Only validating compilation of examples")] public async Task Get_GetRaiBlocklistItem() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetRaiBlocklistItem.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetRaiBlocklistItem.json // this example is just showing the usage of "RaiBlocklistItems_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 @@ -99,7 +99,7 @@ public async Task Get_GetRaiBlocklistItem() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListBlocklistItems() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListBlocklistItems.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ListBlocklistItems.json // this example is just showing the usage of "RaiBlocklistItems_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 @@ -136,7 +136,7 @@ public async Task GetAll_ListBlocklistItems() [Ignore("Only validating compilation of examples")] public async Task Exists_GetRaiBlocklistItem() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetRaiBlocklistItem.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetRaiBlocklistItem.json // this example is just showing the usage of "RaiBlocklistItems_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 @@ -167,7 +167,7 @@ public async Task Exists_GetRaiBlocklistItem() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetRaiBlocklistItem() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetRaiBlocklistItem.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetRaiBlocklistItem.json // this example is just showing the usage of "RaiBlocklistItems_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/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiBlocklistItemResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiBlocklistItemResource.cs index 3bbe5b7155c4..8f91e4bf6c80 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiBlocklistItemResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiBlocklistItemResource.cs @@ -20,7 +20,7 @@ public partial class Sample_RaiBlocklistItemResource [Ignore("Only validating compilation of examples")] public async Task Get_GetRaiBlocklistItem() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetRaiBlocklistItem.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetRaiBlocklistItem.json // this example is just showing the usage of "RaiBlocklistItems_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_GetRaiBlocklistItem() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteRaiBlocklistItem() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/DeleteRaiBlocklistItem.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/DeleteRaiBlocklistItem.json // this example is just showing the usage of "RaiBlocklistItems_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 @@ -80,7 +80,7 @@ public async Task Delete_DeleteRaiBlocklistItem() [Ignore("Only validating compilation of examples")] public async Task Update_PutRaiBlocklistItem() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/PutRaiBlocklistItem.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/PutRaiBlocklistItem.json // this example is just showing the usage of "RaiBlocklistItems_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/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiBlocklistResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiBlocklistResource.cs index def423975610..d63ebc93d844 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiBlocklistResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiBlocklistResource.cs @@ -21,7 +21,7 @@ public partial class Sample_RaiBlocklistResource [Ignore("Only validating compilation of examples")] public async Task Get_GetRaiBlocklist() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetRaiBlocklist.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetRaiBlocklist.json // this example is just showing the usage of "RaiBlocklists_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_GetRaiBlocklist() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteRaiBlocklist() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/DeleteRaiBlocklist.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/DeleteRaiBlocklist.json // this example is just showing the usage of "RaiBlocklists_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 @@ -79,7 +79,7 @@ public async Task Delete_DeleteRaiBlocklist() [Ignore("Only validating compilation of examples")] public async Task Update_PutRaiBlocklist() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/PutRaiBlocklist.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/PutRaiBlocklist.json // this example is just showing the usage of "RaiBlocklists_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 Update_PutRaiBlocklist() [Ignore("Only validating compilation of examples")] public async Task BatchAddRaiBlocklistItem_AddRaiBlocklistItems() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/AddRaiBlocklistItems.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/AddRaiBlocklistItems.json // this example is just showing the usage of "RaiBlocklistItems_BatchAdd" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -167,7 +167,7 @@ public async Task BatchAddRaiBlocklistItem_AddRaiBlocklistItems() [Ignore("Only validating compilation of examples")] public async Task BatchDeleteRaiBlocklistItem_DeleteRaiBlocklistItems() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/DeleteRaiBlocklistItems.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/DeleteRaiBlocklistItems.json // this example is just showing the usage of "RaiBlocklistItems_BatchDelete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiContentFilterCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiContentFilterCollection.cs index 0f88b79808a2..a42aad03a3dc 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiContentFilterCollection.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiContentFilterCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_RaiContentFilterCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetRaiContentFilters() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetRaiContentFilter.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetRaiContentFilter.json // this example is just showing the usage of "RaiContentFilters_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_GetRaiContentFilters() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListRaiContentFilters() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListRaiContentFilters.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ListRaiContentFilters.json // this example is just showing the usage of "RaiContentFilters_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 @@ -88,7 +88,7 @@ public async Task GetAll_ListRaiContentFilters() [Ignore("Only validating compilation of examples")] public async Task Exists_GetRaiContentFilters() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetRaiContentFilter.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetRaiContentFilter.json // this example is just showing the usage of "RaiContentFilters_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 @@ -117,7 +117,7 @@ public async Task Exists_GetRaiContentFilters() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetRaiContentFilters() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetRaiContentFilter.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetRaiContentFilter.json // this example is just showing the usage of "RaiContentFilters_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/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiContentFilterResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiContentFilterResource.cs index d887809f1a2a..e451b1bbcabb 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiContentFilterResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiContentFilterResource.cs @@ -19,7 +19,7 @@ public partial class Sample_RaiContentFilterResource [Ignore("Only validating compilation of examples")] public async Task Get_GetRaiContentFilters() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetRaiContentFilter.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetRaiContentFilter.json // this example is just showing the usage of "RaiContentFilters_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/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiPolicyCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiPolicyCollection.cs index 23a99d41bb7d..7a8b1252d3aa 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiPolicyCollection.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiPolicyCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_RaiPolicyCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PutRaiPolicy() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/PutRaiPolicy.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/PutRaiPolicy.json // this example is just showing the usage of "RaiPolicies_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 @@ -49,81 +49,81 @@ public async Task CreateOrUpdate_PutRaiPolicy() BasePolicyName = "Microsoft.Default", ContentFilters = {new RaiPolicyContentFilter { -Name = "hate", +Name = "Hate", Enabled = false, SeverityThreshold = RaiPolicyContentLevel.High, Blocking = false, Source = RaiPolicyContentSource.Prompt, }, new RaiPolicyContentFilter { -Name = "hate", +Name = "Hate", Enabled = true, SeverityThreshold = RaiPolicyContentLevel.Medium, Blocking = true, Source = RaiPolicyContentSource.Completion, }, new RaiPolicyContentFilter { -Name = "sexual", +Name = "Sexual", Enabled = true, SeverityThreshold = RaiPolicyContentLevel.High, Blocking = true, Source = RaiPolicyContentSource.Prompt, }, new RaiPolicyContentFilter { -Name = "sexual", +Name = "Sexual", Enabled = true, SeverityThreshold = RaiPolicyContentLevel.Medium, Blocking = true, Source = RaiPolicyContentSource.Completion, }, new RaiPolicyContentFilter { -Name = "selfharm", +Name = "Selfharm", Enabled = true, SeverityThreshold = RaiPolicyContentLevel.High, Blocking = true, Source = RaiPolicyContentSource.Prompt, }, new RaiPolicyContentFilter { -Name = "selfharm", +Name = "Selfharm", Enabled = true, SeverityThreshold = RaiPolicyContentLevel.Medium, Blocking = true, Source = RaiPolicyContentSource.Completion, }, new RaiPolicyContentFilter { -Name = "violence", +Name = "Violence", Enabled = true, SeverityThreshold = RaiPolicyContentLevel.Medium, Blocking = true, Source = RaiPolicyContentSource.Prompt, }, new RaiPolicyContentFilter { -Name = "violence", +Name = "Violence", Enabled = true, SeverityThreshold = RaiPolicyContentLevel.Medium, Blocking = true, Source = RaiPolicyContentSource.Completion, }, new RaiPolicyContentFilter { -Name = "jailbreak", +Name = "Jailbreak", Enabled = true, Blocking = true, Source = RaiPolicyContentSource.Prompt, }, new RaiPolicyContentFilter { -Name = "protected_material_text", +Name = "Protected Material Text", Enabled = true, Blocking = true, Source = RaiPolicyContentSource.Completion, }, new RaiPolicyContentFilter { -Name = "protected_material_code", +Name = "Protected Material Code", Enabled = true, Blocking = true, Source = RaiPolicyContentSource.Completion, }, new RaiPolicyContentFilter { -Name = "profanity", +Name = "Profanity", Enabled = true, Blocking = true, Source = RaiPolicyContentSource.Prompt, @@ -144,7 +144,7 @@ public async Task CreateOrUpdate_PutRaiPolicy() [Ignore("Only validating compilation of examples")] public async Task Get_GetRaiPolicy() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetRaiPolicy.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetRaiPolicy.json // this example is just showing the usage of "RaiPolicies_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 @@ -178,7 +178,7 @@ public async Task Get_GetRaiPolicy() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListRaiPolicies() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListRaiPolicies.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ListRaiPolicies.json // this example is just showing the usage of "RaiPolicies_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 @@ -214,7 +214,7 @@ public async Task GetAll_ListRaiPolicies() [Ignore("Only validating compilation of examples")] public async Task Exists_GetRaiPolicy() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetRaiPolicy.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetRaiPolicy.json // this example is just showing the usage of "RaiPolicies_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 @@ -244,7 +244,7 @@ public async Task Exists_GetRaiPolicy() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetRaiPolicy() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetRaiPolicy.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetRaiPolicy.json // this example is just showing the usage of "RaiPolicies_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/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiPolicyResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiPolicyResource.cs index 675b47542fa4..fdcf00e79fb6 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiPolicyResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_RaiPolicyResource.cs @@ -20,7 +20,7 @@ public partial class Sample_RaiPolicyResource [Ignore("Only validating compilation of examples")] public async Task Get_GetRaiPolicy() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetRaiPolicy.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetRaiPolicy.json // this example is just showing the usage of "RaiPolicies_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_GetRaiPolicy() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteRaiPolicy() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/DeleteRaiPolicy.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/DeleteRaiPolicy.json // this example is just showing the usage of "RaiPolicies_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_DeleteRaiPolicy() [Ignore("Only validating compilation of examples")] public async Task Update_PutRaiPolicy() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/PutRaiPolicy.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/PutRaiPolicy.json // this example is just showing the usage of "RaiPolicies_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 @@ -104,81 +104,81 @@ public async Task Update_PutRaiPolicy() BasePolicyName = "Microsoft.Default", ContentFilters = {new RaiPolicyContentFilter { -Name = "hate", +Name = "Hate", Enabled = false, SeverityThreshold = RaiPolicyContentLevel.High, Blocking = false, Source = RaiPolicyContentSource.Prompt, }, new RaiPolicyContentFilter { -Name = "hate", +Name = "Hate", Enabled = true, SeverityThreshold = RaiPolicyContentLevel.Medium, Blocking = true, Source = RaiPolicyContentSource.Completion, }, new RaiPolicyContentFilter { -Name = "sexual", +Name = "Sexual", Enabled = true, SeverityThreshold = RaiPolicyContentLevel.High, Blocking = true, Source = RaiPolicyContentSource.Prompt, }, new RaiPolicyContentFilter { -Name = "sexual", +Name = "Sexual", Enabled = true, SeverityThreshold = RaiPolicyContentLevel.Medium, Blocking = true, Source = RaiPolicyContentSource.Completion, }, new RaiPolicyContentFilter { -Name = "selfharm", +Name = "Selfharm", Enabled = true, SeverityThreshold = RaiPolicyContentLevel.High, Blocking = true, Source = RaiPolicyContentSource.Prompt, }, new RaiPolicyContentFilter { -Name = "selfharm", +Name = "Selfharm", Enabled = true, SeverityThreshold = RaiPolicyContentLevel.Medium, Blocking = true, Source = RaiPolicyContentSource.Completion, }, new RaiPolicyContentFilter { -Name = "violence", +Name = "Violence", Enabled = true, SeverityThreshold = RaiPolicyContentLevel.Medium, Blocking = true, Source = RaiPolicyContentSource.Prompt, }, new RaiPolicyContentFilter { -Name = "violence", +Name = "Violence", Enabled = true, SeverityThreshold = RaiPolicyContentLevel.Medium, Blocking = true, Source = RaiPolicyContentSource.Completion, }, new RaiPolicyContentFilter { -Name = "jailbreak", +Name = "Jailbreak", Enabled = true, Blocking = true, Source = RaiPolicyContentSource.Prompt, }, new RaiPolicyContentFilter { -Name = "protected_material_text", +Name = "Protected Material Text", Enabled = true, Blocking = true, Source = RaiPolicyContentSource.Completion, }, new RaiPolicyContentFilter { -Name = "protected_material_code", +Name = "Protected Material Code", Enabled = true, Blocking = true, Source = RaiPolicyContentSource.Completion, }, new RaiPolicyContentFilter { -Name = "profanity", +Name = "Profanity", Enabled = true, Blocking = true, Source = RaiPolicyContentSource.Prompt, diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 11e46ff371ef..fb51b5976ee2 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -21,7 +21,7 @@ public partial class Sample_SubscriptionResourceExtensions [Ignore("Only validating compilation of examples")] public async Task GetCognitiveServicesAccounts_ListAccountsBySubscription() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListAccountsBySubscription.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ListAccountsBySubscription.json // this example is just showing the usage of "Accounts_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 @@ -31,7 +31,7 @@ public async Task GetCognitiveServicesAccounts_ListAccountsBySubscription() // 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 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -52,7 +52,7 @@ public async Task GetCognitiveServicesAccounts_ListAccountsBySubscription() [Ignore("Only validating compilation of examples")] public async Task GetDeletedAccounts_ListDeletedAccountsBySubscription() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListDeletedAccountsBySubscription.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ListDeletedAccountsBySubscription.json // this example is just showing the usage of "DeletedAccounts_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 @@ -62,7 +62,7 @@ public async Task GetDeletedAccounts_ListDeletedAccountsBySubscription() // 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 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -83,7 +83,7 @@ public async Task GetDeletedAccounts_ListDeletedAccountsBySubscription() [Ignore("Only validating compilation of examples")] public async Task GetResourceSkus_RegenerateKeys() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/GetSkus.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/GetSkus.json // this example is just showing the usage of "ResourceSkus_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 @@ -110,7 +110,7 @@ public async Task GetResourceSkus_RegenerateKeys() [Ignore("Only validating compilation of examples")] public async Task GetUsages_GetUsages() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListUsages.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ListUsages.json // this example is just showing the usage of "Usages_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 @@ -138,7 +138,7 @@ public async Task GetUsages_GetUsages() [Ignore("Only validating compilation of examples")] public async Task CheckSkuAvailability_CheckSKUAvailability() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/CheckSkuAvailability.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/CheckSkuAvailability.json // this example is just showing the usage of "CheckSkuAvailability" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 CheckSkuAvailability_CheckSKUAvailability() // 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 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -167,7 +167,7 @@ public async Task CheckSkuAvailability_CheckSKUAvailability() [Ignore("Only validating compilation of examples")] public async Task CheckDomainAvailability_CheckSKUAvailability() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/CheckDomainAvailability.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/CheckDomainAvailability.json // this example is just showing the usage of "CheckDomainAvailability" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 CheckDomainAvailability_CheckSKUAvailability() // 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 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -192,7 +192,7 @@ public async Task CheckDomainAvailability_CheckSKUAvailability() [Ignore("Only validating compilation of examples")] public async Task CalculateModelCapacity_CalculateModelCapacity() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/CalculateModelCapacity.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/CalculateModelCapacity.json // this example is just showing the usage of "CalculateModelCapacity" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -202,7 +202,7 @@ public async Task CalculateModelCapacity_CalculateModelCapacity() // 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 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -243,7 +243,7 @@ public async Task CalculateModelCapacity_CalculateModelCapacity() [Ignore("Only validating compilation of examples")] public async Task GetCommitmentTiers_ListCommitmentTiers() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListCommitmentTiers.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ListCommitmentTiers.json // this example is just showing the usage of "CommitmentTiers_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 @@ -253,7 +253,7 @@ public async Task GetCommitmentTiers_ListCommitmentTiers() // 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 = "subscriptionId"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -271,7 +271,7 @@ public async Task GetCommitmentTiers_ListCommitmentTiers() [Ignore("Only validating compilation of examples")] public async Task GetModels_ListLocationModels() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListLocationModels.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ListLocationModels.json // this example is just showing the usage of "Models_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 @@ -299,7 +299,7 @@ public async Task GetModels_ListLocationModels() [Ignore("Only validating compilation of examples")] public async Task GetLocationBasedModelCapacities_ListLocationBasedModelCapacities() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListLocationBasedModelCapacities.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ListLocationBasedModelCapacities.json // this example is just showing the usage of "LocationBasedModelCapacities_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 @@ -330,7 +330,7 @@ public async Task GetLocationBasedModelCapacities_ListLocationBasedModelCapaciti [Ignore("Only validating compilation of examples")] public async Task GetModelCapacities_ListModelCapacities() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListModelCapacities.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ListModelCapacities.json // this example is just showing the usage of "ModelCapacities_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 @@ -360,7 +360,7 @@ public async Task GetModelCapacities_ListModelCapacities() [Ignore("Only validating compilation of examples")] public async Task GetCognitiveServicesCommitmentPlans_ListAccountsBySubscription() { - // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2024-10-01/examples/ListSharedCommitmentPlansBySubscription.json + // Generated from example definition: specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-04-01/examples/ListSharedCommitmentPlansBySubscription.json // this example is just showing the usage of "CommitmentPlans_ListPlansBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -370,7 +370,7 @@ public async Task GetCognitiveServicesCommitmentPlans_ListAccountsBySubscription // 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 = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + string subscriptionId = "00000000-1111-2222-3333-444444444444"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountCapabilityHostCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountCapabilityHostCollection.cs new file mode 100644 index 000000000000..5d5c5fe2d7fc --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountCapabilityHostCollection.cs @@ -0,0 +1,415 @@ +// 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.CognitiveServices +{ + /// + /// 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 GetAccountCapabilityHosts method from an instance of . + /// + public partial class AccountCapabilityHostCollection : ArmCollection + { + private readonly ClientDiagnostics _accountCapabilityHostClientDiagnostics; + private readonly AccountCapabilityHostsRestOperations _accountCapabilityHostRestClient; + + /// Initializes a new instance of the class for mocking. + protected AccountCapabilityHostCollection() + { + } + + /// 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 AccountCapabilityHostCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _accountCapabilityHostClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CognitiveServices", AccountCapabilityHostResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AccountCapabilityHostResource.ResourceType, out string accountCapabilityHostApiVersion); + _accountCapabilityHostRestClient = new AccountCapabilityHostsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, accountCapabilityHostApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != CognitiveServicesAccountResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CognitiveServicesAccountResource.ResourceType), nameof(id)); + } + + /// + /// Create or update account capabilityHost. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// AccountCapabilityHosts_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-04-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 name of the capability host associated with the Cognitive Services Resource. + /// CapabilityHost definition. + /// 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 capabilityHostName, CapabilityHostData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(capabilityHostName, nameof(capabilityHostName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _accountCapabilityHostClientDiagnostics.CreateScope("AccountCapabilityHostCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _accountCapabilityHostRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, capabilityHostName, data, cancellationToken).ConfigureAwait(false); + var operation = new CognitiveServicesArmOperation(new AccountCapabilityHostOperationSource(Client), _accountCapabilityHostClientDiagnostics, Pipeline, _accountCapabilityHostRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, capabilityHostName, data).Request, response, OperationFinalStateVia.OriginalUri); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update account capabilityHost. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// AccountCapabilityHosts_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-04-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 name of the capability host associated with the Cognitive Services Resource. + /// CapabilityHost definition. + /// 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 capabilityHostName, CapabilityHostData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(capabilityHostName, nameof(capabilityHostName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _accountCapabilityHostClientDiagnostics.CreateScope("AccountCapabilityHostCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _accountCapabilityHostRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, capabilityHostName, data, cancellationToken); + var operation = new CognitiveServicesArmOperation(new AccountCapabilityHostOperationSource(Client), _accountCapabilityHostClientDiagnostics, Pipeline, _accountCapabilityHostRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, capabilityHostName, data).Request, response, OperationFinalStateVia.OriginalUri); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get account capabilityHost. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// AccountCapabilityHosts_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the capability host associated with the Cognitive Services 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 capabilityHostName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(capabilityHostName, nameof(capabilityHostName)); + + using var scope = _accountCapabilityHostClientDiagnostics.CreateScope("AccountCapabilityHostCollection.Get"); + scope.Start(); + try + { + var response = await _accountCapabilityHostRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, capabilityHostName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AccountCapabilityHostResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get account capabilityHost. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// AccountCapabilityHosts_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the capability host associated with the Cognitive Services Resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string capabilityHostName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(capabilityHostName, nameof(capabilityHostName)); + + using var scope = _accountCapabilityHostClientDiagnostics.CreateScope("AccountCapabilityHostCollection.Get"); + scope.Start(); + try + { + var response = _accountCapabilityHostRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, capabilityHostName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AccountCapabilityHostResource(Client, response.Value), 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.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// AccountCapabilityHosts_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the capability host associated with the Cognitive Services 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 capabilityHostName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(capabilityHostName, nameof(capabilityHostName)); + + using var scope = _accountCapabilityHostClientDiagnostics.CreateScope("AccountCapabilityHostCollection.Exists"); + scope.Start(); + try + { + var response = await _accountCapabilityHostRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, capabilityHostName, 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.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// AccountCapabilityHosts_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the capability host associated with the Cognitive Services Resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string capabilityHostName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(capabilityHostName, nameof(capabilityHostName)); + + using var scope = _accountCapabilityHostClientDiagnostics.CreateScope("AccountCapabilityHostCollection.Exists"); + scope.Start(); + try + { + var response = _accountCapabilityHostRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, capabilityHostName, 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.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// AccountCapabilityHosts_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the capability host associated with the Cognitive Services 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 capabilityHostName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(capabilityHostName, nameof(capabilityHostName)); + + using var scope = _accountCapabilityHostClientDiagnostics.CreateScope("AccountCapabilityHostCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _accountCapabilityHostRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, capabilityHostName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AccountCapabilityHostResource(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.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// AccountCapabilityHosts_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the capability host associated with the Cognitive Services Resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string capabilityHostName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(capabilityHostName, nameof(capabilityHostName)); + + using var scope = _accountCapabilityHostClientDiagnostics.CreateScope("AccountCapabilityHostCollection.GetIfExists"); + scope.Start(); + try + { + var response = _accountCapabilityHostRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, capabilityHostName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AccountCapabilityHostResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountCapabilityHostResource.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountCapabilityHostResource.Serialization.cs new file mode 100644 index 000000000000..7c3dc52cf6e7 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountCapabilityHostResource.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.CognitiveServices +{ + public partial class AccountCapabilityHostResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + CapabilityHostData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + CapabilityHostData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountCapabilityHostResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountCapabilityHostResource.cs new file mode 100644 index 000000000000..2d42ac3652ea --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountCapabilityHostResource.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.CognitiveServices +{ + /// + /// A Class representing an AccountCapabilityHost 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 GetAccountCapabilityHostResource method. + /// Otherwise you can get one from its parent resource using the GetAccountCapabilityHost method. + /// + public partial class AccountCapabilityHostResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The accountName. + /// The capabilityHostName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string capabilityHostName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _accountCapabilityHostClientDiagnostics; + private readonly AccountCapabilityHostsRestOperations _accountCapabilityHostRestClient; + private readonly CapabilityHostData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.CognitiveServices/accounts/capabilityHosts"; + + /// Initializes a new instance of the class for mocking. + protected AccountCapabilityHostResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AccountCapabilityHostResource(ArmClient client, CapabilityHostData 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 AccountCapabilityHostResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _accountCapabilityHostClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CognitiveServices", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string accountCapabilityHostApiVersion); + _accountCapabilityHostRestClient = new AccountCapabilityHostsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, accountCapabilityHostApiVersion); +#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 CapabilityHostData 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 account capabilityHost. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// AccountCapabilityHosts_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _accountCapabilityHostClientDiagnostics.CreateScope("AccountCapabilityHostResource.Get"); + scope.Start(); + try + { + var response = await _accountCapabilityHostRestClient.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 AccountCapabilityHostResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get account capabilityHost. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// AccountCapabilityHosts_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _accountCapabilityHostClientDiagnostics.CreateScope("AccountCapabilityHostResource.Get"); + scope.Start(); + try + { + var response = _accountCapabilityHostRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AccountCapabilityHostResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete account capabilityHost. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// AccountCapabilityHosts_Delete + /// + /// + /// Default Api Version + /// 2025-04-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 = _accountCapabilityHostClientDiagnostics.CreateScope("AccountCapabilityHostResource.Delete"); + scope.Start(); + try + { + var response = await _accountCapabilityHostRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new CognitiveServicesArmOperation(_accountCapabilityHostClientDiagnostics, Pipeline, _accountCapabilityHostRestClient.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 account capabilityHost. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// AccountCapabilityHosts_Delete + /// + /// + /// Default Api Version + /// 2025-04-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 = _accountCapabilityHostClientDiagnostics.CreateScope("AccountCapabilityHostResource.Delete"); + scope.Start(); + try + { + var response = _accountCapabilityHostRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new CognitiveServicesArmOperation(_accountCapabilityHostClientDiagnostics, Pipeline, _accountCapabilityHostRestClient.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 or update account capabilityHost. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// AccountCapabilityHosts_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-04-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. + /// CapabilityHost definition. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, CapabilityHostData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _accountCapabilityHostClientDiagnostics.CreateScope("AccountCapabilityHostResource.Update"); + scope.Start(); + try + { + var response = await _accountCapabilityHostRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new CognitiveServicesArmOperation(new AccountCapabilityHostOperationSource(Client), _accountCapabilityHostClientDiagnostics, Pipeline, _accountCapabilityHostRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.OriginalUri); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update account capabilityHost. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// AccountCapabilityHosts_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-04-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. + /// CapabilityHost definition. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, CapabilityHostData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _accountCapabilityHostClientDiagnostics.CreateScope("AccountCapabilityHostResource.Update"); + scope.Start(); + try + { + var response = _accountCapabilityHostRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new CognitiveServicesArmOperation(new AccountCapabilityHostOperationSource(Client), _accountCapabilityHostClientDiagnostics, Pipeline, _accountCapabilityHostRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.OriginalUri); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountConnectionCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountConnectionCollection.cs new file mode 100644 index 000000000000..832274629009 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountConnectionCollection.cs @@ -0,0 +1,503 @@ +// 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.CognitiveServices +{ + /// + /// 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 GetAccountConnections method from an instance of . + /// + public partial class AccountConnectionCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _accountConnectionClientDiagnostics; + private readonly AccountConnectionRestOperations _accountConnectionRestClient; + + /// Initializes a new instance of the class for mocking. + protected AccountConnectionCollection() + { + } + + /// 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 AccountConnectionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _accountConnectionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CognitiveServices", AccountConnectionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AccountConnectionResource.ResourceType, out string accountConnectionApiVersion); + _accountConnectionRestClient = new AccountConnectionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, accountConnectionApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != CognitiveServicesAccountResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CognitiveServicesAccountResource.ResourceType), nameof(id)); + } + + /// + /// Create or update Cognitive Services account connection under the specified account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName} + /// + /// + /// Operation Id + /// AccountConnection_Create + /// + /// + /// Default Api Version + /// 2025-04-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. + /// Friendly name of the connection. + /// The object for creating or updating a new account connection. + /// 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 connectionName, ConnectionPropertiesV2BasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _accountConnectionClientDiagnostics.CreateScope("AccountConnectionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _accountConnectionRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectionName, data, cancellationToken).ConfigureAwait(false); + var uri = _accountConnectionRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectionName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new CognitiveServicesArmOperation(Response.FromValue(new AccountConnectionResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update Cognitive Services account connection under the specified account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName} + /// + /// + /// Operation Id + /// AccountConnection_Create + /// + /// + /// Default Api Version + /// 2025-04-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. + /// Friendly name of the connection. + /// The object for creating or updating a new account connection. + /// 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 connectionName, ConnectionPropertiesV2BasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _accountConnectionClientDiagnostics.CreateScope("AccountConnectionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _accountConnectionRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectionName, data, cancellationToken); + var uri = _accountConnectionRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectionName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new CognitiveServicesArmOperation(Response.FromValue(new AccountConnectionResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists Cognitive Services account connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName} + /// + /// + /// Operation Id + /// AccountConnection_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Friendly name of the connection. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var scope = _accountConnectionClientDiagnostics.CreateScope("AccountConnectionCollection.Get"); + scope.Start(); + try + { + var response = await _accountConnectionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectionName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AccountConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists Cognitive Services account connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName} + /// + /// + /// Operation Id + /// AccountConnection_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Friendly name of the connection. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var scope = _accountConnectionClientDiagnostics.CreateScope("AccountConnectionCollection.Get"); + scope.Start(); + try + { + var response = _accountConnectionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectionName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AccountConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists all the available Cognitive Services account connections under the specified account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections + /// + /// + /// Operation Id + /// AccountConnection_List + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Target of the connection. + /// Category of the connection. + /// query parameter that indicates if get connection call should return both connections and datastores. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string target = null, string category = null, bool? includeAll = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _accountConnectionRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, target, category, includeAll); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _accountConnectionRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, target, category, includeAll); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AccountConnectionResource(Client, ConnectionPropertiesV2BasicResourceData.DeserializeConnectionPropertiesV2BasicResourceData(e)), _accountConnectionClientDiagnostics, Pipeline, "AccountConnectionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists all the available Cognitive Services account connections under the specified account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections + /// + /// + /// Operation Id + /// AccountConnection_List + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Target of the connection. + /// Category of the connection. + /// query parameter that indicates if get connection call should return both connections and datastores. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string target = null, string category = null, bool? includeAll = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _accountConnectionRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, target, category, includeAll); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _accountConnectionRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, target, category, includeAll); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AccountConnectionResource(Client, ConnectionPropertiesV2BasicResourceData.DeserializeConnectionPropertiesV2BasicResourceData(e)), _accountConnectionClientDiagnostics, Pipeline, "AccountConnectionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName} + /// + /// + /// Operation Id + /// AccountConnection_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Friendly name of the connection. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var scope = _accountConnectionClientDiagnostics.CreateScope("AccountConnectionCollection.Exists"); + scope.Start(); + try + { + var response = await _accountConnectionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectionName, 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.CognitiveServices/accounts/{accountName}/connections/{connectionName} + /// + /// + /// Operation Id + /// AccountConnection_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Friendly name of the connection. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var scope = _accountConnectionClientDiagnostics.CreateScope("AccountConnectionCollection.Exists"); + scope.Start(); + try + { + var response = _accountConnectionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectionName, 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.CognitiveServices/accounts/{accountName}/connections/{connectionName} + /// + /// + /// Operation Id + /// AccountConnection_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Friendly name of the connection. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var scope = _accountConnectionClientDiagnostics.CreateScope("AccountConnectionCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _accountConnectionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectionName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AccountConnectionResource(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.CognitiveServices/accounts/{accountName}/connections/{connectionName} + /// + /// + /// Operation Id + /// AccountConnection_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Friendly name of the connection. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var scope = _accountConnectionClientDiagnostics.CreateScope("AccountConnectionCollection.GetIfExists"); + scope.Start(); + try + { + var response = _accountConnectionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectionName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AccountConnectionResource(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/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountConnectionResource.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountConnectionResource.Serialization.cs new file mode 100644 index 000000000000..091d86c98a20 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountConnectionResource.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.CognitiveServices +{ + public partial class AccountConnectionResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ConnectionPropertiesV2BasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ConnectionPropertiesV2BasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountConnectionResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountConnectionResource.cs new file mode 100644 index 000000000000..4615830ad3a8 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountConnectionResource.cs @@ -0,0 +1,344 @@ +// 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; +using Azure.ResourceManager.CognitiveServices.Models; + +namespace Azure.ResourceManager.CognitiveServices +{ + /// + /// A Class representing an AccountConnection 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 GetAccountConnectionResource method. + /// Otherwise you can get one from its parent resource using the GetAccountConnection method. + /// + public partial class AccountConnectionResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The accountName. + /// The connectionName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string connectionName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _accountConnectionClientDiagnostics; + private readonly AccountConnectionRestOperations _accountConnectionRestClient; + private readonly ConnectionPropertiesV2BasicResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.CognitiveServices/accounts/connections"; + + /// Initializes a new instance of the class for mocking. + protected AccountConnectionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AccountConnectionResource(ArmClient client, ConnectionPropertiesV2BasicResourceData 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 AccountConnectionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _accountConnectionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CognitiveServices", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string accountConnectionApiVersion); + _accountConnectionRestClient = new AccountConnectionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, accountConnectionApiVersion); +#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 ConnectionPropertiesV2BasicResourceData 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)); + } + + /// + /// Lists Cognitive Services account connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName} + /// + /// + /// Operation Id + /// AccountConnection_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _accountConnectionClientDiagnostics.CreateScope("AccountConnectionResource.Get"); + scope.Start(); + try + { + var response = await _accountConnectionRestClient.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 AccountConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists Cognitive Services account connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName} + /// + /// + /// Operation Id + /// AccountConnection_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _accountConnectionClientDiagnostics.CreateScope("AccountConnectionResource.Get"); + scope.Start(); + try + { + var response = _accountConnectionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AccountConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete Cognitive Services account connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName} + /// + /// + /// Operation Id + /// AccountConnection_Delete + /// + /// + /// Default Api Version + /// 2025-04-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 = _accountConnectionClientDiagnostics.CreateScope("AccountConnectionResource.Delete"); + scope.Start(); + try + { + var response = await _accountConnectionRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _accountConnectionRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new CognitiveServicesArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete Cognitive Services account connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName} + /// + /// + /// Operation Id + /// AccountConnection_Delete + /// + /// + /// Default Api Version + /// 2025-04-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 = _accountConnectionClientDiagnostics.CreateScope("AccountConnectionResource.Delete"); + scope.Start(); + try + { + var response = _accountConnectionRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _accountConnectionRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new CognitiveServicesArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update Cognitive Services account connection under the specified account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName} + /// + /// + /// Operation Id + /// AccountConnection_Update + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Parameters for account connection update. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(ConnectionUpdateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _accountConnectionClientDiagnostics.CreateScope("AccountConnectionResource.Update"); + scope.Start(); + try + { + var response = await _accountConnectionRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new AccountConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update Cognitive Services account connection under the specified account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName} + /// + /// + /// Operation Id + /// AccountConnection_Update + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Parameters for account connection update. + /// The cancellation token to use. + /// is null. + public virtual Response Update(ConnectionUpdateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _accountConnectionClientDiagnostics.CreateScope("AccountConnectionResource.Update"); + scope.Start(); + try + { + var response = _accountConnectionRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + return Response.FromValue(new AccountConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountProjectCapabilityHostCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountProjectCapabilityHostCollection.cs new file mode 100644 index 000000000000..2b2b7539354f --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountProjectCapabilityHostCollection.cs @@ -0,0 +1,415 @@ +// 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.CognitiveServices +{ + /// + /// 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 GetAccountProjectCapabilityHosts method from an instance of . + /// + public partial class AccountProjectCapabilityHostCollection : ArmCollection + { + private readonly ClientDiagnostics _accountProjectCapabilityHostProjectCapabilityHostsClientDiagnostics; + private readonly ProjectCapabilityHostsRestOperations _accountProjectCapabilityHostProjectCapabilityHostsRestClient; + + /// Initializes a new instance of the class for mocking. + protected AccountProjectCapabilityHostCollection() + { + } + + /// 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 AccountProjectCapabilityHostCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _accountProjectCapabilityHostProjectCapabilityHostsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CognitiveServices", AccountProjectCapabilityHostResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AccountProjectCapabilityHostResource.ResourceType, out string accountProjectCapabilityHostProjectCapabilityHostsApiVersion); + _accountProjectCapabilityHostProjectCapabilityHostsRestClient = new ProjectCapabilityHostsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, accountProjectCapabilityHostProjectCapabilityHostsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ProjectResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ProjectResource.ResourceType), nameof(id)); + } + + /// + /// Create or update project capabilityHost. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// ProjectCapabilityHosts_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-04-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 name of the capability host associated with the Cognitive Services Resource. + /// CapabilityHost definition. + /// 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 capabilityHostName, CapabilityHostData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(capabilityHostName, nameof(capabilityHostName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _accountProjectCapabilityHostProjectCapabilityHostsClientDiagnostics.CreateScope("AccountProjectCapabilityHostCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _accountProjectCapabilityHostProjectCapabilityHostsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, capabilityHostName, data, cancellationToken).ConfigureAwait(false); + var operation = new CognitiveServicesArmOperation(new AccountProjectCapabilityHostOperationSource(Client), _accountProjectCapabilityHostProjectCapabilityHostsClientDiagnostics, Pipeline, _accountProjectCapabilityHostProjectCapabilityHostsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, capabilityHostName, data).Request, response, OperationFinalStateVia.OriginalUri); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update project capabilityHost. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// ProjectCapabilityHosts_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-04-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 name of the capability host associated with the Cognitive Services Resource. + /// CapabilityHost definition. + /// 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 capabilityHostName, CapabilityHostData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(capabilityHostName, nameof(capabilityHostName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _accountProjectCapabilityHostProjectCapabilityHostsClientDiagnostics.CreateScope("AccountProjectCapabilityHostCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _accountProjectCapabilityHostProjectCapabilityHostsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, capabilityHostName, data, cancellationToken); + var operation = new CognitiveServicesArmOperation(new AccountProjectCapabilityHostOperationSource(Client), _accountProjectCapabilityHostProjectCapabilityHostsClientDiagnostics, Pipeline, _accountProjectCapabilityHostProjectCapabilityHostsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, capabilityHostName, data).Request, response, OperationFinalStateVia.OriginalUri); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get project capabilityHost. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// ProjectCapabilityHosts_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the capability host associated with the Cognitive Services 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 capabilityHostName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(capabilityHostName, nameof(capabilityHostName)); + + using var scope = _accountProjectCapabilityHostProjectCapabilityHostsClientDiagnostics.CreateScope("AccountProjectCapabilityHostCollection.Get"); + scope.Start(); + try + { + var response = await _accountProjectCapabilityHostProjectCapabilityHostsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, capabilityHostName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AccountProjectCapabilityHostResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get project capabilityHost. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// ProjectCapabilityHosts_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the capability host associated with the Cognitive Services Resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string capabilityHostName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(capabilityHostName, nameof(capabilityHostName)); + + using var scope = _accountProjectCapabilityHostProjectCapabilityHostsClientDiagnostics.CreateScope("AccountProjectCapabilityHostCollection.Get"); + scope.Start(); + try + { + var response = _accountProjectCapabilityHostProjectCapabilityHostsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, capabilityHostName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AccountProjectCapabilityHostResource(Client, response.Value), 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.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// ProjectCapabilityHosts_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the capability host associated with the Cognitive Services 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 capabilityHostName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(capabilityHostName, nameof(capabilityHostName)); + + using var scope = _accountProjectCapabilityHostProjectCapabilityHostsClientDiagnostics.CreateScope("AccountProjectCapabilityHostCollection.Exists"); + scope.Start(); + try + { + var response = await _accountProjectCapabilityHostProjectCapabilityHostsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, capabilityHostName, 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.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// ProjectCapabilityHosts_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the capability host associated with the Cognitive Services Resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string capabilityHostName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(capabilityHostName, nameof(capabilityHostName)); + + using var scope = _accountProjectCapabilityHostProjectCapabilityHostsClientDiagnostics.CreateScope("AccountProjectCapabilityHostCollection.Exists"); + scope.Start(); + try + { + var response = _accountProjectCapabilityHostProjectCapabilityHostsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, capabilityHostName, 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.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// ProjectCapabilityHosts_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the capability host associated with the Cognitive Services 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 capabilityHostName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(capabilityHostName, nameof(capabilityHostName)); + + using var scope = _accountProjectCapabilityHostProjectCapabilityHostsClientDiagnostics.CreateScope("AccountProjectCapabilityHostCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _accountProjectCapabilityHostProjectCapabilityHostsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, capabilityHostName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AccountProjectCapabilityHostResource(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.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// ProjectCapabilityHosts_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the capability host associated with the Cognitive Services Resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string capabilityHostName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(capabilityHostName, nameof(capabilityHostName)); + + using var scope = _accountProjectCapabilityHostProjectCapabilityHostsClientDiagnostics.CreateScope("AccountProjectCapabilityHostCollection.GetIfExists"); + scope.Start(); + try + { + var response = _accountProjectCapabilityHostProjectCapabilityHostsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, capabilityHostName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AccountProjectCapabilityHostResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountProjectCapabilityHostResource.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountProjectCapabilityHostResource.Serialization.cs new file mode 100644 index 000000000000..7d5697eda6e7 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountProjectCapabilityHostResource.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.CognitiveServices +{ + public partial class AccountProjectCapabilityHostResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + CapabilityHostData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + CapabilityHostData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountProjectCapabilityHostResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountProjectCapabilityHostResource.cs new file mode 100644 index 000000000000..a0f5cf9c2e4a --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountProjectCapabilityHostResource.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.CognitiveServices +{ + /// + /// A Class representing an AccountProjectCapabilityHost 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 GetAccountProjectCapabilityHostResource method. + /// Otherwise you can get one from its parent resource using the GetAccountProjectCapabilityHost method. + /// + public partial class AccountProjectCapabilityHostResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The accountName. + /// The projectName. + /// The capabilityHostName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string projectName, string capabilityHostName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _accountProjectCapabilityHostProjectCapabilityHostsClientDiagnostics; + private readonly ProjectCapabilityHostsRestOperations _accountProjectCapabilityHostProjectCapabilityHostsRestClient; + private readonly CapabilityHostData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.CognitiveServices/accounts/projects/capabilityHosts"; + + /// Initializes a new instance of the class for mocking. + protected AccountProjectCapabilityHostResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AccountProjectCapabilityHostResource(ArmClient client, CapabilityHostData 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 AccountProjectCapabilityHostResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _accountProjectCapabilityHostProjectCapabilityHostsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CognitiveServices", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string accountProjectCapabilityHostProjectCapabilityHostsApiVersion); + _accountProjectCapabilityHostProjectCapabilityHostsRestClient = new ProjectCapabilityHostsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, accountProjectCapabilityHostProjectCapabilityHostsApiVersion); +#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 CapabilityHostData 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 project capabilityHost. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// ProjectCapabilityHosts_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _accountProjectCapabilityHostProjectCapabilityHostsClientDiagnostics.CreateScope("AccountProjectCapabilityHostResource.Get"); + scope.Start(); + try + { + var response = await _accountProjectCapabilityHostProjectCapabilityHostsRestClient.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 AccountProjectCapabilityHostResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get project capabilityHost. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// ProjectCapabilityHosts_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _accountProjectCapabilityHostProjectCapabilityHostsClientDiagnostics.CreateScope("AccountProjectCapabilityHostResource.Get"); + scope.Start(); + try + { + var response = _accountProjectCapabilityHostProjectCapabilityHostsRestClient.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 AccountProjectCapabilityHostResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete project capabilityHost. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// ProjectCapabilityHosts_Delete + /// + /// + /// Default Api Version + /// 2025-04-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 = _accountProjectCapabilityHostProjectCapabilityHostsClientDiagnostics.CreateScope("AccountProjectCapabilityHostResource.Delete"); + scope.Start(); + try + { + var response = await _accountProjectCapabilityHostProjectCapabilityHostsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new CognitiveServicesArmOperation(_accountProjectCapabilityHostProjectCapabilityHostsClientDiagnostics, Pipeline, _accountProjectCapabilityHostProjectCapabilityHostsRestClient.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 project capabilityHost. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// ProjectCapabilityHosts_Delete + /// + /// + /// Default Api Version + /// 2025-04-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 = _accountProjectCapabilityHostProjectCapabilityHostsClientDiagnostics.CreateScope("AccountProjectCapabilityHostResource.Delete"); + scope.Start(); + try + { + var response = _accountProjectCapabilityHostProjectCapabilityHostsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new CognitiveServicesArmOperation(_accountProjectCapabilityHostProjectCapabilityHostsClientDiagnostics, Pipeline, _accountProjectCapabilityHostProjectCapabilityHostsRestClient.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 or update project capabilityHost. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// ProjectCapabilityHosts_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-04-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. + /// CapabilityHost definition. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, CapabilityHostData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _accountProjectCapabilityHostProjectCapabilityHostsClientDiagnostics.CreateScope("AccountProjectCapabilityHostResource.Update"); + scope.Start(); + try + { + var response = await _accountProjectCapabilityHostProjectCapabilityHostsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new CognitiveServicesArmOperation(new AccountProjectCapabilityHostOperationSource(Client), _accountProjectCapabilityHostProjectCapabilityHostsClientDiagnostics, Pipeline, _accountProjectCapabilityHostProjectCapabilityHostsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.OriginalUri); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update project capabilityHost. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// ProjectCapabilityHosts_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-04-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. + /// CapabilityHost definition. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, CapabilityHostData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _accountProjectCapabilityHostProjectCapabilityHostsClientDiagnostics.CreateScope("AccountProjectCapabilityHostResource.Update"); + scope.Start(); + try + { + var response = _accountProjectCapabilityHostProjectCapabilityHostsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new CognitiveServicesArmOperation(new AccountProjectCapabilityHostOperationSource(Client), _accountProjectCapabilityHostProjectCapabilityHostsClientDiagnostics, Pipeline, _accountProjectCapabilityHostProjectCapabilityHostsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.OriginalUri); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountProjectConnectionCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountProjectConnectionCollection.cs new file mode 100644 index 000000000000..e3746070c7ba --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountProjectConnectionCollection.cs @@ -0,0 +1,503 @@ +// 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.CognitiveServices +{ + /// + /// 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 GetAccountProjectConnections method from an instance of . + /// + public partial class AccountProjectConnectionCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _accountProjectConnectionProjectConnectionClientDiagnostics; + private readonly ProjectConnectionRestOperations _accountProjectConnectionProjectConnectionRestClient; + + /// Initializes a new instance of the class for mocking. + protected AccountProjectConnectionCollection() + { + } + + /// 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 AccountProjectConnectionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _accountProjectConnectionProjectConnectionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CognitiveServices", AccountProjectConnectionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AccountProjectConnectionResource.ResourceType, out string accountProjectConnectionProjectConnectionApiVersion); + _accountProjectConnectionProjectConnectionRestClient = new ProjectConnectionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, accountProjectConnectionProjectConnectionApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ProjectResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ProjectResource.ResourceType), nameof(id)); + } + + /// + /// Create or update Cognitive Services project connection under the specified project. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName} + /// + /// + /// Operation Id + /// ProjectConnection_Create + /// + /// + /// Default Api Version + /// 2025-04-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. + /// Friendly name of the connection. + /// The object for creating or updating a new account connection. + /// 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 connectionName, ConnectionPropertiesV2BasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _accountProjectConnectionProjectConnectionClientDiagnostics.CreateScope("AccountProjectConnectionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _accountProjectConnectionProjectConnectionRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, connectionName, data, cancellationToken).ConfigureAwait(false); + var uri = _accountProjectConnectionProjectConnectionRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, connectionName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new CognitiveServicesArmOperation(Response.FromValue(new AccountProjectConnectionResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update Cognitive Services project connection under the specified project. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName} + /// + /// + /// Operation Id + /// ProjectConnection_Create + /// + /// + /// Default Api Version + /// 2025-04-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. + /// Friendly name of the connection. + /// The object for creating or updating a new account connection. + /// 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 connectionName, ConnectionPropertiesV2BasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _accountProjectConnectionProjectConnectionClientDiagnostics.CreateScope("AccountProjectConnectionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _accountProjectConnectionProjectConnectionRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, connectionName, data, cancellationToken); + var uri = _accountProjectConnectionProjectConnectionRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, connectionName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new CognitiveServicesArmOperation(Response.FromValue(new AccountProjectConnectionResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists Cognitive Services project connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName} + /// + /// + /// Operation Id + /// ProjectConnection_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Friendly name of the connection. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var scope = _accountProjectConnectionProjectConnectionClientDiagnostics.CreateScope("AccountProjectConnectionCollection.Get"); + scope.Start(); + try + { + var response = await _accountProjectConnectionProjectConnectionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, connectionName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AccountProjectConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists Cognitive Services project connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName} + /// + /// + /// Operation Id + /// ProjectConnection_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Friendly name of the connection. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var scope = _accountProjectConnectionProjectConnectionClientDiagnostics.CreateScope("AccountProjectConnectionCollection.Get"); + scope.Start(); + try + { + var response = _accountProjectConnectionProjectConnectionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, connectionName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AccountProjectConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists all the available Cognitive Services project connections under the specified project. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections + /// + /// + /// Operation Id + /// ProjectConnection_List + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Target of the connection. + /// Category of the connection. + /// query parameter that indicates if get connection call should return both connections and datastores. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string target = null, string category = null, bool? includeAll = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _accountProjectConnectionProjectConnectionRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, target, category, includeAll); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _accountProjectConnectionProjectConnectionRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, target, category, includeAll); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AccountProjectConnectionResource(Client, ConnectionPropertiesV2BasicResourceData.DeserializeConnectionPropertiesV2BasicResourceData(e)), _accountProjectConnectionProjectConnectionClientDiagnostics, Pipeline, "AccountProjectConnectionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists all the available Cognitive Services project connections under the specified project. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections + /// + /// + /// Operation Id + /// ProjectConnection_List + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Target of the connection. + /// Category of the connection. + /// query parameter that indicates if get connection call should return both connections and datastores. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string target = null, string category = null, bool? includeAll = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _accountProjectConnectionProjectConnectionRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, target, category, includeAll); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _accountProjectConnectionProjectConnectionRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, target, category, includeAll); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AccountProjectConnectionResource(Client, ConnectionPropertiesV2BasicResourceData.DeserializeConnectionPropertiesV2BasicResourceData(e)), _accountProjectConnectionProjectConnectionClientDiagnostics, Pipeline, "AccountProjectConnectionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName} + /// + /// + /// Operation Id + /// ProjectConnection_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Friendly name of the connection. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var scope = _accountProjectConnectionProjectConnectionClientDiagnostics.CreateScope("AccountProjectConnectionCollection.Exists"); + scope.Start(); + try + { + var response = await _accountProjectConnectionProjectConnectionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, connectionName, 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.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName} + /// + /// + /// Operation Id + /// ProjectConnection_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Friendly name of the connection. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var scope = _accountProjectConnectionProjectConnectionClientDiagnostics.CreateScope("AccountProjectConnectionCollection.Exists"); + scope.Start(); + try + { + var response = _accountProjectConnectionProjectConnectionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, connectionName, 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.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName} + /// + /// + /// Operation Id + /// ProjectConnection_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Friendly name of the connection. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var scope = _accountProjectConnectionProjectConnectionClientDiagnostics.CreateScope("AccountProjectConnectionCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _accountProjectConnectionProjectConnectionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, connectionName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AccountProjectConnectionResource(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.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName} + /// + /// + /// Operation Id + /// ProjectConnection_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Friendly name of the connection. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var scope = _accountProjectConnectionProjectConnectionClientDiagnostics.CreateScope("AccountProjectConnectionCollection.GetIfExists"); + scope.Start(); + try + { + var response = _accountProjectConnectionProjectConnectionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, connectionName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AccountProjectConnectionResource(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/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountProjectConnectionResource.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountProjectConnectionResource.Serialization.cs new file mode 100644 index 000000000000..e65ff8a4a40a --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountProjectConnectionResource.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.CognitiveServices +{ + public partial class AccountProjectConnectionResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ConnectionPropertiesV2BasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ConnectionPropertiesV2BasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountProjectConnectionResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountProjectConnectionResource.cs new file mode 100644 index 000000000000..84d6956691f1 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/AccountProjectConnectionResource.cs @@ -0,0 +1,345 @@ +// 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; +using Azure.ResourceManager.CognitiveServices.Models; + +namespace Azure.ResourceManager.CognitiveServices +{ + /// + /// A Class representing an AccountProjectConnection 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 GetAccountProjectConnectionResource method. + /// Otherwise you can get one from its parent resource using the GetAccountProjectConnection method. + /// + public partial class AccountProjectConnectionResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The accountName. + /// The projectName. + /// The connectionName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string projectName, string connectionName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _accountProjectConnectionProjectConnectionClientDiagnostics; + private readonly ProjectConnectionRestOperations _accountProjectConnectionProjectConnectionRestClient; + private readonly ConnectionPropertiesV2BasicResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.CognitiveServices/accounts/projects/connections"; + + /// Initializes a new instance of the class for mocking. + protected AccountProjectConnectionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AccountProjectConnectionResource(ArmClient client, ConnectionPropertiesV2BasicResourceData 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 AccountProjectConnectionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _accountProjectConnectionProjectConnectionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CognitiveServices", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string accountProjectConnectionProjectConnectionApiVersion); + _accountProjectConnectionProjectConnectionRestClient = new ProjectConnectionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, accountProjectConnectionProjectConnectionApiVersion); +#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 ConnectionPropertiesV2BasicResourceData 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)); + } + + /// + /// Lists Cognitive Services project connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName} + /// + /// + /// Operation Id + /// ProjectConnection_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _accountProjectConnectionProjectConnectionClientDiagnostics.CreateScope("AccountProjectConnectionResource.Get"); + scope.Start(); + try + { + var response = await _accountProjectConnectionProjectConnectionRestClient.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 AccountProjectConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists Cognitive Services project connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName} + /// + /// + /// Operation Id + /// ProjectConnection_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _accountProjectConnectionProjectConnectionClientDiagnostics.CreateScope("AccountProjectConnectionResource.Get"); + scope.Start(); + try + { + var response = _accountProjectConnectionProjectConnectionRestClient.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 AccountProjectConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete Cognitive Services project connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName} + /// + /// + /// Operation Id + /// ProjectConnection_Delete + /// + /// + /// Default Api Version + /// 2025-04-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 = _accountProjectConnectionProjectConnectionClientDiagnostics.CreateScope("AccountProjectConnectionResource.Delete"); + scope.Start(); + try + { + var response = await _accountProjectConnectionProjectConnectionRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _accountProjectConnectionProjectConnectionRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new CognitiveServicesArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete Cognitive Services project connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName} + /// + /// + /// Operation Id + /// ProjectConnection_Delete + /// + /// + /// Default Api Version + /// 2025-04-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 = _accountProjectConnectionProjectConnectionClientDiagnostics.CreateScope("AccountProjectConnectionResource.Delete"); + scope.Start(); + try + { + var response = _accountProjectConnectionProjectConnectionRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _accountProjectConnectionProjectConnectionRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new CognitiveServicesArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update Cognitive Services project connection under the specified project. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName} + /// + /// + /// Operation Id + /// ProjectConnection_Update + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Parameters for account connection update. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(ConnectionUpdateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _accountProjectConnectionProjectConnectionClientDiagnostics.CreateScope("AccountProjectConnectionResource.Update"); + scope.Start(); + try + { + var response = await _accountProjectConnectionProjectConnectionRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new AccountProjectConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update Cognitive Services project connection under the specified project. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName} + /// + /// + /// Operation Id + /// ProjectConnection_Update + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Parameters for account connection update. + /// The cancellation token to use. + /// is null. + public virtual Response Update(ConnectionUpdateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _accountProjectConnectionProjectConnectionClientDiagnostics.CreateScope("AccountProjectConnectionResource.Update"); + scope.Start(); + try + { + var response = _accountProjectConnectionProjectConnectionRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken); + return Response.FromValue(new AccountProjectConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ArmCognitiveServicesModelFactory.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ArmCognitiveServicesModelFactory.cs index 2f565c357a0a..1fc811e23168 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ArmCognitiveServicesModelFactory.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ArmCognitiveServicesModelFactory.cs @@ -60,7 +60,7 @@ public static CognitiveServicesAccountData CognitiveServicesAccountData(Resource /// A collection of rules governing the accessibility from specific network locations. /// The encryption properties for this resource. /// The storage accounts for this resource. - /// The user owned AML workspace properties. + /// The user owned AML account properties. /// The private endpoint connection associated with the Cognitive Services account. /// Whether or not public endpoint access is allowed for this account. /// The api properties for special APIs. @@ -79,8 +79,12 @@ public static CognitiveServicesAccountData CognitiveServicesAccountData(Resource /// The commitment plan associations of Cognitive Services account. /// The abuse penalty. /// Cognitive Services Rai Monitor Config. + /// Specifies in AI Foundry where virtual network injection occurs to secure scenarios like Agents entirely within the user's private network, eliminating public internet exposure while maintaining control over network configurations and resources. + /// Specifies whether this resource support project management as child resources, used as containers for access management, data isolation and cost in AI Foundry. + /// Specifies the project that is targeted when data plane endpoints are called without a project parameter. + /// Specifies the projects that are associated with this resource. /// A new instance for mocking. - public static CognitiveServicesAccountProperties CognitiveServicesAccountProperties(ServiceAccountProvisioningState? provisioningState = null, string endpoint = null, IEnumerable capabilities = null, bool? isMigrated = null, string migrationToken = null, CognitiveServicesSkuChangeInfo skuChangeInfo = null, string customSubDomainName = null, CognitiveServicesNetworkRuleSet networkAcls = null, ServiceAccountEncryptionProperties encryption = null, IEnumerable userOwnedStorage = null, UserOwnedAmlWorkspace amlWorkspace = null, IEnumerable privateEndpointConnections = null, ServiceAccountPublicNetworkAccess? publicNetworkAccess = null, ServiceAccountApiProperties apiProperties = null, DateTimeOffset? createdOn = null, ServiceAccountCallRateLimit callRateLimit = null, bool? enableDynamicThrottling = null, ServiceAccountQuotaLimit quotaLimit = null, bool? restrictOutboundNetworkAccess = null, IEnumerable allowedFqdnList = null, bool? disableLocalAuth = null, IReadOnlyDictionary endpoints = null, bool? restore = null, DateTimeOffset? deletedOn = null, string scheduledPurgeDate = null, CognitiveServicesMultiRegionSettings locations = null, IEnumerable commitmentPlanAssociations = null, AbusePenalty abusePenalty = null, RaiMonitorConfig raiMonitorConfig = null) + public static CognitiveServicesAccountProperties CognitiveServicesAccountProperties(ServiceAccountProvisioningState? provisioningState = null, string endpoint = null, IEnumerable capabilities = null, bool? isMigrated = null, string migrationToken = null, CognitiveServicesSkuChangeInfo skuChangeInfo = null, string customSubDomainName = null, CognitiveServicesNetworkRuleSet networkAcls = null, ServiceAccountEncryptionProperties encryption = null, IEnumerable userOwnedStorage = null, UserOwnedAmlWorkspace amlWorkspace = null, IEnumerable privateEndpointConnections = null, ServiceAccountPublicNetworkAccess? publicNetworkAccess = null, ServiceAccountApiProperties apiProperties = null, DateTimeOffset? createdOn = null, ServiceAccountCallRateLimit callRateLimit = null, bool? enableDynamicThrottling = null, ServiceAccountQuotaLimit quotaLimit = null, bool? restrictOutboundNetworkAccess = null, IEnumerable allowedFqdnList = null, bool? disableLocalAuth = null, IReadOnlyDictionary endpoints = null, bool? restore = null, DateTimeOffset? deletedOn = null, string scheduledPurgeDate = null, CognitiveServicesMultiRegionSettings locations = null, IEnumerable commitmentPlanAssociations = null, AbusePenalty abusePenalty = null, RaiMonitorConfig raiMonitorConfig = null, NetworkInjections networkInjections = null, bool? allowProjectManagement = null, string defaultProject = null, IEnumerable associatedProjects = null) { capabilities ??= new List(); userOwnedStorage ??= new List(); @@ -88,6 +92,7 @@ public static CognitiveServicesAccountProperties CognitiveServicesAccountPropert allowedFqdnList ??= new List(); endpoints ??= new Dictionary(); commitmentPlanAssociations ??= new List(); + associatedProjects ??= new List(); return new CognitiveServicesAccountProperties( provisioningState, @@ -119,6 +124,10 @@ public static CognitiveServicesAccountProperties CognitiveServicesAccountPropert commitmentPlanAssociations?.ToList(), abusePenalty, raiMonitorConfig, + networkInjections, + allowProjectManagement, + defaultProject, + associatedProjects?.ToList(), serializedAdditionalRawData: null); } @@ -821,7 +830,7 @@ public static RaiPolicyData RaiPolicyData(ResourceIdentifier id = null, string n /// Initializes a new instance of . /// Content Filters policy type. - /// Rai policy mode. The enum value mapping is as below: Default = 0, Deferred=1, Blocking=2, Asynchronous_filter =3. Please use 'Asynchronous_filter' after 2024-10-01. It is the same as 'Deferred' in previous version. + /// Rai policy mode. The enum value mapping is as below: Default = 0, Deferred=1, Blocking=2, Asynchronous_filter =3. Please use 'Asynchronous_filter' after 2025-04-01. It is the same as 'Deferred' in previous version. /// Name of Rai policy. /// The list of Content Filters. /// The list of custom Blocklist. @@ -992,6 +1001,656 @@ public static DefenderForAISettingData DefenderForAISettingData(ResourceIdentifi serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Identity for the resource. + /// Properties of Cognitive Services project. + /// Resource Etag. + /// A new instance for mocking. + public static ProjectData ProjectData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, ProjectProperties properties = null, ETag? etag = null) + { + tags ??= new Dictionary(); + + return new ProjectData( + id, + name, + resourceType, + systemData, + tags, + location, + identity, + properties, + etag, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the status of the cognitive services project at the time the operation was called. + /// The display name of the Cognitive Services Project. + /// The description of the Cognitive Services Project. + /// The list of endpoint for this Cognitive Services Project. + /// Indicates whether the project is the default project for the account. + /// A new instance for mocking. + public static ProjectProperties ProjectProperties(ServiceAccountProvisioningState? provisioningState = null, string displayName = null, string description = null, IReadOnlyDictionary endpoints = null, bool? isDefault = null) + { + endpoints ??= new Dictionary(); + + return new ProjectProperties( + provisioningState, + displayName, + description, + endpoints, + isDefault, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// Connection property base schema. + /// 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 ConnectionPropertiesV2BasicResourceData ConnectionPropertiesV2BasicResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ConnectionPropertiesV2 properties = null) + { + return new ConnectionPropertiesV2BasicResourceData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Authentication type of the connection target. + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static ConnectionPropertiesV2 ConnectionPropertiesV2(string authType = null, ConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new UnknownConnectionPropertiesV2( + authType == null ? default : new ConnectionAuthType(authType), + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// [Required] Additional attributes of the entity. + /// A new instance for mocking. + public static CapabilityHostData CapabilityHostData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, CapabilityHostProperties properties = null) + { + return new CapabilityHostData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The asset description text. + /// Tag dictionary. Tags can be added, removed, and updated. + /// List of AI services connections. + /// Kind of this capability host. + /// Customer subnet info to help set up this capability host. + /// Provisioning state for the CapabilityHost. + /// List of Storage connections. + /// List of Thread storage connections. + /// List of VectorStore connections. + /// A new instance for mocking. + public static CapabilityHostProperties CapabilityHostProperties(string description = null, IDictionary tags = null, IEnumerable aiServicesConnections = null, CapabilityHostKind? capabilityHostKind = null, string customerSubnet = null, CapabilityHostProvisioningState? provisioningState = null, IEnumerable storageConnections = null, IEnumerable threadStorageConnections = null, IEnumerable vectorStoreConnections = null) + { + tags ??= new Dictionary(); + aiServicesConnections ??= new List(); + storageConnections ??= new List(); + threadStorageConnections ??= new List(); + vectorStoreConnections ??= new List(); + + return new CapabilityHostProperties( + description, + tags, + serializedAdditionalRawData: null, + aiServicesConnections?.ToList(), + capabilityHostKind, + customerSubnet, + provisioningState, + storageConnections?.ToList(), + threadStorageConnections?.ToList(), + vectorStoreConnections?.ToList()); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static PATAuthTypeConnectionProperties PATAuthTypeConnectionProperties(ConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, string credentialsPat = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new PATAuthTypeConnectionProperties( + ConnectionAuthType.PAT, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentialsPat != null ? new ConnectionPersonalAccessToken(credentialsPat, serializedAdditionalRawData: null) : null); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static ManagedIdentityAuthTypeConnectionProperties ManagedIdentityAuthTypeConnectionProperties(ConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, ConnectionManagedIdentity credentials = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new ManagedIdentityAuthTypeConnectionProperties( + ConnectionAuthType.ManagedIdentity, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentials); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static UsernamePasswordAuthTypeConnectionProperties UsernamePasswordAuthTypeConnectionProperties(ConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, ConnectionUsernamePassword credentials = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new UsernamePasswordAuthTypeConnectionProperties( + ConnectionAuthType.UsernamePassword, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentials); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static NoneAuthTypeConnectionProperties NoneAuthTypeConnectionProperties(ConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new NoneAuthTypeConnectionProperties( + ConnectionAuthType.None, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static SASAuthTypeConnectionProperties SASAuthTypeConnectionProperties(ConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, string credentialsSas = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new SASAuthTypeConnectionProperties( + ConnectionAuthType.SAS, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentialsSas != null ? new ConnectionSharedAccessSignature(credentialsSas, serializedAdditionalRawData: null) : null); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Account key object for connection credential. + /// A new instance for mocking. + public static AccountKeyAuthTypeConnectionProperties AccountKeyAuthTypeConnectionProperties(ConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, string credentialsKey = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new AccountKeyAuthTypeConnectionProperties( + ConnectionAuthType.AccountKey, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentialsKey != null ? new ConnectionAccountKey(credentialsKey, serializedAdditionalRawData: null) : null); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static ServicePrincipalAuthTypeConnectionProperties ServicePrincipalAuthTypeConnectionProperties(ConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, ConnectionServicePrincipal credentials = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new ServicePrincipalAuthTypeConnectionProperties( + ConnectionAuthType.ServicePrincipal, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentials); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static AccessKeyAuthTypeConnectionProperties AccessKeyAuthTypeConnectionProperties(ConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, ConnectionAccessKey credentials = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new AccessKeyAuthTypeConnectionProperties( + ConnectionAuthType.AccessKey, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentials); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Api key object for connection credential. + /// A new instance for mocking. + public static ApiKeyAuthConnectionProperties ApiKeyAuthConnectionProperties(ConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, string credentialsKey = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new ApiKeyAuthConnectionProperties( + ConnectionAuthType.ApiKey, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentialsKey != null ? new ConnectionApiKey(credentialsKey, serializedAdditionalRawData: null) : null); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Custom Keys credential object. + /// A new instance for mocking. + public static CustomKeysConnectionProperties CustomKeysConnectionProperties(ConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, IDictionary credentialsKeys = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + credentialsKeys ??= new Dictionary(); + + return new CustomKeysConnectionProperties( + ConnectionAuthType.CustomKeys, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentialsKeys != null ? new CustomKeys(credentialsKeys, serializedAdditionalRawData: null) : null); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// + /// ClientId and ClientSecret are required. Other properties are optional + /// depending on each OAuth2 provider's implementation. + /// + /// A new instance for mocking. + public static OAuth2AuthTypeConnectionProperties OAuth2AuthTypeConnectionProperties(ConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, ConnectionOAuth2 credentials = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new OAuth2AuthTypeConnectionProperties( + ConnectionAuthType.OAuth2, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentials); + } + + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static AADAuthTypeConnectionProperties AADAuthTypeConnectionProperties(ConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new AADAuthTypeConnectionProperties( + ConnectionAuthType.AAD, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the status of the cognitive services account at the time the operation was called. + /// Endpoint of the created account. + /// Gets the capabilities of the cognitive services account. Each item indicates the capability of a specific feature. The values are read-only and for reference only. + /// If the resource is migrated from an existing key. + /// Resource migration token. + /// Sku change info of account. + /// Optional subdomain name used for token-based authentication. + /// A collection of rules governing the accessibility from specific network locations. + /// The encryption properties for this resource. + /// The storage accounts for this resource. + /// The user owned AML workspace properties. + /// The private endpoint connection associated with the Cognitive Services account. + /// Whether or not public endpoint access is allowed for this account. + /// The api properties for special APIs. + /// Gets the date of cognitive services account creation. + /// The call rate limit Cognitive Services account. + /// The flag to enable dynamic throttling. + /// + /// + /// + /// + /// Dictionary of <string>. + /// + /// The deletion date, only available for deleted account. + /// The scheduled purge date, only available for deleted account. + /// The multiregion settings of Cognitive Services account. + /// The commitment plan associations of Cognitive Services account. + /// The abuse penalty. + /// Cognitive Services Rai Monitor Config. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static CognitiveServicesAccountProperties CognitiveServicesAccountProperties(ServiceAccountProvisioningState? provisioningState, string endpoint, IEnumerable capabilities, bool? isMigrated, string migrationToken, CognitiveServicesSkuChangeInfo skuChangeInfo, string customSubDomainName, CognitiveServicesNetworkRuleSet networkAcls, ServiceAccountEncryptionProperties encryption, IEnumerable userOwnedStorage, UserOwnedAmlWorkspace amlWorkspace, IEnumerable privateEndpointConnections, ServiceAccountPublicNetworkAccess? publicNetworkAccess, ServiceAccountApiProperties apiProperties, DateTimeOffset? createdOn, ServiceAccountCallRateLimit callRateLimit, bool? enableDynamicThrottling, ServiceAccountQuotaLimit quotaLimit, bool? restrictOutboundNetworkAccess, IEnumerable allowedFqdnList, bool? disableLocalAuth, IReadOnlyDictionary endpoints, bool? restore, DateTimeOffset? deletedOn, string scheduledPurgeDate, CognitiveServicesMultiRegionSettings locations, IEnumerable commitmentPlanAssociations, AbusePenalty abusePenalty, RaiMonitorConfig raiMonitorConfig) + { + return CognitiveServicesAccountProperties(provisioningState: provisioningState, endpoint: endpoint, capabilities: capabilities, isMigrated: isMigrated, migrationToken: migrationToken, skuChangeInfo: skuChangeInfo, customSubDomainName: customSubDomainName, networkAcls: networkAcls, encryption: encryption, userOwnedStorage: userOwnedStorage, amlWorkspace: amlWorkspace, privateEndpointConnections: privateEndpointConnections, publicNetworkAccess: publicNetworkAccess, apiProperties: apiProperties, createdOn: createdOn, callRateLimit: callRateLimit, enableDynamicThrottling: enableDynamicThrottling, quotaLimit: quotaLimit, restrictOutboundNetworkAccess: restrictOutboundNetworkAccess, allowedFqdnList: allowedFqdnList, disableLocalAuth: disableLocalAuth, endpoints: endpoints, restore: restore, deletedOn: deletedOn, scheduledPurgeDate: scheduledPurgeDate, locations: locations, commitmentPlanAssociations: commitmentPlanAssociations, abusePenalty: abusePenalty, raiMonitorConfig: raiMonitorConfig, networkInjections: default, allowProjectManagement: default, defaultProject: default, associatedProjects: default); + } + /// Initializes a new instance of . /// Gets the status of the cognitive services account at the time the operation was called. /// Endpoint of the created account. @@ -1024,7 +1683,7 @@ public static DefenderForAISettingData DefenderForAISettingData(ResourceIdentifi [EditorBrowsable(EditorBrowsableState.Never)] public static CognitiveServicesAccountProperties CognitiveServicesAccountProperties(ServiceAccountProvisioningState? provisioningState, string endpoint, IEnumerable capabilities, bool? isMigrated, string migrationToken, CognitiveServicesSkuChangeInfo skuChangeInfo, string customSubDomainName, CognitiveServicesNetworkRuleSet networkAcls, ServiceAccountEncryptionProperties encryption, IEnumerable userOwnedStorage, IEnumerable privateEndpointConnections, ServiceAccountPublicNetworkAccess? publicNetworkAccess, ServiceAccountApiProperties apiProperties, DateTimeOffset? createdOn, ServiceAccountCallRateLimit callRateLimit, bool? enableDynamicThrottling, ServiceAccountQuotaLimit quotaLimit, bool? restrictOutboundNetworkAccess, IEnumerable allowedFqdnList, bool? disableLocalAuth, IReadOnlyDictionary endpoints, bool? restore, DateTimeOffset? deletedOn, string scheduledPurgeDate, CognitiveServicesMultiRegionSettings locations, IEnumerable commitmentPlanAssociations, AbusePenalty abusePenalty) { - return CognitiveServicesAccountProperties(provisioningState: provisioningState, endpoint: endpoint, capabilities: capabilities, isMigrated: isMigrated, migrationToken: migrationToken, skuChangeInfo: skuChangeInfo, customSubDomainName: customSubDomainName, networkAcls: networkAcls, encryption: encryption, userOwnedStorage: userOwnedStorage, amlWorkspace: default, privateEndpointConnections: privateEndpointConnections, publicNetworkAccess: publicNetworkAccess, apiProperties: apiProperties, createdOn: createdOn, callRateLimit: callRateLimit, enableDynamicThrottling: enableDynamicThrottling, quotaLimit: quotaLimit, restrictOutboundNetworkAccess: restrictOutboundNetworkAccess, allowedFqdnList: allowedFqdnList, disableLocalAuth: disableLocalAuth, endpoints: endpoints, restore: restore, deletedOn: deletedOn, scheduledPurgeDate: scheduledPurgeDate, locations: locations, commitmentPlanAssociations: commitmentPlanAssociations, abusePenalty: abusePenalty, raiMonitorConfig: default); + return CognitiveServicesAccountProperties(provisioningState: provisioningState, endpoint: endpoint, capabilities: capabilities, isMigrated: isMigrated, migrationToken: migrationToken, skuChangeInfo: skuChangeInfo, customSubDomainName: customSubDomainName, networkAcls: networkAcls, encryption: encryption, userOwnedStorage: userOwnedStorage, amlWorkspace: default, privateEndpointConnections: privateEndpointConnections, publicNetworkAccess: publicNetworkAccess, apiProperties: apiProperties, createdOn: createdOn, callRateLimit: callRateLimit, enableDynamicThrottling: enableDynamicThrottling, quotaLimit: quotaLimit, restrictOutboundNetworkAccess: restrictOutboundNetworkAccess, allowedFqdnList: allowedFqdnList, disableLocalAuth: disableLocalAuth, endpoints: endpoints, restore: restore, deletedOn: deletedOn, scheduledPurgeDate: scheduledPurgeDate, locations: locations, commitmentPlanAssociations: commitmentPlanAssociations, abusePenalty: abusePenalty, raiMonitorConfig: default, networkInjections: default, allowProjectManagement: default, defaultProject: default, associatedProjects: default); } /// Initializes a new instance of . diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CapabilityHostData.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CapabilityHostData.Serialization.cs new file mode 100644 index 000000000000..650150b2d6a2 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CapabilityHostData.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; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.CognitiveServices.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CognitiveServices +{ + public partial class CapabilityHostData : 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(CapabilityHostData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + + CapabilityHostData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CapabilityHostData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCapabilityHostData(document.RootElement, options); + } + + internal static CapabilityHostData DeserializeCapabilityHostData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CapabilityHostProperties properties = 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)) + { + properties = CapabilityHostProperties.DeserializeCapabilityHostProperties(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 CapabilityHostData( + id, + name, + type, + systemData, + properties, + 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(Properties), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" properties: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Properties)) + { + builder.Append(" properties: "); + BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); + } + } + + 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.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(CapabilityHostData)} does not support writing '{options.Format}' format."); + } + } + + CapabilityHostData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCapabilityHostData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CapabilityHostData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CapabilityHostData.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CapabilityHostData.cs new file mode 100644 index 000000000000..a1a42c35d0f7 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CapabilityHostData.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 Azure.Core; +using Azure.ResourceManager.CognitiveServices.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CognitiveServices +{ + /// + /// A class representing the CapabilityHost data model. + /// Azure Resource Manager resource envelope. + /// + public partial class CapabilityHostData : 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 . + /// [Required] Additional attributes of the entity. + /// is null. + public CapabilityHostData(CapabilityHostProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// [Required] Additional attributes of the entity. + /// Keeps track of any properties unknown to the library. + internal CapabilityHostData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, CapabilityHostProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CapabilityHostData() + { + } + + /// [Required] Additional attributes of the entity. + [WirePath("properties")] + public CapabilityHostProperties Properties { get; set; } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesAccountCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesAccountCollection.cs index 1a0bb9dd497f..599c34774fef 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesAccountCollection.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesAccountCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> Create /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string accountName /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(Cance /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationTok /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string accountName, Cancel /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string accountName, CancellationToken cance /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesAccountDeploymentCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesAccountDeploymentCollection.cs index af0e267fd268..371b68c6eeec 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesAccountDeploymentCollection.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesAccountDeploymentCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOr /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string d /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllA /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(Cance /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string deploymentName, Can /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string deploymentName, CancellationToken ca /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesAccountDeploymentResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesAccountDeploymentResource.cs index ccc446b2a627..9a5263557ba7 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesAccountDeploymentResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesAccountDeploymentResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(Cancella /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -226,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -268,7 +268,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -314,7 +314,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -360,7 +360,7 @@ public virtual ArmOperation Update(W /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -390,7 +390,7 @@ public virtual AsyncPageable GetSkusAsync(Cancella /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -420,7 +420,7 @@ public virtual Pageable GetSkus(CancellationToken /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -482,7 +482,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -544,7 +544,7 @@ public virtual Response AddTag(strin /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -601,7 +601,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -658,7 +658,7 @@ public virtual Response SetTags(IDic /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -718,7 +718,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesAccountResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesAccountResource.cs index ba82aead2d02..82b10222cedf 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesAccountResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesAccountResource.cs @@ -115,7 +115,7 @@ public virtual CognitiveServicesPrivateEndpointConnectionCollection GetCognitive /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -146,7 +146,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual CognitiveServicesAccountDeploymentCollection GetCognitiveServices /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -215,7 +215,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual CommitmentPlanCollection GetCommitmentPlans() /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -284,7 +284,7 @@ public virtual async Task> GetCommitmentPlanAsy /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -322,7 +322,7 @@ public virtual CognitiveServicesEncryptionScopeCollection GetCognitiveServicesEn /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -353,7 +353,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -391,7 +391,7 @@ public virtual RaiPolicyCollection GetRaiPolicies() /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -422,7 +422,7 @@ public virtual async Task> GetRaiPolicyAsync(string /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -460,7 +460,7 @@ public virtual RaiBlocklistCollection GetRaiBlocklists() /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -491,7 +491,7 @@ public virtual async Task> GetRaiBlocklistAsync(s /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -529,7 +529,7 @@ public virtual NetworkSecurityPerimeterConfigurationCollection GetNetworkSecurit /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -560,7 +560,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -598,7 +598,7 @@ public virtual DefenderForAISettingCollection GetDefenderForAISettings() /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -629,7 +629,7 @@ public virtual async Task> GetDefenderFor /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -647,6 +647,213 @@ public virtual Response GetDefenderForAISetting(st return GetDefenderForAISettings().Get(defenderForAISettingName, cancellationToken); } + /// Gets a collection of ProjectResources in the CognitiveServicesAccount. + /// An object representing collection of ProjectResources and their operations over a ProjectResource. + public virtual ProjectCollection GetProjects() + { + return GetCachedClient(client => new ProjectCollection(client, Id)); + } + + /// + /// Returns a Cognitive Services project specified by the parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName} + /// + /// + /// Operation Id + /// Projects_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of Cognitive Services account's project. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetProjectAsync(string projectName, CancellationToken cancellationToken = default) + { + return await GetProjects().GetAsync(projectName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns a Cognitive Services project specified by the parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName} + /// + /// + /// Operation Id + /// Projects_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of Cognitive Services account's project. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetProject(string projectName, CancellationToken cancellationToken = default) + { + return GetProjects().Get(projectName, cancellationToken); + } + + /// Gets a collection of AccountConnectionResources in the CognitiveServicesAccount. + /// An object representing collection of AccountConnectionResources and their operations over a AccountConnectionResource. + public virtual AccountConnectionCollection GetAccountConnections() + { + return GetCachedClient(client => new AccountConnectionCollection(client, Id)); + } + + /// + /// Lists Cognitive Services account connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName} + /// + /// + /// Operation Id + /// AccountConnection_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Friendly name of the connection. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAccountConnectionAsync(string connectionName, CancellationToken cancellationToken = default) + { + return await GetAccountConnections().GetAsync(connectionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Lists Cognitive Services account connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName} + /// + /// + /// Operation Id + /// AccountConnection_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Friendly name of the connection. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAccountConnection(string connectionName, CancellationToken cancellationToken = default) + { + return GetAccountConnections().Get(connectionName, cancellationToken); + } + + /// Gets a collection of AccountCapabilityHostResources in the CognitiveServicesAccount. + /// An object representing collection of AccountCapabilityHostResources and their operations over a AccountCapabilityHostResource. + public virtual AccountCapabilityHostCollection GetAccountCapabilityHosts() + { + return GetCachedClient(client => new AccountCapabilityHostCollection(client, Id)); + } + + /// + /// Get account capabilityHost. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// AccountCapabilityHosts_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the capability host associated with the Cognitive Services Resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAccountCapabilityHostAsync(string capabilityHostName, CancellationToken cancellationToken = default) + { + return await GetAccountCapabilityHosts().GetAsync(capabilityHostName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get account capabilityHost. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// AccountCapabilityHosts_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the capability host associated with the Cognitive Services Resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAccountCapabilityHost(string capabilityHostName, CancellationToken cancellationToken = default) + { + return GetAccountCapabilityHosts().Get(capabilityHostName, cancellationToken); + } + /// /// Returns a Cognitive Services account specified by the parameters. /// @@ -660,7 +867,7 @@ public virtual Response GetDefenderForAISetting(st /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -700,7 +907,7 @@ public virtual async Task> GetAsync(C /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -740,7 +947,7 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -782,7 +989,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -824,7 +1031,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -870,7 +1077,7 @@ public virtual async Task> Update /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -916,7 +1123,7 @@ public virtual ArmOperation Update(WaitUntil w /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -954,7 +1161,7 @@ public virtual async Task> GetKeysAsync(Cancella /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -992,7 +1199,7 @@ public virtual Response GetKeys(CancellationToken cancell /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -1034,7 +1241,7 @@ public virtual async Task> RegenerateKeyAsync(Re /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -1076,7 +1283,7 @@ public virtual Response RegenerateKey(RegenerateServiceAc /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -1105,7 +1312,7 @@ public virtual AsyncPageable GetSkusAsync(Cancellat /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -1134,7 +1341,7 @@ public virtual Pageable GetSkus(CancellationToken c /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -1164,7 +1371,7 @@ public virtual AsyncPageable GetUsagesAsync(string filter = /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -1194,7 +1401,7 @@ public virtual Pageable GetUsages(string filter = null, Can /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -1224,7 +1431,7 @@ public virtual AsyncPageable GetModelsAsync(Cance /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -1254,7 +1461,7 @@ public virtual Pageable GetModels(CancellationTok /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -1279,7 +1486,7 @@ public virtual AsyncPageable GetPrivateLin /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -1304,7 +1511,7 @@ public virtual Pageable GetPrivateLinkReso /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -1366,7 +1573,7 @@ public virtual async Task> AddTagAsyn /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -1428,7 +1635,7 @@ public virtual Response AddTag(string key, str /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -1485,7 +1692,7 @@ public virtual async Task> SetTagsAsy /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -1542,7 +1749,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -1602,7 +1809,7 @@ public virtual async Task> RemoveTagA /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesCommitmentPlanCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesCommitmentPlanCollection.cs index f6b0b88f45b9..3c2365ea6748 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesCommitmentPlanCollection.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesCommitmentPlanCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpd /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string comm /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsyn /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(Cancella /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string commitmentPlanName, /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string commitmentPlanName, CancellationToke /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesCommitmentPlanResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesCommitmentPlanResource.cs index fde21d5c4a06..4e39bfa41af0 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesCommitmentPlanResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesCommitmentPlanResource.cs @@ -110,7 +110,7 @@ public virtual CommitmentPlanAccountAssociationCollection GetCommitmentPlanAccou /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -172,7 +172,7 @@ public virtual Response GetCommitmentP /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(Cancellatio /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -294,7 +294,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -336,7 +336,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -382,7 +382,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -428,7 +428,7 @@ public virtual ArmOperation Update(Wait /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -490,7 +490,7 @@ public virtual async Task> Add /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -552,7 +552,7 @@ public virtual Response AddTag(string k /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -609,7 +609,7 @@ public virtual async Task> Set /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -666,7 +666,7 @@ public virtual Response SetTags(IDictio /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -726,7 +726,7 @@ public virtual async Task> Rem /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesDeletedAccountCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesDeletedAccountCollection.cs index 668533de66fe..a8bc414ded2b 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesDeletedAccountCollection.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesDeletedAccountCollection.cs @@ -62,7 +62,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -110,7 +110,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -158,7 +158,7 @@ public virtual Response Get(AzureLocati /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -204,7 +204,7 @@ public virtual async Task> ExistsAsync(AzureLocation location, st /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -250,7 +250,7 @@ public virtual Response Exists(AzureLocation location, string resourceGrou /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -298,7 +298,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesDeletedAccountResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesDeletedAccountResource.cs index b4f03982244f..3dc35238c9d4 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesDeletedAccountResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesDeletedAccountResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(Cancellatio /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesEncryptionScopeCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesEncryptionScopeCollection.cs index 12d5a3a123c7..0a73649036c7 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesEncryptionScopeCollection.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesEncryptionScopeCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -166,7 +166,7 @@ public virtual ArmOperation CreateOrUp /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(string enc /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable GetAllAsy /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -316,7 +316,7 @@ public virtual Pageable GetAll(Cancell /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string encryptionScopeName /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual Response Exists(string encryptionScopeName, CancellationTok /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -447,7 +447,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesEncryptionScopeResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesEncryptionScopeResource.cs index b2fddcbeb4b4..70c9027dfa22 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesEncryptionScopeResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesEncryptionScopeResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(Cancellati /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -314,7 +314,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -362,7 +362,7 @@ public virtual ArmOperation Update(Wai /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -419,7 +419,7 @@ public virtual async Task> Ad /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -476,7 +476,7 @@ public virtual Response AddTag(string /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -532,7 +532,7 @@ public virtual async Task> Se /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -588,7 +588,7 @@ public virtual Response SetTags(IDicti /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -643,7 +643,7 @@ public virtual async Task> Re /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesPrivateEndpointConnectionCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesPrivateEndpointConnectionCollection.cs index 856efa8a03e1..9c7a32d68979 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesPrivateEndpointConnectionCollection.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesPrivateEndpointConnectionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get( /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual AsyncPageable /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -212,7 +212,7 @@ public virtual Pageable GetA /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -255,7 +255,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -298,7 +298,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -343,7 +343,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesPrivateEndpointConnectionResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesPrivateEndpointConnectionResource.cs index b90be59e0938..44dd11146461 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesPrivateEndpointConnectionResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CognitiveServicesPrivateEndpointConnectionResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get( /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CommitmentPlanAccountAssociationCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CommitmentPlanAccountAssociationCollection.cs index 96dcc25abf0b..343ab6039b2a 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CommitmentPlanAccountAssociationCollection.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CommitmentPlanAccountAssociationCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUp /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string com /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsy /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(Cancell /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string commitmentPlanAssoc /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string commitmentPlanAssociationName, Cance /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CommitmentPlanAccountAssociationResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CommitmentPlanAccountAssociationResource.cs index ca5e5560a47e..efc7e3ca4787 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CommitmentPlanAccountAssociationResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CommitmentPlanAccountAssociationResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(Cancellati /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -358,7 +358,7 @@ public virtual ArmOperation Update(Wai /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -415,7 +415,7 @@ public virtual async Task> Ad /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -472,7 +472,7 @@ public virtual Response AddTag(string /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -528,7 +528,7 @@ public virtual async Task> Se /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -584,7 +584,7 @@ public virtual Response SetTags(IDicti /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -639,7 +639,7 @@ public virtual async Task> Re /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CommitmentPlanCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CommitmentPlanCollection.cs index 7af9d9d926e9..27204f234b27 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CommitmentPlanCollection.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CommitmentPlanCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task> CreateOrUpdateAs /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -166,7 +166,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wai /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> GetAsync(string comm /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(string commitmentPlanName, C /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTok /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -316,7 +316,7 @@ public virtual Pageable GetAll(CancellationToken cancell /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string commitmentPlanName, /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual Response Exists(string commitmentPlanName, CancellationToke /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -447,7 +447,7 @@ public virtual async Task> GetIfExistsA /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CommitmentPlanResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CommitmentPlanResource.cs index 798edf8b7390..d3fc4b93712f 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CommitmentPlanResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/CommitmentPlanResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Cancellatio /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken cancellati /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -314,7 +314,7 @@ public virtual async Task> UpdateAsync(Wait /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -362,7 +362,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -419,7 +419,7 @@ public virtual async Task> AddTagAsync(string k /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -476,7 +476,7 @@ public virtual Response AddTag(string key, string value, /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -532,7 +532,7 @@ public virtual async Task> SetTagsAsync(IDictio /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -588,7 +588,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -643,7 +643,7 @@ public virtual async Task> RemoveTagAsync(strin /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ConnectionPropertiesV2BasicResourceData.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ConnectionPropertiesV2BasicResourceData.Serialization.cs new file mode 100644 index 000000000000..be95ec8d4d8e --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ConnectionPropertiesV2BasicResourceData.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; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.CognitiveServices.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CognitiveServices +{ + public partial class ConnectionPropertiesV2BasicResourceData : 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(ConnectionPropertiesV2BasicResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + + ConnectionPropertiesV2BasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectionPropertiesV2BasicResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectionPropertiesV2BasicResourceData(document.RootElement, options); + } + + internal static ConnectionPropertiesV2BasicResourceData DeserializeConnectionPropertiesV2BasicResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConnectionPropertiesV2 properties = 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)) + { + properties = ConnectionPropertiesV2.DeserializeConnectionPropertiesV2(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 ConnectionPropertiesV2BasicResourceData( + id, + name, + type, + systemData, + properties, + 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(Properties), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" properties: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Properties)) + { + builder.Append(" properties: "); + BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); + } + } + + 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.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(ConnectionPropertiesV2BasicResourceData)} does not support writing '{options.Format}' format."); + } + } + + ConnectionPropertiesV2BasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeConnectionPropertiesV2BasicResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectionPropertiesV2BasicResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ConnectionPropertiesV2BasicResourceData.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ConnectionPropertiesV2BasicResourceData.cs new file mode 100644 index 000000000000..c9c6af3bea07 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ConnectionPropertiesV2BasicResourceData.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; +using Azure.Core; +using Azure.ResourceManager.CognitiveServices.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CognitiveServices +{ + /// + /// A class representing the ConnectionPropertiesV2BasicResource data model. + /// Connection base resource schema. + /// + public partial class ConnectionPropertiesV2BasicResourceData : 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 . + /// + /// Connection property base schema. + /// 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 ConnectionPropertiesV2BasicResourceData(ConnectionPropertiesV2 properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// Connection property base schema. + /// 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 ConnectionPropertiesV2BasicResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ConnectionPropertiesV2 properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ConnectionPropertiesV2BasicResourceData() + { + } + + /// + /// Connection property base schema. + /// 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 . + /// + [WirePath("properties")] + public ConnectionPropertiesV2 Properties { get; set; } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/DefenderForAISettingCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/DefenderForAISettingCollection.cs index e8a2a836cf85..79771cf61a15 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/DefenderForAISettingCollection.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/DefenderForAISettingCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task> CreateOrUp /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -166,7 +166,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnt /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> GetAsync(strin /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(string defenderForAISe /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable GetAllAsync(Cancellat /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -316,7 +316,7 @@ public virtual Pageable GetAll(CancellationToken c /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string defenderForAISettin /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual Response Exists(string defenderForAISettingName, Cancellati /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -447,7 +447,7 @@ public virtual async Task> GetIfE /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/DefenderForAISettingResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/DefenderForAISettingResource.cs index 51201f20c22b..5020ea43adfc 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/DefenderForAISettingResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/DefenderForAISettingResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Cance /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken canc /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task> UpdateAsync(De /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual Response Update(DefenderForAISettin /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -328,7 +328,7 @@ public virtual async Task> AddTagAsync(st /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -390,7 +390,7 @@ public virtual Response AddTag(string key, string /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -447,7 +447,7 @@ public virtual async Task> SetTagsAsync(I /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -504,7 +504,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -564,7 +564,7 @@ public virtual async Task> RemoveTagAsync /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/CognitiveServicesExtensions.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/CognitiveServicesExtensions.cs index e23136a7fcec..fdd995a435cb 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/CognitiveServicesExtensions.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/CognitiveServicesExtensions.cs @@ -299,6 +299,101 @@ public static DefenderForAISettingResource GetDefenderForAISettingResource(this return GetMockableCognitiveServicesArmClient(client).GetDefenderForAISettingResource(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 ProjectResource GetProjectResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableCognitiveServicesArmClient(client).GetProjectResource(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 AccountConnectionResource GetAccountConnectionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableCognitiveServicesArmClient(client).GetAccountConnectionResource(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 AccountProjectConnectionResource GetAccountProjectConnectionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableCognitiveServicesArmClient(client).GetAccountProjectConnectionResource(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 AccountCapabilityHostResource GetAccountCapabilityHostResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableCognitiveServicesArmClient(client).GetAccountCapabilityHostResource(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 AccountProjectCapabilityHostResource GetAccountProjectCapabilityHostResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableCognitiveServicesArmClient(client).GetAccountProjectCapabilityHostResource(id); + } + /// /// Gets a collection of CognitiveServicesAccountResources in the ResourceGroupResource. /// @@ -329,7 +424,7 @@ public static CognitiveServicesAccountCollection GetCognitiveServicesAccounts(th /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -367,7 +462,7 @@ public static async Task> GetCognitiv /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -422,7 +517,7 @@ public static CognitiveServicesCommitmentPlanCollection GetCognitiveServicesComm /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -460,7 +555,7 @@ public static async Task> GetC /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -515,7 +610,7 @@ public static CognitiveServicesDeletedAccountCollection GetCognitiveServicesDele /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -555,7 +650,7 @@ public static async Task> GetC /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -613,7 +708,7 @@ public static RaiContentFilterCollection GetRaiContentFilters(this SubscriptionR /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -652,7 +747,7 @@ public static async Task> GetRaiContentFilter /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -691,7 +786,7 @@ public static Response GetRaiContentFilter(this Subscr /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -727,7 +822,7 @@ public static AsyncPageable GetCognitiveServic /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -763,7 +858,7 @@ public static Pageable GetCognitiveServicesAcc /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -799,7 +894,7 @@ public static AsyncPageable GetDeletedA /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -835,7 +930,7 @@ public static Pageable GetDeletedAccoun /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -867,7 +962,7 @@ public static AsyncPageable GetResourceSkusAsync( /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -899,7 +994,7 @@ public static Pageable GetResourceSkus(this Subsc /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -933,7 +1028,7 @@ public static AsyncPageable GetUsagesAsync(this Subscriptio /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -967,7 +1062,7 @@ public static Pageable GetUsages(this SubscriptionResource /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -1001,7 +1096,7 @@ public static AsyncPageable CheckSkuAvaila /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -1035,7 +1130,7 @@ public static Pageable CheckSkuAvailabilit /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -1067,7 +1162,7 @@ public static async Task> Chec /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -1099,7 +1194,7 @@ public static Response CheckDomainAvail /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -1131,7 +1226,7 @@ public static async Task> CalculateModelC /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -1163,7 +1258,7 @@ public static Response CalculateModelCapacity(this /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -1196,7 +1291,7 @@ public static AsyncPageable GetCommitmentTiersAsync(this Subscri /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -1229,7 +1324,7 @@ public static Pageable GetCommitmentTiers(this SubscriptionResou /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -1262,7 +1357,7 @@ public static AsyncPageable GetModelsAsync(this Subscrip /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -1295,7 +1390,7 @@ public static Pageable GetModels(this SubscriptionResour /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -1331,7 +1426,7 @@ public static AsyncPageable GetLocationBasedMo /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -1367,7 +1462,7 @@ public static Pageable GetLocationBasedModelCa /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -1402,7 +1497,7 @@ public static AsyncPageable GetModelCapacities /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -1437,7 +1532,7 @@ public static Pageable GetModelCapacities(this /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -1473,7 +1568,7 @@ public static AsyncPageable GetCognitiv /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/MockableCognitiveServicesArmClient.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/MockableCognitiveServicesArmClient.cs index 46631425a117..2b1cade455b2 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/MockableCognitiveServicesArmClient.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/MockableCognitiveServicesArmClient.cs @@ -201,5 +201,65 @@ public virtual DefenderForAISettingResource GetDefenderForAISettingResource(Reso DefenderForAISettingResource.ValidateResourceId(id); return new DefenderForAISettingResource(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 ProjectResource GetProjectResource(ResourceIdentifier id) + { + ProjectResource.ValidateResourceId(id); + return new ProjectResource(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 AccountConnectionResource GetAccountConnectionResource(ResourceIdentifier id) + { + AccountConnectionResource.ValidateResourceId(id); + return new AccountConnectionResource(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 AccountProjectConnectionResource GetAccountProjectConnectionResource(ResourceIdentifier id) + { + AccountProjectConnectionResource.ValidateResourceId(id); + return new AccountProjectConnectionResource(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 AccountCapabilityHostResource GetAccountCapabilityHostResource(ResourceIdentifier id) + { + AccountCapabilityHostResource.ValidateResourceId(id); + return new AccountCapabilityHostResource(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 AccountProjectCapabilityHostResource GetAccountProjectCapabilityHostResource(ResourceIdentifier id) + { + AccountProjectCapabilityHostResource.ValidateResourceId(id); + return new AccountProjectCapabilityHostResource(Client, id); + } } } diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/MockableCognitiveServicesResourceGroupResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/MockableCognitiveServicesResourceGroupResource.cs index fb287040703f..0695ce35f3f3 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/MockableCognitiveServicesResourceGroupResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/MockableCognitiveServicesResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual CognitiveServicesAccountCollection GetCognitiveServicesAccounts() /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetCogniti /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -122,7 +122,7 @@ public virtual CognitiveServicesCommitmentPlanCollection GetCognitiveServicesCom /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -153,7 +153,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/MockableCognitiveServicesSubscriptionResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/MockableCognitiveServicesSubscriptionResource.cs index 499d75dfbc20..11c2bdb5e3ac 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/MockableCognitiveServicesSubscriptionResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Extensions/MockableCognitiveServicesSubscriptionResource.cs @@ -98,7 +98,7 @@ public virtual CognitiveServicesDeletedAccountCollection GetCognitiveServicesDel /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -131,7 +131,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -172,7 +172,7 @@ public virtual RaiContentFilterCollection GetRaiContentFilters(AzureLocation loc /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -204,7 +204,7 @@ public virtual async Task> GetRaiContentFilte /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -236,7 +236,7 @@ public virtual Response GetRaiContentFilter(AzureLocat /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual AsyncPageable GetCognitiveServi /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -296,7 +296,7 @@ public virtual Pageable GetCognitiveServicesAc /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -326,7 +326,7 @@ public virtual AsyncPageable GetDeleted /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual Pageable GetDeletedAccou /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -382,7 +382,7 @@ public virtual AsyncPageable GetResourceSkusAsync /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -408,7 +408,7 @@ public virtual Pageable GetResourceSkus(Cancellat /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -436,7 +436,7 @@ public virtual AsyncPageable GetUsagesAsync(AzureLocation l /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -464,7 +464,7 @@ public virtual Pageable GetUsages(AzureLocation location, s /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -494,7 +494,7 @@ public virtual AsyncPageable CheckSkuAvail /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -524,7 +524,7 @@ public virtual Pageable CheckSkuAvailabili /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -562,7 +562,7 @@ public virtual async Task> Che /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -600,7 +600,7 @@ public virtual Response CheckDomainAvai /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -638,7 +638,7 @@ public virtual async Task> CalculateModel /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -676,7 +676,7 @@ public virtual Response CalculateModelCapacity(Cal /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -703,7 +703,7 @@ public virtual AsyncPageable GetCommitmentTiersAsync(AzureLocati /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -730,7 +730,7 @@ public virtual Pageable GetCommitmentTiers(AzureLocation locatio /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -757,7 +757,7 @@ public virtual AsyncPageable GetModelsAsync(AzureLocatio /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -784,7 +784,7 @@ public virtual Pageable GetModels(AzureLocation location /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -819,7 +819,7 @@ public virtual AsyncPageable GetLocationBasedM /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -854,7 +854,7 @@ public virtual Pageable GetLocationBasedModelC /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -888,7 +888,7 @@ public virtual AsyncPageable GetModelCapacitie /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// @@ -922,7 +922,7 @@ public virtual Pageable GetModelCapacities(str /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -952,7 +952,7 @@ public virtual AsyncPageable GetCogniti /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/LongRunningOperation/AccountCapabilityHostOperationSource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/LongRunningOperation/AccountCapabilityHostOperationSource.cs new file mode 100644 index 000000000000..eecf54ce0a05 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/LongRunningOperation/AccountCapabilityHostOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.CognitiveServices +{ + internal class AccountCapabilityHostOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal AccountCapabilityHostOperationSource(ArmClient client) + { + _client = client; + } + + AccountCapabilityHostResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new AccountCapabilityHostResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new AccountCapabilityHostResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/LongRunningOperation/AccountProjectCapabilityHostOperationSource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/LongRunningOperation/AccountProjectCapabilityHostOperationSource.cs new file mode 100644 index 000000000000..e4814c8a7cb7 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/LongRunningOperation/AccountProjectCapabilityHostOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.CognitiveServices +{ + internal class AccountProjectCapabilityHostOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal AccountProjectCapabilityHostOperationSource(ArmClient client) + { + _client = client; + } + + AccountProjectCapabilityHostResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new AccountProjectCapabilityHostResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new AccountProjectCapabilityHostResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/LongRunningOperation/ProjectOperationSource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/LongRunningOperation/ProjectOperationSource.cs new file mode 100644 index 000000000000..76c0b43a5ffd --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/LongRunningOperation/ProjectOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.CognitiveServices +{ + internal class ProjectOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ProjectOperationSource(ArmClient client) + { + _client = client; + } + + ProjectResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new ProjectResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new ProjectResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/AADAuthTypeConnectionProperties.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/AADAuthTypeConnectionProperties.Serialization.cs new file mode 100644 index 000000000000..3d0b6fc05dd0 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/AADAuthTypeConnectionProperties.Serialization.cs @@ -0,0 +1,519 @@ +// 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.CognitiveServices.Models +{ + public partial class AADAuthTypeConnectionProperties : 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(AADAuthTypeConnectionProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + AADAuthTypeConnectionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AADAuthTypeConnectionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAADAuthTypeConnectionProperties(document.RootElement, options); + } + + internal static AADAuthTypeConnectionProperties DeserializeAADAuthTypeConnectionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConnectionAuthType authType = default; + ConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authType"u8)) + { + authType = new ConnectionAuthType(property.Value.GetString()); + continue; + } + if (property.NameEquals("category"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + category = new ConnectionCategory(property.Value.GetString()); + continue; + } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } + if (property.NameEquals("expiryTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expiryTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + 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 (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AADAuthTypeConnectionProperties( + authType, + category, + createdByWorkspaceArmId, + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, + 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(AuthType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" authType: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" authType: "); + builder.AppendLine($"'{AuthType.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Category), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" category: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Category)) + { + builder.Append(" category: "); + builder.AppendLine($"'{Category.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CreatedByWorkspaceArmId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" createdByWorkspaceArmId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CreatedByWorkspaceArmId)) + { + builder.Append(" createdByWorkspaceArmId: "); + builder.AppendLine($"'{CreatedByWorkspaceArmId.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" error: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Error)) + { + builder.Append(" error: "); + if (Error.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Error}'''"); + } + else + { + builder.AppendLine($"'{Error}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExpiryOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" expiryTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ExpiryOn)) + { + builder.Append(" expiryTime: "); + var formattedDateTimeString = TypeFormatters.ToString(ExpiryOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Group), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" group: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Group)) + { + builder.Append(" group: "); + builder.AppendLine($"'{Group.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsSharedToAll), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" isSharedToAll: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IsSharedToAll)) + { + builder.Append(" isSharedToAll: "); + var boolValue = IsSharedToAll.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Metadata), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" metadata: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Metadata)) + { + if (Metadata.Any()) + { + builder.Append(" metadata: "); + builder.AppendLine("{"); + foreach (var item in Metadata) + { + 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(" }"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PeRequirement), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" peRequirement: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PeRequirement)) + { + builder.Append(" peRequirement: "); + builder.AppendLine($"'{PeRequirement.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PeStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" peStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PeStatus)) + { + builder.Append(" peStatus: "); + builder.AppendLine($"'{PeStatus.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SharedUserList), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sharedUserList: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(SharedUserList)) + { + if (SharedUserList.Any()) + { + builder.Append(" sharedUserList: "); + builder.AppendLine("["); + foreach (var item in SharedUserList) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Target), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" target: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Target)) + { + builder.Append(" target: "); + if (Target.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Target}'''"); + } + else + { + builder.AppendLine($"'{Target}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UseWorkspaceManagedIdentity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" useWorkspaceManagedIdentity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + builder.Append(" useWorkspaceManagedIdentity: "); + var boolValue = UseWorkspaceManagedIdentity.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(AADAuthTypeConnectionProperties)} does not support writing '{options.Format}' format."); + } + } + + AADAuthTypeConnectionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAADAuthTypeConnectionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AADAuthTypeConnectionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/AADAuthTypeConnectionProperties.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/AADAuthTypeConnectionProperties.cs new file mode 100644 index 000000000000..e0144a5054b1 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/AADAuthTypeConnectionProperties.cs @@ -0,0 +1,43 @@ +// 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.CognitiveServices.Models +{ + /// This connection type covers the AAD auth for any applicable Azure service. + public partial class AADAuthTypeConnectionProperties : ConnectionPropertiesV2 + { + /// Initializes a new instance of . + public AADAuthTypeConnectionProperties() + { + AuthType = ConnectionAuthType.AAD; + } + + /// Initializes a new instance of . + /// Authentication type of the connection target. + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + internal AADAuthTypeConnectionProperties(ConnectionAuthType authType, ConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) + { + AuthType = authType; + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/AccessKeyAuthTypeConnectionProperties.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/AccessKeyAuthTypeConnectionProperties.Serialization.cs new file mode 100644 index 000000000000..1dd68d20a6d8 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/AccessKeyAuthTypeConnectionProperties.Serialization.cs @@ -0,0 +1,550 @@ +// 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.CognitiveServices.Models +{ + public partial class AccessKeyAuthTypeConnectionProperties : 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(AccessKeyAuthTypeConnectionProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Credentials)) + { + writer.WritePropertyName("credentials"u8); + writer.WriteObjectValue(Credentials, options); + } + } + + AccessKeyAuthTypeConnectionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccessKeyAuthTypeConnectionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAccessKeyAuthTypeConnectionProperties(document.RootElement, options); + } + + internal static AccessKeyAuthTypeConnectionProperties DeserializeAccessKeyAuthTypeConnectionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConnectionAccessKey credentials = default; + ConnectionAuthType authType = default; + ConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("credentials"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + credentials = ConnectionAccessKey.DeserializeConnectionAccessKey(property.Value, options); + continue; + } + if (property.NameEquals("authType"u8)) + { + authType = new ConnectionAuthType(property.Value.GetString()); + continue; + } + if (property.NameEquals("category"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + category = new ConnectionCategory(property.Value.GetString()); + continue; + } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } + if (property.NameEquals("expiryTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expiryTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + 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 (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AccessKeyAuthTypeConnectionProperties( + authType, + category, + createdByWorkspaceArmId, + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData, + credentials); + } + + 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(Credentials), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" credentials: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Credentials)) + { + builder.Append(" credentials: "); + BicepSerializationHelpers.AppendChildObject(builder, Credentials, options, 2, false, " credentials: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AuthType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" authType: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" authType: "); + builder.AppendLine($"'{AuthType.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Category), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" category: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Category)) + { + builder.Append(" category: "); + builder.AppendLine($"'{Category.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CreatedByWorkspaceArmId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" createdByWorkspaceArmId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CreatedByWorkspaceArmId)) + { + builder.Append(" createdByWorkspaceArmId: "); + builder.AppendLine($"'{CreatedByWorkspaceArmId.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" error: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Error)) + { + builder.Append(" error: "); + if (Error.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Error}'''"); + } + else + { + builder.AppendLine($"'{Error}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExpiryOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" expiryTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ExpiryOn)) + { + builder.Append(" expiryTime: "); + var formattedDateTimeString = TypeFormatters.ToString(ExpiryOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Group), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" group: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Group)) + { + builder.Append(" group: "); + builder.AppendLine($"'{Group.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsSharedToAll), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" isSharedToAll: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IsSharedToAll)) + { + builder.Append(" isSharedToAll: "); + var boolValue = IsSharedToAll.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Metadata), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" metadata: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Metadata)) + { + if (Metadata.Any()) + { + builder.Append(" metadata: "); + builder.AppendLine("{"); + foreach (var item in Metadata) + { + 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(" }"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PeRequirement), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" peRequirement: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PeRequirement)) + { + builder.Append(" peRequirement: "); + builder.AppendLine($"'{PeRequirement.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PeStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" peStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PeStatus)) + { + builder.Append(" peStatus: "); + builder.AppendLine($"'{PeStatus.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SharedUserList), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sharedUserList: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(SharedUserList)) + { + if (SharedUserList.Any()) + { + builder.Append(" sharedUserList: "); + builder.AppendLine("["); + foreach (var item in SharedUserList) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Target), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" target: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Target)) + { + builder.Append(" target: "); + if (Target.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Target}'''"); + } + else + { + builder.AppendLine($"'{Target}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UseWorkspaceManagedIdentity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" useWorkspaceManagedIdentity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + builder.Append(" useWorkspaceManagedIdentity: "); + var boolValue = UseWorkspaceManagedIdentity.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(AccessKeyAuthTypeConnectionProperties)} does not support writing '{options.Format}' format."); + } + } + + AccessKeyAuthTypeConnectionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAccessKeyAuthTypeConnectionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AccessKeyAuthTypeConnectionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/AccessKeyAuthTypeConnectionProperties.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/AccessKeyAuthTypeConnectionProperties.cs new file mode 100644 index 000000000000..d30d1845cff1 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/AccessKeyAuthTypeConnectionProperties.cs @@ -0,0 +1,49 @@ +// 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.CognitiveServices.Models +{ + /// The AccessKeyAuthTypeConnectionProperties. + public partial class AccessKeyAuthTypeConnectionProperties : ConnectionPropertiesV2 + { + /// Initializes a new instance of . + public AccessKeyAuthTypeConnectionProperties() + { + AuthType = ConnectionAuthType.AccessKey; + } + + /// Initializes a new instance of . + /// Authentication type of the connection target. + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + /// + internal AccessKeyAuthTypeConnectionProperties(ConnectionAuthType authType, ConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, ConnectionAccessKey credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) + { + Credentials = credentials; + AuthType = authType; + } + + /// Gets or sets the credentials. + [WirePath("credentials")] + public ConnectionAccessKey Credentials { get; set; } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/AccountKeyAuthTypeConnectionProperties.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/AccountKeyAuthTypeConnectionProperties.Serialization.cs new file mode 100644 index 000000000000..2ee2957eafc3 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/AccountKeyAuthTypeConnectionProperties.Serialization.cs @@ -0,0 +1,553 @@ +// 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.CognitiveServices.Models +{ + public partial class AccountKeyAuthTypeConnectionProperties : 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(AccountKeyAuthTypeConnectionProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Credentials)) + { + writer.WritePropertyName("credentials"u8); + writer.WriteObjectValue(Credentials, options); + } + } + + AccountKeyAuthTypeConnectionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccountKeyAuthTypeConnectionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAccountKeyAuthTypeConnectionProperties(document.RootElement, options); + } + + internal static AccountKeyAuthTypeConnectionProperties DeserializeAccountKeyAuthTypeConnectionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConnectionAccountKey credentials = default; + ConnectionAuthType authType = default; + ConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("credentials"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + credentials = ConnectionAccountKey.DeserializeConnectionAccountKey(property.Value, options); + continue; + } + if (property.NameEquals("authType"u8)) + { + authType = new ConnectionAuthType(property.Value.GetString()); + continue; + } + if (property.NameEquals("category"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + category = new ConnectionCategory(property.Value.GetString()); + continue; + } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } + if (property.NameEquals("expiryTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expiryTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + 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 (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AccountKeyAuthTypeConnectionProperties( + authType, + category, + createdByWorkspaceArmId, + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData, + credentials); + } + + 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("CredentialsKey", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" credentials: "); + builder.AppendLine("{"); + builder.Append(" key: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(Credentials)) + { + builder.Append(" credentials: "); + BicepSerializationHelpers.AppendChildObject(builder, Credentials, options, 2, false, " credentials: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AuthType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" authType: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" authType: "); + builder.AppendLine($"'{AuthType.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Category), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" category: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Category)) + { + builder.Append(" category: "); + builder.AppendLine($"'{Category.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CreatedByWorkspaceArmId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" createdByWorkspaceArmId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CreatedByWorkspaceArmId)) + { + builder.Append(" createdByWorkspaceArmId: "); + builder.AppendLine($"'{CreatedByWorkspaceArmId.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" error: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Error)) + { + builder.Append(" error: "); + if (Error.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Error}'''"); + } + else + { + builder.AppendLine($"'{Error}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExpiryOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" expiryTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ExpiryOn)) + { + builder.Append(" expiryTime: "); + var formattedDateTimeString = TypeFormatters.ToString(ExpiryOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Group), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" group: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Group)) + { + builder.Append(" group: "); + builder.AppendLine($"'{Group.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsSharedToAll), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" isSharedToAll: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IsSharedToAll)) + { + builder.Append(" isSharedToAll: "); + var boolValue = IsSharedToAll.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Metadata), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" metadata: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Metadata)) + { + if (Metadata.Any()) + { + builder.Append(" metadata: "); + builder.AppendLine("{"); + foreach (var item in Metadata) + { + 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(" }"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PeRequirement), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" peRequirement: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PeRequirement)) + { + builder.Append(" peRequirement: "); + builder.AppendLine($"'{PeRequirement.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PeStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" peStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PeStatus)) + { + builder.Append(" peStatus: "); + builder.AppendLine($"'{PeStatus.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SharedUserList), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sharedUserList: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(SharedUserList)) + { + if (SharedUserList.Any()) + { + builder.Append(" sharedUserList: "); + builder.AppendLine("["); + foreach (var item in SharedUserList) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Target), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" target: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Target)) + { + builder.Append(" target: "); + if (Target.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Target}'''"); + } + else + { + builder.AppendLine($"'{Target}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UseWorkspaceManagedIdentity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" useWorkspaceManagedIdentity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + builder.Append(" useWorkspaceManagedIdentity: "); + var boolValue = UseWorkspaceManagedIdentity.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(AccountKeyAuthTypeConnectionProperties)} does not support writing '{options.Format}' format."); + } + } + + AccountKeyAuthTypeConnectionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAccountKeyAuthTypeConnectionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AccountKeyAuthTypeConnectionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/AccountKeyAuthTypeConnectionProperties.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/AccountKeyAuthTypeConnectionProperties.cs new file mode 100644 index 000000000000..ba8e6be8bdc3 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/AccountKeyAuthTypeConnectionProperties.cs @@ -0,0 +1,60 @@ +// 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.CognitiveServices.Models +{ + /// This connection type covers the account key connection for Azure storage. + public partial class AccountKeyAuthTypeConnectionProperties : ConnectionPropertiesV2 + { + /// Initializes a new instance of . + public AccountKeyAuthTypeConnectionProperties() + { + AuthType = ConnectionAuthType.AccountKey; + } + + /// Initializes a new instance of . + /// Authentication type of the connection target. + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + /// Account key object for connection credential. + internal AccountKeyAuthTypeConnectionProperties(ConnectionAuthType authType, ConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, ConnectionAccountKey credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) + { + Credentials = credentials; + AuthType = authType; + } + + /// Account key object for connection credential. + internal ConnectionAccountKey Credentials { get; set; } + /// Gets or sets the credentials key. + [WirePath("credentials.key")] + public string CredentialsKey + { + get => Credentials is null ? default : Credentials.Key; + set + { + if (Credentials is null) + Credentials = new ConnectionAccountKey(); + Credentials.Key = value; + } + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ApiKeyAuthConnectionProperties.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ApiKeyAuthConnectionProperties.Serialization.cs new file mode 100644 index 000000000000..ceed21930ad4 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ApiKeyAuthConnectionProperties.Serialization.cs @@ -0,0 +1,553 @@ +// 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.CognitiveServices.Models +{ + public partial class ApiKeyAuthConnectionProperties : 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(ApiKeyAuthConnectionProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Credentials)) + { + writer.WritePropertyName("credentials"u8); + writer.WriteObjectValue(Credentials, options); + } + } + + ApiKeyAuthConnectionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ApiKeyAuthConnectionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApiKeyAuthConnectionProperties(document.RootElement, options); + } + + internal static ApiKeyAuthConnectionProperties DeserializeApiKeyAuthConnectionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConnectionApiKey credentials = default; + ConnectionAuthType authType = default; + ConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("credentials"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + credentials = ConnectionApiKey.DeserializeConnectionApiKey(property.Value, options); + continue; + } + if (property.NameEquals("authType"u8)) + { + authType = new ConnectionAuthType(property.Value.GetString()); + continue; + } + if (property.NameEquals("category"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + category = new ConnectionCategory(property.Value.GetString()); + continue; + } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } + if (property.NameEquals("expiryTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expiryTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + 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 (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ApiKeyAuthConnectionProperties( + authType, + category, + createdByWorkspaceArmId, + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData, + credentials); + } + + 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("CredentialsKey", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" credentials: "); + builder.AppendLine("{"); + builder.Append(" key: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(Credentials)) + { + builder.Append(" credentials: "); + BicepSerializationHelpers.AppendChildObject(builder, Credentials, options, 2, false, " credentials: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AuthType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" authType: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" authType: "); + builder.AppendLine($"'{AuthType.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Category), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" category: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Category)) + { + builder.Append(" category: "); + builder.AppendLine($"'{Category.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CreatedByWorkspaceArmId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" createdByWorkspaceArmId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CreatedByWorkspaceArmId)) + { + builder.Append(" createdByWorkspaceArmId: "); + builder.AppendLine($"'{CreatedByWorkspaceArmId.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" error: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Error)) + { + builder.Append(" error: "); + if (Error.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Error}'''"); + } + else + { + builder.AppendLine($"'{Error}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExpiryOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" expiryTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ExpiryOn)) + { + builder.Append(" expiryTime: "); + var formattedDateTimeString = TypeFormatters.ToString(ExpiryOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Group), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" group: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Group)) + { + builder.Append(" group: "); + builder.AppendLine($"'{Group.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsSharedToAll), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" isSharedToAll: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IsSharedToAll)) + { + builder.Append(" isSharedToAll: "); + var boolValue = IsSharedToAll.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Metadata), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" metadata: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Metadata)) + { + if (Metadata.Any()) + { + builder.Append(" metadata: "); + builder.AppendLine("{"); + foreach (var item in Metadata) + { + 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(" }"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PeRequirement), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" peRequirement: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PeRequirement)) + { + builder.Append(" peRequirement: "); + builder.AppendLine($"'{PeRequirement.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PeStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" peStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PeStatus)) + { + builder.Append(" peStatus: "); + builder.AppendLine($"'{PeStatus.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SharedUserList), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sharedUserList: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(SharedUserList)) + { + if (SharedUserList.Any()) + { + builder.Append(" sharedUserList: "); + builder.AppendLine("["); + foreach (var item in SharedUserList) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Target), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" target: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Target)) + { + builder.Append(" target: "); + if (Target.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Target}'''"); + } + else + { + builder.AppendLine($"'{Target}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UseWorkspaceManagedIdentity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" useWorkspaceManagedIdentity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + builder.Append(" useWorkspaceManagedIdentity: "); + var boolValue = UseWorkspaceManagedIdentity.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(ApiKeyAuthConnectionProperties)} does not support writing '{options.Format}' format."); + } + } + + ApiKeyAuthConnectionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeApiKeyAuthConnectionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ApiKeyAuthConnectionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ApiKeyAuthConnectionProperties.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ApiKeyAuthConnectionProperties.cs new file mode 100644 index 000000000000..b033336ace05 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ApiKeyAuthConnectionProperties.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 Azure.Core; + +namespace Azure.ResourceManager.CognitiveServices.Models +{ + /// + /// This connection type covers the generic ApiKey auth connection categories, for examples: + /// AzureOpenAI: + /// Category:= AzureOpenAI + /// AuthType:= ApiKey (as type discriminator) + /// Credentials:= {ApiKey} as .ApiKey + /// Target:= {ApiBase} + /// + /// CognitiveService: + /// Category:= CognitiveService + /// AuthType:= ApiKey (as type discriminator) + /// Credentials:= {SubscriptionKey} as ApiKey + /// Target:= ServiceRegion={serviceRegion} + /// + /// CognitiveSearch: + /// Category:= CognitiveSearch + /// AuthType:= ApiKey (as type discriminator) + /// Credentials:= {Key} as ApiKey + /// Target:= {Endpoint} + /// + /// Use Metadata property bag for ApiType, ApiVersion, Kind and other metadata fields + /// + public partial class ApiKeyAuthConnectionProperties : ConnectionPropertiesV2 + { + /// Initializes a new instance of . + public ApiKeyAuthConnectionProperties() + { + AuthType = ConnectionAuthType.ApiKey; + } + + /// Initializes a new instance of . + /// Authentication type of the connection target. + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + /// Api key object for connection credential. + internal ApiKeyAuthConnectionProperties(ConnectionAuthType authType, ConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, ConnectionApiKey credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) + { + Credentials = credentials; + AuthType = authType; + } + + /// Api key object for connection credential. + internal ConnectionApiKey Credentials { get; set; } + /// Gets or sets the credentials key. + [WirePath("credentials.key")] + public string CredentialsKey + { + get => Credentials is null ? default : Credentials.Key; + set + { + if (Credentials is null) + Credentials = new ConnectionApiKey(); + Credentials.Key = value; + } + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CapabilityHostKind.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CapabilityHostKind.cs new file mode 100644 index 000000000000..fa84178c4d88 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CapabilityHostKind.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.CognitiveServices.Models +{ + /// The CapabilityHostKind. + public readonly partial struct CapabilityHostKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CapabilityHostKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AgentsValue = "Agents"; + + /// Agents. + public static CapabilityHostKind Agents { get; } = new CapabilityHostKind(AgentsValue); + /// Determines if two values are the same. + public static bool operator ==(CapabilityHostKind left, CapabilityHostKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CapabilityHostKind left, CapabilityHostKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CapabilityHostKind(string value) => new CapabilityHostKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CapabilityHostKind other && Equals(other); + /// + public bool Equals(CapabilityHostKind 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/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CapabilityHostProperties.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CapabilityHostProperties.Serialization.cs new file mode 100644 index 000000000000..6a0593e11d61 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CapabilityHostProperties.Serialization.cs @@ -0,0 +1,597 @@ +// 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.CognitiveServices.Models +{ + public partial class CapabilityHostProperties : 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(CapabilityHostProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(AiServicesConnections)) + { + if (AiServicesConnections != null) + { + writer.WritePropertyName("aiServicesConnections"u8); + writer.WriteStartArray(); + foreach (var item in AiServicesConnections) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("aiServicesConnections"); + } + } + if (Optional.IsDefined(CapabilityHostKind)) + { + writer.WritePropertyName("capabilityHostKind"u8); + writer.WriteStringValue(CapabilityHostKind.Value.ToString()); + } + if (Optional.IsDefined(CustomerSubnet)) + { + if (CustomerSubnet != null) + { + writer.WritePropertyName("customerSubnet"u8); + writer.WriteStringValue(CustomerSubnet); + } + else + { + writer.WriteNull("customerSubnet"); + } + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsCollectionDefined(StorageConnections)) + { + if (StorageConnections != null) + { + writer.WritePropertyName("storageConnections"u8); + writer.WriteStartArray(); + foreach (var item in StorageConnections) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("storageConnections"); + } + } + if (Optional.IsCollectionDefined(ThreadStorageConnections)) + { + if (ThreadStorageConnections != null) + { + writer.WritePropertyName("threadStorageConnections"u8); + writer.WriteStartArray(); + foreach (var item in ThreadStorageConnections) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("threadStorageConnections"); + } + } + if (Optional.IsCollectionDefined(VectorStoreConnections)) + { + if (VectorStoreConnections != null) + { + writer.WritePropertyName("vectorStoreConnections"u8); + writer.WriteStartArray(); + foreach (var item in VectorStoreConnections) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("vectorStoreConnections"); + } + } + } + + CapabilityHostProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CapabilityHostProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCapabilityHostProperties(document.RootElement, options); + } + + internal static CapabilityHostProperties DeserializeCapabilityHostProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList aiServicesConnections = default; + CapabilityHostKind? capabilityHostKind = default; + string customerSubnet = default; + CapabilityHostProvisioningState? provisioningState = default; + IList storageConnections = default; + IList threadStorageConnections = default; + IList vectorStoreConnections = default; + string description = default; + IDictionary tags = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("aiServicesConnections"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + aiServicesConnections = array; + continue; + } + if (property.NameEquals("capabilityHostKind"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capabilityHostKind = new CapabilityHostKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("customerSubnet"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + customerSubnet = null; + continue; + } + customerSubnet = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new CapabilityHostProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("storageConnections"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + storageConnections = array; + continue; + } + if (property.NameEquals("threadStorageConnections"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + threadStorageConnections = array; + continue; + } + if (property.NameEquals("vectorStoreConnections"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + vectorStoreConnections = array; + continue; + } + if (property.NameEquals("description"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + description = null; + continue; + } + description = property.Value.GetString(); + 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 (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CapabilityHostProperties( + description, + tags ?? new ChangeTrackingDictionary(), + serializedAdditionalRawData, + aiServicesConnections ?? new ChangeTrackingList(), + capabilityHostKind, + customerSubnet, + provisioningState, + storageConnections ?? new ChangeTrackingList(), + threadStorageConnections ?? new ChangeTrackingList(), + vectorStoreConnections ?? new ChangeTrackingList()); + } + + 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(AiServicesConnections), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" aiServicesConnections: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(AiServicesConnections)) + { + if (AiServicesConnections.Any()) + { + builder.Append(" aiServicesConnections: "); + builder.AppendLine("["); + foreach (var item in AiServicesConnections) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CapabilityHostKind), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" capabilityHostKind: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CapabilityHostKind)) + { + builder.Append(" capabilityHostKind: "); + builder.AppendLine($"'{CapabilityHostKind.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CustomerSubnet), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" customerSubnet: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CustomerSubnet)) + { + builder.Append(" customerSubnet: "); + if (CustomerSubnet.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{CustomerSubnet}'''"); + } + else + { + builder.AppendLine($"'{CustomerSubnet}'"); + } + } + } + + 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(StorageConnections), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" storageConnections: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(StorageConnections)) + { + if (StorageConnections.Any()) + { + builder.Append(" storageConnections: "); + builder.AppendLine("["); + foreach (var item in StorageConnections) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ThreadStorageConnections), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" threadStorageConnections: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(ThreadStorageConnections)) + { + if (ThreadStorageConnections.Any()) + { + builder.Append(" threadStorageConnections: "); + builder.AppendLine("["); + foreach (var item in ThreadStorageConnections) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(VectorStoreConnections), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" vectorStoreConnections: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(VectorStoreConnections)) + { + if (VectorStoreConnections.Any()) + { + builder.Append(" vectorStoreConnections: "); + builder.AppendLine("["); + foreach (var item in VectorStoreConnections) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Description), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" description: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Description)) + { + builder.Append(" description: "); + if (Description.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Description}'''"); + } + else + { + builder.AppendLine($"'{Description}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tags: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Tags)) + { + if (Tags.Any()) + { + builder.Append(" tags: "); + builder.AppendLine("{"); + foreach (var item in Tags) + { + 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()); + } + + BinaryData 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(CapabilityHostProperties)} does not support writing '{options.Format}' format."); + } + } + + CapabilityHostProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCapabilityHostProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CapabilityHostProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CapabilityHostProperties.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CapabilityHostProperties.cs new file mode 100644 index 000000000000..66d748acf10a --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CapabilityHostProperties.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.CognitiveServices.Models +{ + /// The CapabilityHostProperties. + public partial class CapabilityHostProperties : ResourceBase + { + /// Initializes a new instance of . + public CapabilityHostProperties() + { + AiServicesConnections = new ChangeTrackingList(); + StorageConnections = new ChangeTrackingList(); + ThreadStorageConnections = new ChangeTrackingList(); + VectorStoreConnections = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The asset description text. + /// Tag dictionary. Tags can be added, removed, and updated. + /// Keeps track of any properties unknown to the library. + /// List of AI services connections. + /// Kind of this capability host. + /// Customer subnet info to help set up this capability host. + /// Provisioning state for the CapabilityHost. + /// List of Storage connections. + /// List of Thread storage connections. + /// List of VectorStore connections. + internal CapabilityHostProperties(string description, IDictionary tags, IDictionary serializedAdditionalRawData, IList aiServicesConnections, CapabilityHostKind? capabilityHostKind, string customerSubnet, CapabilityHostProvisioningState? provisioningState, IList storageConnections, IList threadStorageConnections, IList vectorStoreConnections) : base(description, tags, serializedAdditionalRawData) + { + AiServicesConnections = aiServicesConnections; + CapabilityHostKind = capabilityHostKind; + CustomerSubnet = customerSubnet; + ProvisioningState = provisioningState; + StorageConnections = storageConnections; + ThreadStorageConnections = threadStorageConnections; + VectorStoreConnections = vectorStoreConnections; + } + + /// List of AI services connections. + [WirePath("aiServicesConnections")] + public IList AiServicesConnections { get; set; } + /// Kind of this capability host. + [WirePath("capabilityHostKind")] + public CapabilityHostKind? CapabilityHostKind { get; set; } + /// Customer subnet info to help set up this capability host. + [WirePath("customerSubnet")] + public string CustomerSubnet { get; set; } + /// Provisioning state for the CapabilityHost. + [WirePath("provisioningState")] + public CapabilityHostProvisioningState? ProvisioningState { get; } + /// List of Storage connections. + [WirePath("storageConnections")] + public IList StorageConnections { get; set; } + /// List of Thread storage connections. + [WirePath("threadStorageConnections")] + public IList ThreadStorageConnections { get; set; } + /// List of VectorStore connections. + [WirePath("vectorStoreConnections")] + public IList VectorStoreConnections { get; set; } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CapabilityHostProvisioningState.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CapabilityHostProvisioningState.cs new file mode 100644 index 000000000000..554d0009a33e --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CapabilityHostProvisioningState.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.CognitiveServices.Models +{ + /// Provisioning state of capability host. + public readonly partial struct CapabilityHostProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CapabilityHostProvisioningState(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 CreatingValue = "Creating"; + private const string UpdatingValue = "Updating"; + private const string DeletingValue = "Deleting"; + + /// Succeeded. + public static CapabilityHostProvisioningState Succeeded { get; } = new CapabilityHostProvisioningState(SucceededValue); + /// Failed. + public static CapabilityHostProvisioningState Failed { get; } = new CapabilityHostProvisioningState(FailedValue); + /// Canceled. + public static CapabilityHostProvisioningState Canceled { get; } = new CapabilityHostProvisioningState(CanceledValue); + /// Creating. + public static CapabilityHostProvisioningState Creating { get; } = new CapabilityHostProvisioningState(CreatingValue); + /// Updating. + public static CapabilityHostProvisioningState Updating { get; } = new CapabilityHostProvisioningState(UpdatingValue); + /// Deleting. + public static CapabilityHostProvisioningState Deleting { get; } = new CapabilityHostProvisioningState(DeletingValue); + /// Determines if two values are the same. + public static bool operator ==(CapabilityHostProvisioningState left, CapabilityHostProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CapabilityHostProvisioningState left, CapabilityHostProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CapabilityHostProvisioningState(string value) => new CapabilityHostProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CapabilityHostProvisioningState other && Equals(other); + /// + public bool Equals(CapabilityHostProvisioningState 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/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CognitiveServicesAccountProperties.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CognitiveServicesAccountProperties.Serialization.cs index 6914e6979d85..6f2128bfdc08 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CognitiveServicesAccountProperties.Serialization.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CognitiveServicesAccountProperties.Serialization.cs @@ -212,6 +212,31 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("raiMonitorConfig"u8); writer.WriteObjectValue(RaiMonitorConfig, options); } + if (Optional.IsDefined(NetworkInjections)) + { + writer.WritePropertyName("networkInjections"u8); + writer.WriteObjectValue(NetworkInjections, options); + } + if (Optional.IsDefined(AllowProjectManagement)) + { + writer.WritePropertyName("allowProjectManagement"u8); + writer.WriteBooleanValue(AllowProjectManagement.Value); + } + if (Optional.IsDefined(DefaultProject)) + { + writer.WritePropertyName("defaultProject"u8); + writer.WriteStringValue(DefaultProject); + } + if (Optional.IsCollectionDefined(AssociatedProjects)) + { + writer.WritePropertyName("associatedProjects"u8); + writer.WriteStartArray(); + foreach (var item in AssociatedProjects) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -278,6 +303,10 @@ internal static CognitiveServicesAccountProperties DeserializeCognitiveServicesA IReadOnlyList commitmentPlanAssociations = default; AbusePenalty abusePenalty = default; RaiMonitorConfig raiMonitorConfig = default; + NetworkInjections networkInjections = default; + bool? allowProjectManagement = default; + string defaultProject = default; + IList associatedProjects = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -557,6 +586,43 @@ internal static CognitiveServicesAccountProperties DeserializeCognitiveServicesA raiMonitorConfig = RaiMonitorConfig.DeserializeRaiMonitorConfig(property.Value, options); continue; } + if (property.NameEquals("networkInjections"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkInjections = NetworkInjections.DeserializeNetworkInjections(property.Value, options); + continue; + } + if (property.NameEquals("allowProjectManagement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allowProjectManagement = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("defaultProject"u8)) + { + defaultProject = property.Value.GetString(); + continue; + } + if (property.NameEquals("associatedProjects"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + associatedProjects = array; + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -593,6 +659,10 @@ internal static CognitiveServicesAccountProperties DeserializeCognitiveServicesA commitmentPlanAssociations ?? new ChangeTrackingList(), abusePenalty, raiMonitorConfig, + networkInjections, + allowProjectManagement, + defaultProject, + associatedProjects ?? new ChangeTrackingList(), serializedAdditionalRawData); } @@ -1156,6 +1226,96 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NetworkInjections), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" networkInjections: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NetworkInjections)) + { + builder.Append(" networkInjections: "); + BicepSerializationHelpers.AppendChildObject(builder, NetworkInjections, options, 2, false, " networkInjections: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AllowProjectManagement), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" allowProjectManagement: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AllowProjectManagement)) + { + builder.Append(" allowProjectManagement: "); + var boolValue = AllowProjectManagement.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DefaultProject), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" defaultProject: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DefaultProject)) + { + builder.Append(" defaultProject: "); + if (DefaultProject.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{DefaultProject}'''"); + } + else + { + builder.AppendLine($"'{DefaultProject}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AssociatedProjects), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" associatedProjects: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(AssociatedProjects)) + { + if (AssociatedProjects.Any()) + { + builder.Append(" associatedProjects: "); + builder.AppendLine("["); + foreach (var item in AssociatedProjects) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CognitiveServicesAccountProperties.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CognitiveServicesAccountProperties.cs index 0ad2112d5bfa..b918b0a026cc 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CognitiveServicesAccountProperties.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CognitiveServicesAccountProperties.cs @@ -54,6 +54,7 @@ public CognitiveServicesAccountProperties() AllowedFqdnList = new ChangeTrackingList(); Endpoints = new ChangeTrackingDictionary(); CommitmentPlanAssociations = new ChangeTrackingList(); + AssociatedProjects = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -67,7 +68,7 @@ public CognitiveServicesAccountProperties() /// A collection of rules governing the accessibility from specific network locations. /// The encryption properties for this resource. /// The storage accounts for this resource. - /// The user owned AML workspace properties. + /// The user owned AML account properties. /// The private endpoint connection associated with the Cognitive Services account. /// Whether or not public endpoint access is allowed for this account. /// The api properties for special APIs. @@ -86,8 +87,12 @@ public CognitiveServicesAccountProperties() /// The commitment plan associations of Cognitive Services account. /// The abuse penalty. /// Cognitive Services Rai Monitor Config. + /// Specifies in AI Foundry where virtual network injection occurs to secure scenarios like Agents entirely within the user's private network, eliminating public internet exposure while maintaining control over network configurations and resources. + /// Specifies whether this resource support project management as child resources, used as containers for access management, data isolation and cost in AI Foundry. + /// Specifies the project that is targeted when data plane endpoints are called without a project parameter. + /// Specifies the projects that are associated with this resource. /// Keeps track of any properties unknown to the library. - internal CognitiveServicesAccountProperties(ServiceAccountProvisioningState? provisioningState, string endpoint, IReadOnlyList capabilities, bool? isMigrated, string migrationToken, CognitiveServicesSkuChangeInfo skuChangeInfo, string customSubDomainName, CognitiveServicesNetworkRuleSet networkAcls, ServiceAccountEncryptionProperties encryption, IList userOwnedStorage, UserOwnedAmlWorkspace amlWorkspace, IReadOnlyList privateEndpointConnections, ServiceAccountPublicNetworkAccess? publicNetworkAccess, ServiceAccountApiProperties apiProperties, DateTimeOffset? createdOn, ServiceAccountCallRateLimit callRateLimit, bool? enableDynamicThrottling, ServiceAccountQuotaLimit quotaLimit, bool? restrictOutboundNetworkAccess, IList allowedFqdnList, bool? disableLocalAuth, IReadOnlyDictionary endpoints, bool? restore, DateTimeOffset? deletedOn, string scheduledPurgeDate, CognitiveServicesMultiRegionSettings locations, IReadOnlyList commitmentPlanAssociations, AbusePenalty abusePenalty, RaiMonitorConfig raiMonitorConfig, IDictionary serializedAdditionalRawData) + internal CognitiveServicesAccountProperties(ServiceAccountProvisioningState? provisioningState, string endpoint, IReadOnlyList capabilities, bool? isMigrated, string migrationToken, CognitiveServicesSkuChangeInfo skuChangeInfo, string customSubDomainName, CognitiveServicesNetworkRuleSet networkAcls, ServiceAccountEncryptionProperties encryption, IList userOwnedStorage, UserOwnedAmlWorkspace amlWorkspace, IReadOnlyList privateEndpointConnections, ServiceAccountPublicNetworkAccess? publicNetworkAccess, ServiceAccountApiProperties apiProperties, DateTimeOffset? createdOn, ServiceAccountCallRateLimit callRateLimit, bool? enableDynamicThrottling, ServiceAccountQuotaLimit quotaLimit, bool? restrictOutboundNetworkAccess, IList allowedFqdnList, bool? disableLocalAuth, IReadOnlyDictionary endpoints, bool? restore, DateTimeOffset? deletedOn, string scheduledPurgeDate, CognitiveServicesMultiRegionSettings locations, IReadOnlyList commitmentPlanAssociations, AbusePenalty abusePenalty, RaiMonitorConfig raiMonitorConfig, NetworkInjections networkInjections, bool? allowProjectManagement, string defaultProject, IList associatedProjects, IDictionary serializedAdditionalRawData) { ProvisioningState = provisioningState; Endpoint = endpoint; @@ -118,6 +123,10 @@ internal CognitiveServicesAccountProperties(ServiceAccountProvisioningState? pro CommitmentPlanAssociations = commitmentPlanAssociations; AbusePenalty = abusePenalty; RaiMonitorConfig = raiMonitorConfig; + NetworkInjections = networkInjections; + AllowProjectManagement = allowProjectManagement; + DefaultProject = defaultProject; + AssociatedProjects = associatedProjects; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -151,7 +160,7 @@ internal CognitiveServicesAccountProperties(ServiceAccountProvisioningState? pro /// The storage accounts for this resource. [WirePath("userOwnedStorage")] public IList UserOwnedStorage { get; } - /// The user owned AML workspace properties. + /// The user owned AML account properties. [WirePath("amlWorkspace")] public UserOwnedAmlWorkspace AmlWorkspace { get; set; } /// The private endpoint connection associated with the Cognitive Services account. @@ -208,5 +217,17 @@ internal CognitiveServicesAccountProperties(ServiceAccountProvisioningState? pro /// Cognitive Services Rai Monitor Config. [WirePath("raiMonitorConfig")] public RaiMonitorConfig RaiMonitorConfig { get; set; } + /// Specifies in AI Foundry where virtual network injection occurs to secure scenarios like Agents entirely within the user's private network, eliminating public internet exposure while maintaining control over network configurations and resources. + [WirePath("networkInjections")] + public NetworkInjections NetworkInjections { get; set; } + /// Specifies whether this resource support project management as child resources, used as containers for access management, data isolation and cost in AI Foundry. + [WirePath("allowProjectManagement")] + public bool? AllowProjectManagement { get; set; } + /// Specifies the project that is targeted when data plane endpoints are called without a project parameter. + [WirePath("defaultProject")] + public string DefaultProject { get; set; } + /// Specifies the projects that are associated with this resource. + [WirePath("associatedProjects")] + public IList AssociatedProjects { get; } } } diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionAccessKey.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionAccessKey.Serialization.cs new file mode 100644 index 000000000000..89afff23ef62 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionAccessKey.Serialization.cs @@ -0,0 +1,204 @@ +// 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.CognitiveServices.Models +{ + public partial class ConnectionAccessKey : 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(ConnectionAccessKey)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(AccessKeyId)) + { + writer.WritePropertyName("accessKeyId"u8); + writer.WriteStringValue(AccessKeyId); + } + if (Optional.IsDefined(SecretAccessKey)) + { + writer.WritePropertyName("secretAccessKey"u8); + writer.WriteStringValue(SecretAccessKey); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectionAccessKey IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectionAccessKey)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectionAccessKey(document.RootElement, options); + } + + internal static ConnectionAccessKey DeserializeConnectionAccessKey(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string accessKeyId = default; + string secretAccessKey = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("accessKeyId"u8)) + { + accessKeyId = property.Value.GetString(); + continue; + } + if (property.NameEquals("secretAccessKey"u8)) + { + secretAccessKey = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectionAccessKey(accessKeyId, secretAccessKey, 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(AccessKeyId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" accessKeyId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AccessKeyId)) + { + builder.Append(" accessKeyId: "); + if (AccessKeyId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{AccessKeyId}'''"); + } + else + { + builder.AppendLine($"'{AccessKeyId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SecretAccessKey), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" secretAccessKey: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SecretAccessKey)) + { + builder.Append(" secretAccessKey: "); + if (SecretAccessKey.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{SecretAccessKey}'''"); + } + else + { + builder.AppendLine($"'{SecretAccessKey}'"); + } + } + } + + 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(ConnectionAccessKey)} does not support writing '{options.Format}' format."); + } + } + + ConnectionAccessKey IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeConnectionAccessKey(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectionAccessKey)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionAccessKey.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionAccessKey.cs new file mode 100644 index 000000000000..d8d6cc86195f --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionAccessKey.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.CognitiveServices.Models +{ + /// The ConnectionAccessKey. + public partial class ConnectionAccessKey + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// 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 ConnectionAccessKey() + { + } + + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal ConnectionAccessKey(string accessKeyId, string secretAccessKey, IDictionary serializedAdditionalRawData) + { + AccessKeyId = accessKeyId; + SecretAccessKey = secretAccessKey; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the access key id. + [WirePath("accessKeyId")] + public string AccessKeyId { get; set; } + /// Gets or sets the secret access key. + [WirePath("secretAccessKey")] + public string SecretAccessKey { get; set; } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionAccountKey.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionAccountKey.Serialization.cs new file mode 100644 index 000000000000..7b24404a64dc --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionAccountKey.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; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CognitiveServices.Models +{ + internal partial class ConnectionAccountKey : 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(ConnectionAccountKey)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Key)) + { + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectionAccountKey IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectionAccountKey)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectionAccountKey(document.RootElement, options); + } + + internal static ConnectionAccountKey DeserializeConnectionAccountKey(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string key = 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 (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectionAccountKey(key, 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(Key), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" key: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Key)) + { + builder.Append(" key: "); + if (Key.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Key}'''"); + } + else + { + builder.AppendLine($"'{Key}'"); + } + } + } + + 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(ConnectionAccountKey)} does not support writing '{options.Format}' format."); + } + } + + ConnectionAccountKey IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeConnectionAccountKey(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectionAccountKey)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionAccountKey.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionAccountKey.cs new file mode 100644 index 000000000000..02b7736f7241 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionAccountKey.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.CognitiveServices.Models +{ + /// Account key object for connection credential. + internal partial class ConnectionAccountKey + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// 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 ConnectionAccountKey() + { + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + internal ConnectionAccountKey(string key, IDictionary serializedAdditionalRawData) + { + Key = key; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the key. + [WirePath("key")] + public string Key { get; set; } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionApiKey.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionApiKey.Serialization.cs new file mode 100644 index 000000000000..fa380a869758 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionApiKey.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; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CognitiveServices.Models +{ + internal partial class ConnectionApiKey : 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(ConnectionApiKey)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Key)) + { + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectionApiKey IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectionApiKey)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectionApiKey(document.RootElement, options); + } + + internal static ConnectionApiKey DeserializeConnectionApiKey(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string key = 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 (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectionApiKey(key, 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(Key), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" key: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Key)) + { + builder.Append(" key: "); + if (Key.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Key}'''"); + } + else + { + builder.AppendLine($"'{Key}'"); + } + } + } + + 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(ConnectionApiKey)} does not support writing '{options.Format}' format."); + } + } + + ConnectionApiKey IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeConnectionApiKey(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectionApiKey)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionApiKey.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionApiKey.cs new file mode 100644 index 000000000000..6b74162305d1 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionApiKey.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.CognitiveServices.Models +{ + /// Api key object for connection credential. + internal partial class ConnectionApiKey + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// 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 ConnectionApiKey() + { + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + internal ConnectionApiKey(string key, IDictionary serializedAdditionalRawData) + { + Key = key; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the key. + [WirePath("key")] + public string Key { get; set; } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionAuthType.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionAuthType.cs new file mode 100644 index 000000000000..e01627db55c7 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionAuthType.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.CognitiveServices.Models +{ + /// Authentication type of the connection target. + internal readonly partial struct ConnectionAuthType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ConnectionAuthType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PATValue = "PAT"; + private const string ManagedIdentityValue = "ManagedIdentity"; + private const string UsernamePasswordValue = "UsernamePassword"; + private const string NoneValue = "None"; + private const string SASValue = "SAS"; + private const string AccountKeyValue = "AccountKey"; + private const string ServicePrincipalValue = "ServicePrincipal"; + private const string AccessKeyValue = "AccessKey"; + private const string ApiKeyValue = "ApiKey"; + private const string CustomKeysValue = "CustomKeys"; + private const string OAuth2Value = "OAuth2"; + private const string AADValue = "AAD"; + + /// PAT. + public static ConnectionAuthType PAT { get; } = new ConnectionAuthType(PATValue); + /// ManagedIdentity. + public static ConnectionAuthType ManagedIdentity { get; } = new ConnectionAuthType(ManagedIdentityValue); + /// UsernamePassword. + public static ConnectionAuthType UsernamePassword { get; } = new ConnectionAuthType(UsernamePasswordValue); + /// None. + public static ConnectionAuthType None { get; } = new ConnectionAuthType(NoneValue); + /// SAS. + public static ConnectionAuthType SAS { get; } = new ConnectionAuthType(SASValue); + /// AccountKey. + public static ConnectionAuthType AccountKey { get; } = new ConnectionAuthType(AccountKeyValue); + /// ServicePrincipal. + public static ConnectionAuthType ServicePrincipal { get; } = new ConnectionAuthType(ServicePrincipalValue); + /// AccessKey. + public static ConnectionAuthType AccessKey { get; } = new ConnectionAuthType(AccessKeyValue); + /// ApiKey. + public static ConnectionAuthType ApiKey { get; } = new ConnectionAuthType(ApiKeyValue); + /// CustomKeys. + public static ConnectionAuthType CustomKeys { get; } = new ConnectionAuthType(CustomKeysValue); + /// OAuth2. + public static ConnectionAuthType OAuth2 { get; } = new ConnectionAuthType(OAuth2Value); + /// AAD. + public static ConnectionAuthType AAD { get; } = new ConnectionAuthType(AADValue); + /// Determines if two values are the same. + public static bool operator ==(ConnectionAuthType left, ConnectionAuthType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ConnectionAuthType left, ConnectionAuthType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ConnectionAuthType(string value) => new ConnectionAuthType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ConnectionAuthType other && Equals(other); + /// + public bool Equals(ConnectionAuthType 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/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionCategory.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionCategory.cs new file mode 100644 index 000000000000..73f3a7aae373 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionCategory.cs @@ -0,0 +1,360 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.CognitiveServices.Models +{ + /// Category of the connection. + public readonly partial struct ConnectionCategory : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ConnectionCategory(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PythonFeedValue = "PythonFeed"; + private const string ContainerRegistryValue = "ContainerRegistry"; + private const string GitValue = "Git"; + private const string S3Value = "S3"; + private const string SnowflakeValue = "Snowflake"; + private const string AzureSqlDbValue = "AzureSqlDb"; + private const string AzureSynapseAnalyticsValue = "AzureSynapseAnalytics"; + private const string AzureMySqlDbValue = "AzureMySqlDb"; + private const string AzurePostgresDbValue = "AzurePostgresDb"; + private const string AdlsGen2Value = "ADLSGen2"; + private const string RedisValue = "Redis"; + private const string ApiKeyValue = "ApiKey"; + private const string AzureOpenAIValue = "AzureOpenAI"; + private const string AIServicesValue = "AIServices"; + private const string CognitiveSearchValue = "CognitiveSearch"; + private const string CognitiveServiceValue = "CognitiveService"; + private const string CustomKeysValue = "CustomKeys"; + private const string AzureBlobValue = "AzureBlob"; + private const string AzureOneLakeValue = "AzureOneLake"; + private const string CosmosDbValue = "CosmosDb"; + private const string CosmosDbMongoDbApiValue = "CosmosDbMongoDbApi"; + private const string AzureDataExplorerValue = "AzureDataExplorer"; + private const string AzureMariaDbValue = "AzureMariaDb"; + private const string AzureDatabricksDeltaLakeValue = "AzureDatabricksDeltaLake"; + private const string AzureSqlMiValue = "AzureSqlMi"; + private const string AzureTableStorageValue = "AzureTableStorage"; + private const string AmazonRdsForOracleValue = "AmazonRdsForOracle"; + private const string AmazonRdsForSqlServerValue = "AmazonRdsForSqlServer"; + private const string AmazonRedshiftValue = "AmazonRedshift"; + private const string Db2Value = "Db2"; + private const string DrillValue = "Drill"; + private const string GoogleBigQueryValue = "GoogleBigQuery"; + private const string GreenplumValue = "Greenplum"; + private const string HbaseValue = "Hbase"; + private const string HiveValue = "Hive"; + private const string ImpalaValue = "Impala"; + private const string InformixValue = "Informix"; + private const string MariaDbValue = "MariaDb"; + private const string MicrosoftAccessValue = "MicrosoftAccess"; + private const string MySqlValue = "MySql"; + private const string NetezzaValue = "Netezza"; + private const string OracleValue = "Oracle"; + private const string PhoenixValue = "Phoenix"; + private const string PostgreSqlValue = "PostgreSql"; + private const string PrestoValue = "Presto"; + private const string SapOpenHubValue = "SapOpenHub"; + private const string SapBwValue = "SapBw"; + private const string SapHanaValue = "SapHana"; + private const string SapTableValue = "SapTable"; + private const string SparkValue = "Spark"; + private const string SqlServerValue = "SqlServer"; + private const string SybaseValue = "Sybase"; + private const string TeradataValue = "Teradata"; + private const string VerticaValue = "Vertica"; + private const string PineconeValue = "Pinecone"; + private const string CassandraValue = "Cassandra"; + private const string CouchbaseValue = "Couchbase"; + private const string MongoDbV2Value = "MongoDbV2"; + private const string MongoDbAtlasValue = "MongoDbAtlas"; + private const string AmazonS3CompatibleValue = "AmazonS3Compatible"; + private const string FileServerValue = "FileServer"; + private const string FtpServerValue = "FtpServer"; + private const string GoogleCloudStorageValue = "GoogleCloudStorage"; + private const string HdfsValue = "Hdfs"; + private const string OracleCloudStorageValue = "OracleCloudStorage"; + private const string SftpValue = "Sftp"; + private const string GenericHttpValue = "GenericHttp"; + private const string ODataRestValue = "ODataRest"; + private const string OdbcValue = "Odbc"; + private const string GenericRestValue = "GenericRest"; + private const string AmazonMwsValue = "AmazonMws"; + private const string ConcurValue = "Concur"; + private const string DynamicsValue = "Dynamics"; + private const string DynamicsAxValue = "DynamicsAx"; + private const string DynamicsCrmValue = "DynamicsCrm"; + private const string GoogleAdWordsValue = "GoogleAdWords"; + private const string HubspotValue = "Hubspot"; + private const string JiraValue = "Jira"; + private const string MagentoValue = "Magento"; + private const string MarketoValue = "Marketo"; + private const string Office365Value = "Office365"; + private const string EloquaValue = "Eloqua"; + private const string ResponsysValue = "Responsys"; + private const string OracleServiceCloudValue = "OracleServiceCloud"; + private const string PayPalValue = "PayPal"; + private const string QuickBooksValue = "QuickBooks"; + private const string SalesforceValue = "Salesforce"; + private const string SalesforceServiceCloudValue = "SalesforceServiceCloud"; + private const string SalesforceMarketingCloudValue = "SalesforceMarketingCloud"; + private const string SapCloudForCustomerValue = "SapCloudForCustomer"; + private const string SapEccValue = "SapEcc"; + private const string ServiceNowValue = "ServiceNow"; + private const string SharePointOnlineListValue = "SharePointOnlineList"; + private const string ShopifyValue = "Shopify"; + private const string SquareValue = "Square"; + private const string WebTableValue = "WebTable"; + private const string XeroValue = "Xero"; + private const string ZohoValue = "Zoho"; + private const string GenericContainerRegistryValue = "GenericContainerRegistry"; + private const string ElasticsearchValue = "Elasticsearch"; + private const string OpenAIValue = "OpenAI"; + private const string SerpValue = "Serp"; + private const string BingLLMSearchValue = "BingLLMSearch"; + private const string ServerlessValue = "Serverless"; + private const string ManagedOnlineEndpointValue = "ManagedOnlineEndpoint"; + + /// PythonFeed. + public static ConnectionCategory PythonFeed { get; } = new ConnectionCategory(PythonFeedValue); + /// ContainerRegistry. + public static ConnectionCategory ContainerRegistry { get; } = new ConnectionCategory(ContainerRegistryValue); + /// Git. + public static ConnectionCategory Git { get; } = new ConnectionCategory(GitValue); + /// S3. + public static ConnectionCategory S3 { get; } = new ConnectionCategory(S3Value); + /// Snowflake. + public static ConnectionCategory Snowflake { get; } = new ConnectionCategory(SnowflakeValue); + /// AzureSqlDb. + public static ConnectionCategory AzureSqlDb { get; } = new ConnectionCategory(AzureSqlDbValue); + /// AzureSynapseAnalytics. + public static ConnectionCategory AzureSynapseAnalytics { get; } = new ConnectionCategory(AzureSynapseAnalyticsValue); + /// AzureMySqlDb. + public static ConnectionCategory AzureMySqlDb { get; } = new ConnectionCategory(AzureMySqlDbValue); + /// AzurePostgresDb. + public static ConnectionCategory AzurePostgresDb { get; } = new ConnectionCategory(AzurePostgresDbValue); + /// ADLSGen2. + public static ConnectionCategory AdlsGen2 { get; } = new ConnectionCategory(AdlsGen2Value); + /// Redis. + public static ConnectionCategory Redis { get; } = new ConnectionCategory(RedisValue); + /// ApiKey. + public static ConnectionCategory ApiKey { get; } = new ConnectionCategory(ApiKeyValue); + /// AzureOpenAI. + public static ConnectionCategory AzureOpenAI { get; } = new ConnectionCategory(AzureOpenAIValue); + /// AIServices. + public static ConnectionCategory AIServices { get; } = new ConnectionCategory(AIServicesValue); + /// CognitiveSearch. + public static ConnectionCategory CognitiveSearch { get; } = new ConnectionCategory(CognitiveSearchValue); + /// CognitiveService. + public static ConnectionCategory CognitiveService { get; } = new ConnectionCategory(CognitiveServiceValue); + /// CustomKeys. + public static ConnectionCategory CustomKeys { get; } = new ConnectionCategory(CustomKeysValue); + /// AzureBlob. + public static ConnectionCategory AzureBlob { get; } = new ConnectionCategory(AzureBlobValue); + /// AzureOneLake. + public static ConnectionCategory AzureOneLake { get; } = new ConnectionCategory(AzureOneLakeValue); + /// CosmosDb. + public static ConnectionCategory CosmosDb { get; } = new ConnectionCategory(CosmosDbValue); + /// CosmosDbMongoDbApi. + public static ConnectionCategory CosmosDbMongoDbApi { get; } = new ConnectionCategory(CosmosDbMongoDbApiValue); + /// AzureDataExplorer. + public static ConnectionCategory AzureDataExplorer { get; } = new ConnectionCategory(AzureDataExplorerValue); + /// AzureMariaDb. + public static ConnectionCategory AzureMariaDb { get; } = new ConnectionCategory(AzureMariaDbValue); + /// AzureDatabricksDeltaLake. + public static ConnectionCategory AzureDatabricksDeltaLake { get; } = new ConnectionCategory(AzureDatabricksDeltaLakeValue); + /// AzureSqlMi. + public static ConnectionCategory AzureSqlMi { get; } = new ConnectionCategory(AzureSqlMiValue); + /// AzureTableStorage. + public static ConnectionCategory AzureTableStorage { get; } = new ConnectionCategory(AzureTableStorageValue); + /// AmazonRdsForOracle. + public static ConnectionCategory AmazonRdsForOracle { get; } = new ConnectionCategory(AmazonRdsForOracleValue); + /// AmazonRdsForSqlServer. + public static ConnectionCategory AmazonRdsForSqlServer { get; } = new ConnectionCategory(AmazonRdsForSqlServerValue); + /// AmazonRedshift. + public static ConnectionCategory AmazonRedshift { get; } = new ConnectionCategory(AmazonRedshiftValue); + /// Db2. + public static ConnectionCategory Db2 { get; } = new ConnectionCategory(Db2Value); + /// Drill. + public static ConnectionCategory Drill { get; } = new ConnectionCategory(DrillValue); + /// GoogleBigQuery. + public static ConnectionCategory GoogleBigQuery { get; } = new ConnectionCategory(GoogleBigQueryValue); + /// Greenplum. + public static ConnectionCategory Greenplum { get; } = new ConnectionCategory(GreenplumValue); + /// Hbase. + public static ConnectionCategory Hbase { get; } = new ConnectionCategory(HbaseValue); + /// Hive. + public static ConnectionCategory Hive { get; } = new ConnectionCategory(HiveValue); + /// Impala. + public static ConnectionCategory Impala { get; } = new ConnectionCategory(ImpalaValue); + /// Informix. + public static ConnectionCategory Informix { get; } = new ConnectionCategory(InformixValue); + /// MariaDb. + public static ConnectionCategory MariaDb { get; } = new ConnectionCategory(MariaDbValue); + /// MicrosoftAccess. + public static ConnectionCategory MicrosoftAccess { get; } = new ConnectionCategory(MicrosoftAccessValue); + /// MySql. + public static ConnectionCategory MySql { get; } = new ConnectionCategory(MySqlValue); + /// Netezza. + public static ConnectionCategory Netezza { get; } = new ConnectionCategory(NetezzaValue); + /// Oracle. + public static ConnectionCategory Oracle { get; } = new ConnectionCategory(OracleValue); + /// Phoenix. + public static ConnectionCategory Phoenix { get; } = new ConnectionCategory(PhoenixValue); + /// PostgreSql. + public static ConnectionCategory PostgreSql { get; } = new ConnectionCategory(PostgreSqlValue); + /// Presto. + public static ConnectionCategory Presto { get; } = new ConnectionCategory(PrestoValue); + /// SapOpenHub. + public static ConnectionCategory SapOpenHub { get; } = new ConnectionCategory(SapOpenHubValue); + /// SapBw. + public static ConnectionCategory SapBw { get; } = new ConnectionCategory(SapBwValue); + /// SapHana. + public static ConnectionCategory SapHana { get; } = new ConnectionCategory(SapHanaValue); + /// SapTable. + public static ConnectionCategory SapTable { get; } = new ConnectionCategory(SapTableValue); + /// Spark. + public static ConnectionCategory Spark { get; } = new ConnectionCategory(SparkValue); + /// SqlServer. + public static ConnectionCategory SqlServer { get; } = new ConnectionCategory(SqlServerValue); + /// Sybase. + public static ConnectionCategory Sybase { get; } = new ConnectionCategory(SybaseValue); + /// Teradata. + public static ConnectionCategory Teradata { get; } = new ConnectionCategory(TeradataValue); + /// Vertica. + public static ConnectionCategory Vertica { get; } = new ConnectionCategory(VerticaValue); + /// Pinecone. + public static ConnectionCategory Pinecone { get; } = new ConnectionCategory(PineconeValue); + /// Cassandra. + public static ConnectionCategory Cassandra { get; } = new ConnectionCategory(CassandraValue); + /// Couchbase. + public static ConnectionCategory Couchbase { get; } = new ConnectionCategory(CouchbaseValue); + /// MongoDbV2. + public static ConnectionCategory MongoDbV2 { get; } = new ConnectionCategory(MongoDbV2Value); + /// MongoDbAtlas. + public static ConnectionCategory MongoDbAtlas { get; } = new ConnectionCategory(MongoDbAtlasValue); + /// AmazonS3Compatible. + public static ConnectionCategory AmazonS3Compatible { get; } = new ConnectionCategory(AmazonS3CompatibleValue); + /// FileServer. + public static ConnectionCategory FileServer { get; } = new ConnectionCategory(FileServerValue); + /// FtpServer. + public static ConnectionCategory FtpServer { get; } = new ConnectionCategory(FtpServerValue); + /// GoogleCloudStorage. + public static ConnectionCategory GoogleCloudStorage { get; } = new ConnectionCategory(GoogleCloudStorageValue); + /// Hdfs. + public static ConnectionCategory Hdfs { get; } = new ConnectionCategory(HdfsValue); + /// OracleCloudStorage. + public static ConnectionCategory OracleCloudStorage { get; } = new ConnectionCategory(OracleCloudStorageValue); + /// Sftp. + public static ConnectionCategory Sftp { get; } = new ConnectionCategory(SftpValue); + /// GenericHttp. + public static ConnectionCategory GenericHttp { get; } = new ConnectionCategory(GenericHttpValue); + /// ODataRest. + public static ConnectionCategory ODataRest { get; } = new ConnectionCategory(ODataRestValue); + /// Odbc. + public static ConnectionCategory Odbc { get; } = new ConnectionCategory(OdbcValue); + /// GenericRest. + public static ConnectionCategory GenericRest { get; } = new ConnectionCategory(GenericRestValue); + /// AmazonMws. + public static ConnectionCategory AmazonMws { get; } = new ConnectionCategory(AmazonMwsValue); + /// Concur. + public static ConnectionCategory Concur { get; } = new ConnectionCategory(ConcurValue); + /// Dynamics. + public static ConnectionCategory Dynamics { get; } = new ConnectionCategory(DynamicsValue); + /// DynamicsAx. + public static ConnectionCategory DynamicsAx { get; } = new ConnectionCategory(DynamicsAxValue); + /// DynamicsCrm. + public static ConnectionCategory DynamicsCrm { get; } = new ConnectionCategory(DynamicsCrmValue); + /// GoogleAdWords. + public static ConnectionCategory GoogleAdWords { get; } = new ConnectionCategory(GoogleAdWordsValue); + /// Hubspot. + public static ConnectionCategory Hubspot { get; } = new ConnectionCategory(HubspotValue); + /// Jira. + public static ConnectionCategory Jira { get; } = new ConnectionCategory(JiraValue); + /// Magento. + public static ConnectionCategory Magento { get; } = new ConnectionCategory(MagentoValue); + /// Marketo. + public static ConnectionCategory Marketo { get; } = new ConnectionCategory(MarketoValue); + /// Office365. + public static ConnectionCategory Office365 { get; } = new ConnectionCategory(Office365Value); + /// Eloqua. + public static ConnectionCategory Eloqua { get; } = new ConnectionCategory(EloquaValue); + /// Responsys. + public static ConnectionCategory Responsys { get; } = new ConnectionCategory(ResponsysValue); + /// OracleServiceCloud. + public static ConnectionCategory OracleServiceCloud { get; } = new ConnectionCategory(OracleServiceCloudValue); + /// PayPal. + public static ConnectionCategory PayPal { get; } = new ConnectionCategory(PayPalValue); + /// QuickBooks. + public static ConnectionCategory QuickBooks { get; } = new ConnectionCategory(QuickBooksValue); + /// Salesforce. + public static ConnectionCategory Salesforce { get; } = new ConnectionCategory(SalesforceValue); + /// SalesforceServiceCloud. + public static ConnectionCategory SalesforceServiceCloud { get; } = new ConnectionCategory(SalesforceServiceCloudValue); + /// SalesforceMarketingCloud. + public static ConnectionCategory SalesforceMarketingCloud { get; } = new ConnectionCategory(SalesforceMarketingCloudValue); + /// SapCloudForCustomer. + public static ConnectionCategory SapCloudForCustomer { get; } = new ConnectionCategory(SapCloudForCustomerValue); + /// SapEcc. + public static ConnectionCategory SapEcc { get; } = new ConnectionCategory(SapEccValue); + /// ServiceNow. + public static ConnectionCategory ServiceNow { get; } = new ConnectionCategory(ServiceNowValue); + /// SharePointOnlineList. + public static ConnectionCategory SharePointOnlineList { get; } = new ConnectionCategory(SharePointOnlineListValue); + /// Shopify. + public static ConnectionCategory Shopify { get; } = new ConnectionCategory(ShopifyValue); + /// Square. + public static ConnectionCategory Square { get; } = new ConnectionCategory(SquareValue); + /// WebTable. + public static ConnectionCategory WebTable { get; } = new ConnectionCategory(WebTableValue); + /// Xero. + public static ConnectionCategory Xero { get; } = new ConnectionCategory(XeroValue); + /// Zoho. + public static ConnectionCategory Zoho { get; } = new ConnectionCategory(ZohoValue); + /// GenericContainerRegistry. + public static ConnectionCategory GenericContainerRegistry { get; } = new ConnectionCategory(GenericContainerRegistryValue); + /// Elasticsearch. + public static ConnectionCategory Elasticsearch { get; } = new ConnectionCategory(ElasticsearchValue); + /// OpenAI. + public static ConnectionCategory OpenAI { get; } = new ConnectionCategory(OpenAIValue); + /// Serp. + public static ConnectionCategory Serp { get; } = new ConnectionCategory(SerpValue); + /// BingLLMSearch. + public static ConnectionCategory BingLLMSearch { get; } = new ConnectionCategory(BingLLMSearchValue); + /// Serverless. + public static ConnectionCategory Serverless { get; } = new ConnectionCategory(ServerlessValue); + /// ManagedOnlineEndpoint. + public static ConnectionCategory ManagedOnlineEndpoint { get; } = new ConnectionCategory(ManagedOnlineEndpointValue); + /// Determines if two values are the same. + public static bool operator ==(ConnectionCategory left, ConnectionCategory right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ConnectionCategory left, ConnectionCategory right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ConnectionCategory(string value) => new ConnectionCategory(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ConnectionCategory other && Equals(other); + /// + public bool Equals(ConnectionCategory 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/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionGroup.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionGroup.cs new file mode 100644 index 000000000000..9e45593c671f --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionGroup.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.CognitiveServices.Models +{ + /// Group based on connection category. + public readonly partial struct ConnectionGroup : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ConnectionGroup(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AzureValue = "Azure"; + private const string AzureAIValue = "AzureAI"; + private const string DatabaseValue = "Database"; + private const string NoSQLValue = "NoSQL"; + private const string FileValue = "File"; + private const string GenericProtocolValue = "GenericProtocol"; + private const string ServicesAndAppsValue = "ServicesAndApps"; + + /// Azure. + public static ConnectionGroup Azure { get; } = new ConnectionGroup(AzureValue); + /// AzureAI. + public static ConnectionGroup AzureAI { get; } = new ConnectionGroup(AzureAIValue); + /// Database. + public static ConnectionGroup Database { get; } = new ConnectionGroup(DatabaseValue); + /// NoSQL. + public static ConnectionGroup NoSQL { get; } = new ConnectionGroup(NoSQLValue); + /// File. + public static ConnectionGroup File { get; } = new ConnectionGroup(FileValue); + /// GenericProtocol. + public static ConnectionGroup GenericProtocol { get; } = new ConnectionGroup(GenericProtocolValue); + /// ServicesAndApps. + public static ConnectionGroup ServicesAndApps { get; } = new ConnectionGroup(ServicesAndAppsValue); + /// Determines if two values are the same. + public static bool operator ==(ConnectionGroup left, ConnectionGroup right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ConnectionGroup left, ConnectionGroup right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ConnectionGroup(string value) => new ConnectionGroup(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ConnectionGroup other && Equals(other); + /// + public bool Equals(ConnectionGroup 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/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionManagedIdentity.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionManagedIdentity.Serialization.cs new file mode 100644 index 000000000000..24b0a04d1c21 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionManagedIdentity.Serialization.cs @@ -0,0 +1,204 @@ +// 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.CognitiveServices.Models +{ + public partial class ConnectionManagedIdentity : 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(ConnectionManagedIdentity)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ClientId)) + { + writer.WritePropertyName("clientId"u8); + writer.WriteStringValue(ClientId); + } + if (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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectionManagedIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectionManagedIdentity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectionManagedIdentity(document.RootElement, options); + } + + internal static ConnectionManagedIdentity DeserializeConnectionManagedIdentity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string clientId = default; + string resourceId = 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("resourceId"u8)) + { + resourceId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectionManagedIdentity(clientId, 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(nameof(ClientId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" clientId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ClientId)) + { + builder.Append(" clientId: "); + if (ClientId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ClientId}'''"); + } + else + { + builder.AppendLine($"'{ClientId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ResourceId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" resourceId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ResourceId)) + { + builder.Append(" resourceId: "); + if (ResourceId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ResourceId}'''"); + } + else + { + builder.AppendLine($"'{ResourceId}'"); + } + } + } + + 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(ConnectionManagedIdentity)} does not support writing '{options.Format}' format."); + } + } + + ConnectionManagedIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeConnectionManagedIdentity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectionManagedIdentity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionManagedIdentity.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionManagedIdentity.cs new file mode 100644 index 000000000000..4243da8f8552 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionManagedIdentity.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.CognitiveServices.Models +{ + /// The ConnectionManagedIdentity. + public partial class ConnectionManagedIdentity + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// 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 ConnectionManagedIdentity() + { + } + + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal ConnectionManagedIdentity(string clientId, string resourceId, IDictionary serializedAdditionalRawData) + { + ClientId = clientId; + ResourceId = resourceId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the client id. + [WirePath("clientId")] + public string ClientId { get; set; } + /// Gets or sets the resource id. + [WirePath("resourceId")] + public string ResourceId { get; set; } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionOAuth2.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionOAuth2.Serialization.cs new file mode 100644 index 000000000000..c519a00eca7a --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionOAuth2.Serialization.cs @@ -0,0 +1,405 @@ +// 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.CognitiveServices.Models +{ + public partial class ConnectionOAuth2 : 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(ConnectionOAuth2)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(AuthUri)) + { + writer.WritePropertyName("authUrl"u8); + writer.WriteStringValue(AuthUri.AbsoluteUri); + } + if (Optional.IsDefined(ClientId)) + { + writer.WritePropertyName("clientId"u8); + writer.WriteStringValue(ClientId.Value); + } + if (Optional.IsDefined(ClientSecret)) + { + writer.WritePropertyName("clientSecret"u8); + writer.WriteStringValue(ClientSecret); + } + if (Optional.IsDefined(DeveloperToken)) + { + writer.WritePropertyName("developerToken"u8); + writer.WriteStringValue(DeveloperToken); + } + if (Optional.IsDefined(Password)) + { + writer.WritePropertyName("password"u8); + writer.WriteStringValue(Password); + } + if (Optional.IsDefined(RefreshToken)) + { + writer.WritePropertyName("refreshToken"u8); + writer.WriteStringValue(RefreshToken); + } + if (Optional.IsDefined(TenantId)) + { + writer.WritePropertyName("tenantId"u8); + writer.WriteStringValue(TenantId.Value); + } + if (Optional.IsDefined(Username)) + { + writer.WritePropertyName("username"u8); + writer.WriteStringValue(Username); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectionOAuth2 IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectionOAuth2)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectionOAuth2(document.RootElement, options); + } + + internal static ConnectionOAuth2 DeserializeConnectionOAuth2(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri authUrl = default; + Guid? clientId = default; + string clientSecret = default; + string developerToken = default; + string password = default; + string refreshToken = default; + Guid? tenantId = default; + string username = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("clientId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + clientId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("clientSecret"u8)) + { + clientSecret = property.Value.GetString(); + continue; + } + if (property.NameEquals("developerToken"u8)) + { + developerToken = property.Value.GetString(); + continue; + } + if (property.NameEquals("password"u8)) + { + password = property.Value.GetString(); + continue; + } + if (property.NameEquals("refreshToken"u8)) + { + refreshToken = property.Value.GetString(); + continue; + } + if (property.NameEquals("tenantId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tenantId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("username"u8)) + { + username = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectionOAuth2( + authUrl, + clientId, + clientSecret, + developerToken, + password, + refreshToken, + tenantId, + username, + 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(AuthUri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" authUrl: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AuthUri)) + { + builder.Append(" authUrl: "); + builder.AppendLine($"'{AuthUri.AbsoluteUri}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ClientId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" clientId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ClientId)) + { + builder.Append(" clientId: "); + builder.AppendLine($"'{ClientId.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ClientSecret), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" clientSecret: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ClientSecret)) + { + builder.Append(" clientSecret: "); + if (ClientSecret.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ClientSecret}'''"); + } + else + { + builder.AppendLine($"'{ClientSecret}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DeveloperToken), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" developerToken: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DeveloperToken)) + { + builder.Append(" developerToken: "); + if (DeveloperToken.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{DeveloperToken}'''"); + } + else + { + builder.AppendLine($"'{DeveloperToken}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Password), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" password: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Password)) + { + builder.Append(" password: "); + if (Password.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Password}'''"); + } + else + { + builder.AppendLine($"'{Password}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RefreshToken), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" refreshToken: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RefreshToken)) + { + builder.Append(" refreshToken: "); + if (RefreshToken.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{RefreshToken}'''"); + } + else + { + builder.AppendLine($"'{RefreshToken}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TenantId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tenantId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TenantId)) + { + builder.Append(" tenantId: "); + builder.AppendLine($"'{TenantId.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Username), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" username: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Username)) + { + builder.Append(" username: "); + if (Username.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Username}'''"); + } + else + { + builder.AppendLine($"'{Username}'"); + } + } + } + + 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(ConnectionOAuth2)} does not support writing '{options.Format}' format."); + } + } + + ConnectionOAuth2 IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeConnectionOAuth2(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectionOAuth2)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionOAuth2.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionOAuth2.cs new file mode 100644 index 000000000000..f10d7f61ce44 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionOAuth2.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.ResourceManager.CognitiveServices.Models +{ + /// + /// ClientId and ClientSecret are required. Other properties are optional + /// depending on each OAuth2 provider's implementation. + /// + public partial class ConnectionOAuth2 + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// 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 ConnectionOAuth2() + { + } + + /// Initializes a new instance of . + /// Required by Concur connection category. + /// Client id in the format of UUID. + /// + /// Required by GoogleAdWords connection category. + /// + /// + /// Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, Xero, Zoho + /// where user needs to get RefreshToken offline + /// + /// Required by QuickBooks and Xero connection categories. + /// + /// Concur, ServiceNow auth server AccessToken grant type is 'Password' + /// which requires UsernamePassword + /// + /// Keeps track of any properties unknown to the library. + internal ConnectionOAuth2(Uri authUri, Guid? clientId, string clientSecret, string developerToken, string password, string refreshToken, Guid? tenantId, string username, IDictionary serializedAdditionalRawData) + { + AuthUri = authUri; + ClientId = clientId; + ClientSecret = clientSecret; + DeveloperToken = developerToken; + Password = password; + RefreshToken = refreshToken; + TenantId = tenantId; + Username = username; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Required by Concur connection category. + [WirePath("authUrl")] + public Uri AuthUri { get; set; } + /// Client id in the format of UUID. + [WirePath("clientId")] + public Guid? ClientId { get; set; } + /// Gets or sets the client secret. + [WirePath("clientSecret")] + public string ClientSecret { get; set; } + /// Required by GoogleAdWords connection category. + [WirePath("developerToken")] + public string DeveloperToken { get; set; } + /// Gets or sets the password. + [WirePath("password")] + public string Password { get; set; } + /// + /// Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, Xero, Zoho + /// where user needs to get RefreshToken offline + /// + [WirePath("refreshToken")] + public string RefreshToken { get; set; } + /// Required by QuickBooks and Xero connection categories. + [WirePath("tenantId")] + public Guid? TenantId { get; set; } + /// + /// Concur, ServiceNow auth server AccessToken grant type is 'Password' + /// which requires UsernamePassword + /// + [WirePath("username")] + public string Username { get; set; } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionPersonalAccessToken.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionPersonalAccessToken.Serialization.cs new file mode 100644 index 000000000000..1132055095ec --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionPersonalAccessToken.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; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CognitiveServices.Models +{ + internal partial class ConnectionPersonalAccessToken : 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(ConnectionPersonalAccessToken)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Pat)) + { + writer.WritePropertyName("pat"u8); + writer.WriteStringValue(Pat); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectionPersonalAccessToken IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectionPersonalAccessToken)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectionPersonalAccessToken(document.RootElement, options); + } + + internal static ConnectionPersonalAccessToken DeserializeConnectionPersonalAccessToken(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string pat = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("pat"u8)) + { + pat = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectionPersonalAccessToken(pat, 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(Pat), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" pat: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Pat)) + { + builder.Append(" pat: "); + if (Pat.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Pat}'''"); + } + else + { + builder.AppendLine($"'{Pat}'"); + } + } + } + + 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(ConnectionPersonalAccessToken)} does not support writing '{options.Format}' format."); + } + } + + ConnectionPersonalAccessToken IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeConnectionPersonalAccessToken(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectionPersonalAccessToken)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionPersonalAccessToken.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionPersonalAccessToken.cs new file mode 100644 index 000000000000..f9c57241869a --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionPersonalAccessToken.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.CognitiveServices.Models +{ + /// The ConnectionPersonalAccessToken. + internal partial class ConnectionPersonalAccessToken + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// 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 ConnectionPersonalAccessToken() + { + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + internal ConnectionPersonalAccessToken(string pat, IDictionary serializedAdditionalRawData) + { + Pat = pat; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the pat. + [WirePath("pat")] + public string Pat { get; set; } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionPropertiesV2.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionPropertiesV2.Serialization.cs new file mode 100644 index 000000000000..23c2ad298f83 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionPropertiesV2.Serialization.cs @@ -0,0 +1,473 @@ +// 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.CognitiveServices.Models +{ + [PersistableModelProxy(typeof(UnknownConnectionPropertiesV2))] + public partial class ConnectionPropertiesV2 : 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(ConnectionPropertiesV2)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("authType"u8); + writer.WriteStringValue(AuthType.ToString()); + if (Optional.IsDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(CreatedByWorkspaceArmId)) + { + writer.WritePropertyName("createdByWorkspaceArmId"u8); + writer.WriteStringValue(CreatedByWorkspaceArmId); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } + if (Optional.IsDefined(ExpiryOn)) + { + writer.WritePropertyName("expiryTime"u8); + writer.WriteStringValue(ExpiryOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(Group)) + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + 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 (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteStringValue(Target); + } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectionPropertiesV2 IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectionPropertiesV2)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectionPropertiesV2(document.RootElement, options); + } + + internal static ConnectionPropertiesV2 DeserializeConnectionPropertiesV2(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("authType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "AAD": return AADAuthTypeConnectionProperties.DeserializeAADAuthTypeConnectionProperties(element, options); + case "AccessKey": return AccessKeyAuthTypeConnectionProperties.DeserializeAccessKeyAuthTypeConnectionProperties(element, options); + case "AccountKey": return AccountKeyAuthTypeConnectionProperties.DeserializeAccountKeyAuthTypeConnectionProperties(element, options); + case "ApiKey": return ApiKeyAuthConnectionProperties.DeserializeApiKeyAuthConnectionProperties(element, options); + case "CustomKeys": return CustomKeysConnectionProperties.DeserializeCustomKeysConnectionProperties(element, options); + case "ManagedIdentity": return ManagedIdentityAuthTypeConnectionProperties.DeserializeManagedIdentityAuthTypeConnectionProperties(element, options); + case "None": return NoneAuthTypeConnectionProperties.DeserializeNoneAuthTypeConnectionProperties(element, options); + case "OAuth2": return OAuth2AuthTypeConnectionProperties.DeserializeOAuth2AuthTypeConnectionProperties(element, options); + case "PAT": return PATAuthTypeConnectionProperties.DeserializePATAuthTypeConnectionProperties(element, options); + case "SAS": return SASAuthTypeConnectionProperties.DeserializeSASAuthTypeConnectionProperties(element, options); + case "ServicePrincipal": return ServicePrincipalAuthTypeConnectionProperties.DeserializeServicePrincipalAuthTypeConnectionProperties(element, options); + case "UsernamePassword": return UsernamePasswordAuthTypeConnectionProperties.DeserializeUsernamePasswordAuthTypeConnectionProperties(element, options); + } + } + return UnknownConnectionPropertiesV2.DeserializeUnknownConnectionPropertiesV2(element, options); + } + + 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(AuthType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" authType: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" authType: "); + builder.AppendLine($"'{AuthType.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Category), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" category: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Category)) + { + builder.Append(" category: "); + builder.AppendLine($"'{Category.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CreatedByWorkspaceArmId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" createdByWorkspaceArmId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CreatedByWorkspaceArmId)) + { + builder.Append(" createdByWorkspaceArmId: "); + builder.AppendLine($"'{CreatedByWorkspaceArmId.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" error: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Error)) + { + builder.Append(" error: "); + if (Error.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Error}'''"); + } + else + { + builder.AppendLine($"'{Error}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExpiryOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" expiryTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ExpiryOn)) + { + builder.Append(" expiryTime: "); + var formattedDateTimeString = TypeFormatters.ToString(ExpiryOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Group), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" group: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Group)) + { + builder.Append(" group: "); + builder.AppendLine($"'{Group.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsSharedToAll), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" isSharedToAll: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IsSharedToAll)) + { + builder.Append(" isSharedToAll: "); + var boolValue = IsSharedToAll.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Metadata), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" metadata: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Metadata)) + { + if (Metadata.Any()) + { + builder.Append(" metadata: "); + builder.AppendLine("{"); + foreach (var item in Metadata) + { + 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(" }"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PeRequirement), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" peRequirement: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PeRequirement)) + { + builder.Append(" peRequirement: "); + builder.AppendLine($"'{PeRequirement.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PeStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" peStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PeStatus)) + { + builder.Append(" peStatus: "); + builder.AppendLine($"'{PeStatus.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SharedUserList), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sharedUserList: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(SharedUserList)) + { + if (SharedUserList.Any()) + { + builder.Append(" sharedUserList: "); + builder.AppendLine("["); + foreach (var item in SharedUserList) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Target), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" target: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Target)) + { + builder.Append(" target: "); + if (Target.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Target}'''"); + } + else + { + builder.AppendLine($"'{Target}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UseWorkspaceManagedIdentity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" useWorkspaceManagedIdentity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + builder.Append(" useWorkspaceManagedIdentity: "); + var boolValue = UseWorkspaceManagedIdentity.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(ConnectionPropertiesV2)} does not support writing '{options.Format}' format."); + } + } + + ConnectionPropertiesV2 IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeConnectionPropertiesV2(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectionPropertiesV2)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionPropertiesV2.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionPropertiesV2.cs new file mode 100644 index 000000000000..e7c2002a07e4 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionPropertiesV2.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 Azure.Core; + +namespace Azure.ResourceManager.CognitiveServices.Models +{ + /// + /// Connection property base schema. + /// 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 ConnectionPropertiesV2 + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload 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 ConnectionPropertiesV2() + { + Metadata = new ChangeTrackingDictionary(); + SharedUserList = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Authentication type of the connection target. + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + internal ConnectionPropertiesV2(ConnectionAuthType authType, ConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData) + { + AuthType = authType; + Category = category; + CreatedByWorkspaceArmId = createdByWorkspaceArmId; + Error = error; + ExpiryOn = expiryOn; + Group = group; + IsSharedToAll = isSharedToAll; + Metadata = metadata; + PeRequirement = peRequirement; + PeStatus = peStatus; + SharedUserList = sharedUserList; + Target = target; + UseWorkspaceManagedIdentity = useWorkspaceManagedIdentity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Authentication type of the connection target. + internal ConnectionAuthType AuthType { get; set; } + /// Category of the connection. + [WirePath("category")] + public ConnectionCategory? Category { get; set; } + /// Gets the created by workspace arm id. + [WirePath("createdByWorkspaceArmId")] + public ResourceIdentifier CreatedByWorkspaceArmId { get; } + /// Gets or sets the error. + [WirePath("error")] + public string Error { get; set; } + /// Gets or sets the expiry on. + [WirePath("expiryTime")] + public DateTimeOffset? ExpiryOn { get; set; } + /// Group based on connection category. + [WirePath("group")] + public ConnectionGroup? Group { get; } + /// Gets or sets the is shared to all. + [WirePath("isSharedToAll")] + public bool? IsSharedToAll { get; set; } + /// Store user metadata for this connection. + [WirePath("metadata")] + public IDictionary Metadata { get; } + /// Gets or sets the pe requirement. + [WirePath("peRequirement")] + public ManagedPERequirement? PeRequirement { get; set; } + /// Gets or sets the pe status. + [WirePath("peStatus")] + public ManagedPEStatus? PeStatus { get; set; } + /// Gets the shared user list. + [WirePath("sharedUserList")] + public IList SharedUserList { get; } + /// Gets or sets the target. + [WirePath("target")] + public string Target { get; set; } + /// Gets or sets the use workspace managed identity. + [WirePath("useWorkspaceManagedIdentity")] + public bool? UseWorkspaceManagedIdentity { get; set; } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionPropertiesV2BasicResourceArmPaginatedResult.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionPropertiesV2BasicResourceArmPaginatedResult.Serialization.cs new file mode 100644 index 000000000000..5803852886c1 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionPropertiesV2BasicResourceArmPaginatedResult.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.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CognitiveServices.Models +{ + internal partial class ConnectionPropertiesV2BasicResourceArmPaginatedResult : 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(ConnectionPropertiesV2BasicResourceArmPaginatedResult)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectionPropertiesV2BasicResourceArmPaginatedResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectionPropertiesV2BasicResourceArmPaginatedResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectionPropertiesV2BasicResourceArmPaginatedResult(document.RootElement, options); + } + + internal static ConnectionPropertiesV2BasicResourceArmPaginatedResult DeserializeConnectionPropertiesV2BasicResourceArmPaginatedResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nextLink = default; + IReadOnlyList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ConnectionPropertiesV2BasicResourceData.DeserializeConnectionPropertiesV2BasicResourceData(item, options)); + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectionPropertiesV2BasicResourceArmPaginatedResult(nextLink, value ?? 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(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}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + 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(ConnectionPropertiesV2BasicResourceArmPaginatedResult)} does not support writing '{options.Format}' format."); + } + } + + ConnectionPropertiesV2BasicResourceArmPaginatedResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeConnectionPropertiesV2BasicResourceArmPaginatedResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectionPropertiesV2BasicResourceArmPaginatedResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionPropertiesV2BasicResourceArmPaginatedResult.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionPropertiesV2BasicResourceArmPaginatedResult.cs new file mode 100644 index 000000000000..bed5f0bad9c9 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionPropertiesV2BasicResourceArmPaginatedResult.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.CognitiveServices.Models +{ + /// The ConnectionPropertiesV2BasicResourceArmPaginatedResult. + internal partial class ConnectionPropertiesV2BasicResourceArmPaginatedResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// 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 ConnectionPropertiesV2BasicResourceArmPaginatedResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal ConnectionPropertiesV2BasicResourceArmPaginatedResult(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + NextLink = nextLink; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the next link. + public string NextLink { get; } + /// Gets the value. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionServicePrincipal.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionServicePrincipal.Serialization.cs new file mode 100644 index 000000000000..8fb9ff99ee87 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionServicePrincipal.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; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CognitiveServices.Models +{ + public partial class ConnectionServicePrincipal : 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(ConnectionServicePrincipal)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ClientId)) + { + writer.WritePropertyName("clientId"u8); + writer.WriteStringValue(ClientId); + } + if (Optional.IsDefined(ClientSecret)) + { + writer.WritePropertyName("clientSecret"u8); + writer.WriteStringValue(ClientSecret); + } + if (Optional.IsDefined(TenantId)) + { + writer.WritePropertyName("tenantId"u8); + writer.WriteStringValue(TenantId.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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectionServicePrincipal IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectionServicePrincipal)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectionServicePrincipal(document.RootElement, options); + } + + internal static ConnectionServicePrincipal DeserializeConnectionServicePrincipal(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string clientId = default; + string clientSecret = default; + Guid? 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("clientSecret"u8)) + { + clientSecret = property.Value.GetString(); + continue; + } + if (property.NameEquals("tenantId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tenantId = property.Value.GetGuid(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectionServicePrincipal(clientId, clientSecret, tenantId, 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(ClientId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" clientId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ClientId)) + { + builder.Append(" clientId: "); + if (ClientId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ClientId}'''"); + } + else + { + builder.AppendLine($"'{ClientId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ClientSecret), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" clientSecret: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ClientSecret)) + { + builder.Append(" clientSecret: "); + if (ClientSecret.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ClientSecret}'''"); + } + else + { + builder.AppendLine($"'{ClientSecret}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TenantId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tenantId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TenantId)) + { + builder.Append(" tenantId: "); + builder.AppendLine($"'{TenantId.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(ConnectionServicePrincipal)} does not support writing '{options.Format}' format."); + } + } + + ConnectionServicePrincipal IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeConnectionServicePrincipal(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectionServicePrincipal)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionServicePrincipal.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionServicePrincipal.cs new file mode 100644 index 000000000000..0e6cf256eb73 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionServicePrincipal.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.CognitiveServices.Models +{ + /// The ConnectionServicePrincipal. + public partial class ConnectionServicePrincipal + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// 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 ConnectionServicePrincipal() + { + } + + /// Initializes a new instance of . + /// + /// + /// + /// Keeps track of any properties unknown to the library. + internal ConnectionServicePrincipal(string clientId, string clientSecret, Guid? tenantId, IDictionary serializedAdditionalRawData) + { + ClientId = clientId; + ClientSecret = clientSecret; + TenantId = tenantId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the client id. + [WirePath("clientId")] + public string ClientId { get; set; } + /// Gets or sets the client secret. + [WirePath("clientSecret")] + public string ClientSecret { get; set; } + /// Gets or sets the tenant id. + [WirePath("tenantId")] + public Guid? TenantId { get; set; } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionSharedAccessSignature.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionSharedAccessSignature.Serialization.cs new file mode 100644 index 000000000000..f2cfb1541d5d --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionSharedAccessSignature.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; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CognitiveServices.Models +{ + internal partial class ConnectionSharedAccessSignature : 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(ConnectionSharedAccessSignature)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Sas)) + { + writer.WritePropertyName("sas"u8); + writer.WriteStringValue(Sas); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectionSharedAccessSignature IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectionSharedAccessSignature)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectionSharedAccessSignature(document.RootElement, options); + } + + internal static ConnectionSharedAccessSignature DeserializeConnectionSharedAccessSignature(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string sas = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sas"u8)) + { + sas = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectionSharedAccessSignature(sas, 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(Sas), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sas: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Sas)) + { + builder.Append(" sas: "); + if (Sas.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Sas}'''"); + } + else + { + builder.AppendLine($"'{Sas}'"); + } + } + } + + 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(ConnectionSharedAccessSignature)} does not support writing '{options.Format}' format."); + } + } + + ConnectionSharedAccessSignature IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeConnectionSharedAccessSignature(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectionSharedAccessSignature)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionSharedAccessSignature.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionSharedAccessSignature.cs new file mode 100644 index 000000000000..936bcc3986ce --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionSharedAccessSignature.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.CognitiveServices.Models +{ + /// The ConnectionSharedAccessSignature. + internal partial class ConnectionSharedAccessSignature + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// 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 ConnectionSharedAccessSignature() + { + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + internal ConnectionSharedAccessSignature(string sas, IDictionary serializedAdditionalRawData) + { + Sas = sas; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the sas. + [WirePath("sas")] + public string Sas { get; set; } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionUpdateContent.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionUpdateContent.Serialization.cs new file mode 100644 index 000000000000..04ae019982a9 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionUpdateContent.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.CognitiveServices.Models +{ + public partial class ConnectionUpdateContent : 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(ConnectionUpdateContent)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectionUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectionUpdateContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectionUpdateContent(document.RootElement, options); + } + + internal static ConnectionUpdateContent DeserializeConnectionUpdateContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConnectionPropertiesV2 properties = 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 = ConnectionPropertiesV2.DeserializeConnectionPropertiesV2(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectionUpdateContent(properties, 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(ConnectionUpdateContent)} does not support writing '{options.Format}' format."); + } + } + + ConnectionUpdateContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeConnectionUpdateContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectionUpdateContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionUpdateContent.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionUpdateContent.cs new file mode 100644 index 000000000000..a0b90899a9b2 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionUpdateContent.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CognitiveServices.Models +{ + /// The properties that the Cognitive services connection will be updated with. + public partial class ConnectionUpdateContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// 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 ConnectionUpdateContent() + { + } + + /// Initializes a new instance of . + /// + /// The properties that the Cognitive services connection will be updated with. + /// 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 ConnectionUpdateContent(ConnectionPropertiesV2 properties, IDictionary serializedAdditionalRawData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// The properties that the Cognitive services connection will be updated with. + /// 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 . + /// + [WirePath("properties")] + public ConnectionPropertiesV2 Properties { get; set; } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionUsernamePassword.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionUsernamePassword.Serialization.cs new file mode 100644 index 000000000000..5a32d1f3c042 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionUsernamePassword.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; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CognitiveServices.Models +{ + public partial class ConnectionUsernamePassword : 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(ConnectionUsernamePassword)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Password)) + { + writer.WritePropertyName("password"u8); + writer.WriteStringValue(Password); + } + if (Optional.IsDefined(SecurityToken)) + { + writer.WritePropertyName("securityToken"u8); + writer.WriteStringValue(SecurityToken); + } + if (Optional.IsDefined(Username)) + { + writer.WritePropertyName("username"u8); + writer.WriteStringValue(Username); + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ConnectionUsernamePassword IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectionUsernamePassword)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectionUsernamePassword(document.RootElement, options); + } + + internal static ConnectionUsernamePassword DeserializeConnectionUsernamePassword(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string password = default; + string securityToken = default; + string username = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("password"u8)) + { + password = property.Value.GetString(); + continue; + } + if (property.NameEquals("securityToken"u8)) + { + securityToken = property.Value.GetString(); + continue; + } + if (property.NameEquals("username"u8)) + { + username = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectionUsernamePassword(password, securityToken, username, 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(Password), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" password: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Password)) + { + builder.Append(" password: "); + if (Password.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Password}'''"); + } + else + { + builder.AppendLine($"'{Password}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SecurityToken), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" securityToken: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SecurityToken)) + { + builder.Append(" securityToken: "); + if (SecurityToken.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{SecurityToken}'''"); + } + else + { + builder.AppendLine($"'{SecurityToken}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Username), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" username: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Username)) + { + builder.Append(" username: "); + if (Username.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Username}'''"); + } + else + { + builder.AppendLine($"'{Username}'"); + } + } + } + + 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(ConnectionUsernamePassword)} does not support writing '{options.Format}' format."); + } + } + + ConnectionUsernamePassword IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeConnectionUsernamePassword(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectionUsernamePassword)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionUsernamePassword.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionUsernamePassword.cs new file mode 100644 index 000000000000..d61bc4a975a3 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ConnectionUsernamePassword.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.CognitiveServices.Models +{ + /// The ConnectionUsernamePassword. + public partial class ConnectionUsernamePassword + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// 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 ConnectionUsernamePassword() + { + } + + /// Initializes a new instance of . + /// + /// Optional, required by connections like SalesForce for extra security in addition to UsernamePassword. + /// + /// Keeps track of any properties unknown to the library. + internal ConnectionUsernamePassword(string password, string securityToken, string username, IDictionary serializedAdditionalRawData) + { + Password = password; + SecurityToken = securityToken; + Username = username; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the password. + [WirePath("password")] + public string Password { get; set; } + /// Optional, required by connections like SalesForce for extra security in addition to UsernamePassword. + [WirePath("securityToken")] + public string SecurityToken { get; set; } + /// Gets or sets the username. + [WirePath("username")] + public string Username { get; set; } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CustomKeys.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CustomKeys.Serialization.cs new file mode 100644 index 000000000000..440159d6674c --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CustomKeys.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.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CognitiveServices.Models +{ + internal partial class CustomKeys : 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(CustomKeys)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Keys)) + { + writer.WritePropertyName("keys"u8); + writer.WriteStartObject(); + foreach (var item in Keys) + { + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CustomKeys IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomKeys)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomKeys(document.RootElement, options); + } + + internal static CustomKeys DeserializeCustomKeys(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary keys = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("keys"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()); + } + keys = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomKeys(keys ?? new ChangeTrackingDictionary(), 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(Keys), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" keys: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Keys)) + { + if (Keys.Any()) + { + builder.Append(" keys: "); + builder.AppendLine("{"); + foreach (var item in Keys) + { + 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()); + } + + BinaryData 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(CustomKeys)} does not support writing '{options.Format}' format."); + } + } + + CustomKeys IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCustomKeys(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomKeys)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CustomKeys.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CustomKeys.cs new file mode 100644 index 000000000000..0315ca004831 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CustomKeys.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.CognitiveServices.Models +{ + /// Custom Keys credential object. + internal partial class CustomKeys + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// 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 CustomKeys() + { + Keys = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Dictionary of <string>. + /// Keeps track of any properties unknown to the library. + internal CustomKeys(IDictionary keys, IDictionary serializedAdditionalRawData) + { + Keys = keys; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Dictionary of <string>. + [WirePath("keys")] + public IDictionary Keys { get; } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CustomKeysConnectionProperties.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CustomKeysConnectionProperties.Serialization.cs new file mode 100644 index 000000000000..c1eed657fee3 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CustomKeysConnectionProperties.Serialization.cs @@ -0,0 +1,553 @@ +// 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.CognitiveServices.Models +{ + public partial class CustomKeysConnectionProperties : 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(CustomKeysConnectionProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Credentials)) + { + writer.WritePropertyName("credentials"u8); + writer.WriteObjectValue(Credentials, options); + } + } + + CustomKeysConnectionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomKeysConnectionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomKeysConnectionProperties(document.RootElement, options); + } + + internal static CustomKeysConnectionProperties DeserializeCustomKeysConnectionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CustomKeys credentials = default; + ConnectionAuthType authType = default; + ConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("credentials"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + credentials = CustomKeys.DeserializeCustomKeys(property.Value, options); + continue; + } + if (property.NameEquals("authType"u8)) + { + authType = new ConnectionAuthType(property.Value.GetString()); + continue; + } + if (property.NameEquals("category"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + category = new ConnectionCategory(property.Value.GetString()); + continue; + } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } + if (property.NameEquals("expiryTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expiryTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + 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 (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomKeysConnectionProperties( + authType, + category, + createdByWorkspaceArmId, + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData, + credentials); + } + + 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("CredentialsKeys", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" credentials: "); + builder.AppendLine("{"); + builder.Append(" keys: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(Credentials)) + { + builder.Append(" credentials: "); + BicepSerializationHelpers.AppendChildObject(builder, Credentials, options, 2, false, " credentials: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AuthType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" authType: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" authType: "); + builder.AppendLine($"'{AuthType.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Category), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" category: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Category)) + { + builder.Append(" category: "); + builder.AppendLine($"'{Category.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CreatedByWorkspaceArmId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" createdByWorkspaceArmId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CreatedByWorkspaceArmId)) + { + builder.Append(" createdByWorkspaceArmId: "); + builder.AppendLine($"'{CreatedByWorkspaceArmId.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" error: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Error)) + { + builder.Append(" error: "); + if (Error.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Error}'''"); + } + else + { + builder.AppendLine($"'{Error}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExpiryOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" expiryTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ExpiryOn)) + { + builder.Append(" expiryTime: "); + var formattedDateTimeString = TypeFormatters.ToString(ExpiryOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Group), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" group: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Group)) + { + builder.Append(" group: "); + builder.AppendLine($"'{Group.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsSharedToAll), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" isSharedToAll: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IsSharedToAll)) + { + builder.Append(" isSharedToAll: "); + var boolValue = IsSharedToAll.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Metadata), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" metadata: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Metadata)) + { + if (Metadata.Any()) + { + builder.Append(" metadata: "); + builder.AppendLine("{"); + foreach (var item in Metadata) + { + 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(" }"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PeRequirement), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" peRequirement: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PeRequirement)) + { + builder.Append(" peRequirement: "); + builder.AppendLine($"'{PeRequirement.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PeStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" peStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PeStatus)) + { + builder.Append(" peStatus: "); + builder.AppendLine($"'{PeStatus.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SharedUserList), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sharedUserList: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(SharedUserList)) + { + if (SharedUserList.Any()) + { + builder.Append(" sharedUserList: "); + builder.AppendLine("["); + foreach (var item in SharedUserList) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Target), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" target: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Target)) + { + builder.Append(" target: "); + if (Target.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Target}'''"); + } + else + { + builder.AppendLine($"'{Target}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UseWorkspaceManagedIdentity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" useWorkspaceManagedIdentity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + builder.Append(" useWorkspaceManagedIdentity: "); + var boolValue = UseWorkspaceManagedIdentity.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(CustomKeysConnectionProperties)} does not support writing '{options.Format}' format."); + } + } + + CustomKeysConnectionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCustomKeysConnectionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomKeysConnectionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CustomKeysConnectionProperties.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CustomKeysConnectionProperties.cs new file mode 100644 index 000000000000..e55a232ab3ee --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/CustomKeysConnectionProperties.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; +using Azure.Core; + +namespace Azure.ResourceManager.CognitiveServices.Models +{ + /// + /// Category:= CustomKeys + /// AuthType:= CustomKeys (as type discriminator) + /// Credentials:= {CustomKeys} as CustomKeys + /// Target:= {any value} + /// Use Metadata property bag for ApiVersion and other metadata fields + /// + public partial class CustomKeysConnectionProperties : ConnectionPropertiesV2 + { + /// Initializes a new instance of . + public CustomKeysConnectionProperties() + { + AuthType = ConnectionAuthType.CustomKeys; + } + + /// Initializes a new instance of . + /// Authentication type of the connection target. + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + /// Custom Keys credential object. + internal CustomKeysConnectionProperties(ConnectionAuthType authType, ConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, CustomKeys credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) + { + Credentials = credentials; + AuthType = authType; + } + + /// Custom Keys credential object. + internal CustomKeys Credentials { get; set; } + /// Dictionary of <string>. + [WirePath("credentials.keys")] + public IDictionary CredentialsKeys + { + get + { + if (Credentials is null) + Credentials = new CustomKeys(); + return Credentials.Keys; + } + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ManagedIdentityAuthTypeConnectionProperties.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ManagedIdentityAuthTypeConnectionProperties.Serialization.cs new file mode 100644 index 000000000000..3eefff3546be --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ManagedIdentityAuthTypeConnectionProperties.Serialization.cs @@ -0,0 +1,550 @@ +// 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.CognitiveServices.Models +{ + public partial class ManagedIdentityAuthTypeConnectionProperties : 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(ManagedIdentityAuthTypeConnectionProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Credentials)) + { + writer.WritePropertyName("credentials"u8); + writer.WriteObjectValue(Credentials, options); + } + } + + ManagedIdentityAuthTypeConnectionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedIdentityAuthTypeConnectionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedIdentityAuthTypeConnectionProperties(document.RootElement, options); + } + + internal static ManagedIdentityAuthTypeConnectionProperties DeserializeManagedIdentityAuthTypeConnectionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConnectionManagedIdentity credentials = default; + ConnectionAuthType authType = default; + ConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("credentials"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + credentials = ConnectionManagedIdentity.DeserializeConnectionManagedIdentity(property.Value, options); + continue; + } + if (property.NameEquals("authType"u8)) + { + authType = new ConnectionAuthType(property.Value.GetString()); + continue; + } + if (property.NameEquals("category"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + category = new ConnectionCategory(property.Value.GetString()); + continue; + } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } + if (property.NameEquals("expiryTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expiryTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + 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 (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedIdentityAuthTypeConnectionProperties( + authType, + category, + createdByWorkspaceArmId, + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData, + credentials); + } + + 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(Credentials), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" credentials: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Credentials)) + { + builder.Append(" credentials: "); + BicepSerializationHelpers.AppendChildObject(builder, Credentials, options, 2, false, " credentials: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AuthType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" authType: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" authType: "); + builder.AppendLine($"'{AuthType.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Category), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" category: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Category)) + { + builder.Append(" category: "); + builder.AppendLine($"'{Category.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CreatedByWorkspaceArmId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" createdByWorkspaceArmId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CreatedByWorkspaceArmId)) + { + builder.Append(" createdByWorkspaceArmId: "); + builder.AppendLine($"'{CreatedByWorkspaceArmId.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" error: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Error)) + { + builder.Append(" error: "); + if (Error.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Error}'''"); + } + else + { + builder.AppendLine($"'{Error}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExpiryOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" expiryTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ExpiryOn)) + { + builder.Append(" expiryTime: "); + var formattedDateTimeString = TypeFormatters.ToString(ExpiryOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Group), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" group: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Group)) + { + builder.Append(" group: "); + builder.AppendLine($"'{Group.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsSharedToAll), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" isSharedToAll: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IsSharedToAll)) + { + builder.Append(" isSharedToAll: "); + var boolValue = IsSharedToAll.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Metadata), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" metadata: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Metadata)) + { + if (Metadata.Any()) + { + builder.Append(" metadata: "); + builder.AppendLine("{"); + foreach (var item in Metadata) + { + 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(" }"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PeRequirement), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" peRequirement: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PeRequirement)) + { + builder.Append(" peRequirement: "); + builder.AppendLine($"'{PeRequirement.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PeStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" peStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PeStatus)) + { + builder.Append(" peStatus: "); + builder.AppendLine($"'{PeStatus.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SharedUserList), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sharedUserList: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(SharedUserList)) + { + if (SharedUserList.Any()) + { + builder.Append(" sharedUserList: "); + builder.AppendLine("["); + foreach (var item in SharedUserList) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Target), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" target: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Target)) + { + builder.Append(" target: "); + if (Target.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Target}'''"); + } + else + { + builder.AppendLine($"'{Target}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UseWorkspaceManagedIdentity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" useWorkspaceManagedIdentity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + builder.Append(" useWorkspaceManagedIdentity: "); + var boolValue = UseWorkspaceManagedIdentity.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(ManagedIdentityAuthTypeConnectionProperties)} does not support writing '{options.Format}' format."); + } + } + + ManagedIdentityAuthTypeConnectionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeManagedIdentityAuthTypeConnectionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedIdentityAuthTypeConnectionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ManagedIdentityAuthTypeConnectionProperties.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ManagedIdentityAuthTypeConnectionProperties.cs new file mode 100644 index 000000000000..059794615747 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ManagedIdentityAuthTypeConnectionProperties.cs @@ -0,0 +1,49 @@ +// 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.CognitiveServices.Models +{ + /// The ManagedIdentityAuthTypeConnectionProperties. + public partial class ManagedIdentityAuthTypeConnectionProperties : ConnectionPropertiesV2 + { + /// Initializes a new instance of . + public ManagedIdentityAuthTypeConnectionProperties() + { + AuthType = ConnectionAuthType.ManagedIdentity; + } + + /// Initializes a new instance of . + /// Authentication type of the connection target. + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + /// + internal ManagedIdentityAuthTypeConnectionProperties(ConnectionAuthType authType, ConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, ConnectionManagedIdentity credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) + { + Credentials = credentials; + AuthType = authType; + } + + /// Gets or sets the credentials. + [WirePath("credentials")] + public ConnectionManagedIdentity Credentials { get; set; } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ManagedPERequirement.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ManagedPERequirement.cs new file mode 100644 index 000000000000..a55099b5a2cb --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ManagedPERequirement.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.CognitiveServices.Models +{ + /// The ManagedPERequirement. + public readonly partial struct ManagedPERequirement : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ManagedPERequirement(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RequiredValue = "Required"; + private const string NotRequiredValue = "NotRequired"; + private const string NotApplicableValue = "NotApplicable"; + + /// Required. + public static ManagedPERequirement Required { get; } = new ManagedPERequirement(RequiredValue); + /// NotRequired. + public static ManagedPERequirement NotRequired { get; } = new ManagedPERequirement(NotRequiredValue); + /// NotApplicable. + public static ManagedPERequirement NotApplicable { get; } = new ManagedPERequirement(NotApplicableValue); + /// Determines if two values are the same. + public static bool operator ==(ManagedPERequirement left, ManagedPERequirement right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ManagedPERequirement left, ManagedPERequirement right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ManagedPERequirement(string value) => new ManagedPERequirement(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ManagedPERequirement other && Equals(other); + /// + public bool Equals(ManagedPERequirement 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/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ManagedPEStatus.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ManagedPEStatus.cs new file mode 100644 index 000000000000..00c9adb401da --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ManagedPEStatus.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.CognitiveServices.Models +{ + /// The ManagedPEStatus. + public readonly partial struct ManagedPEStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ManagedPEStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InactiveValue = "Inactive"; + private const string ActiveValue = "Active"; + private const string NotApplicableValue = "NotApplicable"; + + /// Inactive. + public static ManagedPEStatus Inactive { get; } = new ManagedPEStatus(InactiveValue); + /// Active. + public static ManagedPEStatus Active { get; } = new ManagedPEStatus(ActiveValue); + /// NotApplicable. + public static ManagedPEStatus NotApplicable { get; } = new ManagedPEStatus(NotApplicableValue); + /// Determines if two values are the same. + public static bool operator ==(ManagedPEStatus left, ManagedPEStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ManagedPEStatus left, ManagedPEStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ManagedPEStatus(string value) => new ManagedPEStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ManagedPEStatus other && Equals(other); + /// + public bool Equals(ManagedPEStatus 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/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/NetworkInjections.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/NetworkInjections.Serialization.cs new file mode 100644 index 000000000000..1879d01da701 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/NetworkInjections.Serialization.cs @@ -0,0 +1,227 @@ +// 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.CognitiveServices.Models +{ + public partial class NetworkInjections : 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(NetworkInjections)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Scenario)) + { + writer.WritePropertyName("scenario"u8); + writer.WriteStringValue(Scenario.Value.ToString()); + } + if (Optional.IsDefined(SubnetArmId)) + { + writer.WritePropertyName("subnetArmId"u8); + writer.WriteStringValue(SubnetArmId); + } + if (Optional.IsDefined(UseMicrosoftManagedNetwork)) + { + writer.WritePropertyName("useMicrosoftManagedNetwork"u8); + writer.WriteBooleanValue(UseMicrosoftManagedNetwork.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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NetworkInjections IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkInjections)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkInjections(document.RootElement, options); + } + + internal static NetworkInjections DeserializeNetworkInjections(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ScenarioType? scenario = default; + ResourceIdentifier subnetArmId = default; + bool? useMicrosoftManagedNetwork = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("scenario"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scenario = new ScenarioType(property.Value.GetString()); + continue; + } + if (property.NameEquals("subnetArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + subnetArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("useMicrosoftManagedNetwork"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useMicrosoftManagedNetwork = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkInjections(scenario, subnetArmId, useMicrosoftManagedNetwork, 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(Scenario), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" scenario: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Scenario)) + { + builder.Append(" scenario: "); + builder.AppendLine($"'{Scenario.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SubnetArmId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" subnetArmId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SubnetArmId)) + { + builder.Append(" subnetArmId: "); + builder.AppendLine($"'{SubnetArmId.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UseMicrosoftManagedNetwork), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" useMicrosoftManagedNetwork: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(UseMicrosoftManagedNetwork)) + { + builder.Append(" useMicrosoftManagedNetwork: "); + var boolValue = UseMicrosoftManagedNetwork.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(NetworkInjections)} does not support writing '{options.Format}' format."); + } + } + + NetworkInjections IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNetworkInjections(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkInjections)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/NetworkInjections.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/NetworkInjections.cs new file mode 100644 index 000000000000..3a8077664eab --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/NetworkInjections.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 Azure.Core; + +namespace Azure.ResourceManager.CognitiveServices.Models +{ + /// Specifies in AI Foundry where virtual network injection occurs to secure scenarios like Agents entirely within the user's private network, eliminating public internet exposure while maintaining control over network configurations and resources. + public partial class NetworkInjections + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// 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 NetworkInjections() + { + } + + /// Initializes a new instance of . + /// Specifies what features in AI Foundry network injection applies to. Currently only supports 'agent' for agent scenarios. 'none' means no network injection. + /// Specify the subnet for which your Agent Client is injected into. + /// Boolean to enable Microsoft Managed Network for subnet delegation. + /// Keeps track of any properties unknown to the library. + internal NetworkInjections(ScenarioType? scenario, ResourceIdentifier subnetArmId, bool? useMicrosoftManagedNetwork, IDictionary serializedAdditionalRawData) + { + Scenario = scenario; + SubnetArmId = subnetArmId; + UseMicrosoftManagedNetwork = useMicrosoftManagedNetwork; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specifies what features in AI Foundry network injection applies to. Currently only supports 'agent' for agent scenarios. 'none' means no network injection. + [WirePath("scenario")] + public ScenarioType? Scenario { get; set; } + /// Specify the subnet for which your Agent Client is injected into. + [WirePath("subnetArmId")] + public ResourceIdentifier SubnetArmId { get; set; } + /// Boolean to enable Microsoft Managed Network for subnet delegation. + [WirePath("useMicrosoftManagedNetwork")] + public bool? UseMicrosoftManagedNetwork { get; set; } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/NoneAuthTypeConnectionProperties.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/NoneAuthTypeConnectionProperties.Serialization.cs new file mode 100644 index 000000000000..698ea4a8f39e --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/NoneAuthTypeConnectionProperties.Serialization.cs @@ -0,0 +1,519 @@ +// 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.CognitiveServices.Models +{ + public partial class NoneAuthTypeConnectionProperties : 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(NoneAuthTypeConnectionProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + NoneAuthTypeConnectionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NoneAuthTypeConnectionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNoneAuthTypeConnectionProperties(document.RootElement, options); + } + + internal static NoneAuthTypeConnectionProperties DeserializeNoneAuthTypeConnectionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConnectionAuthType authType = default; + ConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authType"u8)) + { + authType = new ConnectionAuthType(property.Value.GetString()); + continue; + } + if (property.NameEquals("category"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + category = new ConnectionCategory(property.Value.GetString()); + continue; + } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } + if (property.NameEquals("expiryTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expiryTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + 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 (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NoneAuthTypeConnectionProperties( + authType, + category, + createdByWorkspaceArmId, + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, + 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(AuthType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" authType: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" authType: "); + builder.AppendLine($"'{AuthType.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Category), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" category: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Category)) + { + builder.Append(" category: "); + builder.AppendLine($"'{Category.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CreatedByWorkspaceArmId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" createdByWorkspaceArmId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CreatedByWorkspaceArmId)) + { + builder.Append(" createdByWorkspaceArmId: "); + builder.AppendLine($"'{CreatedByWorkspaceArmId.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" error: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Error)) + { + builder.Append(" error: "); + if (Error.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Error}'''"); + } + else + { + builder.AppendLine($"'{Error}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExpiryOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" expiryTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ExpiryOn)) + { + builder.Append(" expiryTime: "); + var formattedDateTimeString = TypeFormatters.ToString(ExpiryOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Group), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" group: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Group)) + { + builder.Append(" group: "); + builder.AppendLine($"'{Group.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsSharedToAll), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" isSharedToAll: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IsSharedToAll)) + { + builder.Append(" isSharedToAll: "); + var boolValue = IsSharedToAll.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Metadata), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" metadata: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Metadata)) + { + if (Metadata.Any()) + { + builder.Append(" metadata: "); + builder.AppendLine("{"); + foreach (var item in Metadata) + { + 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(" }"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PeRequirement), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" peRequirement: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PeRequirement)) + { + builder.Append(" peRequirement: "); + builder.AppendLine($"'{PeRequirement.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PeStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" peStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PeStatus)) + { + builder.Append(" peStatus: "); + builder.AppendLine($"'{PeStatus.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SharedUserList), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sharedUserList: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(SharedUserList)) + { + if (SharedUserList.Any()) + { + builder.Append(" sharedUserList: "); + builder.AppendLine("["); + foreach (var item in SharedUserList) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Target), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" target: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Target)) + { + builder.Append(" target: "); + if (Target.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Target}'''"); + } + else + { + builder.AppendLine($"'{Target}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UseWorkspaceManagedIdentity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" useWorkspaceManagedIdentity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + builder.Append(" useWorkspaceManagedIdentity: "); + var boolValue = UseWorkspaceManagedIdentity.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(NoneAuthTypeConnectionProperties)} does not support writing '{options.Format}' format."); + } + } + + NoneAuthTypeConnectionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNoneAuthTypeConnectionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NoneAuthTypeConnectionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/NoneAuthTypeConnectionProperties.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/NoneAuthTypeConnectionProperties.cs new file mode 100644 index 000000000000..08911b5b1984 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/NoneAuthTypeConnectionProperties.cs @@ -0,0 +1,43 @@ +// 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.CognitiveServices.Models +{ + /// The NoneAuthTypeConnectionProperties. + public partial class NoneAuthTypeConnectionProperties : ConnectionPropertiesV2 + { + /// Initializes a new instance of . + public NoneAuthTypeConnectionProperties() + { + AuthType = ConnectionAuthType.None; + } + + /// Initializes a new instance of . + /// Authentication type of the connection target. + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + internal NoneAuthTypeConnectionProperties(ConnectionAuthType authType, ConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) + { + AuthType = authType; + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/OAuth2AuthTypeConnectionProperties.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/OAuth2AuthTypeConnectionProperties.Serialization.cs new file mode 100644 index 000000000000..f3362f5c5258 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/OAuth2AuthTypeConnectionProperties.Serialization.cs @@ -0,0 +1,550 @@ +// 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.CognitiveServices.Models +{ + public partial class OAuth2AuthTypeConnectionProperties : 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(OAuth2AuthTypeConnectionProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Credentials)) + { + writer.WritePropertyName("credentials"u8); + writer.WriteObjectValue(Credentials, options); + } + } + + OAuth2AuthTypeConnectionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OAuth2AuthTypeConnectionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOAuth2AuthTypeConnectionProperties(document.RootElement, options); + } + + internal static OAuth2AuthTypeConnectionProperties DeserializeOAuth2AuthTypeConnectionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConnectionOAuth2 credentials = default; + ConnectionAuthType authType = default; + ConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("credentials"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + credentials = ConnectionOAuth2.DeserializeConnectionOAuth2(property.Value, options); + continue; + } + if (property.NameEquals("authType"u8)) + { + authType = new ConnectionAuthType(property.Value.GetString()); + continue; + } + if (property.NameEquals("category"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + category = new ConnectionCategory(property.Value.GetString()); + continue; + } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } + if (property.NameEquals("expiryTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expiryTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + 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 (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OAuth2AuthTypeConnectionProperties( + authType, + category, + createdByWorkspaceArmId, + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData, + credentials); + } + + 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(Credentials), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" credentials: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Credentials)) + { + builder.Append(" credentials: "); + BicepSerializationHelpers.AppendChildObject(builder, Credentials, options, 2, false, " credentials: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AuthType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" authType: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" authType: "); + builder.AppendLine($"'{AuthType.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Category), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" category: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Category)) + { + builder.Append(" category: "); + builder.AppendLine($"'{Category.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CreatedByWorkspaceArmId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" createdByWorkspaceArmId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CreatedByWorkspaceArmId)) + { + builder.Append(" createdByWorkspaceArmId: "); + builder.AppendLine($"'{CreatedByWorkspaceArmId.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" error: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Error)) + { + builder.Append(" error: "); + if (Error.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Error}'''"); + } + else + { + builder.AppendLine($"'{Error}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExpiryOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" expiryTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ExpiryOn)) + { + builder.Append(" expiryTime: "); + var formattedDateTimeString = TypeFormatters.ToString(ExpiryOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Group), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" group: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Group)) + { + builder.Append(" group: "); + builder.AppendLine($"'{Group.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsSharedToAll), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" isSharedToAll: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IsSharedToAll)) + { + builder.Append(" isSharedToAll: "); + var boolValue = IsSharedToAll.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Metadata), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" metadata: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Metadata)) + { + if (Metadata.Any()) + { + builder.Append(" metadata: "); + builder.AppendLine("{"); + foreach (var item in Metadata) + { + 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(" }"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PeRequirement), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" peRequirement: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PeRequirement)) + { + builder.Append(" peRequirement: "); + builder.AppendLine($"'{PeRequirement.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PeStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" peStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PeStatus)) + { + builder.Append(" peStatus: "); + builder.AppendLine($"'{PeStatus.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SharedUserList), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sharedUserList: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(SharedUserList)) + { + if (SharedUserList.Any()) + { + builder.Append(" sharedUserList: "); + builder.AppendLine("["); + foreach (var item in SharedUserList) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Target), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" target: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Target)) + { + builder.Append(" target: "); + if (Target.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Target}'''"); + } + else + { + builder.AppendLine($"'{Target}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UseWorkspaceManagedIdentity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" useWorkspaceManagedIdentity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + builder.Append(" useWorkspaceManagedIdentity: "); + var boolValue = UseWorkspaceManagedIdentity.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(OAuth2AuthTypeConnectionProperties)} does not support writing '{options.Format}' format."); + } + } + + OAuth2AuthTypeConnectionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOAuth2AuthTypeConnectionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OAuth2AuthTypeConnectionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/OAuth2AuthTypeConnectionProperties.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/OAuth2AuthTypeConnectionProperties.cs new file mode 100644 index 000000000000..ff13b68badd5 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/OAuth2AuthTypeConnectionProperties.cs @@ -0,0 +1,55 @@ +// 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.CognitiveServices.Models +{ + /// The OAuth2AuthTypeConnectionProperties. + public partial class OAuth2AuthTypeConnectionProperties : ConnectionPropertiesV2 + { + /// Initializes a new instance of . + public OAuth2AuthTypeConnectionProperties() + { + AuthType = ConnectionAuthType.OAuth2; + } + + /// Initializes a new instance of . + /// Authentication type of the connection target. + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + /// + /// ClientId and ClientSecret are required. Other properties are optional + /// depending on each OAuth2 provider's implementation. + /// + internal OAuth2AuthTypeConnectionProperties(ConnectionAuthType authType, ConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, ConnectionOAuth2 credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) + { + Credentials = credentials; + AuthType = authType; + } + + /// + /// ClientId and ClientSecret are required. Other properties are optional + /// depending on each OAuth2 provider's implementation. + /// + [WirePath("credentials")] + public ConnectionOAuth2 Credentials { get; set; } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/PATAuthTypeConnectionProperties.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/PATAuthTypeConnectionProperties.Serialization.cs new file mode 100644 index 000000000000..e56608ba178b --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/PATAuthTypeConnectionProperties.Serialization.cs @@ -0,0 +1,553 @@ +// 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.CognitiveServices.Models +{ + public partial class PATAuthTypeConnectionProperties : 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(PATAuthTypeConnectionProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Credentials)) + { + writer.WritePropertyName("credentials"u8); + writer.WriteObjectValue(Credentials, options); + } + } + + PATAuthTypeConnectionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PATAuthTypeConnectionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePATAuthTypeConnectionProperties(document.RootElement, options); + } + + internal static PATAuthTypeConnectionProperties DeserializePATAuthTypeConnectionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConnectionPersonalAccessToken credentials = default; + ConnectionAuthType authType = default; + ConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("credentials"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + credentials = ConnectionPersonalAccessToken.DeserializeConnectionPersonalAccessToken(property.Value, options); + continue; + } + if (property.NameEquals("authType"u8)) + { + authType = new ConnectionAuthType(property.Value.GetString()); + continue; + } + if (property.NameEquals("category"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + category = new ConnectionCategory(property.Value.GetString()); + continue; + } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } + if (property.NameEquals("expiryTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expiryTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + 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 (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PATAuthTypeConnectionProperties( + authType, + category, + createdByWorkspaceArmId, + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData, + credentials); + } + + 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("CredentialsPat", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" credentials: "); + builder.AppendLine("{"); + builder.Append(" pat: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(Credentials)) + { + builder.Append(" credentials: "); + BicepSerializationHelpers.AppendChildObject(builder, Credentials, options, 2, false, " credentials: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AuthType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" authType: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" authType: "); + builder.AppendLine($"'{AuthType.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Category), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" category: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Category)) + { + builder.Append(" category: "); + builder.AppendLine($"'{Category.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CreatedByWorkspaceArmId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" createdByWorkspaceArmId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CreatedByWorkspaceArmId)) + { + builder.Append(" createdByWorkspaceArmId: "); + builder.AppendLine($"'{CreatedByWorkspaceArmId.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" error: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Error)) + { + builder.Append(" error: "); + if (Error.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Error}'''"); + } + else + { + builder.AppendLine($"'{Error}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExpiryOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" expiryTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ExpiryOn)) + { + builder.Append(" expiryTime: "); + var formattedDateTimeString = TypeFormatters.ToString(ExpiryOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Group), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" group: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Group)) + { + builder.Append(" group: "); + builder.AppendLine($"'{Group.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsSharedToAll), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" isSharedToAll: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IsSharedToAll)) + { + builder.Append(" isSharedToAll: "); + var boolValue = IsSharedToAll.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Metadata), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" metadata: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Metadata)) + { + if (Metadata.Any()) + { + builder.Append(" metadata: "); + builder.AppendLine("{"); + foreach (var item in Metadata) + { + 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(" }"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PeRequirement), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" peRequirement: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PeRequirement)) + { + builder.Append(" peRequirement: "); + builder.AppendLine($"'{PeRequirement.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PeStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" peStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PeStatus)) + { + builder.Append(" peStatus: "); + builder.AppendLine($"'{PeStatus.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SharedUserList), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sharedUserList: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(SharedUserList)) + { + if (SharedUserList.Any()) + { + builder.Append(" sharedUserList: "); + builder.AppendLine("["); + foreach (var item in SharedUserList) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Target), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" target: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Target)) + { + builder.Append(" target: "); + if (Target.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Target}'''"); + } + else + { + builder.AppendLine($"'{Target}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UseWorkspaceManagedIdentity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" useWorkspaceManagedIdentity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + builder.Append(" useWorkspaceManagedIdentity: "); + var boolValue = UseWorkspaceManagedIdentity.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(PATAuthTypeConnectionProperties)} does not support writing '{options.Format}' format."); + } + } + + PATAuthTypeConnectionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePATAuthTypeConnectionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PATAuthTypeConnectionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/PATAuthTypeConnectionProperties.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/PATAuthTypeConnectionProperties.cs new file mode 100644 index 000000000000..653bae2eedcd --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/PATAuthTypeConnectionProperties.cs @@ -0,0 +1,60 @@ +// 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.CognitiveServices.Models +{ + /// The PATAuthTypeConnectionProperties. + public partial class PATAuthTypeConnectionProperties : ConnectionPropertiesV2 + { + /// Initializes a new instance of . + public PATAuthTypeConnectionProperties() + { + AuthType = ConnectionAuthType.PAT; + } + + /// Initializes a new instance of . + /// Authentication type of the connection target. + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + /// + internal PATAuthTypeConnectionProperties(ConnectionAuthType authType, ConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, ConnectionPersonalAccessToken credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) + { + Credentials = credentials; + AuthType = authType; + } + + /// Gets or sets the credentials. + internal ConnectionPersonalAccessToken Credentials { get; set; } + /// Gets or sets the credentials pat. + [WirePath("credentials.pat")] + public string CredentialsPat + { + get => Credentials is null ? default : Credentials.Pat; + set + { + if (Credentials is null) + Credentials = new ConnectionPersonalAccessToken(); + Credentials.Pat = value; + } + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ProjectListResult.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ProjectListResult.Serialization.cs new file mode 100644 index 000000000000..81187be563a5 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ProjectListResult.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.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CognitiveServices.Models +{ + internal partial class ProjectListResult : 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(ProjectListResult)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProjectListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProjectListResult(document.RootElement, options); + } + + internal static ProjectListResult DeserializeProjectListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nextLink = default; + IReadOnlyList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ProjectData.DeserializeProjectData(item, options)); + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProjectListResult(nextLink, value ?? 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(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}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + 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(ProjectListResult)} does not support writing '{options.Format}' format."); + } + } + + ProjectListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeProjectListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProjectListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ProjectListResult.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ProjectListResult.cs new file mode 100644 index 000000000000..9bc1e0f2e804 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ProjectListResult.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.CognitiveServices.Models +{ + /// The list of cognitive services projects operation response. + internal partial class ProjectListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// 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 ProjectListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The link used to get the next page of projects. + /// Gets the list of Cognitive Services projects and their properties. + /// Keeps track of any properties unknown to the library. + internal ProjectListResult(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + NextLink = nextLink; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The link used to get the next page of projects. + public string NextLink { get; } + /// Gets the list of Cognitive Services projects and their properties. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ProjectProperties.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ProjectProperties.Serialization.cs new file mode 100644 index 000000000000..3d992cfd2e75 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ProjectProperties.Serialization.cs @@ -0,0 +1,335 @@ +// 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.CognitiveServices.Models +{ + public partial class ProjectProperties : 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(ProjectProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Endpoints)) + { + writer.WritePropertyName("endpoints"u8); + writer.WriteStartObject(); + foreach (var item in Endpoints) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && Optional.IsDefined(IsDefault)) + { + writer.WritePropertyName("isDefault"u8); + writer.WriteBooleanValue(IsDefault.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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProjectProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProjectProperties(document.RootElement, options); + } + + internal static ProjectProperties DeserializeProjectProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ServiceAccountProvisioningState? provisioningState = default; + string displayName = default; + string description = default; + IReadOnlyDictionary endpoints = default; + bool? isDefault = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ServiceAccountProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("endpoints"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()); + } + endpoints = dictionary; + continue; + } + if (property.NameEquals("isDefault"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDefault = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProjectProperties( + provisioningState, + displayName, + description, + endpoints ?? new ChangeTrackingDictionary(), + isDefault, + 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(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(DisplayName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" displayName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DisplayName)) + { + builder.Append(" displayName: "); + if (DisplayName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{DisplayName}'''"); + } + else + { + builder.AppendLine($"'{DisplayName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Description), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" description: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Description)) + { + builder.Append(" description: "); + if (Description.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Description}'''"); + } + else + { + builder.AppendLine($"'{Description}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Endpoints), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" endpoints: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Endpoints)) + { + if (Endpoints.Any()) + { + builder.Append(" endpoints: "); + builder.AppendLine("{"); + foreach (var item in Endpoints) + { + 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(" }"); + } + } + } + + 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}"); + } + } + + 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(ProjectProperties)} does not support writing '{options.Format}' format."); + } + } + + ProjectProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeProjectProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProjectProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ProjectProperties.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ProjectProperties.cs new file mode 100644 index 000000000000..0b097aa2a4c5 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ProjectProperties.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.ResourceManager.CognitiveServices.Models +{ + /// Properties of Cognitive Services Project'. + public partial class ProjectProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// 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 ProjectProperties() + { + Endpoints = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Gets the status of the cognitive services project at the time the operation was called. + /// The display name of the Cognitive Services Project. + /// The description of the Cognitive Services Project. + /// The list of endpoint for this Cognitive Services Project. + /// Indicates whether the project is the default project for the account. + /// Keeps track of any properties unknown to the library. + internal ProjectProperties(ServiceAccountProvisioningState? provisioningState, string displayName, string description, IReadOnlyDictionary endpoints, bool? isDefault, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + DisplayName = displayName; + Description = description; + Endpoints = endpoints; + IsDefault = isDefault; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the status of the cognitive services project at the time the operation was called. + [WirePath("provisioningState")] + public ServiceAccountProvisioningState? ProvisioningState { get; } + /// The display name of the Cognitive Services Project. + [WirePath("displayName")] + public string DisplayName { get; set; } + /// The description of the Cognitive Services Project. + [WirePath("description")] + public string Description { get; set; } + /// The list of endpoint for this Cognitive Services Project. + [WirePath("endpoints")] + public IReadOnlyDictionary Endpoints { get; } + /// Indicates whether the project is the default project for the account. + [WirePath("isDefault")] + public bool? IsDefault { get; } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiPolicyMode.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiPolicyMode.cs index 42e0a82802e4..e2e2dad8c896 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiPolicyMode.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiPolicyMode.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.CognitiveServices.Models { - /// Rai policy mode. The enum value mapping is as below: Default = 0, Deferred=1, Blocking=2, Asynchronous_filter =3. Please use 'Asynchronous_filter' after 2024-10-01. It is the same as 'Deferred' in previous version. + /// Rai policy mode. The enum value mapping is as below: Default = 0, Deferred=1, Blocking=2, Asynchronous_filter =3. Please use 'Asynchronous_filter' after 2025-04-01. It is the same as 'Deferred' in previous version. public readonly partial struct RaiPolicyMode : IEquatable { private readonly string _value; diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiPolicyProperties.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiPolicyProperties.cs index 3efc70b72022..058947fe3295 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiPolicyProperties.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/RaiPolicyProperties.cs @@ -54,7 +54,7 @@ public RaiPolicyProperties() /// Initializes a new instance of . /// Content Filters policy type. - /// Rai policy mode. The enum value mapping is as below: Default = 0, Deferred=1, Blocking=2, Asynchronous_filter =3. Please use 'Asynchronous_filter' after 2024-10-01. It is the same as 'Deferred' in previous version. + /// Rai policy mode. The enum value mapping is as below: Default = 0, Deferred=1, Blocking=2, Asynchronous_filter =3. Please use 'Asynchronous_filter' after 2025-04-01. It is the same as 'Deferred' in previous version. /// Name of Rai policy. /// The list of Content Filters. /// The list of custom Blocklist. @@ -72,7 +72,7 @@ internal RaiPolicyProperties(RaiPolicyType? policyType, RaiPolicyMode? mode, str /// Content Filters policy type. [WirePath("type")] public RaiPolicyType? PolicyType { get; } - /// Rai policy mode. The enum value mapping is as below: Default = 0, Deferred=1, Blocking=2, Asynchronous_filter =3. Please use 'Asynchronous_filter' after 2024-10-01. It is the same as 'Deferred' in previous version. + /// Rai policy mode. The enum value mapping is as below: Default = 0, Deferred=1, Blocking=2, Asynchronous_filter =3. Please use 'Asynchronous_filter' after 2025-04-01. It is the same as 'Deferred' in previous version. [WirePath("mode")] public RaiPolicyMode? Mode { get; set; } /// Name of Rai policy. diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ResourceBase.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ResourceBase.Serialization.cs new file mode 100644 index 000000000000..6404b2b3260a --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ResourceBase.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.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CognitiveServices.Models +{ + public partial class ResourceBase : 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(ResourceBase)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Description)) + { + if (Description != null) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + else + { + writer.WriteNull("description"); + } + } + if (Optional.IsCollectionDefined(Tags)) + { + if (Tags != null) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + else + { + writer.WriteNull("tags"); + } + } + 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ResourceBase IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResourceBase)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceBase(document.RootElement, options); + } + + internal static ResourceBase DeserializeResourceBase(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string description = default; + IDictionary tags = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("description"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + description = null; + continue; + } + description = property.Value.GetString(); + 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 (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ResourceBase(description, tags ?? new ChangeTrackingDictionary(), 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(Description), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" description: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Description)) + { + builder.Append(" description: "); + if (Description.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Description}'''"); + } + else + { + builder.AppendLine($"'{Description}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tags: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Tags)) + { + if (Tags.Any()) + { + builder.Append(" tags: "); + builder.AppendLine("{"); + foreach (var item in Tags) + { + 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()); + } + + BinaryData 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(ResourceBase)} does not support writing '{options.Format}' format."); + } + } + + ResourceBase IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeResourceBase(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ResourceBase)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ResourceBase.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ResourceBase.cs new file mode 100644 index 000000000000..fffa3c3a04d1 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ResourceBase.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.CognitiveServices.Models +{ + /// The ResourceBase. + public partial class ResourceBase + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload 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 . + public ResourceBase() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The asset description text. + /// Tag dictionary. Tags can be added, removed, and updated. + /// Keeps track of any properties unknown to the library. + internal ResourceBase(string description, IDictionary tags, IDictionary serializedAdditionalRawData) + { + Description = description; + Tags = tags; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The asset description text. + [WirePath("description")] + public string Description { get; set; } + /// Tag dictionary. Tags can be added, removed, and updated. + [WirePath("tags")] + public IDictionary Tags { get; set; } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/SASAuthTypeConnectionProperties.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/SASAuthTypeConnectionProperties.Serialization.cs new file mode 100644 index 000000000000..ee9140cd1f7f --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/SASAuthTypeConnectionProperties.Serialization.cs @@ -0,0 +1,553 @@ +// 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.CognitiveServices.Models +{ + public partial class SASAuthTypeConnectionProperties : 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(SASAuthTypeConnectionProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Credentials)) + { + writer.WritePropertyName("credentials"u8); + writer.WriteObjectValue(Credentials, options); + } + } + + SASAuthTypeConnectionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SASAuthTypeConnectionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSASAuthTypeConnectionProperties(document.RootElement, options); + } + + internal static SASAuthTypeConnectionProperties DeserializeSASAuthTypeConnectionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConnectionSharedAccessSignature credentials = default; + ConnectionAuthType authType = default; + ConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("credentials"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + credentials = ConnectionSharedAccessSignature.DeserializeConnectionSharedAccessSignature(property.Value, options); + continue; + } + if (property.NameEquals("authType"u8)) + { + authType = new ConnectionAuthType(property.Value.GetString()); + continue; + } + if (property.NameEquals("category"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + category = new ConnectionCategory(property.Value.GetString()); + continue; + } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } + if (property.NameEquals("expiryTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expiryTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + 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 (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SASAuthTypeConnectionProperties( + authType, + category, + createdByWorkspaceArmId, + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData, + credentials); + } + + 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("CredentialsSas", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" credentials: "); + builder.AppendLine("{"); + builder.Append(" sas: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(Credentials)) + { + builder.Append(" credentials: "); + BicepSerializationHelpers.AppendChildObject(builder, Credentials, options, 2, false, " credentials: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AuthType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" authType: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" authType: "); + builder.AppendLine($"'{AuthType.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Category), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" category: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Category)) + { + builder.Append(" category: "); + builder.AppendLine($"'{Category.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CreatedByWorkspaceArmId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" createdByWorkspaceArmId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CreatedByWorkspaceArmId)) + { + builder.Append(" createdByWorkspaceArmId: "); + builder.AppendLine($"'{CreatedByWorkspaceArmId.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" error: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Error)) + { + builder.Append(" error: "); + if (Error.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Error}'''"); + } + else + { + builder.AppendLine($"'{Error}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExpiryOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" expiryTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ExpiryOn)) + { + builder.Append(" expiryTime: "); + var formattedDateTimeString = TypeFormatters.ToString(ExpiryOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Group), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" group: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Group)) + { + builder.Append(" group: "); + builder.AppendLine($"'{Group.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsSharedToAll), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" isSharedToAll: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IsSharedToAll)) + { + builder.Append(" isSharedToAll: "); + var boolValue = IsSharedToAll.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Metadata), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" metadata: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Metadata)) + { + if (Metadata.Any()) + { + builder.Append(" metadata: "); + builder.AppendLine("{"); + foreach (var item in Metadata) + { + 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(" }"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PeRequirement), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" peRequirement: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PeRequirement)) + { + builder.Append(" peRequirement: "); + builder.AppendLine($"'{PeRequirement.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PeStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" peStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PeStatus)) + { + builder.Append(" peStatus: "); + builder.AppendLine($"'{PeStatus.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SharedUserList), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sharedUserList: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(SharedUserList)) + { + if (SharedUserList.Any()) + { + builder.Append(" sharedUserList: "); + builder.AppendLine("["); + foreach (var item in SharedUserList) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Target), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" target: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Target)) + { + builder.Append(" target: "); + if (Target.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Target}'''"); + } + else + { + builder.AppendLine($"'{Target}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UseWorkspaceManagedIdentity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" useWorkspaceManagedIdentity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + builder.Append(" useWorkspaceManagedIdentity: "); + var boolValue = UseWorkspaceManagedIdentity.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(SASAuthTypeConnectionProperties)} does not support writing '{options.Format}' format."); + } + } + + SASAuthTypeConnectionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSASAuthTypeConnectionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SASAuthTypeConnectionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/SASAuthTypeConnectionProperties.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/SASAuthTypeConnectionProperties.cs new file mode 100644 index 000000000000..b8bb8d9e097d --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/SASAuthTypeConnectionProperties.cs @@ -0,0 +1,60 @@ +// 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.CognitiveServices.Models +{ + /// The SASAuthTypeConnectionProperties. + public partial class SASAuthTypeConnectionProperties : ConnectionPropertiesV2 + { + /// Initializes a new instance of . + public SASAuthTypeConnectionProperties() + { + AuthType = ConnectionAuthType.SAS; + } + + /// Initializes a new instance of . + /// Authentication type of the connection target. + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + /// + internal SASAuthTypeConnectionProperties(ConnectionAuthType authType, ConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, ConnectionSharedAccessSignature credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) + { + Credentials = credentials; + AuthType = authType; + } + + /// Gets or sets the credentials. + internal ConnectionSharedAccessSignature Credentials { get; set; } + /// Gets or sets the credentials sas. + [WirePath("credentials.sas")] + public string CredentialsSas + { + get => Credentials is null ? default : Credentials.Sas; + set + { + if (Credentials is null) + Credentials = new ConnectionSharedAccessSignature(); + Credentials.Sas = value; + } + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ScenarioType.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ScenarioType.cs new file mode 100644 index 000000000000..3f73d8d1d735 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ScenarioType.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.CognitiveServices.Models +{ + /// Specifies what features in AI Foundry network injection applies to. Currently only supports 'agent' for agent scenarios. 'none' means no network injection. + public readonly partial struct ScenarioType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ScenarioType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "none"; + private const string AgentValue = "agent"; + + /// none. + public static ScenarioType None { get; } = new ScenarioType(NoneValue); + /// agent. + public static ScenarioType Agent { get; } = new ScenarioType(AgentValue); + /// Determines if two values are the same. + public static bool operator ==(ScenarioType left, ScenarioType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ScenarioType left, ScenarioType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ScenarioType(string value) => new ScenarioType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ScenarioType other && Equals(other); + /// + public bool Equals(ScenarioType 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/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ServiceAccountProvisioningState.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ServiceAccountProvisioningState.cs index 4fbf889b9ea8..89c4f40db0a4 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ServiceAccountProvisioningState.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ServiceAccountProvisioningState.cs @@ -29,6 +29,7 @@ public ServiceAccountProvisioningState(string value) private const string FailedValue = "Failed"; private const string SucceededValue = "Succeeded"; private const string ResolvingDnsValue = "ResolvingDNS"; + private const string CanceledValue = "Canceled"; /// Accepted. public static ServiceAccountProvisioningState Accepted { get; } = new ServiceAccountProvisioningState(AcceptedValue); @@ -44,6 +45,8 @@ public ServiceAccountProvisioningState(string value) public static ServiceAccountProvisioningState Succeeded { get; } = new ServiceAccountProvisioningState(SucceededValue); /// ResolvingDNS. public static ServiceAccountProvisioningState ResolvingDns { get; } = new ServiceAccountProvisioningState(ResolvingDnsValue); + /// Canceled. + public static ServiceAccountProvisioningState Canceled { get; } = new ServiceAccountProvisioningState(CanceledValue); /// Determines if two values are the same. public static bool operator ==(ServiceAccountProvisioningState left, ServiceAccountProvisioningState right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ServicePrincipalAuthTypeConnectionProperties.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ServicePrincipalAuthTypeConnectionProperties.Serialization.cs new file mode 100644 index 000000000000..479aed32ce03 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ServicePrincipalAuthTypeConnectionProperties.Serialization.cs @@ -0,0 +1,550 @@ +// 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.CognitiveServices.Models +{ + public partial class ServicePrincipalAuthTypeConnectionProperties : 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(ServicePrincipalAuthTypeConnectionProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Credentials)) + { + writer.WritePropertyName("credentials"u8); + writer.WriteObjectValue(Credentials, options); + } + } + + ServicePrincipalAuthTypeConnectionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServicePrincipalAuthTypeConnectionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServicePrincipalAuthTypeConnectionProperties(document.RootElement, options); + } + + internal static ServicePrincipalAuthTypeConnectionProperties DeserializeServicePrincipalAuthTypeConnectionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConnectionServicePrincipal credentials = default; + ConnectionAuthType authType = default; + ConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("credentials"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + credentials = ConnectionServicePrincipal.DeserializeConnectionServicePrincipal(property.Value, options); + continue; + } + if (property.NameEquals("authType"u8)) + { + authType = new ConnectionAuthType(property.Value.GetString()); + continue; + } + if (property.NameEquals("category"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + category = new ConnectionCategory(property.Value.GetString()); + continue; + } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } + if (property.NameEquals("expiryTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expiryTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + 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 (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServicePrincipalAuthTypeConnectionProperties( + authType, + category, + createdByWorkspaceArmId, + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData, + credentials); + } + + 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(Credentials), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" credentials: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Credentials)) + { + builder.Append(" credentials: "); + BicepSerializationHelpers.AppendChildObject(builder, Credentials, options, 2, false, " credentials: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AuthType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" authType: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" authType: "); + builder.AppendLine($"'{AuthType.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Category), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" category: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Category)) + { + builder.Append(" category: "); + builder.AppendLine($"'{Category.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CreatedByWorkspaceArmId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" createdByWorkspaceArmId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CreatedByWorkspaceArmId)) + { + builder.Append(" createdByWorkspaceArmId: "); + builder.AppendLine($"'{CreatedByWorkspaceArmId.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" error: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Error)) + { + builder.Append(" error: "); + if (Error.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Error}'''"); + } + else + { + builder.AppendLine($"'{Error}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExpiryOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" expiryTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ExpiryOn)) + { + builder.Append(" expiryTime: "); + var formattedDateTimeString = TypeFormatters.ToString(ExpiryOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Group), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" group: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Group)) + { + builder.Append(" group: "); + builder.AppendLine($"'{Group.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsSharedToAll), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" isSharedToAll: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IsSharedToAll)) + { + builder.Append(" isSharedToAll: "); + var boolValue = IsSharedToAll.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Metadata), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" metadata: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Metadata)) + { + if (Metadata.Any()) + { + builder.Append(" metadata: "); + builder.AppendLine("{"); + foreach (var item in Metadata) + { + 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(" }"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PeRequirement), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" peRequirement: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PeRequirement)) + { + builder.Append(" peRequirement: "); + builder.AppendLine($"'{PeRequirement.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PeStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" peStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PeStatus)) + { + builder.Append(" peStatus: "); + builder.AppendLine($"'{PeStatus.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SharedUserList), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sharedUserList: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(SharedUserList)) + { + if (SharedUserList.Any()) + { + builder.Append(" sharedUserList: "); + builder.AppendLine("["); + foreach (var item in SharedUserList) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Target), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" target: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Target)) + { + builder.Append(" target: "); + if (Target.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Target}'''"); + } + else + { + builder.AppendLine($"'{Target}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UseWorkspaceManagedIdentity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" useWorkspaceManagedIdentity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + builder.Append(" useWorkspaceManagedIdentity: "); + var boolValue = UseWorkspaceManagedIdentity.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(ServicePrincipalAuthTypeConnectionProperties)} does not support writing '{options.Format}' format."); + } + } + + ServicePrincipalAuthTypeConnectionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeServicePrincipalAuthTypeConnectionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServicePrincipalAuthTypeConnectionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ServicePrincipalAuthTypeConnectionProperties.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ServicePrincipalAuthTypeConnectionProperties.cs new file mode 100644 index 000000000000..8b8b966b50a2 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/ServicePrincipalAuthTypeConnectionProperties.cs @@ -0,0 +1,49 @@ +// 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.CognitiveServices.Models +{ + /// The ServicePrincipalAuthTypeConnectionProperties. + public partial class ServicePrincipalAuthTypeConnectionProperties : ConnectionPropertiesV2 + { + /// Initializes a new instance of . + public ServicePrincipalAuthTypeConnectionProperties() + { + AuthType = ConnectionAuthType.ServicePrincipal; + } + + /// Initializes a new instance of . + /// Authentication type of the connection target. + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + /// + internal ServicePrincipalAuthTypeConnectionProperties(ConnectionAuthType authType, ConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, ConnectionServicePrincipal credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) + { + Credentials = credentials; + AuthType = authType; + } + + /// Gets or sets the credentials. + [WirePath("credentials")] + public ConnectionServicePrincipal Credentials { get; set; } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/UnknownConnectionPropertiesV2.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/UnknownConnectionPropertiesV2.Serialization.cs new file mode 100644 index 000000000000..d12826fed8e9 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/UnknownConnectionPropertiesV2.Serialization.cs @@ -0,0 +1,519 @@ +// 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.CognitiveServices.Models +{ + internal partial class UnknownConnectionPropertiesV2 : 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(ConnectionPropertiesV2)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ConnectionPropertiesV2 IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectionPropertiesV2)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectionPropertiesV2(document.RootElement, options); + } + + internal static UnknownConnectionPropertiesV2 DeserializeUnknownConnectionPropertiesV2(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConnectionAuthType authType = "Unknown"; + ConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authType"u8)) + { + authType = new ConnectionAuthType(property.Value.GetString()); + continue; + } + if (property.NameEquals("category"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + category = new ConnectionCategory(property.Value.GetString()); + continue; + } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } + if (property.NameEquals("expiryTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expiryTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + 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 (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownConnectionPropertiesV2( + authType, + category, + createdByWorkspaceArmId, + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, + 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(AuthType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" authType: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" authType: "); + builder.AppendLine($"'{AuthType.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Category), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" category: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Category)) + { + builder.Append(" category: "); + builder.AppendLine($"'{Category.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CreatedByWorkspaceArmId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" createdByWorkspaceArmId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CreatedByWorkspaceArmId)) + { + builder.Append(" createdByWorkspaceArmId: "); + builder.AppendLine($"'{CreatedByWorkspaceArmId.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" error: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Error)) + { + builder.Append(" error: "); + if (Error.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Error}'''"); + } + else + { + builder.AppendLine($"'{Error}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExpiryOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" expiryTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ExpiryOn)) + { + builder.Append(" expiryTime: "); + var formattedDateTimeString = TypeFormatters.ToString(ExpiryOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Group), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" group: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Group)) + { + builder.Append(" group: "); + builder.AppendLine($"'{Group.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsSharedToAll), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" isSharedToAll: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IsSharedToAll)) + { + builder.Append(" isSharedToAll: "); + var boolValue = IsSharedToAll.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Metadata), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" metadata: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Metadata)) + { + if (Metadata.Any()) + { + builder.Append(" metadata: "); + builder.AppendLine("{"); + foreach (var item in Metadata) + { + 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(" }"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PeRequirement), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" peRequirement: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PeRequirement)) + { + builder.Append(" peRequirement: "); + builder.AppendLine($"'{PeRequirement.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PeStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" peStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PeStatus)) + { + builder.Append(" peStatus: "); + builder.AppendLine($"'{PeStatus.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SharedUserList), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sharedUserList: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(SharedUserList)) + { + if (SharedUserList.Any()) + { + builder.Append(" sharedUserList: "); + builder.AppendLine("["); + foreach (var item in SharedUserList) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Target), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" target: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Target)) + { + builder.Append(" target: "); + if (Target.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Target}'''"); + } + else + { + builder.AppendLine($"'{Target}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UseWorkspaceManagedIdentity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" useWorkspaceManagedIdentity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + builder.Append(" useWorkspaceManagedIdentity: "); + var boolValue = UseWorkspaceManagedIdentity.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(ConnectionPropertiesV2)} does not support writing '{options.Format}' format."); + } + } + + ConnectionPropertiesV2 IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeConnectionPropertiesV2(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectionPropertiesV2)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/UnknownConnectionPropertiesV2.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/UnknownConnectionPropertiesV2.cs new file mode 100644 index 000000000000..9411349a8c41 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/UnknownConnectionPropertiesV2.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; +using Azure.Core; + +namespace Azure.ResourceManager.CognitiveServices.Models +{ + /// Unknown version of ConnectionPropertiesV2. + internal partial class UnknownConnectionPropertiesV2 : ConnectionPropertiesV2 + { + /// Initializes a new instance of . + /// Authentication type of the connection target. + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + internal UnknownConnectionPropertiesV2(ConnectionAuthType authType, ConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) + { + AuthType = authType; + } + + /// Initializes a new instance of for deserialization. + internal UnknownConnectionPropertiesV2() + { + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/UserOwnedAmlWorkspace.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/UserOwnedAmlWorkspace.cs index 97f6852c0580..f9b30b604c99 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/UserOwnedAmlWorkspace.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/UserOwnedAmlWorkspace.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.CognitiveServices.Models { - /// The user owned AML workspace for Cognitive Services account. + /// The user owned AML account for Cognitive Services account. public partial class UserOwnedAmlWorkspace { /// @@ -52,8 +52,8 @@ public UserOwnedAmlWorkspace() } /// Initializes a new instance of . - /// Full resource id of a AML workspace resource. - /// Identity Client id of a AML workspace resource. + /// Full resource id of a AML account resource. + /// Identity Client id of a AML account resource. /// Keeps track of any properties unknown to the library. internal UserOwnedAmlWorkspace(ResourceIdentifier resourceId, Guid? identityClientId, IDictionary serializedAdditionalRawData) { @@ -62,10 +62,10 @@ internal UserOwnedAmlWorkspace(ResourceIdentifier resourceId, Guid? identityClie _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Full resource id of a AML workspace resource. + /// Full resource id of a AML account resource. [WirePath("resourceId")] public ResourceIdentifier ResourceId { get; set; } - /// Identity Client id of a AML workspace resource. + /// Identity Client id of a AML account resource. [WirePath("identityClientId")] public Guid? IdentityClientId { get; set; } } diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/UsernamePasswordAuthTypeConnectionProperties.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/UsernamePasswordAuthTypeConnectionProperties.Serialization.cs new file mode 100644 index 000000000000..8776d0b92d85 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/UsernamePasswordAuthTypeConnectionProperties.Serialization.cs @@ -0,0 +1,550 @@ +// 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.CognitiveServices.Models +{ + public partial class UsernamePasswordAuthTypeConnectionProperties : 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(UsernamePasswordAuthTypeConnectionProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Credentials)) + { + writer.WritePropertyName("credentials"u8); + writer.WriteObjectValue(Credentials, options); + } + } + + UsernamePasswordAuthTypeConnectionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UsernamePasswordAuthTypeConnectionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUsernamePasswordAuthTypeConnectionProperties(document.RootElement, options); + } + + internal static UsernamePasswordAuthTypeConnectionProperties DeserializeUsernamePasswordAuthTypeConnectionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ConnectionUsernamePassword credentials = default; + ConnectionAuthType authType = default; + ConnectionCategory? category = default; + ResourceIdentifier createdByWorkspaceArmId = default; + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("credentials"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + credentials = ConnectionUsernamePassword.DeserializeConnectionUsernamePassword(property.Value, options); + continue; + } + if (property.NameEquals("authType"u8)) + { + authType = new ConnectionAuthType(property.Value.GetString()); + continue; + } + if (property.NameEquals("category"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + category = new ConnectionCategory(property.Value.GetString()); + continue; + } + if (property.NameEquals("createdByWorkspaceArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } + if (property.NameEquals("expiryTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expiryTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("group"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + group = new ConnectionGroup(property.Value.GetString()); + continue; + } + if (property.NameEquals("isSharedToAll"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSharedToAll = property.Value.GetBoolean(); + 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 (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UsernamePasswordAuthTypeConnectionProperties( + authType, + category, + createdByWorkspaceArmId, + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData, + credentials); + } + + 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(Credentials), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" credentials: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Credentials)) + { + builder.Append(" credentials: "); + BicepSerializationHelpers.AppendChildObject(builder, Credentials, options, 2, false, " credentials: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AuthType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" authType: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" authType: "); + builder.AppendLine($"'{AuthType.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Category), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" category: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Category)) + { + builder.Append(" category: "); + builder.AppendLine($"'{Category.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CreatedByWorkspaceArmId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" createdByWorkspaceArmId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CreatedByWorkspaceArmId)) + { + builder.Append(" createdByWorkspaceArmId: "); + builder.AppendLine($"'{CreatedByWorkspaceArmId.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" error: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Error)) + { + builder.Append(" error: "); + if (Error.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Error}'''"); + } + else + { + builder.AppendLine($"'{Error}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExpiryOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" expiryTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ExpiryOn)) + { + builder.Append(" expiryTime: "); + var formattedDateTimeString = TypeFormatters.ToString(ExpiryOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Group), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" group: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Group)) + { + builder.Append(" group: "); + builder.AppendLine($"'{Group.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsSharedToAll), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" isSharedToAll: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IsSharedToAll)) + { + builder.Append(" isSharedToAll: "); + var boolValue = IsSharedToAll.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Metadata), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" metadata: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Metadata)) + { + if (Metadata.Any()) + { + builder.Append(" metadata: "); + builder.AppendLine("{"); + foreach (var item in Metadata) + { + 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(" }"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PeRequirement), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" peRequirement: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PeRequirement)) + { + builder.Append(" peRequirement: "); + builder.AppendLine($"'{PeRequirement.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PeStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" peStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PeStatus)) + { + builder.Append(" peStatus: "); + builder.AppendLine($"'{PeStatus.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SharedUserList), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sharedUserList: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(SharedUserList)) + { + if (SharedUserList.Any()) + { + builder.Append(" sharedUserList: "); + builder.AppendLine("["); + foreach (var item in SharedUserList) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Target), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" target: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Target)) + { + builder.Append(" target: "); + if (Target.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Target}'''"); + } + else + { + builder.AppendLine($"'{Target}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UseWorkspaceManagedIdentity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" useWorkspaceManagedIdentity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + builder.Append(" useWorkspaceManagedIdentity: "); + var boolValue = UseWorkspaceManagedIdentity.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(UsernamePasswordAuthTypeConnectionProperties)} does not support writing '{options.Format}' format."); + } + } + + UsernamePasswordAuthTypeConnectionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUsernamePasswordAuthTypeConnectionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UsernamePasswordAuthTypeConnectionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/UsernamePasswordAuthTypeConnectionProperties.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/UsernamePasswordAuthTypeConnectionProperties.cs new file mode 100644 index 000000000000..3ffbd4ec195a --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/Models/UsernamePasswordAuthTypeConnectionProperties.cs @@ -0,0 +1,49 @@ +// 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.CognitiveServices.Models +{ + /// The UsernamePasswordAuthTypeConnectionProperties. + public partial class UsernamePasswordAuthTypeConnectionProperties : ConnectionPropertiesV2 + { + /// Initializes a new instance of . + public UsernamePasswordAuthTypeConnectionProperties() + { + AuthType = ConnectionAuthType.UsernamePassword; + } + + /// Initializes a new instance of . + /// Authentication type of the connection target. + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + /// + internal UsernamePasswordAuthTypeConnectionProperties(ConnectionAuthType authType, ConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, ConnectionUsernamePassword credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) + { + Credentials = credentials; + AuthType = authType; + } + + /// Gets or sets the credentials. + [WirePath("credentials")] + public ConnectionUsernamePassword Credentials { get; set; } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs index 54da989ec490..72eb563d135a 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(strin /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual AsyncPageable GetA /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual Pageable GetAll(Ca /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -257,7 +257,7 @@ public virtual async Task> ExistsAsync(string nspConfigurationNam /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -300,7 +300,7 @@ public virtual Response Exists(string nspConfigurationName, CancellationTo /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -345,7 +345,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs index 24d4e3e82a90..f19e5fbb837d 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(Cance /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ProjectCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ProjectCollection.cs new file mode 100644 index 000000000000..42a5a0349a70 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ProjectCollection.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.CognitiveServices +{ + /// + /// 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 GetProjects method from an instance of . + /// + public partial class ProjectCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _projectClientDiagnostics; + private readonly ProjectsRestOperations _projectRestClient; + + /// Initializes a new instance of the class for mocking. + protected ProjectCollection() + { + } + + /// 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 ProjectCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _projectClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CognitiveServices", ProjectResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ProjectResource.ResourceType, out string projectApiVersion); + _projectRestClient = new ProjectsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, projectApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != CognitiveServicesAccountResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CognitiveServicesAccountResource.ResourceType), nameof(id)); + } + + /// + /// Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's individual container to work on. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName} + /// + /// + /// Operation Id + /// Projects_Create + /// + /// + /// Default Api Version + /// 2025-04-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 name of Cognitive Services account's project. + /// The parameters to provide for the created project. + /// 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 projectName, ProjectData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _projectClientDiagnostics.CreateScope("ProjectCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _projectRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectName, data, cancellationToken).ConfigureAwait(false); + var operation = new CognitiveServicesArmOperation(new ProjectOperationSource(Client), _projectClientDiagnostics, Pipeline, _projectRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's individual container to work on. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName} + /// + /// + /// Operation Id + /// Projects_Create + /// + /// + /// Default Api Version + /// 2025-04-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 name of Cognitive Services account's project. + /// The parameters to provide for the created project. + /// 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 projectName, ProjectData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _projectClientDiagnostics.CreateScope("ProjectCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _projectRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectName, data, cancellationToken); + var operation = new CognitiveServicesArmOperation(new ProjectOperationSource(Client), _projectClientDiagnostics, Pipeline, _projectRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns a Cognitive Services project specified by the parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName} + /// + /// + /// Operation Id + /// Projects_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of Cognitive Services account's project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = _projectClientDiagnostics.CreateScope("ProjectCollection.Get"); + scope.Start(); + try + { + var response = await _projectRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ProjectResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns a Cognitive Services project specified by the parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName} + /// + /// + /// Operation Id + /// Projects_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of Cognitive Services account's project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = _projectClientDiagnostics.CreateScope("ProjectCollection.Get"); + scope.Start(); + try + { + var response = _projectRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ProjectResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns all the projects in a Cognitive Services account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects + /// + /// + /// Operation Id + /// Projects_List + /// + /// + /// Default Api Version + /// 2025-04-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) => _projectRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _projectRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ProjectResource(Client, ProjectData.DeserializeProjectData(e)), _projectClientDiagnostics, Pipeline, "ProjectCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Returns all the projects in a Cognitive Services account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects + /// + /// + /// Operation Id + /// Projects_List + /// + /// + /// Default Api Version + /// 2025-04-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) => _projectRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _projectRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ProjectResource(Client, ProjectData.DeserializeProjectData(e)), _projectClientDiagnostics, Pipeline, "ProjectCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName} + /// + /// + /// Operation Id + /// Projects_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of Cognitive Services account's project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = _projectClientDiagnostics.CreateScope("ProjectCollection.Exists"); + scope.Start(); + try + { + var response = await _projectRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectName, 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.CognitiveServices/accounts/{accountName}/projects/{projectName} + /// + /// + /// Operation Id + /// Projects_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of Cognitive Services account's project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = _projectClientDiagnostics.CreateScope("ProjectCollection.Exists"); + scope.Start(); + try + { + var response = _projectRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectName, 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.CognitiveServices/accounts/{accountName}/projects/{projectName} + /// + /// + /// Operation Id + /// Projects_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of Cognitive Services account's project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = _projectClientDiagnostics.CreateScope("ProjectCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _projectRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ProjectResource(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.CognitiveServices/accounts/{accountName}/projects/{projectName} + /// + /// + /// Operation Id + /// Projects_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of Cognitive Services account's project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = _projectClientDiagnostics.CreateScope("ProjectCollection.GetIfExists"); + scope.Start(); + try + { + var response = _projectRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ProjectResource(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/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ProjectData.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ProjectData.Serialization.cs new file mode 100644 index 000000000000..b3b32517a652 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ProjectData.Serialization.cs @@ -0,0 +1,376 @@ +// 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; +using Azure.ResourceManager.CognitiveServices.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CognitiveServices +{ + public partial class ProjectData : 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(ProjectData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + JsonSerializer.Serialize(writer, Identity); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && Optional.IsDefined(ETag)) + { + writer.WritePropertyName("etag"u8); + writer.WriteStringValue(ETag.Value.ToString()); + } + } + + ProjectData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProjectData(document.RootElement, options); + } + + internal static ProjectData DeserializeProjectData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ManagedServiceIdentity identity = default; + ProjectProperties properties = default; + ETag? etag = 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("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = ProjectProperties.DeserializeProjectProperties(property.Value, options); + continue; + } + if (property.NameEquals("etag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + etag = new ETag(property.Value.GetString()); + 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 ProjectData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + identity, + properties, + etag, + 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(Location), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" location: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" location: "); + builder.AppendLine($"'{Location.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tags: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Tags)) + { + if (Tags.Any()) + { + builder.Append(" tags: "); + builder.AppendLine("{"); + foreach (var item in Tags) + { + 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(" }"); + } + } + } + + 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: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Properties), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" properties: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Properties)) + { + builder.Append(" properties: "); + BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); + } + } + + 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(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.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(ProjectData)} does not support writing '{options.Format}' format."); + } + } + + ProjectData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeProjectData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProjectData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ProjectData.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ProjectData.cs new file mode 100644 index 000000000000..5801d490cd26 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ProjectData.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; +using Azure.ResourceManager.CognitiveServices.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CognitiveServices +{ + /// + /// A class representing the Project data model. + /// Cognitive Services project is an Azure resource representing the provisioned account's project, it's type, location and SKU. + /// + public partial class ProjectData : 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. + public ProjectData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Identity for the resource. + /// Properties of Cognitive Services project. + /// Resource Etag. + /// Keeps track of any properties unknown to the library. + internal ProjectData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, ProjectProperties properties, ETag? etag, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Identity = identity; + Properties = properties; + ETag = etag; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ProjectData() + { + } + + /// Identity for the resource. + [WirePath("identity")] + public ManagedServiceIdentity Identity { get; set; } + /// Properties of Cognitive Services project. + [WirePath("properties")] + public ProjectProperties Properties { get; set; } + /// Resource Etag. + [WirePath("etag")] + public ETag? ETag { get; } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ProjectResource.Serialization.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ProjectResource.Serialization.cs new file mode 100644 index 000000000000..8f70f23ae1f2 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ProjectResource.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.CognitiveServices +{ + public partial class ProjectResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ProjectData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ProjectData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ProjectResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ProjectResource.cs new file mode 100644 index 000000000000..73177a61f8a1 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/ProjectResource.cs @@ -0,0 +1,844 @@ +// 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; + +namespace Azure.ResourceManager.CognitiveServices +{ + /// + /// A Class representing a Project 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 GetProjectResource method. + /// Otherwise you can get one from its parent resource using the GetProject method. + /// + public partial class ProjectResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The accountName. + /// The projectName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName, string projectName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _projectClientDiagnostics; + private readonly ProjectsRestOperations _projectRestClient; + private readonly ProjectData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.CognitiveServices/accounts/projects"; + + /// Initializes a new instance of the class for mocking. + protected ProjectResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ProjectResource(ArmClient client, ProjectData 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 ProjectResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _projectClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CognitiveServices", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string projectApiVersion); + _projectRestClient = new ProjectsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, projectApiVersion); +#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 ProjectData 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 AccountProjectConnectionResources in the Project. + /// An object representing collection of AccountProjectConnectionResources and their operations over a AccountProjectConnectionResource. + public virtual AccountProjectConnectionCollection GetAccountProjectConnections() + { + return GetCachedClient(client => new AccountProjectConnectionCollection(client, Id)); + } + + /// + /// Lists Cognitive Services project connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName} + /// + /// + /// Operation Id + /// ProjectConnection_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Friendly name of the connection. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAccountProjectConnectionAsync(string connectionName, CancellationToken cancellationToken = default) + { + return await GetAccountProjectConnections().GetAsync(connectionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Lists Cognitive Services project connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName} + /// + /// + /// Operation Id + /// ProjectConnection_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Friendly name of the connection. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAccountProjectConnection(string connectionName, CancellationToken cancellationToken = default) + { + return GetAccountProjectConnections().Get(connectionName, cancellationToken); + } + + /// Gets a collection of AccountProjectCapabilityHostResources in the Project. + /// An object representing collection of AccountProjectCapabilityHostResources and their operations over a AccountProjectCapabilityHostResource. + public virtual AccountProjectCapabilityHostCollection GetAccountProjectCapabilityHosts() + { + return GetCachedClient(client => new AccountProjectCapabilityHostCollection(client, Id)); + } + + /// + /// Get project capabilityHost. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// ProjectCapabilityHosts_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the capability host associated with the Cognitive Services Resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAccountProjectCapabilityHostAsync(string capabilityHostName, CancellationToken cancellationToken = default) + { + return await GetAccountProjectCapabilityHosts().GetAsync(capabilityHostName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get project capabilityHost. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName} + /// + /// + /// Operation Id + /// ProjectCapabilityHosts_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the capability host associated with the Cognitive Services Resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAccountProjectCapabilityHost(string capabilityHostName, CancellationToken cancellationToken = default) + { + return GetAccountProjectCapabilityHosts().Get(capabilityHostName, cancellationToken); + } + + /// + /// Returns a Cognitive Services project specified by the parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName} + /// + /// + /// Operation Id + /// Projects_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _projectClientDiagnostics.CreateScope("ProjectResource.Get"); + scope.Start(); + try + { + var response = await _projectRestClient.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 ProjectResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns a Cognitive Services project specified by the parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName} + /// + /// + /// Operation Id + /// Projects_Get + /// + /// + /// Default Api Version + /// 2025-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _projectClientDiagnostics.CreateScope("ProjectResource.Get"); + scope.Start(); + try + { + var response = _projectRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ProjectResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a Cognitive Services project from the resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName} + /// + /// + /// Operation Id + /// Projects_Delete + /// + /// + /// Default Api Version + /// 2025-04-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 = _projectClientDiagnostics.CreateScope("ProjectResource.Delete"); + scope.Start(); + try + { + var response = await _projectRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new CognitiveServicesArmOperation(_projectClientDiagnostics, Pipeline, _projectRestClient.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; + } + } + + /// + /// Deletes a Cognitive Services project from the resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName} + /// + /// + /// Operation Id + /// Projects_Delete + /// + /// + /// Default Api Version + /// 2025-04-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 = _projectClientDiagnostics.CreateScope("ProjectResource.Delete"); + scope.Start(); + try + { + var response = _projectRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new CognitiveServicesArmOperation(_projectClientDiagnostics, Pipeline, _projectRestClient.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; + } + } + + /// + /// Updates a Cognitive Services Project + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName} + /// + /// + /// Operation Id + /// Projects_Update + /// + /// + /// Default Api Version + /// 2025-04-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 parameters to provide for the created project. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ProjectData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _projectClientDiagnostics.CreateScope("ProjectResource.Update"); + scope.Start(); + try + { + var response = await _projectRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new CognitiveServicesArmOperation(new ProjectOperationSource(Client), _projectClientDiagnostics, Pipeline, _projectRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a Cognitive Services Project + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName} + /// + /// + /// Operation Id + /// Projects_Update + /// + /// + /// Default Api Version + /// 2025-04-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 parameters to provide for the created project. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ProjectData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _projectClientDiagnostics.CreateScope("ProjectResource.Update"); + scope.Start(); + try + { + var response = _projectRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new CognitiveServicesArmOperation(new ProjectOperationSource(Client), _projectClientDiagnostics, Pipeline, _projectRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName} + /// + /// + /// Operation Id + /// Projects_Get + /// + /// + /// Default Api Version + /// 2025-04-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 = _projectClientDiagnostics.CreateScope("ProjectResource.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 _projectRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ProjectResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ProjectData(current.Location); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName} + /// + /// + /// Operation Id + /// Projects_Get + /// + /// + /// Default Api Version + /// 2025-04-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 = _projectClientDiagnostics.CreateScope("ProjectResource.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 = _projectRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new ProjectResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ProjectData(current.Location); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + 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.CognitiveServices/accounts/{accountName}/projects/{projectName} + /// + /// + /// Operation Id + /// Projects_Get + /// + /// + /// Default Api Version + /// 2025-04-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 = _projectClientDiagnostics.CreateScope("ProjectResource.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 _projectRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ProjectResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ProjectData(current.Location); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + 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.CognitiveServices/accounts/{accountName}/projects/{projectName} + /// + /// + /// Operation Id + /// Projects_Get + /// + /// + /// Default Api Version + /// 2025-04-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 = _projectClientDiagnostics.CreateScope("ProjectResource.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 = _projectRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new ProjectResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ProjectData(current.Location); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName} + /// + /// + /// Operation Id + /// Projects_Get + /// + /// + /// Default Api Version + /// 2025-04-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 = _projectClientDiagnostics.CreateScope("ProjectResource.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 _projectRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ProjectResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ProjectData(current.Location); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName} + /// + /// + /// Operation Id + /// Projects_Get + /// + /// + /// Default Api Version + /// 2025-04-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 = _projectClientDiagnostics.CreateScope("ProjectResource.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 = _projectRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new ProjectResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ProjectData(current.Location); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiBlocklistCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiBlocklistCollection.cs index 9a5853bc4d6a..804d8ac76ff3 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiBlocklistCollection.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiBlocklistCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task> CreateOrUpdateAsyn /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -166,7 +166,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitU /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> GetAsync(string raiBlo /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(string raiBlocklistName, Cance /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -316,7 +316,7 @@ public virtual Pageable GetAll(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string raiBlocklistName, C /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual Response Exists(string raiBlocklistName, CancellationToken /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -447,7 +447,7 @@ public virtual async Task> GetIfExistsAsy /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiBlocklistItemCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiBlocklistItemCollection.cs index d55603084eb8..cd73496cabcf 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiBlocklistItemCollection.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiBlocklistItemCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task> CreateOrUpdate /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -166,7 +166,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil w /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> GetAsync(string ra /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(string raiBlocklistItemNam /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable GetAllAsync(CancellationT /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -316,7 +316,7 @@ public virtual Pageable GetAll(CancellationToken cance /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string raiBlocklistItemNam /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual Response Exists(string raiBlocklistItemName, CancellationTo /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -447,7 +447,7 @@ public virtual async Task> GetIfExist /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiBlocklistItemResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiBlocklistItemResource.cs index 93ad2f2e091b..f5ad8afaee8f 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiBlocklistItemResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiBlocklistItemResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(Cancellat /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancella /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task> UpdateAsync(Wa /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -363,7 +363,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -420,7 +420,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -477,7 +477,7 @@ public virtual Response AddTag(string key, string valu /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -533,7 +533,7 @@ public virtual async Task> SetTagsAsync(IDict /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -589,7 +589,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -644,7 +644,7 @@ public virtual async Task> RemoveTagAsync(str /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiBlocklistResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiBlocklistResource.cs index 6ed676479deb..f998df10ffad 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiBlocklistResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiBlocklistResource.cs @@ -115,7 +115,7 @@ public virtual RaiBlocklistItemCollection GetRaiBlocklistItems() /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -146,7 +146,7 @@ public virtual async Task> GetRaiBlocklistIte /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -177,7 +177,7 @@ public virtual Response GetRaiBlocklistItem(string rai /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -217,7 +217,7 @@ public virtual async Task> GetAsync(CancellationT /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(CancellationToken cancellation /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -299,7 +299,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -341,7 +341,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -389,7 +389,7 @@ public virtual async Task> UpdateAsync(WaitUn /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -437,7 +437,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, Ra /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -479,7 +479,7 @@ public virtual async Task> BatchAddRaiBlocklistIt /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -521,7 +521,7 @@ public virtual Response BatchAddRaiBlocklistItem(IEnumerab /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -563,7 +563,7 @@ public virtual async Task BatchDeleteRaiBlocklistItemAsync(BinaryData /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -605,7 +605,7 @@ public virtual Response BatchDeleteRaiBlocklistItem(BinaryData raiBlocklistItems /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -662,7 +662,7 @@ public virtual async Task> AddTagAsync(string key /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -719,7 +719,7 @@ public virtual Response AddTag(string key, string value, C /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -775,7 +775,7 @@ public virtual async Task> SetTagsAsync(IDictiona /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -831,7 +831,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -886,7 +886,7 @@ public virtual async Task> RemoveTagAsync(string /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiContentFilterCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiContentFilterCollection.cs index 947b30d1ece9..72718e021460 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiContentFilterCollection.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiContentFilterCollection.cs @@ -68,7 +68,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> GetAsync(string fi /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -158,7 +158,7 @@ public virtual Response Get(string filterName, Cancell /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -188,7 +188,7 @@ public virtual AsyncPageable GetAllAsync(CancellationT /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -218,7 +218,7 @@ public virtual Pageable GetAll(CancellationToken cance /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -261,7 +261,7 @@ public virtual async Task> ExistsAsync(string filterName, Cancell /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -304,7 +304,7 @@ public virtual Response Exists(string filterName, CancellationToken cancel /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -349,7 +349,7 @@ public virtual async Task> GetIfExist /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiContentFilterResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiContentFilterResource.cs index 978bcbe227c1..4e499dd34b79 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiContentFilterResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiContentFilterResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Cancellat /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiPolicyCollection.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiPolicyCollection.cs index 7d09da46693d..ac10390f2964 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiPolicyCollection.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiPolicyCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task> CreateOrUpdateAsync(W /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -166,7 +166,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUnti /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> GetAsync(string raiPolicy /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(string raiPolicyName, Cancellatio /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken ca /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -316,7 +316,7 @@ public virtual Pageable GetAll(CancellationToken cancellation /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string raiPolicyName, Canc /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual Response Exists(string raiPolicyName, CancellationToken can /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -447,7 +447,7 @@ public virtual async Task> GetIfExistsAsync( /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiPolicyResource.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiPolicyResource.cs index 1efd777e2ebe..9567c028e059 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiPolicyResource.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RaiPolicyResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(CancellationToke /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken cancellationTok /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -314,7 +314,7 @@ public virtual async Task> UpdateAsync(WaitUntil /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -362,7 +362,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, RaiPo /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -419,7 +419,7 @@ public virtual async Task> AddTagAsync(string key, s /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -476,7 +476,7 @@ public virtual Response AddTag(string key, string value, Canc /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -532,7 +532,7 @@ public virtual async Task> SetTagsAsync(IDictionary< /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -588,7 +588,7 @@ public virtual Response SetTags(IDictionary t /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource @@ -643,7 +643,7 @@ public virtual async Task> RemoveTagAsync(string key /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/AccountCapabilityHostsRestOperations.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/AccountCapabilityHostsRestOperations.cs new file mode 100644 index 000000000000..97fdeb043eaf --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/AccountCapabilityHostsRestOperations.cs @@ -0,0 +1,334 @@ +// 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; + +namespace Azure.ResourceManager.CognitiveServices +{ + internal partial class AccountCapabilityHostsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AccountCapabilityHostsRestOperations. + /// 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 AccountCapabilityHostsRestOperations(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 ?? "2025-04-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string accountName, string capabilityHostName) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/capabilityHosts/", false); + uri.AppendPath(capabilityHostName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string accountName, string capabilityHostName) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/capabilityHosts/", false); + uri.AppendPath(capabilityHostName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete account capabilityHost. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The name of the capability host associated with the Cognitive Services 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 accountName, string capabilityHostName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(capabilityHostName, nameof(capabilityHostName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, accountName, capabilityHostName); + 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 account capabilityHost. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The name of the capability host associated with the Cognitive Services 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 accountName, string capabilityHostName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(capabilityHostName, nameof(capabilityHostName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, accountName, capabilityHostName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string accountName, string capabilityHostName) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/capabilityHosts/", false); + uri.AppendPath(capabilityHostName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string accountName, string capabilityHostName) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/capabilityHosts/", false); + uri.AppendPath(capabilityHostName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get account capabilityHost. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The name of the capability host associated with the Cognitive Services 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 accountName, string capabilityHostName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(capabilityHostName, nameof(capabilityHostName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName, capabilityHostName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CapabilityHostData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CapabilityHostData.DeserializeCapabilityHostData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((CapabilityHostData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get account capabilityHost. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The name of the capability host associated with the Cognitive Services 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 accountName, string capabilityHostName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(capabilityHostName, nameof(capabilityHostName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName, capabilityHostName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CapabilityHostData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CapabilityHostData.DeserializeCapabilityHostData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((CapabilityHostData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string accountName, string capabilityHostName, CapabilityHostData 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/capabilityHosts/", false); + uri.AppendPath(capabilityHostName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string accountName, string capabilityHostName, CapabilityHostData 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/capabilityHosts/", false); + uri.AppendPath(capabilityHostName, 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 or update account capabilityHost. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The name of the capability host associated with the Cognitive Services Resource. + /// CapabilityHost definition. + /// 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 accountName, string capabilityHostName, CapabilityHostData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(capabilityHostName, nameof(capabilityHostName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, accountName, capabilityHostName, 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 or update account capabilityHost. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The name of the capability host associated with the Cognitive Services Resource. + /// CapabilityHost definition. + /// 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 accountName, string capabilityHostName, CapabilityHostData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(capabilityHostName, nameof(capabilityHostName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, accountName, capabilityHostName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/AccountConnectionRestOperations.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/AccountConnectionRestOperations.cs new file mode 100644 index 000000000000..4af101230a10 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/AccountConnectionRestOperations.cs @@ -0,0 +1,665 @@ +// 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.CognitiveServices.Models; + +namespace Azure.ResourceManager.CognitiveServices +{ + internal partial class AccountConnectionRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AccountConnectionRestOperations. + /// 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 AccountConnectionRestOperations(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 ?? "2025-04-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string accountName, string connectionName) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string accountName, string connectionName) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete Cognitive Services account connection by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// Friendly name of the connection. + /// 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 accountName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, accountName, connectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete Cognitive Services account connection by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// Friendly name of the connection. + /// 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 accountName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, accountName, connectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string accountName, string connectionName) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string accountName, string connectionName) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists Cognitive Services account connection by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// Friendly name of the connection. + /// 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 accountName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName, connectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConnectionPropertiesV2BasicResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ConnectionPropertiesV2BasicResourceData.DeserializeConnectionPropertiesV2BasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ConnectionPropertiesV2BasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists Cognitive Services account connection by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// Friendly name of the connection. + /// 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 accountName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName, connectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConnectionPropertiesV2BasicResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ConnectionPropertiesV2BasicResourceData.DeserializeConnectionPropertiesV2BasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ConnectionPropertiesV2BasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string accountName, string connectionName, ConnectionUpdateContent content) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string accountName, string connectionName, ConnectionUpdateContent content) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Update Cognitive Services account connection under the specified account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// Friendly name of the connection. + /// Parameters for account connection update. + /// 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 accountName, string connectionName, ConnectionUpdateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, accountName, connectionName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConnectionPropertiesV2BasicResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ConnectionPropertiesV2BasicResourceData.DeserializeConnectionPropertiesV2BasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update Cognitive Services account connection under the specified account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// Friendly name of the connection. + /// Parameters for account connection update. + /// 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 accountName, string connectionName, ConnectionUpdateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, accountName, connectionName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConnectionPropertiesV2BasicResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ConnectionPropertiesV2BasicResourceData.DeserializeConnectionPropertiesV2BasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string accountName, string connectionName, ConnectionPropertiesV2BasicResourceData 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string accountName, string connectionName, ConnectionPropertiesV2BasicResourceData 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, 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 or update Cognitive Services account connection under the specified account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// Friendly name of the connection. + /// The object for creating or updating a new account connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> CreateAsync(string subscriptionId, string resourceGroupName, string accountName, string connectionName, ConnectionPropertiesV2BasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, accountName, connectionName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConnectionPropertiesV2BasicResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ConnectionPropertiesV2BasicResourceData.DeserializeConnectionPropertiesV2BasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or update Cognitive Services account connection under the specified account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// Friendly name of the connection. + /// The object for creating or updating a new account connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string accountName, string connectionName, ConnectionPropertiesV2BasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, accountName, connectionName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConnectionPropertiesV2BasicResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ConnectionPropertiesV2BasicResourceData.DeserializeConnectionPropertiesV2BasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string accountName, string target, string category, bool? includeAll) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/connections", false); + if (target != null) + { + uri.AppendQuery("target", target, true); + } + if (category != null) + { + uri.AppendQuery("category", category, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + if (includeAll != null) + { + uri.AppendQuery("includeAll", includeAll.Value, true); + } + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string accountName, string target, string category, bool? includeAll) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/connections", false); + if (target != null) + { + uri.AppendQuery("target", target, true); + } + if (category != null) + { + uri.AppendQuery("category", category, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + if (includeAll != null) + { + uri.AppendQuery("includeAll", includeAll.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all the available Cognitive Services account connections under the specified account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// Target of the connection. + /// Category of the connection. + /// query parameter that indicates if get connection call should return both connections and datastores. + /// 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 accountName, string target = null, string category = null, bool? includeAll = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, accountName, target, category, includeAll); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConnectionPropertiesV2BasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ConnectionPropertiesV2BasicResourceArmPaginatedResult.DeserializeConnectionPropertiesV2BasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all the available Cognitive Services account connections under the specified account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// Target of the connection. + /// Category of the connection. + /// query parameter that indicates if get connection call should return both connections and datastores. + /// 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 accountName, string target = null, string category = null, bool? includeAll = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, accountName, target, category, includeAll); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConnectionPropertiesV2BasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ConnectionPropertiesV2BasicResourceArmPaginatedResult.DeserializeConnectionPropertiesV2BasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string accountName, string target, string category, bool? includeAll) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string accountName, string target, string category, bool? includeAll) + { + 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; + } + + /// Lists all the available Cognitive Services account connections under the specified account. + /// 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 Cognitive Services account. + /// Target of the connection. + /// Category of the connection. + /// query parameter that indicates if get connection call should return both connections and datastores. + /// 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 accountName, string target = null, string category = null, bool? includeAll = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, accountName, target, category, includeAll); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConnectionPropertiesV2BasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ConnectionPropertiesV2BasicResourceArmPaginatedResult.DeserializeConnectionPropertiesV2BasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all the available Cognitive Services account connections under the specified account. + /// 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 Cognitive Services account. + /// Target of the connection. + /// Category of the connection. + /// query parameter that indicates if get connection call should return both connections and datastores. + /// 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 accountName, string target = null, string category = null, bool? includeAll = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, accountName, target, category, includeAll); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConnectionPropertiesV2BasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ConnectionPropertiesV2BasicResourceArmPaginatedResult.DeserializeConnectionPropertiesV2BasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/AccountsRestOperations.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/AccountsRestOperations.cs index 616ccc280f61..0f3ae628ce65 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/AccountsRestOperations.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/AccountsRestOperations.cs @@ -32,7 +32,7 @@ public AccountsRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-10-01"; + _apiVersion = apiVersion ?? "2025-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/CognitiveServicesManagementRestOperations.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/CognitiveServicesManagementRestOperations.cs index 1505d16ee346..fff91e0b2732 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/CognitiveServicesManagementRestOperations.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/CognitiveServicesManagementRestOperations.cs @@ -32,7 +32,7 @@ public CognitiveServicesManagementRestOperations(HttpPipeline pipeline, string a { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-10-01"; + _apiVersion = apiVersion ?? "2025-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/CommitmentPlansRestOperations.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/CommitmentPlansRestOperations.cs index 2515af197c0c..cb452266229a 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/CommitmentPlansRestOperations.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/CommitmentPlansRestOperations.cs @@ -32,7 +32,7 @@ public CommitmentPlansRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-10-01"; + _apiVersion = apiVersion ?? "2025-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/CommitmentTiersRestOperations.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/CommitmentTiersRestOperations.cs index b6a8aabf647a..b6dac3cef866 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/CommitmentTiersRestOperations.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/CommitmentTiersRestOperations.cs @@ -32,7 +32,7 @@ public CommitmentTiersRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-10-01"; + _apiVersion = apiVersion ?? "2025-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/DefenderForAISettingsRestOperations.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/DefenderForAISettingsRestOperations.cs index cc66856f64d4..950c8c954104 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/DefenderForAISettingsRestOperations.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/DefenderForAISettingsRestOperations.cs @@ -32,7 +32,7 @@ public DefenderForAISettingsRestOperations(HttpPipeline pipeline, string applica { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-10-01"; + _apiVersion = apiVersion ?? "2025-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/DeletedAccountsRestOperations.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/DeletedAccountsRestOperations.cs index 6492d8d8d648..3daaf2a01cad 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/DeletedAccountsRestOperations.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/DeletedAccountsRestOperations.cs @@ -32,7 +32,7 @@ public DeletedAccountsRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-10-01"; + _apiVersion = apiVersion ?? "2025-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/DeploymentsRestOperations.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/DeploymentsRestOperations.cs index 382c7427470a..4cf3bb7dd456 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/DeploymentsRestOperations.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/DeploymentsRestOperations.cs @@ -32,7 +32,7 @@ public DeploymentsRestOperations(HttpPipeline pipeline, string applicationId, Ur { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-10-01"; + _apiVersion = apiVersion ?? "2025-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/EncryptionScopesRestOperations.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/EncryptionScopesRestOperations.cs index a6a8a403024a..375ee17a1321 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/EncryptionScopesRestOperations.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/EncryptionScopesRestOperations.cs @@ -32,7 +32,7 @@ public EncryptionScopesRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-10-01"; + _apiVersion = apiVersion ?? "2025-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/LocationBasedModelCapacitiesRestOperations.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/LocationBasedModelCapacitiesRestOperations.cs index f69ce4373fab..97ed25616732 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/LocationBasedModelCapacitiesRestOperations.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/LocationBasedModelCapacitiesRestOperations.cs @@ -32,7 +32,7 @@ public LocationBasedModelCapacitiesRestOperations(HttpPipeline pipeline, string { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-10-01"; + _apiVersion = apiVersion ?? "2025-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/ModelCapacitiesRestOperations.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/ModelCapacitiesRestOperations.cs index 93d72ea906c4..76e5abbe44a2 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/ModelCapacitiesRestOperations.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/ModelCapacitiesRestOperations.cs @@ -32,7 +32,7 @@ public ModelCapacitiesRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-10-01"; + _apiVersion = apiVersion ?? "2025-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/ModelsRestOperations.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/ModelsRestOperations.cs index 4cf97a24326a..c27afe842e15 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/ModelsRestOperations.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/ModelsRestOperations.cs @@ -32,7 +32,7 @@ public ModelsRestOperations(HttpPipeline pipeline, string applicationId, Uri end { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-10-01"; + _apiVersion = apiVersion ?? "2025-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs index 3f22bd9f9940..04bdb5dc595a 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs @@ -32,7 +32,7 @@ public NetworkSecurityPerimeterConfigurationsRestOperations(HttpPipeline pipelin { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-10-01"; + _apiVersion = apiVersion ?? "2025-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index cd3f26775c2e..4af7e979e522 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/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-10-01"; + _apiVersion = apiVersion ?? "2025-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs index 5aab0c8fdf43..0d907b09c87e 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/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-10-01"; + _apiVersion = apiVersion ?? "2025-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/ProjectCapabilityHostsRestOperations.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/ProjectCapabilityHostsRestOperations.cs new file mode 100644 index 000000000000..4d53eeca9baf --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/ProjectCapabilityHostsRestOperations.cs @@ -0,0 +1,358 @@ +// 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; + +namespace Azure.ResourceManager.CognitiveServices +{ + internal partial class ProjectCapabilityHostsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ProjectCapabilityHostsRestOperations. + /// 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 ProjectCapabilityHostsRestOperations(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 ?? "2025-04-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string accountName, string projectName, string capabilityHostName) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/capabilityHosts/", false); + uri.AppendPath(capabilityHostName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string accountName, string projectName, string capabilityHostName) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/capabilityHosts/", false); + uri.AppendPath(capabilityHostName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete project capabilityHost. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The name of Cognitive Services account's project. + /// The name of the capability host associated with the Cognitive Services 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 accountName, string projectName, string capabilityHostName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(capabilityHostName, nameof(capabilityHostName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, accountName, projectName, capabilityHostName); + 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 project capabilityHost. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The name of Cognitive Services account's project. + /// The name of the capability host associated with the Cognitive Services 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 accountName, string projectName, string capabilityHostName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(capabilityHostName, nameof(capabilityHostName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, accountName, projectName, capabilityHostName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string accountName, string projectName, string capabilityHostName) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/capabilityHosts/", false); + uri.AppendPath(capabilityHostName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string accountName, string projectName, string capabilityHostName) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/capabilityHosts/", false); + uri.AppendPath(capabilityHostName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get project capabilityHost. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The name of Cognitive Services account's project. + /// The name of the capability host associated with the Cognitive Services 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 accountName, string projectName, string capabilityHostName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(capabilityHostName, nameof(capabilityHostName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName, projectName, capabilityHostName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CapabilityHostData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CapabilityHostData.DeserializeCapabilityHostData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((CapabilityHostData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get project capabilityHost. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The name of Cognitive Services account's project. + /// The name of the capability host associated with the Cognitive Services 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 accountName, string projectName, string capabilityHostName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(capabilityHostName, nameof(capabilityHostName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName, projectName, capabilityHostName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CapabilityHostData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CapabilityHostData.DeserializeCapabilityHostData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((CapabilityHostData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string accountName, string projectName, string capabilityHostName, CapabilityHostData 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/capabilityHosts/", false); + uri.AppendPath(capabilityHostName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string accountName, string projectName, string capabilityHostName, CapabilityHostData 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/capabilityHosts/", false); + uri.AppendPath(capabilityHostName, 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 or update project capabilityHost. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The name of Cognitive Services account's project. + /// The name of the capability host associated with the Cognitive Services Resource. + /// CapabilityHost definition. + /// 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 accountName, string projectName, string capabilityHostName, CapabilityHostData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(capabilityHostName, nameof(capabilityHostName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, accountName, projectName, capabilityHostName, 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 or update project capabilityHost. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The name of Cognitive Services account's project. + /// The name of the capability host associated with the Cognitive Services Resource. + /// CapabilityHost definition. + /// 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 accountName, string projectName, string capabilityHostName, CapabilityHostData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(capabilityHostName, nameof(capabilityHostName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, accountName, projectName, capabilityHostName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/ProjectConnectionRestOperations.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/ProjectConnectionRestOperations.cs new file mode 100644 index 000000000000..a93cbe4b09e2 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/ProjectConnectionRestOperations.cs @@ -0,0 +1,709 @@ +// 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.CognitiveServices.Models; + +namespace Azure.ResourceManager.CognitiveServices +{ + internal partial class ProjectConnectionRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ProjectConnectionRestOperations. + /// 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 ProjectConnectionRestOperations(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 ?? "2025-04-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string accountName, string projectName, string connectionName) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string accountName, string projectName, string connectionName) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete Cognitive Services project connection by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The name of Cognitive Services account's project. + /// Friendly name of the connection. + /// 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 accountName, string projectName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, accountName, projectName, connectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete Cognitive Services project connection by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The name of Cognitive Services account's project. + /// Friendly name of the connection. + /// 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 accountName, string projectName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, accountName, projectName, connectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string accountName, string projectName, string connectionName) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string accountName, string projectName, string connectionName) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists Cognitive Services project connection by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The name of Cognitive Services account's project. + /// Friendly name of the connection. + /// 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 accountName, string projectName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName, projectName, connectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConnectionPropertiesV2BasicResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ConnectionPropertiesV2BasicResourceData.DeserializeConnectionPropertiesV2BasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ConnectionPropertiesV2BasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists Cognitive Services project connection by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The name of Cognitive Services account's project. + /// Friendly name of the connection. + /// 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 accountName, string projectName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName, projectName, connectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConnectionPropertiesV2BasicResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ConnectionPropertiesV2BasicResourceData.DeserializeConnectionPropertiesV2BasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ConnectionPropertiesV2BasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string accountName, string projectName, string connectionName, ConnectionUpdateContent content) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string accountName, string projectName, string connectionName, ConnectionUpdateContent content) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Update Cognitive Services project connection under the specified project. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The name of Cognitive Services account's project. + /// Friendly name of the connection. + /// Parameters for account connection update. + /// 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 accountName, string projectName, string connectionName, ConnectionUpdateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, accountName, projectName, connectionName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConnectionPropertiesV2BasicResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ConnectionPropertiesV2BasicResourceData.DeserializeConnectionPropertiesV2BasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update Cognitive Services project connection under the specified project. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The name of Cognitive Services account's project. + /// Friendly name of the connection. + /// Parameters for account connection update. + /// 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 accountName, string projectName, string connectionName, ConnectionUpdateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, accountName, projectName, connectionName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConnectionPropertiesV2BasicResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ConnectionPropertiesV2BasicResourceData.DeserializeConnectionPropertiesV2BasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string accountName, string projectName, string connectionName, ConnectionPropertiesV2BasicResourceData 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string accountName, string projectName, string connectionName, ConnectionPropertiesV2BasicResourceData 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, 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 or update Cognitive Services project connection under the specified project. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The name of Cognitive Services account's project. + /// Friendly name of the connection. + /// The object for creating or updating a new account connection. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> CreateAsync(string subscriptionId, string resourceGroupName, string accountName, string projectName, string connectionName, ConnectionPropertiesV2BasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, accountName, projectName, connectionName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConnectionPropertiesV2BasicResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ConnectionPropertiesV2BasicResourceData.DeserializeConnectionPropertiesV2BasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or update Cognitive Services project connection under the specified project. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The name of Cognitive Services account's project. + /// Friendly name of the connection. + /// The object for creating or updating a new account connection. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string accountName, string projectName, string connectionName, ConnectionPropertiesV2BasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, accountName, projectName, connectionName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConnectionPropertiesV2BasicResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ConnectionPropertiesV2BasicResourceData.DeserializeConnectionPropertiesV2BasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string accountName, string projectName, string target, string category, bool? includeAll) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/connections", false); + if (target != null) + { + uri.AppendQuery("target", target, true); + } + if (category != null) + { + uri.AppendQuery("category", category, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + if (includeAll != null) + { + uri.AppendQuery("includeAll", includeAll.Value, true); + } + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string accountName, string projectName, string target, string category, bool? includeAll) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/connections", false); + if (target != null) + { + uri.AppendQuery("target", target, true); + } + if (category != null) + { + uri.AppendQuery("category", category, true); + } + uri.AppendQuery("api-version", _apiVersion, true); + if (includeAll != null) + { + uri.AppendQuery("includeAll", includeAll.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all the available Cognitive Services project connections under the specified project. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The name of Cognitive Services account's project. + /// Target of the connection. + /// Category of the connection. + /// query parameter that indicates if get connection call should return both connections and datastores. + /// 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 accountName, string projectName, string target = null, string category = null, bool? includeAll = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, accountName, projectName, target, category, includeAll); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConnectionPropertiesV2BasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ConnectionPropertiesV2BasicResourceArmPaginatedResult.DeserializeConnectionPropertiesV2BasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all the available Cognitive Services project connections under the specified project. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The name of Cognitive Services account's project. + /// Target of the connection. + /// Category of the connection. + /// query parameter that indicates if get connection call should return both connections and datastores. + /// 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 accountName, string projectName, string target = null, string category = null, bool? includeAll = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, accountName, projectName, target, category, includeAll); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConnectionPropertiesV2BasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ConnectionPropertiesV2BasicResourceArmPaginatedResult.DeserializeConnectionPropertiesV2BasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string accountName, string projectName, string target, string category, bool? includeAll) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string accountName, string projectName, string target, string category, bool? includeAll) + { + 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; + } + + /// Lists all the available Cognitive Services project connections under the specified project. + /// 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 Cognitive Services account. + /// The name of Cognitive Services account's project. + /// Target of the connection. + /// Category of the connection. + /// query parameter that indicates if get connection call should return both connections and datastores. + /// 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 accountName, string projectName, string target = null, string category = null, bool? includeAll = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, accountName, projectName, target, category, includeAll); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConnectionPropertiesV2BasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ConnectionPropertiesV2BasicResourceArmPaginatedResult.DeserializeConnectionPropertiesV2BasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all the available Cognitive Services project connections under the specified project. + /// 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 Cognitive Services account. + /// The name of Cognitive Services account's project. + /// Target of the connection. + /// Category of the connection. + /// query parameter that indicates if get connection call should return both connections and datastores. + /// 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 accountName, string projectName, string target = null, string category = null, bool? includeAll = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, accountName, projectName, target, category, includeAll); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConnectionPropertiesV2BasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ConnectionPropertiesV2BasicResourceArmPaginatedResult.DeserializeConnectionPropertiesV2BasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/ProjectsRestOperations.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/ProjectsRestOperations.cs new file mode 100644 index 000000000000..57d1a2b0bae2 --- /dev/null +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/ProjectsRestOperations.cs @@ -0,0 +1,617 @@ +// 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.CognitiveServices.Models; + +namespace Azure.ResourceManager.CognitiveServices +{ + internal partial class ProjectsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ProjectsRestOperations. + /// 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 ProjectsRestOperations(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 ?? "2025-04-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string accountName, string projectName, ProjectData 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string accountName, string projectName, ProjectData 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, 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 Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's individual container to work on. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The name of Cognitive Services account's project. + /// The parameters to provide for the created project. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string accountName, string projectName, ProjectData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, accountName, projectName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create Cognitive Services Account's Project. Project is a sub-resource of an account which give AI developer it's individual container to work on. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The name of Cognitive Services account's project. + /// The parameters to provide for the created project. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string accountName, string projectName, ProjectData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, accountName, projectName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string accountName, string projectName, ProjectData 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string accountName, string projectName, ProjectData data) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, 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; + } + + /// Updates a Cognitive Services Project. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The name of Cognitive Services account's project. + /// The parameters to provide for the created project. + /// 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 accountName, string projectName, ProjectData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, accountName, projectName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates a Cognitive Services Project. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The name of Cognitive Services account's project. + /// The parameters to provide for the created project. + /// 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 accountName, string projectName, ProjectData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, accountName, projectName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string accountName, string projectName) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string accountName, string projectName) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a Cognitive Services project from the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The name of Cognitive Services account's project. + /// 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 accountName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, accountName, projectName); + 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); + } + } + + /// Deletes a Cognitive Services project from the resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The name of Cognitive Services account's project. + /// 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 accountName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, accountName, projectName); + _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 CreateGetRequestUri(string subscriptionId, string resourceGroupName, string accountName, string projectName) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string accountName, string projectName) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Returns a Cognitive Services project specified by the parameters. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The name of Cognitive Services account's project. + /// 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 accountName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProjectData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ProjectData.DeserializeProjectData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProjectData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Returns a Cognitive Services project specified by the parameters. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// The name of Cognitive Services account's project. + /// 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 accountName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProjectData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ProjectData.DeserializeProjectData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProjectData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string accountName) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/projects", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string accountName) + { + 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.CognitiveServices/accounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/projects", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Returns all the projects in a Cognitive Services account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// 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 accountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, accountName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProjectListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ProjectListResult.DeserializeProjectListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Returns all the projects in a Cognitive Services account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Cognitive Services account. + /// 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 accountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, accountName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProjectListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ProjectListResult.DeserializeProjectListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string accountName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string accountName) + { + 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; + } + + /// Returns all the projects in a Cognitive Services account. + /// 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 Cognitive Services account. + /// 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 accountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, accountName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProjectListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ProjectListResult.DeserializeProjectListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Returns all the projects in a Cognitive Services account. + /// 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 Cognitive Services account. + /// 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 accountName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, accountName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProjectListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ProjectListResult.DeserializeProjectListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/RaiBlocklistItemsRestOperations.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/RaiBlocklistItemsRestOperations.cs index accec0fb5b26..7295cbba6300 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/RaiBlocklistItemsRestOperations.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/RaiBlocklistItemsRestOperations.cs @@ -33,7 +33,7 @@ public RaiBlocklistItemsRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-10-01"; + _apiVersion = apiVersion ?? "2025-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/RaiBlocklistsRestOperations.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/RaiBlocklistsRestOperations.cs index e4fa1bd8d21b..87d405ad3ee4 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/RaiBlocklistsRestOperations.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/RaiBlocklistsRestOperations.cs @@ -32,7 +32,7 @@ public RaiBlocklistsRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-10-01"; + _apiVersion = apiVersion ?? "2025-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/RaiContentFiltersRestOperations.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/RaiContentFiltersRestOperations.cs index 40e289a62ad5..e5118ff22aa6 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/RaiContentFiltersRestOperations.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/RaiContentFiltersRestOperations.cs @@ -32,7 +32,7 @@ public RaiContentFiltersRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-10-01"; + _apiVersion = apiVersion ?? "2025-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/RaiPoliciesRestOperations.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/RaiPoliciesRestOperations.cs index 5981eb8eb292..adfa1c0dc3de 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/RaiPoliciesRestOperations.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/RaiPoliciesRestOperations.cs @@ -32,7 +32,7 @@ public RaiPoliciesRestOperations(HttpPipeline pipeline, string applicationId, Ur { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-10-01"; + _apiVersion = apiVersion ?? "2025-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/ResourceSkusRestOperations.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/ResourceSkusRestOperations.cs index bc0c25ae290f..4c298a209764 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/ResourceSkusRestOperations.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/ResourceSkusRestOperations.cs @@ -32,7 +32,7 @@ public ResourceSkusRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-10-01"; + _apiVersion = apiVersion ?? "2025-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/UsagesRestOperations.cs b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/UsagesRestOperations.cs index 835504ae915b..9971d2d92c1b 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/Generated/RestOperations/UsagesRestOperations.cs +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/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 ?? "2024-10-01"; + _apiVersion = apiVersion ?? "2025-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/autorest.md b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/autorest.md index 2479c12fbdc1..d42f658ea889 100644 --- a/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/autorest.md +++ b/sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: CognitiveServices namespace: Azure.ResourceManager.CognitiveServices -require: https://github.com/Azure/azure-rest-api-specs/blob/399cbac2de1bc0acbed4c9a0a864a9c84da3692e/specification/cognitiveservices/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/cognitiveservices/resource-manager/readme.md #tag: package-2024-10 output-folder: $(this-folder)/Generated clear-output-folder: true diff --git a/sdk/storage/ci.yml b/sdk/storage/ci.yml index 2ca0501b60bd..4e749e6b85b1 100644 --- a/sdk/storage/ci.yml +++ b/sdk/storage/ci.yml @@ -12,6 +12,8 @@ trigger: - sdk/storage/Azure.Storage.DataMovement/ - sdk/storage/Azure.Storage.DataMovement.Blobs/ - sdk/storage/Azure.Storage.DataMovement.Files/ + exclude: + - sdk/storage/Azure.ResourceManager.Storage/ - sdk/storage/Azure.Storage.DataMovement.Blobs.Files.Shares/ exclude: - sdk/storage/Azure.ResourceManager.Storage/