From b6579ca1a5d3f4aecdf88eae0f72c736c2c47e90 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Thu, 26 Mar 2026 17:42:54 +0000 Subject: [PATCH] Configurations: 'specification/cognitiveservices/CognitiveServices.Management/tspconfig.yaml', API Version: 2026-01-15-preview, SDK Release Type: beta, and CommitSHA: '2f2a6cd8118938c1ba3f65d4e09a550d4504620f' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6069559 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../CHANGELOG.md | 1062 +++++++- .../README.md | 4 +- .../SAMPLE.md | 2325 +++++++++++++---- .../pom.xml | 7 +- .../CognitiveServicesManager.java | 514 ++-- .../fluent/AccountCapabilityHostsClient.java | 140 +- .../fluent/AccountConnectionsClient.java | 42 +- .../fluent/AccountsClient.java | 62 +- .../fluent/AgentApplicationsClient.java | 318 +++ .../fluent/AgentDeploymentsClient.java | 303 +++ .../CognitiveServicesManagementClient.java | 250 +- .../fluent/CommitmentPlansClient.java | 178 +- .../fluent/CommitmentTiersClient.java | 6 +- .../fluent/ComputeOperationsClient.java | 43 + .../fluent/DefenderForAISettingsClient.java | 56 +- .../fluent/DeletedAccountsClient.java | 14 +- .../fluent/DeploymentsClient.java | 138 +- .../fluent/EncryptionScopesClient.java | 60 +- .../LocationBasedModelCapacitiesClient.java | 6 +- .../ManagedNetworkProvisionsClient.java | 87 + ...anagedNetworkSettingsOperationsClient.java | 290 ++ .../fluent/ModelCapacitiesClient.java | 2 +- .../fluent/ModelsClient.java | 6 +- ...SecurityPerimeterConfigurationsClient.java | 56 +- .../fluent/OperationsClient.java | 2 +- .../fluent/OutboundRulesClient.java | 247 ++ .../fluent/OutboundRulesOperationsClient.java | 92 + .../PrivateEndpointConnectionsClient.java | 60 +- .../fluent/PrivateLinkResourcesClient.java | 2 +- .../fluent/ProjectCapabilityHostsClient.java | 154 +- .../fluent/ProjectConnectionsClient.java | 44 +- .../fluent/ProjectsClient.java | 66 +- .../fluent/QuotaTiersClient.java | 86 +- .../fluent/RaiBlocklistItemsClient.java | 70 +- .../fluent/RaiBlocklistsClient.java | 60 +- .../fluent/RaiContentFiltersClient.java | 50 +- .../RaiExternalSafetyProvidersClient.java | 128 + ...ternalSafetyProvidersOperationsClient.java | 39 + .../fluent/RaiPoliciesClient.java | 60 +- .../fluent/RaiToolLabelsClient.java | 167 ++ .../fluent/RaiTopicsClient.java | 2 +- .../fluent/ResourceProvidersClient.java | 18 +- .../fluent/ResourceSkusClient.java | 2 +- .../fluent/SubscriptionRaiPoliciesClient.java | 119 + .../TestRaiExternalSafetyProvidersClient.java | 52 + .../fluent/UsagesClient.java | 12 +- .../fluent/models/AccountInner.java | 196 +- .../fluent/models/AccountModelInner.java | 196 +- .../models/AccountSkuListResultInner.java | 30 +- .../fluent/models/AgentApplicationInner.java | 155 ++ .../fluent/models/AgentDeploymentInner.java | 155 ++ ...erenceResourceArmPaginatedResultInner.java | 97 + .../fluent/models/ApiKeysInner.java | 38 +- .../CalculateModelCapacityResultInner.java | 56 +- .../fluent/models/CapabilityHostInner.java | 19 +- ...CommitmentPlanAccountAssociationInner.java | 49 +- ...tmentPlanAccountAssociationProperties.java | 10 +- .../fluent/models/CommitmentPlanInner.java | 150 +- .../fluent/models/CommitmentTierInner.java | 114 +- .../models/ComputeOperationStatusInner.java | 145 + ...nectionPropertiesV2BasicResourceInner.java | 20 +- .../models/DefenderForAISettingInner.java | 49 +- .../DefenderForAISettingProperties.java | 10 +- .../fluent/models/DeploymentInner.java | 72 +- .../models/DomainAvailabilityInner.java | 75 +- .../fluent/models/EncryptionScopeInner.java | 69 +- .../ManagedNetworkProvisionStatusInner.java | 88 + ...agedNetworkSettingsBasicResourceInner.java | 156 ++ .../models/ManagedNetworkSettingsInner.java | 293 +++ ...kSettingsPropertiesBasicResourceInner.java | 160 ++ ...ModelCapacityListResultValueItemInner.java | 41 +- .../fluent/models/ModelInner.java | 63 +- ...rkSecurityPerimeterConfigurationInner.java | 31 +- .../fluent/models/OperationInner.java | 42 +- .../OutboundRuleBasicResourceInner.java | 156 ++ .../models/OutboundRuleListResultInner.java | 97 + .../PrivateEndpointConnectionInner.java | 56 +- ...vateEndpointConnectionListResultInner.java | 30 +- .../PrivateLinkResourceListResultInner.java | 30 +- .../models/ProjectCapabilityHostInner.java | 156 ++ .../fluent/models/ProjectInner.java | 109 +- .../fluent/models/QuotaTierInner.java | 13 +- .../fluent/models/RaiBlocklistInner.java | 69 +- .../fluent/models/RaiBlocklistItemInner.java | 69 +- .../fluent/models/RaiContentFilterInner.java | 30 +- .../RaiExternalSafetyProviderInner.java | 180 ++ .../RaiExternalSafetyProviderSchemaInner.java | 191 ++ .../fluent/models/RaiPolicyInner.java | 69 +- .../fluent/models/RaiToolLabelInner.java | 201 ++ .../fluent/models/RaiTopicInner.java | 69 +- .../fluent/models/ResourceSkuInner.java | 86 +- .../SkuAvailabilityListResultInner.java | 30 +- .../fluent/models/SkuResourceInner.java | 55 +- .../fluent/models/UsageInner.java | 214 ++ .../fluent/models/UsageListResultInner.java | 48 +- .../fluent/models/package-info.java | 4 +- .../fluent/package-info.java | 4 +- .../AccountCapabilityHostsClientImpl.java | 817 +++--- .../AccountCapabilityHostsImpl.java | 69 +- .../AccountConnectionsClientImpl.java | 514 +--- .../AccountConnectionsImpl.java | 144 +- .../implementation/AccountImpl.java | 50 +- .../implementation/AccountModelImpl.java | 2 +- .../AccountSkuListResultImpl.java | 2 +- .../implementation/AccountsClientImpl.java | 986 ++----- .../implementation/AccountsImpl.java | 58 +- .../implementation/AgentApplicationImpl.java | 164 ++ .../AgentApplicationsClientImpl.java | 1185 +++++++++ .../implementation/AgentApplicationsImpl.java | 217 ++ .../implementation/AgentDeploymentImpl.java | 162 ++ .../AgentDeploymentsClientImpl.java | 1135 ++++++++ .../implementation/AgentDeploymentsImpl.java | 226 ++ ...ferenceResourceArmPaginatedResultImpl.java | 44 + .../implementation/ApiKeysImpl.java | 2 +- .../CalculateModelCapacityResultImpl.java | 2 +- .../implementation/CapabilityHostImpl.java | 20 +- ...nitiveServicesManagementClientBuilder.java | 28 +- ...CognitiveServicesManagementClientImpl.java | 556 ++-- .../CommitmentPlanAccountAssociationImpl.java | 2 +- .../implementation/CommitmentPlanImpl.java | 36 +- .../CommitmentPlansClientImpl.java | 2008 +++++--------- .../implementation/CommitmentPlansImpl.java | 94 +- .../implementation/CommitmentTierImpl.java | 2 +- .../CommitmentTiersClientImpl.java | 105 +- .../implementation/CommitmentTiersImpl.java | 2 +- .../ComputeOperationStatusImpl.java | 50 + .../ComputeOperationsClientImpl.java | 145 + .../implementation/ComputeOperationsImpl.java | 52 + ...nnectionPropertiesV2BasicResourceImpl.java | 35 +- .../DefenderForAISettingImpl.java | 2 +- .../DefenderForAISettingsClientImpl.java | 579 ++-- .../DefenderForAISettingsImpl.java | 32 +- .../DeletedAccountsClientImpl.java | 249 +- .../implementation/DeletedAccountsImpl.java | 10 +- .../implementation/DeploymentImpl.java | 37 +- .../implementation/DeploymentsClientImpl.java | 1067 +++----- .../implementation/DeploymentsImpl.java | 64 +- .../DomainAvailabilityImpl.java | 2 +- .../implementation/EncryptionScopeImpl.java | 10 +- .../EncryptionScopesClientImpl.java | 593 ++--- .../implementation/EncryptionScopesImpl.java | 30 +- ...ocationBasedModelCapacitiesClientImpl.java | 144 +- .../LocationBasedModelCapacitiesImpl.java | 2 +- .../ManagedNetworkProvisionStatusImpl.java | 33 + .../ManagedNetworkProvisionsClientImpl.java | 352 +++ .../ManagedNetworkProvisionsImpl.java | 57 + ...nagedNetworkSettingsBasicResourceImpl.java | 56 + .../ManagedNetworkSettingsImpl.java | 79 + ...edNetworkSettingsOperationsClientImpl.java | 1121 ++++++++ .../ManagedNetworkSettingsOperationsImpl.java | 160 ++ ...rkSettingsPropertiesBasicResourceImpl.java | 134 + .../ModelCapacitiesClientImpl.java | 121 +- .../implementation/ModelCapacitiesImpl.java | 2 +- .../ModelCapacityListResultValueItemImpl.java | 2 +- .../implementation/ModelImpl.java | 2 +- .../implementation/ModelsClientImpl.java | 109 +- .../implementation/ModelsImpl.java | 2 +- ...orkSecurityPerimeterConfigurationImpl.java | 2 +- ...rityPerimeterConfigurationsClientImpl.java | 433 +-- ...rkSecurityPerimeterConfigurationsImpl.java | 40 +- .../implementation/OperationImpl.java | 2 +- .../implementation/OperationsClientImpl.java | 56 +- .../implementation/OperationsImpl.java | 2 +- .../OutboundRuleBasicResourceImpl.java | 138 + .../OutboundRuleListResultImpl.java | 48 + .../OutboundRulesClientImpl.java | 892 +++++++ .../implementation/OutboundRulesImpl.java | 180 ++ .../OutboundRulesOperationsClientImpl.java | 295 +++ .../OutboundRulesOperationsImpl.java | 57 + .../PrivateEndpointConnectionImpl.java | 18 +- ...ivateEndpointConnectionListResultImpl.java | 2 +- .../PrivateEndpointConnectionsClientImpl.java | 492 +--- .../PrivateEndpointConnectionsImpl.java | 48 +- .../PrivateLinkResourceListResultImpl.java | 2 +- .../PrivateLinkResourcesClientImpl.java | 56 +- .../PrivateLinkResourcesImpl.java | 10 +- .../ProjectCapabilityHostImpl.java | 140 + .../ProjectCapabilityHostsClientImpl.java | 898 +++---- .../ProjectCapabilityHostsImpl.java | 169 +- .../ProjectConnectionsClientImpl.java | 562 +--- .../ProjectConnectionsImpl.java | 172 +- .../implementation/ProjectImpl.java | 34 +- .../implementation/ProjectsClientImpl.java | 666 ++--- .../implementation/ProjectsImpl.java | 26 +- .../implementation/QuotaTierImpl.java | 2 +- .../implementation/QuotaTiersClientImpl.java | 506 ++-- .../implementation/QuotaTiersImpl.java | 30 +- .../implementation/RaiBlocklistImpl.java | 10 +- .../implementation/RaiBlocklistItemImpl.java | 10 +- .../RaiBlocklistItemsClientImpl.java | 843 ++---- .../implementation/RaiBlocklistItemsImpl.java | 48 +- .../RaiBlocklistsClientImpl.java | 588 ++--- .../implementation/RaiBlocklistsImpl.java | 30 +- .../implementation/RaiContentFilterImpl.java | 2 +- .../RaiContentFiltersClientImpl.java | 295 +-- .../implementation/RaiContentFiltersImpl.java | 30 +- .../RaiExternalSafetyProviderImpl.java | 65 + .../RaiExternalSafetyProviderSchemaImpl.java | 137 + .../RaiExternalSafetyProvidersClientImpl.java | 415 +++ .../RaiExternalSafetyProvidersImpl.java | 71 + ...alSafetyProvidersOperationsClientImpl.java | 246 ++ ...ExternalSafetyProvidersOperationsImpl.java | 47 + .../implementation/RaiPoliciesClientImpl.java | 584 ++--- .../implementation/RaiPoliciesImpl.java | 30 +- .../implementation/RaiPolicyImpl.java | 10 +- .../implementation/RaiToolLabelImpl.java | 157 ++ .../RaiToolLabelsClientImpl.java | 655 +++++ .../implementation/RaiToolLabelsImpl.java | 152 ++ .../implementation/RaiTopicImpl.java | 10 +- .../implementation/RaiTopicsClientImpl.java | 341 +-- .../implementation/RaiTopicsImpl.java | 10 +- .../implementation/ResourceManagerUtils.java | 2 +- .../ResourceProvidersClientImpl.java | 218 +- .../implementation/ResourceProvidersImpl.java | 26 +- .../implementation/ResourceSkuImpl.java | 2 +- .../ResourceSkusClientImpl.java | 70 +- .../implementation/ResourceSkusImpl.java | 2 +- .../SkuAvailabilityListResultImpl.java | 2 +- .../implementation/SkuResourceImpl.java | 2 +- .../SubscriptionRaiPoliciesClientImpl.java | 391 +++ .../SubscriptionRaiPoliciesImpl.java | 76 + ...tRaiExternalSafetyProvidersClientImpl.java | 172 ++ .../TestRaiExternalSafetyProvidersImpl.java | 35 + .../implementation/UsageImpl.java | 68 + .../implementation/UsageListResultImpl.java | 9 +- .../implementation/UsagesClientImpl.java | 135 +- .../implementation/UsagesImpl.java | 9 +- .../models/AccountListResult.java | 32 +- .../models/AccountModelListResult.java | 43 +- ...ApplicationResourceArmPaginatedResult.java | 98 + ...tDeploymentResourceArmPaginatedResult.java | 98 + ...abilityHostResourceArmPaginatedResult.java | 98 + ...tmentPlanAccountAssociationListResult.java | 32 +- .../models/CommitmentPlanListResult.java | 32 +- .../models/CommitmentTierListResult.java | 32 +- ...tiesV2BasicResourceArmPaginatedResult.java | 44 +- .../models/DefenderForAISettingResult.java | 43 +- .../models/DeploymentListResult.java | 32 +- .../models/DeploymentSkuListResult.java | 32 +- .../models/EncryptionScopeListResult.java | 43 +- .../models/ManagedNetworkListResult.java | 98 + .../models/ModelCapacityListResult.java | 44 +- .../models/ModelListResult.java | 43 +- ...orkSecurityPerimeterConfigurationList.java | 43 +- .../models/OperationListResult.java | 28 +- ...abilityHostResourceArmPaginatedResult.java | 98 + .../models/ProjectListResult.java | 32 +- .../models/QuotaTierListResult.java | 32 +- .../models/RaiBlockListItemsResult.java | 43 +- .../models/RaiBlockListResult.java | 43 +- .../models/RaiContentFilterListResult.java | 43 +- .../RaiExternalSafetyProviderResult.java | 96 + .../models/RaiPolicyListResult.java | 43 +- .../models/RaiToolLabelResult.java | 94 + .../models/RaiTopicResult.java | 43 +- .../models/ResourceSkuListResult.java | 57 +- .../implementation/package-info.java | 4 +- .../AadAuthTypeConnectionProperties.java | 11 +- .../models/AbusePenalty.java | 49 +- .../models/AbusePenaltyAction.java | 2 +- ...AccessKeyAuthTypeConnectionProperties.java | 14 +- .../cognitiveservices/models/Account.java | 118 +- .../models/AccountCapabilityHosts.java | 56 +- .../models/AccountConnections.java | 102 +- ...ccountKeyAuthTypeConnectionProperties.java | 14 +- .../models/AccountModel.java | 2 +- .../models/AccountProperties.java | 85 +- .../cognitiveservices/models/AccountSku.java | 41 +- .../models/AccountSkuListResult.java | 2 +- .../cognitiveservices/models/Accounts.java | 30 +- .../cognitiveservices/models/ActionType.java | 6 +- .../models/AgentApplication.java | 249 ++ .../models/AgentApplications.java | 249 ++ .../models/AgentDeployment.java | 231 ++ .../models/AgentDeploymentProperties.java | 303 +++ .../AgentDeploymentProvisioningState.java | 71 + .../models/AgentDeploymentState.java | 81 + .../models/AgentDeploymentType.java | 57 + .../models/AgentDeployments.java | 230 ++ .../models/AgentProtocol.java | 56 + .../models/AgentProtocolVersion.java | 113 + ...ntityResource.java => AgentReference.java} | 79 +- .../models/AgentReferenceProperties.java | 113 + ...ntReferenceResourceArmPaginatedResult.java | 36 + .../models/AgenticApplicationProperties.java | 324 +++ .../AgenticApplicationProvisioningState.java | 72 + .../ApiKeyAuthConnectionProperties.java | 14 +- .../cognitiveservices/models/ApiKeys.java | 2 +- .../models/ApiProperties.java | 10 +- .../ApplicationAuthorizationPolicy.java | 105 + .../ApplicationTrafficRoutingPolicy.java | 117 + .../models/AssignedIdentity.java | 243 ++ .../models/BillingMeterInfo.java | 49 +- .../models/BuiltInAuthorizationScheme.java | 61 + .../models/ByPassSelection.java | 2 +- .../CalculateModelCapacityParameter.java | 16 +- .../models/CalculateModelCapacityResult.java | 2 +- ...eModelCapacityResultEstimatedCapacity.java | 38 +- .../models/CallRateLimit.java | 52 +- .../models/CapabilityHost.java | 2 +- .../models/CapabilityHostKind.java | 2 +- .../models/CapabilityHostProperties.java | 42 +- .../CapabilityHostProvisioningState.java | 2 +- .../models/CapacityConfig.java | 71 +- .../ChannelsBuiltInAuthorizationPolicy.java | 76 + .../CheckDomainAvailabilityParameter.java | 29 +- .../models/CheckSkuAvailabilityParameter.java | 28 +- .../models/CommitmentCost.java | 38 +- .../models/CommitmentPeriod.java | 13 +- .../models/CommitmentPlan.java | 70 +- .../CommitmentPlanAccountAssociation.java | 2 +- .../models/CommitmentPlanAssociation.java | 38 +- .../models/CommitmentPlanProperties.java | 19 +- .../CommitmentPlanProvisioningState.java | 2 +- .../models/CommitmentPlans.java | 118 +- .../models/CommitmentQuota.java | 38 +- .../models/CommitmentTier.java | 4 +- .../models/CommitmentTiers.java | 6 +- .../models/ComputeOperationStatus.java | 55 + .../ComputeOperationStatusProperties.java | 130 + .../models/ComputeOperationStatusType.java | 61 + .../models/ComputeOperations.java | 38 + .../models/ConnectionAccessKey.java | 10 +- .../models/ConnectionAccountKey.java | 10 +- .../models/ConnectionApiKey.java | 10 +- .../models/ConnectionAuthType.java | 37 +- .../models/ConnectionCategory.java | 76 +- .../models/ConnectionGroup.java | 2 +- .../models/ConnectionManagedIdentity.java | 10 +- .../models/ConnectionOAuth2.java | 23 +- .../models/ConnectionPersonalAccessToken.java | 10 +- .../models/ConnectionPropertiesV2.java | 10 +- .../ConnectionPropertiesV2BasicResource.java | 7 +- .../models/ConnectionServicePrincipal.java | 10 +- .../ConnectionSharedAccessSignature.java | 10 +- .../models/ConnectionUpdateContent.java | 13 +- .../models/ConnectionUsernamePassword.java | 10 +- .../models/ContentLevel.java | 2 +- .../models/CustomBlocklistConfig.java | 11 +- .../cognitiveservices/models/CustomKeys.java | 10 +- .../CustomKeysConnectionProperties.java | 14 +- .../models/CustomTopicConfig.java | 11 +- .../models/DefenderForAISetting.java | 2 +- .../models/DefenderForAISettingState.java | 2 +- .../models/DefenderForAISettings.java | 36 +- .../models/DeletedAccounts.java | 10 +- .../cognitiveservices/models/Deployment.java | 97 +- .../models/DeploymentCapacitySettings.java | 10 +- .../models/DeploymentModel.java | 13 +- .../DeploymentModelVersionUpgradeOption.java | 2 +- .../models/DeploymentProperties.java | 122 +- .../models/DeploymentProvisioningState.java | 2 +- .../models/DeploymentRouting.java | 118 + .../models/DeploymentScaleSettings.java | 10 +- .../models/DeploymentScaleType.java | 2 +- .../models/DeploymentState.java | 53 + .../cognitiveservices/models/Deployments.java | 122 +- .../models/DeprecationStatus.java | 2 +- .../models/DomainAvailability.java | 4 +- .../cognitiveservices/models/Encryption.java | 13 +- .../models/EncryptionScope.java | 16 +- .../models/EncryptionScopeProperties.java | 14 +- .../EncryptionScopeProvisioningState.java | 2 +- .../models/EncryptionScopeState.java | 2 +- .../models/EncryptionScopes.java | 48 +- .../cognitiveservices/models/FirewallSku.java | 51 + .../models/FoundryAutoUpgrade.java | 177 ++ .../models/FoundryAutoUpgradeMode.java | 51 + .../models/FqdnOutboundRule.java | 132 + .../models/HostedAgentDeployment.java | 226 ++ .../models/HostingModel.java | 2 +- .../cognitiveservices/models/Identity.java | 17 +- .../models/IdentityKind.java | 66 + .../models/IdentityManagementType.java | 56 + .../models/IdentityProvisioningState.java | 71 + .../cognitiveservices/models/IpRule.java | 16 +- .../models/IsolationMode.java | 56 + .../cognitiveservices/models/KeyName.java | 2 +- .../cognitiveservices/models/KeySource.java | 2 +- .../models/KeyVaultProperties.java | 10 +- .../models/LocationBasedModelCapacities.java | 6 +- .../models/ManagedAgentDeployment.java | 171 ++ ...dIdentityAuthTypeConnectionProperties.java | 14 +- .../models/ManagedNetworkKind.java | 52 + .../ManagedNetworkProvisionOptions.java | 56 + .../models/ManagedNetworkProvisionStatus.java | 27 + .../ManagedNetworkProvisioningState.java | 71 + .../models/ManagedNetworkProvisions.java | 44 + .../models/ManagedNetworkSettings.java | 77 + .../ManagedNetworkSettingsBasicResource.java | 56 + .../models/ManagedNetworkSettingsEx.java | 195 ++ .../ManagedNetworkSettingsOperations.java | 152 ++ .../ManagedNetworkSettingsProperties.java | 106 + ...etworkSettingsPropertiesBasicResource.java | 195 ++ .../models/ManagedNetworkStatus.java | 51 + .../models/ManagedPERequirement.java | 2 +- .../models/ManagedPEStatus.java | 2 +- .../cognitiveservices/models/MetricName.java | 38 +- .../cognitiveservices/models/Model.java | 2 +- .../models/ModelCapacities.java | 2 +- .../ModelCapacityCalculatorWorkload.java | 13 +- ...apacityCalculatorWorkloadRequestParam.java | 10 +- .../ModelCapacityListResultValueItem.java | 2 +- .../models/ModelDeprecationInfo.java | 52 +- .../models/ModelLifecycleStatus.java | 17 +- .../cognitiveservices/models/ModelSku.java | 91 +- .../models/ModelSkuCapacityProperties.java | 78 +- .../cognitiveservices/models/Models.java | 6 +- .../models/MultiRegionSettings.java | 13 +- .../models/NetworkInjection.java | 10 +- .../models/NetworkRuleAction.java | 2 +- .../models/NetworkRuleSet.java | 16 +- .../models/NetworkSecurityPerimeter.java | 49 +- .../NetworkSecurityPerimeterAccessRule.java | 41 +- ...SecurityPerimeterAccessRuleProperties.java | 80 +- ...AccessRulePropertiesSubscriptionsItem.java | 27 +- ...NetworkSecurityPerimeterConfiguration.java | 2 +- ...PerimeterConfigurationAssociationInfo.java | 38 +- ...urityPerimeterConfigurationProperties.java | 75 +- ...etworkSecurityPerimeterConfigurations.java | 44 +- .../NetworkSecurityPerimeterProfileInfo.java | 74 +- .../NoneAuthTypeConnectionProperties.java | 11 +- .../models/NspAccessRuleDirection.java | 2 +- .../OAuth2AuthTypeConnectionProperties.java | 14 +- .../cognitiveservices/models/Operation.java | 8 +- .../models/OperationDisplay.java | 14 +- .../cognitiveservices/models/Operations.java | 2 +- ...ationSharedBuiltInAuthorizationPolicy.java | 76 + .../cognitiveservices/models/Origin.java | 8 +- .../models/OutboundRule.java | 217 ++ .../models/OutboundRuleBasicResource.java | 194 ++ .../models/OutboundRuleListResult.java | 36 + .../models/OutboundRules.java | 175 ++ .../models/OutboundRulesOperations.java | 48 + .../PatAuthTypeConnectionProperties.java | 14 +- .../models/PatchResourceTags.java | 10 +- .../models/PatchResourceTagsAndSku.java | 14 +- .../models/PrivateEndpoint.java | 16 +- .../models/PrivateEndpointConnection.java | 26 +- .../PrivateEndpointConnectionListResult.java | 2 +- .../PrivateEndpointConnectionProperties.java | 23 +- ...teEndpointConnectionProvisioningState.java | 10 +- .../models/PrivateEndpointConnections.java | 52 +- .../models/PrivateEndpointOutboundRule.java | 162 ++ ...rivateEndpointOutboundRuleDestination.java | 115 + ...rivateEndpointServiceConnectionStatus.java | 8 +- .../models/PrivateLinkResource.java | 30 +- .../models/PrivateLinkResourceListResult.java | 2 +- .../models/PrivateLinkResourceProperties.java | 27 +- .../models/PrivateLinkResources.java | 2 +- .../PrivateLinkServiceConnectionState.java | 10 +- .../cognitiveservices/models/Project.java | 82 +- .../models/ProjectCapabilityHost.java | 190 ++ .../ProjectCapabilityHostProperties.java | 203 ++ .../models/ProjectCapabilityHosts.java | 112 +- .../models/ProjectConnections.java | 115 +- .../models/ProjectProperties.java | 10 +- .../cognitiveservices/models/Projects.java | 32 +- .../models/ProvisioningIssue.java | 41 +- .../models/ProvisioningIssueProperties.java | 76 +- .../models/ProvisioningState.java | 10 +- .../models/PublicNetworkAccess.java | 2 +- .../cognitiveservices/models/QuotaLimit.java | 52 +- .../models/QuotaScopeType.java | 61 + .../cognitiveservices/models/QuotaTier.java | 2 +- .../models/QuotaTierProperties.java | 13 +- .../QuotaTierUpgradeEligibilityInfo.java | 63 +- .../cognitiveservices/models/QuotaTiers.java | 56 +- .../models/QuotaUsageStatus.java | 2 +- .../models/RaiActionType.java | 66 + .../models/RaiBlocklist.java | 16 +- .../models/RaiBlocklistConfig.java | 10 +- .../models/RaiBlocklistItem.java | 16 +- .../models/RaiBlocklistItemBulkRequest.java | 13 +- .../models/RaiBlocklistItemProperties.java | 10 +- .../models/RaiBlocklistItems.java | 56 +- .../models/RaiBlocklistProperties.java | 10 +- .../models/RaiBlocklists.java | 48 +- .../models/RaiContentFilter.java | 2 +- .../models/RaiContentFilterProperties.java | 49 +- .../models/RaiContentFilters.java | 42 +- .../models/RaiExternalSafetyProvider.java | 70 + .../RaiExternalSafetyProviderProperties.java | 168 ++ .../RaiExternalSafetyProviderSchema.java | 190 ++ ...xternalSafetyProviderSchemaProperties.java | 291 +++ .../models/RaiExternalSafetyProviders.java | 91 + .../RaiExternalSafetyProvidersOperations.java | 33 + .../models/RaiMonitorConfig.java | 10 +- .../cognitiveservices/models/RaiPolicies.java | 48 +- .../cognitiveservices/models/RaiPolicy.java | 16 +- .../models/RaiPolicyContentFilter.java | 28 +- .../models/RaiPolicyContentSource.java | 22 +- .../models/RaiPolicyMode.java | 2 +- .../models/RaiPolicyProperties.java | 40 +- .../models/RaiPolicyType.java | 2 +- .../models/RaiSafetyProviderConfig.java | 113 + .../models/RaiToolLabel.java | 217 ++ .../models/RaiToolLabelProperties.java | 146 ++ .../RaiToolLabelPropertiesAccountScope.java | 88 + ...iToolLabelPropertiesProjectScopesItem.java | 118 + .../models/RaiToolLabels.java | 144 + .../cognitiveservices/models/RaiTopic.java | 16 +- .../models/RaiTopicConfig.java | 10 +- .../models/RaiTopicProperties.java | 10 +- .../cognitiveservices/models/RaiTopics.java | 2 +- .../models/RegenerateKeyParameters.java | 18 +- .../models/RegionSetting.java | 10 +- .../models/ReplacementConfig.java | 62 +- .../models/RequestMatchPattern.java | 38 +- .../models/ResourceBase.java | 10 +- .../models/ResourceIdentityType.java | 2 +- .../models/ResourceProviders.java | 18 +- .../cognitiveservices/models/ResourceSku.java | 2 +- .../models/ResourceSkuRestrictionInfo.java | 38 +- .../models/ResourceSkuRestrictions.java | 64 +- .../ResourceSkuRestrictionsReasonCode.java | 2 +- .../models/ResourceSkuRestrictionsType.java | 2 +- .../models/ResourceSkus.java | 2 +- .../RoleBasedBuiltInAuthorizationPolicy.java | 76 + .../models/RoutingMethods.java | 2 +- .../cognitiveservices/models/RoutingMode.java | 56 + .../cognitiveservices/models/RuleAction.java | 51 + .../models/RuleCategory.java | 61 + .../cognitiveservices/models/RuleStatus.java | 66 + .../cognitiveservices/models/RuleType.java | 56 + .../models/SafetyProviderConfig.java | 108 + .../SasAuthTypeConnectionProperties.java | 14 +- .../models/ScenarioType.java | 2 +- ...PrincipalAuthTypeConnectionProperties.java | 14 +- .../models/ServiceTagOutboundRule.java | 132 + .../ServiceTagOutboundRuleDestination.java | 203 ++ .../cognitiveservices/models/ServiceTier.java | 55 + .../cognitiveservices/models/Sku.java | 16 +- .../models/SkuAvailability.java | 90 +- .../models/SkuAvailabilityListResult.java | 2 +- .../models/SkuCapability.java | 38 +- .../models/SkuChangeInfo.java | 49 +- .../cognitiveservices/models/SkuResource.java | 2 +- .../cognitiveservices/models/SkuTier.java | 2 +- .../models/SubscriptionRaiPolicies.java | 83 + .../TestRaiExternalSafetyProviders.java | 18 + .../models/ThrottlingRule.java | 85 +- .../models/TierUpgradePolicy.java | 2 +- .../models/TrafficRoutingProtocol.java | 46 + .../models/TrafficRoutingRule.java | 169 ++ .../cognitiveservices/models/UnitType.java | 2 +- .../models/UpgradeAvailabilityStatus.java | 2 +- .../cognitiveservices/models/Usage.java | 236 +- .../models/UsageListResult.java | 2 +- .../cognitiveservices/models/Usages.java | 6 +- .../models/UserAssignedIdentity.java | 10 +- .../models/UserOwnedAmlWorkspace.java | 10 +- .../models/UserOwnedStorage.java | 10 +- ...ePasswordAuthTypeConnectionProperties.java | 14 +- .../models/VersionedAgentReference.java | 108 + .../models/VirtualNetworkRule.java | 17 +- .../models/package-info.java | 4 +- .../cognitiveservices/package-info.java | 4 +- .../src/main/java/module-info.java | 3 +- ...rcemanager-cognitiveservices_metadata.json | 1 + .../proxy-config.json | 2 +- ...tCapabilityHostsCreateOrUpdateSamples.java | 9 +- .../AccountCapabilityHostsDeleteSamples.java | 6 +- .../AccountCapabilityHostsGetSamples.java | 6 +- .../AccountCapabilityHostsListSamples.java | 23 + .../AccountConnectionsCreateSamples.java | 19 +- .../AccountConnectionsDeleteSamples.java | 6 +- .../AccountConnectionsGetSamples.java | 6 +- .../AccountConnectionsListSamples.java | 8 +- .../AccountConnectionsUpdateSamples.java | 29 +- .../generated/AccountsCreateSamples.java | 18 +- .../generated/AccountsDeleteSamples.java | 6 +- .../AccountsGetByResourceGroupSamples.java | 6 +- .../AccountsListByResourceGroupSamples.java | 6 +- .../generated/AccountsListKeysSamples.java | 6 +- .../generated/AccountsListModelsSamples.java | 6 +- .../generated/AccountsListSamples.java | 6 +- .../generated/AccountsListSkusSamples.java | 6 +- .../generated/AccountsListUsagesSamples.java | 48 +- .../AccountsRegenerateKeySamples.java | 6 +- .../generated/AccountsUpdateSamples.java | 6 +- ...gentApplicationsCreateOrUpdateSamples.java | 46 + .../AgentApplicationsDeleteSamples.java | 25 + .../AgentApplicationsDisableSamples.java | 25 + .../AgentApplicationsEnableSamples.java | 25 + .../AgentApplicationsGetSamples.java | 25 + .../AgentApplicationsListAgentsSamples.java | 25 + .../AgentApplicationsListSamples.java | 27 + ...AgentDeploymentsCreateOrUpdateSamples.java | 40 + .../AgentDeploymentsDeleteSamples.java | 25 + .../generated/AgentDeploymentsGetSamples.java | 25 + .../AgentDeploymentsListSamples.java | 25 + .../AgentDeploymentsStartSamples.java | 25 + .../AgentDeploymentsStopSamples.java | 25 + ...PlansCreateOrUpdateAssociationSamples.java | 6 +- ...mitmentPlansCreateOrUpdatePlanSamples.java | 10 +- .../CommitmentPlansCreateOrUpdateSamples.java | 6 +- ...mmitmentPlansDeleteAssociationSamples.java | 6 +- .../CommitmentPlansDeletePlanSamples.java | 6 +- .../CommitmentPlansDeleteSamples.java | 6 +- .../CommitmentPlansGetAssociationSamples.java | 6 +- ...mitmentPlansGetByResourceGroupSamples.java | 6 +- .../generated/CommitmentPlansGetSamples.java | 6 +- ...ommitmentPlansListAssociationsSamples.java | 6 +- ...itmentPlansListByResourceGroupSamples.java | 6 +- ...ntPlansListPlansBySubscriptionSamples.java | 6 +- .../generated/CommitmentPlansListSamples.java | 6 +- .../CommitmentPlansUpdatePlanSamples.java | 6 +- .../generated/CommitmentTiersListSamples.java | 6 +- .../ComputeOperationsGetSamples.java | 24 + ...derForAISettingsCreateOrUpdateSamples.java | 6 +- .../DefenderForAISettingsGetSamples.java | 6 +- .../DefenderForAISettingsListSamples.java | 6 +- .../DefenderForAISettingsUpdateSamples.java | 6 +- .../generated/DeletedAccountsGetSamples.java | 6 +- .../generated/DeletedAccountsListSamples.java | 6 +- .../DeletedAccountsPurgeSamples.java | 6 +- .../DeploymentsCreateOrUpdateSamples.java | 14 +- .../generated/DeploymentsDeleteSamples.java | 6 +- .../generated/DeploymentsGetSamples.java | 6 +- .../generated/DeploymentsListSamples.java | 6 +- .../generated/DeploymentsListSkusSamples.java | 6 +- .../generated/DeploymentsPauseSamples.java | 23 + .../generated/DeploymentsResumeSamples.java | 23 + .../generated/DeploymentsUpdateSamples.java | 6 +- ...EncryptionScopesCreateOrUpdateSamples.java | 6 +- .../EncryptionScopesDeleteSamples.java | 6 +- .../generated/EncryptionScopesGetSamples.java | 6 +- .../EncryptionScopesListSamples.java | 6 +- ...cationBasedModelCapacitiesListSamples.java | 45 +- ...visionsProvisionManagedNetworkSamples.java | 27 + ...NetworkSettingsOperationDeleteSamples.java | 24 + ...gedNetworkSettingsOperationGetSamples.java | 24 + ...edNetworkSettingsOperationListSamples.java | 24 + ...dNetworkSettingsOperationPatchSamples.java | 55 + ...gedNetworkSettingsOperationPutSamples.java | 53 + .../generated/ModelCapacitiesListSamples.java | 45 +- .../generated/ModelsListSamples.java | 6 +- ...rityPerimeterConfigurationsGetSamples.java | 6 +- ...ityPerimeterConfigurationsListSamples.java | 6 +- ...rimeterConfigurationsReconcileSamples.java | 6 +- .../generated/OperationsListSamples.java | 6 +- .../OutboundRuleCreateOrUpdateSamples.java | 33 + .../generated/OutboundRuleDeleteSamples.java | 24 + .../generated/OutboundRuleGetSamples.java | 24 + .../generated/OutboundRuleListSamples.java | 22 + .../OutboundRulesOperationPostSamples.java | 51 + ...pointConnectionsCreateOrUpdateSamples.java | 6 +- ...ivateEndpointConnectionsDeleteSamples.java | 6 +- .../PrivateEndpointConnectionsGetSamples.java | 6 +- ...PrivateEndpointConnectionsListSamples.java | 6 +- .../PrivateLinkResourcesListSamples.java | 6 +- ...tCapabilityHostsCreateOrUpdateSamples.java | 22 +- .../ProjectCapabilityHostsDeleteSamples.java | 6 +- .../ProjectCapabilityHostsGetSamples.java | 6 +- .../ProjectCapabilityHostsListSamples.java | 23 + .../ProjectConnectionsCreateSamples.java | 19 +- .../ProjectConnectionsDeleteSamples.java | 6 +- .../ProjectConnectionsGetSamples.java | 6 +- .../ProjectConnectionsListSamples.java | 8 +- .../ProjectConnectionsUpdateSamples.java | 29 +- .../generated/ProjectsCreateSamples.java | 14 +- .../generated/ProjectsDeleteSamples.java | 6 +- .../generated/ProjectsGetSamples.java | 6 +- .../generated/ProjectsListSamples.java | 6 +- .../generated/ProjectsUpdateSamples.java | 6 +- .../QuotaTiersCreateOrUpdateSamples.java | 6 +- .../generated/QuotaTiersGetSamples.java | 6 +- .../generated/QuotaTiersListSamples.java | 6 +- .../generated/QuotaTiersUpdateSamples.java | 6 +- .../RaiBlocklistItemsBatchAddSamples.java | 6 +- .../RaiBlocklistItemsBatchDeleteSamples.java | 18 +- ...aiBlocklistItemsCreateOrUpdateSamples.java | 6 +- .../RaiBlocklistItemsDeleteSamples.java | 6 +- .../RaiBlocklistItemsGetSamples.java | 6 +- .../RaiBlocklistItemsListSamples.java | 6 +- .../RaiBlocklistsCreateOrUpdateSamples.java | 6 +- .../generated/RaiBlocklistsDeleteSamples.java | 6 +- .../generated/RaiBlocklistsGetSamples.java | 6 +- .../generated/RaiBlocklistsListSamples.java | 6 +- .../RaiContentFiltersGetSamples.java | 6 +- .../RaiContentFiltersListSamples.java | 6 +- ...alSafetyProviderCreateOrUpdateSamples.java | 35 + ...aiExternalSafetyProviderDeleteSamples.java | 22 + .../RaiExternalSafetyProviderGetSamples.java | 23 + ...alSafetyProvidersOperationListSamples.java | 23 + .../RaiPoliciesCreateOrUpdateSamples.java | 6 +- .../generated/RaiPoliciesDeleteSamples.java | 6 +- .../generated/RaiPoliciesGetSamples.java | 6 +- .../generated/RaiPoliciesListSamples.java | 6 +- .../RaiToolLabelsCreateOrUpdateSamples.java | 52 + .../generated/RaiToolLabelsDeleteSamples.java | 24 + .../generated/RaiToolLabelsGetSamples.java | 23 + .../generated/RaiToolLabelsListSamples.java | 22 + .../RaiTopicsCreateOrUpdateSamples.java | 6 +- .../generated/RaiTopicsDeleteSamples.java | 6 +- .../generated/RaiTopicsGetSamples.java | 6 +- .../generated/RaiTopicsListSamples.java | 6 +- ...ProviderCalculateModelCapacitySamples.java | 6 +- ...roviderCheckDomainAvailabilitySamples.java | 6 +- ...ceProviderCheckSkuAvailabilitySamples.java | 6 +- .../generated/ResourceSkusListSamples.java | 6 +- ...riptionRaiPolicyCreateOrUpdateSamples.java | 92 + .../SubscriptionRaiPolicyDeleteSamples.java | 22 + .../SubscriptionRaiPolicyGetSamples.java | 22 + ...alSafetyProviderCreateOrUpdateSamples.java | 36 + .../generated/UsagesListSamples.java | 45 +- .../AadAuthTypeConnectionPropertiesTests.java | 52 +- .../generated/AbusePenaltyTests.java | 21 +- ...apabilityHostsCreateOrUpdateMockTests.java | 40 +- ...pabilityHostsGetWithResponseMockTests.java | 21 +- .../AccountCapabilityHostsListMockTests.java | 52 + ...onnectionsCreateWithResponseMockTests.java | 50 +- ...onnectionsDeleteWithResponseMockTests.java | 4 +- ...ntConnectionsGetWithResponseMockTests.java | 24 +- .../AccountConnectionsListMockTests.java | 25 +- ...nnectionsUpdateWithResponseMockTests.java} | 41 +- .../AccountSkuListResultInnerTests.java | 55 +- .../generated/AccountSkuTests.java | 34 +- .../generated/AccountsDeleteMockTests.java | 4 +- ...AccountsListSkusWithResponseMockTests.java | 18 +- ...countsListUsagesWithResponseMockTests.java | 27 +- ...licationsDisableWithResponseMockTests.java | 34 + ...licationsEnableWithResponseMockTests.java} | 9 +- ...ationsListAgentsWithResponseMockTests.java | 42 + .../generated/AgentDeploymentInnerTests.java | 77 + .../AgentDeploymentPropertiesTests.java | 72 + ...oymentResourceArmPaginatedResultTests.java | 31 + ...entDeploymentsCreateOrUpdateMockTests.java | 83 + ...ntDeploymentsGetWithResponseMockTests.java | 51 + .../AgentDeploymentsListMockTests.java | 54 + ...DeploymentsStartWithResponseMockTests.java | 35 + ...tDeploymentsStopWithResponseMockTests.java | 35 + .../generated/AgentProtocolVersionTests.java | 29 + .../AgentReferencePropertiesTests.java | 27 + ...eResourceArmPaginatedResultInnerTests.java | 21 + .../generated/AgentReferenceTests.java | 20 + .../ApplicationAuthorizationPolicyTests.java | 22 + .../ApplicationTrafficRoutingPolicyTests.java | 51 + .../generated/AssignedIdentityTests.java | 43 + .../generated/AzureEntityResourceTests.java | 23 - .../generated/BillingMeterInfoTests.java | 20 +- ...lCapacityResultEstimatedCapacityTests.java | 17 +- .../generated/CapabilityHostInnerTests.java | 54 +- .../CapabilityHostPropertiesTests.java | 50 +- ...tyHostResourceArmPaginatedResultTests.java | 29 + .../generated/CapacityConfigTests.java | 30 +- ...annelsBuiltInAuthorizationPolicyTests.java | 22 + ...CheckDomainAvailabilityParameterTests.java | 22 +- .../CheckSkuAvailabilityParameterTests.java | 26 +- .../generated/CommitmentCostTests.java | 16 +- .../generated/CommitmentPeriodTests.java | 14 +- ...tmentPlanAccountAssociationInnerTests.java | 17 +- ...PlanAccountAssociationListResultTests.java | 16 +- ...PlanAccountAssociationPropertiesTests.java | 10 +- .../CommitmentPlanAssociationTests.java | 17 +- .../generated/CommitmentPlanInnerTests.java | 92 +- .../CommitmentPlanListResultTests.java | 15 +- .../CommitmentPlanPropertiesTests.java | 36 +- ...ansCreateOrUpdateAssociationMockTests.java | 18 +- ...tmentPlansCreateOrUpdatePlanMockTests.java | 67 +- ...nsCreateOrUpdateWithResponseMockTests.java | 66 +- ...itmentPlansDeleteAssociationMockTests.java | 4 +- .../CommitmentPlansDeleteMockTests.java | 4 +- .../CommitmentPlansDeletePlanMockTests.java | 4 +- ...nsGetAssociationWithResponseMockTests.java | 11 +- ...tByResourceGroupWithResponseMockTests.java | 38 +- ...mmitmentPlansGetWithResponseMockTests.java | 38 +- ...mitmentPlansListAssociationsMockTests.java | 10 +- ...mentPlansListByResourceGroupMockTests.java | 39 +- .../CommitmentPlansListMockTests.java | 34 +- ...PlansListPlansBySubscriptionMockTests.java | 35 +- .../generated/CommitmentQuotaTests.java | 16 +- .../generated/CommitmentTierInnerTests.java | 47 +- .../CommitmentTierListResultTests.java | 15 +- .../CommitmentTiersListMockTests.java | 26 +- .../ConnectionManagedIdentityTests.java | 14 +- .../ConnectionPersonalAccessTokenTests.java | 10 +- ...2BasicResourceArmPaginatedResultTests.java | 98 +- ...onPropertiesV2BasicResourceInnerTests.java | 47 +- .../ConnectionPropertiesV2Tests.java | 52 +- .../ConnectionSharedAccessSignatureTests.java | 10 +- .../ConnectionUpdateContentTests.java | 46 +- .../generated/CustomBlocklistConfigTests.java | 22 +- .../generated/CustomTopicConfigTests.java | 22 +- .../DefenderForAISettingInnerTests.java | 14 +- .../DefenderForAISettingPropertiesTests.java | 2 +- .../DefenderForAISettingResultTests.java | 38 +- ...gsCreateOrUpdateWithResponseMockTests.java | 14 +- ...ForAISettingsGetWithResponseMockTests.java | 10 +- .../DefenderForAISettingsListMockTests.java | 12 +- .../DeletedAccountsPurgeMockTests.java | 4 +- .../DeploymentCapacitySettingsTests.java | 14 +- .../DeploymentScaleSettingsTests.java | 10 +- .../DeploymentSkuListResultTests.java | 15 +- .../generated/DeploymentsDeleteMockTests.java | 4 +- .../DeploymentsListSkusMockTests.java | 28 +- .../DomainAvailabilityInnerTests.java | 29 +- .../generated/FoundryAutoUpgradeTests.java | 37 + .../generated/FqdnOutboundRuleTests.java | 34 + .../generated/HostedAgentDeploymentTests.java | 80 + .../generated/IdentityTests.java | 15 +- .../generated/IpRuleTests.java | 10 +- ...tionBasedModelCapacitiesListMockTests.java | 29 +- .../ManagedAgentDeploymentTests.java | 81 + .../ManagedNetworkListResultTests.java | 30 + .../ManagedNetworkProvisionOptionsTests.java | 22 + ...nagedNetworkProvisionStatusInnerTests.java | 27 + ...sionsProvisionManagedNetworkMockTests.java | 40 + ...etworkSettingsBasicResourceInnerTests.java | 69 + .../ManagedNetworkSettingsExTests.java | 66 + .../ManagedNetworkSettingsInnerTests.java | 67 + ...ngsOperationsGetWithResponseMockTests.java | 53 + ...etworkSettingsOperationsListMockTests.java | 57 + ...NetworkSettingsOperationsPutMockTests.java | 82 + ...ingsPropertiesBasicResourceInnerTests.java | 74 + ...ManagedNetworkSettingsPropertiesTests.java | 69 + .../generated/MetricNameTests.java | 16 +- .../ModelCapacitiesListMockTests.java | 29 +- .../ModelCapacityListResultTests.java | 50 +- .../generated/ModelDeprecationInfoTests.java | 19 +- .../generated/ModelListResultTests.java | 288 +- .../generated/MultiRegionSettingsTests.java | 24 +- .../generated/NetworkInjectionTests.java | 11 +- .../generated/NetworkRuleSetTests.java | 29 +- ...sRulePropertiesSubscriptionsItemTests.java | 16 +- ...ityPerimeterAccessRulePropertiesTests.java | 50 +- ...tworkSecurityPerimeterAccessRuleTests.java | 59 +- ...eterConfigurationAssociationInfoTests.java | 18 +- ...urityPerimeterConfigurationInnerTests.java | 155 +- ...curityPerimeterConfigurationListTests.java | 130 +- ...PerimeterConfigurationPropertiesTests.java | 145 +- ...onfigurationsGetWithResponseMockTests.java | 38 +- ...yPerimeterConfigurationsListMockTests.java | 38 +- ...meterConfigurationsReconcileMockTests.java | 37 +- ...workSecurityPerimeterProfileInfoTests.java | 135 +- .../NetworkSecurityPerimeterTests.java | 21 +- ...NoneAuthTypeConnectionPropertiesTests.java | 65 +- .../generated/OperationDisplayTests.java | 10 +- .../generated/OperationInnerTests.java | 11 +- .../generated/OperationListResultTests.java | 14 +- .../generated/OperationsListMockTests.java | 4 +- ...SharedBuiltInAuthorizationPolicyTests.java | 22 + .../OutboundRuleBasicResourceInnerTests.java | 32 + .../OutboundRuleListResultInnerTests.java | 23 + .../generated/OutboundRuleTests.java | 30 + .../OutboundRulesCreateOrUpdateMockTests.java | 45 + ...OutboundRulesGetWithResponseMockTests.java | 43 + .../generated/OutboundRulesListMockTests.java | 42 + .../OutboundRulesOperationsPostMockTests.java | 80 + .../PatchResourceTagsAndSkuTests.java | 37 +- .../generated/PatchResourceTagsTests.java | 12 +- .../PrivateEndpointConnectionInnerTests.java | 37 +- ...ndpointConnectionListResultInnerTests.java | 62 +- ...vateEndpointConnectionPropertiesTests.java | 28 +- ...intConnectionsCreateOrUpdateMockTests.java | 30 +- ...ateEndpointConnectionsDeleteMockTests.java | 5 +- ...ntConnectionsGetWithResponseMockTests.java | 15 +- ...tConnectionsListWithResponseMockTests.java | 16 +- ...eEndpointOutboundRuleDestinationTests.java | 30 + .../PrivateEndpointOutboundRuleTests.java | 42 + .../generated/PrivateEndpointTests.java | 4 +- ...ivateLinkResourceListResultInnerTests.java | 18 +- .../PrivateLinkResourcePropertiesTests.java | 15 +- .../generated/PrivateLinkResourceTests.java | 16 +- ...inkResourcesListWithResponseMockTests.java | 8 +- ...rivateLinkServiceConnectionStateTests.java | 23 +- .../ProjectCapabilityHostInnerTests.java | 39 + .../ProjectCapabilityHostPropertiesTests.java | 37 + ...tyHostResourceArmPaginatedResultTests.java | 23 + ...apabilityHostsCreateOrUpdateMockTests.java | 58 +- ...pabilityHostsGetWithResponseMockTests.java | 23 +- .../ProjectCapabilityHostsListMockTests.java | 42 + ...onnectionsCreateWithResponseMockTests.java | 51 +- ...onnectionsDeleteWithResponseMockTests.java | 4 +- ...ctConnectionsGetWithResponseMockTests.java | 22 +- .../ProjectConnectionsListMockTests.java | 26 +- .../generated/ProjectInnerTests.java | 36 +- .../generated/ProjectListResultTests.java | 15 +- .../generated/ProjectPropertiesTests.java | 14 +- .../generated/ProjectsCreateMockTests.java | 27 +- .../ProjectsGetWithResponseMockTests.java | 16 +- .../generated/ProjectsListMockTests.java | 17 +- .../ProvisioningIssuePropertiesTests.java | 111 +- .../generated/ProvisioningIssueTests.java | 87 +- .../generated/QuotaTierInnerTests.java | 4 +- .../generated/QuotaTierListResultTests.java | 15 +- .../generated/QuotaTierPropertiesTests.java | 4 +- .../QuotaTierUpgradeEligibilityInfoTests.java | 25 +- ...rsCreateOrUpdateWithResponseMockTests.java | 8 +- .../QuotaTiersGetWithResponseMockTests.java | 9 +- .../generated/QuotaTiersListMockTests.java | 4 +- .../RaiBlockListItemsResultTests.java | 41 +- .../generated/RaiBlockListResultTests.java | 40 +- .../generated/RaiBlocklistConfigTests.java | 14 +- .../generated/RaiBlocklistInnerTests.java | 19 +- .../RaiBlocklistItemBulkRequestTests.java | 16 +- .../generated/RaiBlocklistItemInnerTests.java | 22 +- .../RaiBlocklistItemPropertiesTests.java | 14 +- ...istItemsBatchAddWithResponseMockTests.java | 22 +- ...ItemsBatchDeleteWithResponseMockTests.java | 7 +- ...msCreateOrUpdateWithResponseMockTests.java | 16 +- ...locklistItemsGetWithResponseMockTests.java | 10 +- .../RaiBlocklistItemsListMockTests.java | 10 +- .../RaiBlocklistPropertiesTests.java | 10 +- ...tsCreateOrUpdateWithResponseMockTests.java | 16 +- ...RaiBlocklistsGetWithResponseMockTests.java | 10 +- .../generated/RaiBlocklistsListMockTests.java | 10 +- .../generated/RaiContentFilterInnerTests.java | 21 +- .../RaiContentFilterListResultTests.java | 29 +- .../RaiContentFilterPropertiesTests.java | 25 +- ...ontentFiltersGetWithResponseMockTests.java | 10 +- .../RaiContentFiltersListMockTests.java | 10 +- .../RaiExternalSafetyProviderInnerTests.java | 25 + ...ExternalSafetyProviderPropertiesTests.java | 25 + .../generated/RaiMonitorConfigTests.java | 15 +- ...esCreateOrUpdateWithResponseMockTests.java | 90 +- .../RaiPoliciesGetWithResponseMockTests.java | 34 +- .../generated/RaiPoliciesListMockTests.java | 37 +- .../RaiPolicyContentFilterTests.java | 26 +- .../generated/RaiPolicyInnerTests.java | 137 +- .../generated/RaiPolicyListResultTests.java | 202 +- .../generated/RaiPolicyPropertiesTests.java | 94 +- .../RaiSafetyProviderConfigTests.java | 27 + .../generated/RaiToolLabelInnerTests.java | 61 + ...iToolLabelPropertiesAccountScopeTests.java | 42 + ...LabelPropertiesProjectScopesItemTests.java | 44 + .../RaiToolLabelPropertiesTests.java | 54 + .../generated/RaiToolLabelResultTests.java | 26 + ...lsCreateOrUpdateWithResponseMockTests.java | 83 + ...RaiToolLabelsGetWithResponseMockTests.java | 44 + .../generated/RaiToolLabelsListMockTests.java | 46 + .../generated/RaiTopicConfigTests.java | 12 +- .../generated/RaiTopicInnerTests.java | 59 +- .../generated/RaiTopicPropertiesTests.java | 52 +- .../generated/RaiTopicResultTests.java | 82 +- ...csCreateOrUpdateWithResponseMockTests.java | 44 +- .../RaiTopicsGetWithResponseMockTests.java | 24 +- .../generated/RaiTopicsListMockTests.java | 25 +- .../generated/RegionSettingTests.java | 19 +- .../generated/ReplacementConfigTests.java | 25 +- .../generated/RequestMatchPatternTests.java | 16 +- .../generated/ResourceBaseTests.java | 18 +- ...mainAvailabilityWithResponseMockTests.java | 18 +- ...kSkuAvailabilityWithResponseMockTests.java | 24 +- .../ResourceSkuRestrictionInfoTests.java | 20 +- ...eBasedBuiltInAuthorizationPolicyTests.java | 22 + .../generated/SafetyProviderConfigTests.java | 33 + ...erviceTagOutboundRuleDestinationTests.java | 40 + .../ServiceTagOutboundRuleTests.java | 49 + .../SkuAvailabilityListResultInnerTests.java | 52 +- .../generated/SkuAvailabilityTests.java | 31 +- .../generated/SkuCapabilityTests.java | 16 +- .../generated/SkuChangeInfoTests.java | 21 +- .../generated/SkuResourceInnerTests.java | 56 +- .../cognitiveservices/generated/SkuTests.java | 34 +- ...esCreateOrUpdateWithResponseMockTests.java | 125 + ...onRaiPoliciesGetWithResponseMockTests.java | 63 + .../generated/TrafficRoutingRuleTests.java | 35 + .../generated/UsageInnerTests.java | 31 + .../generated/UsageListResultInnerTests.java | 48 +- .../generated/UsageTests.java | 49 - .../generated/UsagesListMockTests.java | 23 +- .../generated/UserAssignedIdentityTests.java | 4 +- .../generated/UserOwnedAmlWorkspaceTests.java | 14 +- .../generated/UserOwnedStorageTests.java | 14 +- .../VersionedAgentReferenceTests.java | 32 + .../generated/VirtualNetworkRuleTests.java | 23 +- .../tsp-location.yaml | 4 + 969 files changed, 43611 insertions(+), 22577 deletions(-) create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AgentApplicationsClient.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AgentDeploymentsClient.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ComputeOperationsClient.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ManagedNetworkProvisionsClient.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ManagedNetworkSettingsOperationsClient.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/OutboundRulesClient.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/OutboundRulesOperationsClient.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiExternalSafetyProvidersClient.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiExternalSafetyProvidersOperationsClient.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiToolLabelsClient.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/SubscriptionRaiPoliciesClient.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/TestRaiExternalSafetyProvidersClient.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AgentApplicationInner.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AgentDeploymentInner.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AgentReferenceResourceArmPaginatedResultInner.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ComputeOperationStatusInner.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkProvisionStatusInner.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkSettingsBasicResourceInner.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkSettingsInner.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkSettingsPropertiesBasicResourceInner.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/OutboundRuleBasicResourceInner.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/OutboundRuleListResultInner.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ProjectCapabilityHostInner.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiExternalSafetyProviderInner.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiExternalSafetyProviderSchemaInner.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiToolLabelInner.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/UsageInner.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentApplicationImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentApplicationsClientImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentApplicationsImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentDeploymentImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentDeploymentsClientImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentDeploymentsImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentReferenceResourceArmPaginatedResultImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeOperationStatusImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeOperationsClientImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeOperationsImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkProvisionStatusImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkProvisionsClientImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkProvisionsImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsBasicResourceImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsOperationsClientImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsOperationsImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsPropertiesBasicResourceImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRuleBasicResourceImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRuleListResultImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesClientImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesOperationsClientImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesOperationsImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProviderImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProviderSchemaImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersClientImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersOperationsClientImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersOperationsImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiToolLabelImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiToolLabelsClientImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiToolLabelsImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SubscriptionRaiPoliciesClientImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SubscriptionRaiPoliciesImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/TestRaiExternalSafetyProvidersClientImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/TestRaiExternalSafetyProvidersImpl.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsageImpl.java rename sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/{ => implementation}/models/AccountListResult.java (78%) rename sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/{ => implementation}/models/AccountModelListResult.java (72%) create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AgentApplicationResourceArmPaginatedResult.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AgentDeploymentResourceArmPaginatedResult.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CapabilityHostResourceArmPaginatedResult.java rename sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/{ => implementation}/models/CommitmentPlanAccountAssociationListResult.java (79%) rename sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/{ => implementation}/models/CommitmentPlanListResult.java (78%) rename sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/{ => implementation}/models/CommitmentTierListResult.java (78%) rename sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/{ => implementation}/models/ConnectionPropertiesV2BasicResourceArmPaginatedResult.java (73%) rename sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/{ => implementation}/models/DefenderForAISettingResult.java (72%) rename sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/{ => implementation}/models/DeploymentListResult.java (78%) rename sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/{ => implementation}/models/DeploymentSkuListResult.java (78%) rename sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/{ => implementation}/models/EncryptionScopeListResult.java (72%) create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ManagedNetworkListResult.java rename sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/{ => implementation}/models/ModelCapacityListResult.java (70%) rename sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/{ => implementation}/models/ModelListResult.java (72%) rename sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/{ => implementation}/models/NetworkSecurityPerimeterConfigurationList.java (72%) rename sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/{ => implementation}/models/OperationListResult.java (78%) create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ProjectCapabilityHostResourceArmPaginatedResult.java rename sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/{ => implementation}/models/ProjectListResult.java (78%) rename sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/{ => implementation}/models/QuotaTierListResult.java (77%) rename sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/{ => implementation}/models/RaiBlockListItemsResult.java (72%) rename sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/{ => implementation}/models/RaiBlockListResult.java (72%) rename sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/{ => implementation}/models/RaiContentFilterListResult.java (72%) create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiExternalSafetyProviderResult.java rename sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/{ => implementation}/models/RaiPolicyListResult.java (72%) create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiToolLabelResult.java rename sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/{ => implementation}/models/RaiTopicResult.java (72%) rename sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/{ => implementation}/models/ResourceSkuListResult.java (62%) create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentApplication.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentApplications.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeployment.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentProperties.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentProvisioningState.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentState.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentType.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeployments.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentProtocol.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentProtocolVersion.java rename sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/{AzureEntityResource.java => AgentReference.java} (55%) create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentReferenceProperties.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentReferenceResourceArmPaginatedResult.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgenticApplicationProperties.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgenticApplicationProvisioningState.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApplicationAuthorizationPolicy.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApplicationTrafficRoutingPolicy.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AssignedIdentity.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/BuiltInAuthorizationScheme.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ChannelsBuiltInAuthorizationPolicy.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperationStatus.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperationStatusProperties.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperationStatusType.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperations.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentRouting.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentState.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FirewallSku.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FoundryAutoUpgrade.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FoundryAutoUpgradeMode.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FqdnOutboundRule.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/HostedAgentDeployment.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IdentityKind.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IdentityManagementType.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IdentityProvisioningState.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IsolationMode.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedAgentDeployment.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkKind.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisionOptions.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisionStatus.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisioningState.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisions.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettings.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsBasicResource.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsEx.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsOperations.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsProperties.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsPropertiesBasicResource.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkStatus.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OrganizationSharedBuiltInAuthorizationPolicy.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRule.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRuleBasicResource.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRuleListResult.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRules.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRulesOperations.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointOutboundRule.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointOutboundRuleDestination.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectCapabilityHost.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectCapabilityHostProperties.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaScopeType.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiActionType.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProvider.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviderProperties.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviderSchema.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviderSchemaProperties.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviders.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProvidersOperations.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiSafetyProviderConfig.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabel.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabelProperties.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabelPropertiesAccountScope.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabelPropertiesProjectScopesItem.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabels.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RoleBasedBuiltInAuthorizationPolicy.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RoutingMode.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleAction.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleCategory.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleStatus.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleType.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SafetyProviderConfig.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServiceTagOutboundRule.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServiceTagOutboundRuleDestination.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServiceTier.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SubscriptionRaiPolicies.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TestRaiExternalSafetyProviders.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TrafficRoutingProtocol.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TrafficRoutingRule.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/VersionedAgentReference.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/resources/META-INF/azure-resourcemanager-cognitiveservices_metadata.json create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsListSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsCreateOrUpdateSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsDeleteSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsDisableSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsEnableSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsGetSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsListAgentsSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsListSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsCreateOrUpdateSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsDeleteSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsGetSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsListSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsStartSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsStopSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ComputeOperationsGetSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsPauseSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsResumeSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkProvisionsProvisionManagedNetworkSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationDeleteSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationGetSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationListSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationPatchSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationPutSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRuleCreateOrUpdateSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRuleDeleteSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRuleGetSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRuleListSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRulesOperationPostSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsListSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiExternalSafetyProviderCreateOrUpdateSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiExternalSafetyProviderDeleteSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiExternalSafetyProviderGetSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiExternalSafetyProvidersOperationListSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelsCreateOrUpdateSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelsDeleteSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelsGetSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelsListSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/SubscriptionRaiPolicyCreateOrUpdateSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/SubscriptionRaiPolicyDeleteSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/SubscriptionRaiPolicyGetSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/TestRaiExternalSafetyProviderCreateOrUpdateSamples.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsListMockTests.java rename sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/{ProjectConnectionsUpdateWithResponseMockTests.java => AccountConnectionsUpdateWithResponseMockTests.java} (59%) create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsDisableWithResponseMockTests.java rename sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/{ProjectsDeleteMockTests.java => AgentApplicationsEnableWithResponseMockTests.java} (76%) create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsListAgentsWithResponseMockTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentInnerTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentPropertiesTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentResourceArmPaginatedResultTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsCreateOrUpdateMockTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsGetWithResponseMockTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsListMockTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsStartWithResponseMockTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsStopWithResponseMockTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentProtocolVersionTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentReferencePropertiesTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentReferenceResourceArmPaginatedResultInnerTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentReferenceTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ApplicationAuthorizationPolicyTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ApplicationTrafficRoutingPolicyTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AssignedIdentityTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AzureEntityResourceTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CapabilityHostResourceArmPaginatedResultTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ChannelsBuiltInAuthorizationPolicyTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/FoundryAutoUpgradeTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/FqdnOutboundRuleTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/HostedAgentDeploymentTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedAgentDeploymentTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkListResultTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkProvisionOptionsTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkProvisionStatusInnerTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkProvisionsProvisionManagedNetworkMockTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsBasicResourceInnerTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsExTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsInnerTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationsGetWithResponseMockTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationsListMockTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationsPutMockTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsPropertiesBasicResourceInnerTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsPropertiesTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OrganizationSharedBuiltInAuthorizationPolicyTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRuleBasicResourceInnerTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRuleListResultInnerTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRuleTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRulesCreateOrUpdateMockTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRulesGetWithResponseMockTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRulesListMockTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRulesOperationsPostMockTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointOutboundRuleDestinationTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointOutboundRuleTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostInnerTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostPropertiesTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostResourceArmPaginatedResultTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsListMockTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiExternalSafetyProviderInnerTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiExternalSafetyProviderPropertiesTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiSafetyProviderConfigTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelInnerTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelPropertiesAccountScopeTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelPropertiesProjectScopesItemTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelPropertiesTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelResultTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelsCreateOrUpdateWithResponseMockTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelsGetWithResponseMockTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelsListMockTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RoleBasedBuiltInAuthorizationPolicyTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SafetyProviderConfigTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ServiceTagOutboundRuleDestinationTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ServiceTagOutboundRuleTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SubscriptionRaiPoliciesCreateOrUpdateWithResponseMockTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SubscriptionRaiPoliciesGetWithResponseMockTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/TrafficRoutingRuleTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsageInnerTests.java delete mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsageTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/VersionedAgentReferenceTests.java create mode 100644 sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/tsp-location.yaml diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/CHANGELOG.md b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/CHANGELOG.md index 3d72349a1a19..514a0b5a7e32 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/CHANGELOG.md +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/CHANGELOG.md @@ -1,14 +1,1068 @@ # Release History -## 1.5.0-beta.1 (Unreleased) +## 1.5.0-beta.1 (2026-03-26) + +- Azure Resource Manager CognitiveServices client library for Java. This package contains Microsoft Azure SDK for CognitiveServices Management SDK. Cognitive Services Management Client. Package api-version 2026-01-15-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +### Breaking Changes + +#### `models.DefenderForAISettingResult` was removed + +#### `models.AccountModelListResult` was removed + +#### `models.RaiContentFilterListResult` was removed + +#### `models.RaiTopicResult` was removed + +#### `models.CommitmentPlanAccountAssociationListResult` was removed + +#### `models.RaiBlockListItemsResult` was removed + +#### `models.DeploymentSkuListResult` was removed + +#### `models.NetworkSecurityPerimeterConfigurationList` was removed + +#### `models.DeploymentListResult` was removed + +#### `models.RaiPolicyListResult` was removed + +#### `models.AzureEntityResource` was removed + +#### `models.ProjectListResult` was removed + +#### `models.OperationListResult` was removed + +#### `models.EncryptionScopeListResult` was removed + +#### `models.ModelCapacityListResult` was removed + +#### `models.ModelListResult` was removed + +#### `models.CommitmentPlanListResult` was removed + +#### `models.AccountListResult` was removed + +#### `models.CommitmentTierListResult` was removed + +#### `models.ResourceSkuListResult` was removed + +#### `models.QuotaTierListResult` was removed + +#### `models.ConnectionPropertiesV2BasicResourceArmPaginatedResult` was removed + +#### `models.RaiBlockListResult` was removed + +#### `models.ConnectionPropertiesV2BasicResource$DefinitionStages` was modified + +* `withExistingAccount(java.lang.String,java.lang.String)` was removed in stage 1 + +#### `models.RegenerateKeyParameters` was modified + +* `validate()` was removed + +#### `models.Sku` was modified + +* `validate()` was removed + +#### `models.ResourceSkuRestrictions` was modified + +* `ResourceSkuRestrictions()` was changed to private access +* `validate()` was removed +* `withValues(java.util.List)` was removed +* `withReasonCode(models.ResourceSkuRestrictionsReasonCode)` was removed +* `withRestrictionInfo(models.ResourceSkuRestrictionInfo)` was removed +* `withType(models.ResourceSkuRestrictionsType)` was removed + +#### `models.ApiProperties` was modified + +* `validate()` was removed + +#### `models.NetworkSecurityPerimeterConfigurationProperties` was modified + +* `NetworkSecurityPerimeterConfigurationProperties()` was changed to private access +* `validate()` was removed +* `withResourceAssociation(models.NetworkSecurityPerimeterConfigurationAssociationInfo)` was removed +* `withProvisioningIssues(java.util.List)` was removed +* `withProfile(models.NetworkSecurityPerimeterProfileInfo)` was removed +* `withNetworkSecurityPerimeter(models.NetworkSecurityPerimeter)` was removed + +#### `models.DeploymentCapacitySettings` was modified + +* `validate()` was removed + +#### `models.OperationDisplay` was modified + +* `OperationDisplay()` was changed to private access +* `validate()` was removed + +#### `models.CheckSkuAvailabilityParameter` was modified + +* `validate()` was removed + +#### `models.RaiBlocklistItems` was modified + +* `batchDeleteWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.Object,com.azure.core.util.Context)` was removed +* `batchDelete(java.lang.String,java.lang.String,java.lang.String,java.lang.Object)` was removed + +#### `models.NetworkSecurityPerimeterAccessRule` was modified + +* `NetworkSecurityPerimeterAccessRule()` was changed to private access +* `validate()` was removed +* `withProperties(models.NetworkSecurityPerimeterAccessRuleProperties)` was removed +* `withName(java.lang.String)` was removed + +#### `models.CustomTopicConfig` was modified + +* `validate()` was removed + +#### `models.CapabilityHostProperties` was modified + +* `validate()` was removed + +#### `models.ConnectionPropertiesV2` was modified + +* `validate()` was removed + +#### `models.ConnectionAccessKey` was modified + +* `validate()` was removed + +#### `models.CustomKeysConnectionProperties` was modified + +* `validate()` was removed + +#### `models.PrivateLinkResource` was modified + +* `PrivateLinkResource()` was changed to private access +* `validate()` was removed +* `withProperties(models.PrivateLinkResourceProperties)` was removed + +#### `models.AccountConnections` was modified + +* `define(java.lang.String)` was removed +* `getByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `getById(java.lang.String)` was removed +* `deleteById(java.lang.String)` was removed + +#### `models.RaiBlocklistProperties` was modified + +* `validate()` was removed + +#### `models.SkuAvailability` was modified + +* `SkuAvailability()` was changed to private access +* `withType(java.lang.String)` was removed +* `validate()` was removed +* `withSkuName(java.lang.String)` was removed +* `withSkuAvailable(java.lang.Boolean)` was removed +* `withKind(java.lang.String)` was removed +* `withMessage(java.lang.String)` was removed +* `withReason(java.lang.String)` was removed + +#### `models.RequestMatchPattern` was modified + +* `RequestMatchPattern()` was changed to private access +* `withMethod(java.lang.String)` was removed +* `withPath(java.lang.String)` was removed +* `validate()` was removed + +#### `models.ConnectionPropertiesV2BasicResource$Definition` was modified + +* `withExistingAccount(java.lang.String,java.lang.String)` was removed + +#### `models.AccountKeyAuthTypeConnectionProperties` was modified + +* `validate()` was removed + +#### `models.NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem` was modified + +* `NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem()` was changed to private access +* `withId(java.lang.String)` was removed +* `validate()` was removed + +#### `models.CommitmentQuota` was modified + +* `CommitmentQuota()` was changed to private access +* `validate()` was removed +* `withUnit(java.lang.String)` was removed +* `withQuantity(java.lang.Long)` was removed + +#### `models.AccessKeyAuthTypeConnectionProperties` was modified + +* `validate()` was removed + +#### `models.ConnectionApiKey` was modified + +* `validate()` was removed + +#### `models.ModelCapacityCalculatorWorkloadRequestParam` was modified + +* `validate()` was removed + +#### `models.ReplacementConfig` was modified + +* `ReplacementConfig()` was changed to private access +* `validate()` was removed +* `withAutoUpgradeStartDate(java.time.OffsetDateTime)` was removed +* `withTargetModelVersion(java.lang.String)` was removed +* `withTargetModelName(java.lang.String)` was removed +* `withUpgradeOnExpiryLeadTimeDays(java.lang.Integer)` was removed + +#### `models.CalculateModelCapacityParameter` was modified + +* `validate()` was removed + +#### `models.UserOwnedStorage` was modified + +* `validate()` was removed + +#### `models.CheckDomainAvailabilityParameter` was modified + +* `validate()` was removed + +#### `models.NetworkSecurityPerimeterProfileInfo` was modified + +* `NetworkSecurityPerimeterProfileInfo()` was changed to private access +* `withEnabledLogCategories(java.util.List)` was removed +* `withAccessRulesVersion(java.lang.Long)` was removed +* `validate()` was removed +* `withDiagnosticSettingsVersion(java.lang.Long)` was removed +* `withName(java.lang.String)` was removed +* `withAccessRules(java.util.List)` was removed + +#### `models.ModelSku` was modified + +* `ModelSku()` was changed to private access +* `withName(java.lang.String)` was removed +* `withCost(java.util.List)` was removed +* `withUsageName(java.lang.String)` was removed +* `validate()` was removed +* `withRateLimits(java.util.List)` was removed +* `withCapacity(models.CapacityConfig)` was removed +* `withDeprecationDate(java.time.OffsetDateTime)` was removed + +#### `models.ProjectProperties` was modified + +* `validate()` was removed + +#### `models.RaiBlocklistItemProperties` was modified + +* `validate()` was removed + +#### `models.CommitmentPlanAssociation` was modified + +* `CommitmentPlanAssociation()` was changed to private access +* `withCommitmentPlanLocation(java.lang.String)` was removed +* `validate()` was removed +* `withCommitmentPlanId(java.lang.String)` was removed + +#### `models.RaiPolicyProperties` was modified + +* `validate()` was removed + +#### `models.SkuChangeInfo` was modified + +* `SkuChangeInfo()` was changed to private access +* `withCountOfUpgradesAfterDowngrades(java.lang.Float)` was removed +* `withLastChangeDate(java.lang.String)` was removed +* `validate()` was removed +* `withCountOfDowngrades(java.lang.Float)` was removed + +#### `models.NetworkSecurityPerimeterConfigurationAssociationInfo` was modified + +* `NetworkSecurityPerimeterConfigurationAssociationInfo()` was changed to private access +* `withAccessMode(java.lang.String)` was removed +* `validate()` was removed +* `withName(java.lang.String)` was removed + +#### `models.DeploymentProperties` was modified + +* `validate()` was removed + +#### `models.QuotaLimit` was modified + +* `QuotaLimit()` was changed to private access +* `validate()` was removed +* `withRenewalPeriod(java.lang.Float)` was removed +* `withCount(java.lang.Float)` was removed +* `withRules(java.util.List)` was removed + +#### `models.OAuth2AuthTypeConnectionProperties` was modified + +* `validate()` was removed + +#### `models.ApiKeyAuthConnectionProperties` was modified + +* `validate()` was removed + +#### `models.RaiBlocklistItemBulkRequest` was modified + +* `validate()` was removed + +#### `models.MetricName` was modified + +* `MetricName()` was changed to private access +* `withLocalizedValue(java.lang.String)` was removed +* `withValue(java.lang.String)` was removed +* `validate()` was removed + +#### `models.AccountSku` was modified + +* `AccountSku()` was changed to private access +* `validate()` was removed +* `withResourceType(java.lang.String)` was removed +* `withSku(models.Sku)` was removed + +#### `models.MultiRegionSettings` was modified + +* `validate()` was removed + +#### `models.PatchResourceTags` was modified + +* `validate()` was removed + +#### `models.ConnectionUsernamePassword` was modified + +* `validate()` was removed + +#### `models.NetworkInjection` was modified + +* `validate()` was removed + +#### `models.ModelDeprecationInfo` was modified + +* `ModelDeprecationInfo()` was changed to private access +* `withFineTune(java.lang.String)` was removed +* `withDeprecationStatus(models.DeprecationStatus)` was removed +* `validate()` was removed +* `withInference(java.lang.String)` was removed + +#### `models.PrivateLinkServiceConnectionState` was modified + +* `validate()` was removed + +#### `models.QuotaTierUpgradeEligibilityInfo` was modified + +* `QuotaTierUpgradeEligibilityInfo()` was changed to private access +* `withUpgradeAvailabilityStatus(models.UpgradeAvailabilityStatus)` was removed +* `withUpgradeApplicableDate(java.time.OffsetDateTime)` was removed +* `validate()` was removed +* `withNextTierName(java.lang.String)` was removed +* `withUpgradeUnavailabilityReason(java.lang.String)` was removed + +#### `models.BillingMeterInfo` was modified + +* `BillingMeterInfo()` was changed to private access +* `withMeterId(java.lang.String)` was removed +* `validate()` was removed +* `withName(java.lang.String)` was removed +* `withUnit(java.lang.String)` was removed + +#### `models.ConnectionOAuth2` was modified + +* `validate()` was removed +* `java.util.UUID clientId()` -> `java.lang.String clientId()` +* `withClientId(java.util.UUID)` was removed + +#### `models.ConnectionServicePrincipal` was modified + +* `validate()` was removed + +#### `models.ConnectionSharedAccessSignature` was modified + +* `validate()` was removed + +#### `models.ProvisioningIssueProperties` was modified + +* `ProvisioningIssueProperties()` was changed to private access +* `validate()` was removed +* `withIssueType(java.lang.String)` was removed +* `withSeverity(java.lang.String)` was removed +* `withDescription(java.lang.String)` was removed +* `withSuggestedAccessRules(java.util.List)` was removed +* `withSuggestedResourceIds(java.util.List)` was removed + +#### `models.ResourceBase` was modified + +* `validate()` was removed + +#### `models.VirtualNetworkRule` was modified + +* `validate()` was removed + +#### `models.ServicePrincipalAuthTypeConnectionProperties` was modified + +* `validate()` was removed + +#### `models.ThrottlingRule` was modified + +* `ThrottlingRule()` was changed to private access +* `withDynamicThrottlingEnabled(java.lang.Boolean)` was removed +* `withMatchPatterns(java.util.List)` was removed +* `withRenewalPeriod(java.lang.Float)` was removed +* `withKey(java.lang.String)` was removed +* `withMinCount(java.lang.Float)` was removed +* `validate()` was removed +* `withCount(java.lang.Float)` was removed + +#### `models.AbusePenalty` was modified + +* `AbusePenalty()` was changed to private access +* `validate()` was removed +* `withExpiration(java.time.OffsetDateTime)` was removed +* `withRateLimitPercentage(java.lang.Float)` was removed +* `withAction(models.AbusePenaltyAction)` was removed + +#### `models.CommitmentCost` was modified + +* `CommitmentCost()` was changed to private access +* `withOverageMeterId(java.lang.String)` was removed +* `validate()` was removed +* `withCommitmentMeterId(java.lang.String)` was removed + +#### `models.NetworkSecurityPerimeterAccessRuleProperties` was modified + +* `NetworkSecurityPerimeterAccessRuleProperties()` was changed to private access +* `withAddressPrefixes(java.util.List)` was removed +* `validate()` was removed +* `withNetworkSecurityPerimeters(java.util.List)` was removed +* `withDirection(models.NspAccessRuleDirection)` was removed +* `withSubscriptions(java.util.List)` was removed +* `withFullyQualifiedDomainNames(java.util.List)` was removed + +#### `models.PatchResourceTagsAndSku` was modified + +* `validate()` was removed + +#### `models.CapacityConfig` was modified + +* `CapacityConfig()` was changed to private access +* `withMaximum(java.lang.Integer)` was removed +* `withStep(java.lang.Integer)` was removed +* `withAllowedValues(java.util.List)` was removed +* `withDefaultProperty(java.lang.Integer)` was removed +* `withMinimum(java.lang.Integer)` was removed +* `validate()` was removed + +#### `models.RaiContentFilterProperties` was modified + +* `RaiContentFilterProperties()` was changed to private access +* `withIsMultiLevelFilter(java.lang.Boolean)` was removed +* `withSource(models.RaiPolicyContentSource)` was removed +* `validate()` was removed +* `withName(java.lang.String)` was removed + +#### `models.ModelSkuCapacityProperties` was modified + +* `ModelSkuCapacityProperties()` was changed to private access +* `withModel(models.DeploymentModel)` was removed +* `withAvailableCapacity(java.lang.Float)` was removed +* `withSkuName(java.lang.String)` was removed +* `withAvailableFinetuneCapacity(java.lang.Float)` was removed +* `validate()` was removed + +#### `models.ProjectConnections` was modified + +* `createWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,fluent.models.ConnectionPropertiesV2BasicResourceInner,com.azure.core.util.Context)` was removed +* `create(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was removed +* `updateWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,models.ConnectionUpdateContent,com.azure.core.util.Context)` was removed +* `update(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was removed + +#### `models.SkuCapability` was modified + +* `SkuCapability()` was changed to private access +* `withName(java.lang.String)` was removed +* `validate()` was removed +* `withValue(java.lang.String)` was removed + +#### `models.NetworkRuleSet` was modified + +* `validate()` was removed + +#### `models.Usage` was modified + +* `Usage()` was removed +* `withLimit(java.lang.Double)` was removed +* `withNextResetTime(java.lang.String)` was removed +* `withQuotaPeriod(java.lang.String)` was removed +* `withName(models.MetricName)` was removed +* `withCurrentValue(java.lang.Double)` was removed +* `toJson(com.azure.json.JsonWriter)` was removed +* `java.lang.String nextResetTime()` -> `java.lang.String nextResetTime()` +* `withUnit(models.UnitType)` was removed +* `java.lang.Double currentValue()` -> `java.lang.Double currentValue()` +* `java.lang.Double limit()` -> `java.lang.Double limit()` +* `models.QuotaUsageStatus status()` -> `models.QuotaUsageStatus status()` +* `models.MetricName name()` -> `models.MetricName name()` +* `fromJson(com.azure.json.JsonReader)` was removed +* `validate()` was removed +* `java.lang.String quotaPeriod()` -> `java.lang.String quotaPeriod()` +* `models.UnitType unit()` -> `models.UnitType unit()` +* `withStatus(models.QuotaUsageStatus)` was removed + +#### `models.Encryption` was modified + +* `validate()` was removed + +#### `models.PatAuthTypeConnectionProperties` was modified + +* `validate()` was removed + +#### `models.NoneAuthTypeConnectionProperties` was modified + +* `validate()` was removed + +#### `models.RaiBlocklistConfig` was modified + +* `validate()` was removed + +#### `models.RaiTopicConfig` was modified + +* `validate()` was removed + +#### `models.RegionSetting` was modified + +* `validate()` was removed + +#### `models.ProvisioningIssue` was modified + +* `ProvisioningIssue()` was changed to private access +* `validate()` was removed +* `withName(java.lang.String)` was removed +* `withProperties(models.ProvisioningIssueProperties)` was removed + +#### `models.Identity` was modified + +* `validate()` was removed + +#### `models.CommitmentPeriod` was modified + +* `validate()` was removed + +#### `models.PrivateEndpoint` was modified + +* `validate()` was removed + +#### `models.NetworkSecurityPerimeter` was modified + +* `NetworkSecurityPerimeter()` was changed to private access +* `withId(java.lang.String)` was removed +* `validate()` was removed +* `withPerimeterGuid(java.lang.String)` was removed +* `withLocation(java.lang.String)` was removed + +#### `models.ConnectionUpdateContent` was modified + +* `validate()` was removed + +#### `models.ConnectionManagedIdentity` was modified + +* `validate()` was removed + +#### `models.RaiTopicProperties` was modified + +* `validate()` was removed + +#### `models.RaiPolicyContentFilter` was modified + +* `validate()` was removed + +#### `models.CustomKeys` was modified + +* `validate()` was removed + +#### `models.UserOwnedAmlWorkspace` was modified + +* `validate()` was removed + +#### `models.DeploymentModel` was modified + +* `validate()` was removed + +#### `models.RaiMonitorConfig` was modified + +* `validate()` was removed + +#### `models.AccountProperties` was modified + +* `validate()` was removed + +#### `models.ManagedIdentityAuthTypeConnectionProperties` was modified + +* `validate()` was removed + +#### `models.PrivateEndpointConnectionProperties` was modified + +* `validate()` was removed + +#### `models.ResourceSkuRestrictionInfo` was modified + +* `ResourceSkuRestrictionInfo()` was changed to private access +* `validate()` was removed +* `withLocations(java.util.List)` was removed +* `withZones(java.util.List)` was removed + +#### `models.CalculateModelCapacityResultEstimatedCapacity` was modified + +* `CalculateModelCapacityResultEstimatedCapacity()` was changed to private access +* `withDeployableValue(java.lang.Integer)` was removed +* `validate()` was removed +* `withValue(java.lang.Integer)` was removed + +#### `models.ModelCapacityCalculatorWorkload` was modified + +* `validate()` was removed + +#### `models.ProjectCapabilityHosts` was modified + +* `createOrUpdate(java.lang.String,java.lang.String,java.lang.String,java.lang.String,fluent.models.CapabilityHostInner)` was removed +* `createOrUpdate(java.lang.String,java.lang.String,java.lang.String,java.lang.String,fluent.models.CapabilityHostInner,com.azure.core.util.Context)` was removed +* `models.CapabilityHost get(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` -> `models.ProjectCapabilityHost get(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` + +#### `models.KeyVaultProperties` was modified + +* `validate()` was removed + +#### `models.EncryptionScopeProperties` was modified + +* `validate()` was removed + +#### `models.UserAssignedIdentity` was modified + +* `validate()` was removed + +#### `models.ConnectionAccountKey` was modified + +* `validate()` was removed + +#### `models.DeploymentScaleSettings` was modified + +* `validate()` was removed + +#### `models.SasAuthTypeConnectionProperties` was modified + +* `validate()` was removed + +#### `models.UsernamePasswordAuthTypeConnectionProperties` was modified + +* `validate()` was removed + +#### `models.AadAuthTypeConnectionProperties` was modified + +* `validate()` was removed + +#### `models.CallRateLimit` was modified + +* `CallRateLimit()` was changed to private access +* `withRenewalPeriod(java.lang.Float)` was removed +* `validate()` was removed +* `withRules(java.util.List)` was removed +* `withCount(java.lang.Float)` was removed + +#### `models.CommitmentPlanProperties` was modified + +* `validate()` was removed + +#### `models.PrivateLinkResourceProperties` was modified + +* `PrivateLinkResourceProperties()` was changed to private access +* `validate()` was removed +* `withRequiredZoneNames(java.util.List)` was removed + +#### `models.IpRule` was modified + +* `validate()` was removed + +#### `models.QuotaTierProperties` was modified + +* `validate()` was removed + +#### `models.CustomBlocklistConfig` was modified + +* `validate()` was removed + +#### `models.ConnectionPersonalAccessToken` was modified + +* `validate()` was removed ### Features Added -### Breaking Changes +* `models.SafetyProviderConfig` was added + +* `models.ServiceTagOutboundRuleDestination` was added + +* `models.AgentApplication$Update` was added + +* `models.HostedAgentDeployment` was added + +* `models.AgentDeploymentType` was added + +* `models.ProjectCapabilityHostProperties` was added + +* `models.IdentityKind` was added + +* `models.AgenticApplicationProperties` was added + +* `models.ComputeOperationStatusProperties` was added + +* `models.PrivateEndpointOutboundRule` was added + +* `models.OutboundRuleBasicResource$Definition` was added + +* `models.AgentDeploymentProvisioningState` was added + +* `models.ProjectCapabilityHost` was added + +* `models.AgentReference` was added + +* `models.ProjectCapabilityHost$DefinitionStages` was added + +* `models.ApplicationTrafficRoutingPolicy` was added + +* `models.RaiExternalSafetyProviderSchema$DefinitionStages` was added + +* `models.ManagedNetworkSettings` was added + +* `models.AgentDeploymentProperties` was added + +* `models.TrafficRoutingProtocol` was added + +* `models.RaiToolLabels` was added + +* `models.RaiExternalSafetyProviderSchema$Definition` was added + +* `models.OutboundRuleBasicResource$UpdateStages` was added + +* `models.OutboundRules` was added + +* `models.ManagedNetworkSettingsProperties` was added + +* `models.RaiExternalSafetyProviderSchema$Update` was added + +* `models.RaiSafetyProviderConfig` was added -### Bugs Fixed +* `models.ManagedNetworkSettingsPropertiesBasicResource` was added + +* `models.AgentReferenceResourceArmPaginatedResult` was added + +* `models.FoundryAutoUpgradeMode` was added + +* `models.ProjectCapabilityHost$Definition` was added + +* `models.OutboundRuleListResult` was added + +* `models.VersionedAgentReference` was added + +* `models.OutboundRuleBasicResource$DefinitionStages` was added + +* `models.IsolationMode` was added + +* `models.ManagedNetworkSettingsPropertiesBasicResource$UpdateStages` was added + +* `models.RaiToolLabel$DefinitionStages` was added + +* `models.AgentDeployment$UpdateStages` was added + +* `models.ComputeOperationStatus` was added + +* `models.AgentApplications` was added + +* `models.OrganizationSharedBuiltInAuthorizationPolicy` was added + +* `models.ServiceTagOutboundRule` was added + +* `models.QuotaScopeType` was added + +* `models.ManagedNetworkProvisionOptions` was added + +* `models.RaiActionType` was added + +* `models.RaiExternalSafetyProviderSchemaProperties` was added + +* `models.AgentApplication$Definition` was added + +* `models.RaiExternalSafetyProvider` was added + +* `models.ManagedNetworkSettingsPropertiesBasicResource$DefinitionStages` was added + +* `models.ProjectCapabilityHost$Update` was added + +* `models.OutboundRulesOperations` was added + +* `models.RaiToolLabel` was added + +* `models.OutboundRuleBasicResource$Update` was added + +* `models.RuleStatus` was added + +* `models.ManagedNetworkStatus` was added + +* `models.IdentityManagementType` was added + +* `models.AgentDeployment$Definition` was added + +* `models.RaiExternalSafetyProviderSchema` was added + +* `models.RaiToolLabel$UpdateStages` was added + +* `models.RaiToolLabel$Definition` was added + +* `models.ComputeOperationStatusType` was added + +* `models.ServiceTier` was added + +* `models.OutboundRule` was added + +* `models.IdentityProvisioningState` was added + +* `models.RuleAction` was added + +* `models.ManagedNetworkProvisioningState` was added + +* `models.ApplicationAuthorizationPolicy` was added + +* `models.AgentApplication$UpdateStages` was added + +* `models.DeploymentState` was added + +* `models.AssignedIdentity` was added + +* `models.FoundryAutoUpgrade` was added + +* `models.ManagedAgentDeployment` was added + +* `models.FirewallSku` was added + +* `models.PrivateEndpointOutboundRuleDestination` was added + +* `models.ManagedNetworkSettingsPropertiesBasicResource$Update` was added + +* `models.OutboundRuleBasicResource` was added + +* `models.RaiToolLabelPropertiesAccountScope` was added + +* `models.ManagedNetworkSettingsOperations` was added + +* `models.ChannelsBuiltInAuthorizationPolicy` was added + +* `models.AgentApplication$DefinitionStages` was added + +* `models.RoleBasedBuiltInAuthorizationPolicy` was added + +* `models.RaiExternalSafetyProvidersOperations` was added + +* `models.AgentProtocolVersion` was added + +* `models.FqdnOutboundRule` was added + +* `models.RoutingMode` was added + +* `models.AgentProtocol` was added + +* `models.ManagedNetworkSettingsBasicResource` was added + +* `models.AgentDeployment$DefinitionStages` was added + +* `models.RaiToolLabelPropertiesProjectScopesItem` was added + +* `models.ManagedNetworkProvisionStatus` was added + +* `models.AgentDeploymentState` was added + +* `models.RaiExternalSafetyProviders` was added + +* `models.ManagedNetworkKind` was added + +* `models.SubscriptionRaiPolicies` was added + +* `models.RaiExternalSafetyProviderProperties` was added + +* `models.ProjectCapabilityHost$UpdateStages` was added + +* `models.ManagedNetworkSettingsEx` was added + +* `models.RaiExternalSafetyProviderSchema$UpdateStages` was added + +* `models.AgenticApplicationProvisioningState` was added + +* `models.AgentDeployment$Update` was added + +* `models.TrafficRoutingRule` was added + +* `models.AgentDeployment` was added + +* `models.ComputeOperations` was added + +* `models.RuleType` was added + +* `models.AgentReferenceProperties` was added + +* `models.AgentApplication` was added + +* `models.RaiToolLabelProperties` was added + +* `models.DeploymentRouting` was added + +* `models.RuleCategory` was added + +* `models.BuiltInAuthorizationScheme` was added + +* `models.ManagedNetworkSettingsPropertiesBasicResource$Definition` was added + +* `models.AgentDeployments` was added + +* `models.ManagedNetworkProvisions` was added + +* `models.TestRaiExternalSafetyProviders` was added + +* `models.RaiToolLabel$Update` was added + +#### `models.RaiBlocklistItems` was modified + +* `batchDeleteWithResponse(java.lang.String,java.lang.String,java.lang.String,java.util.List,com.azure.core.util.Context)` was added +* `batchDelete(java.lang.String,java.lang.String,java.lang.String,java.util.List)` was added + +#### `models.CapabilityHostProperties` was modified + +* `enablePublicHostingEnvironment()` was added +* `withEnablePublicHostingEnvironment(java.lang.Boolean)` was added + +#### `models.AccountConnections` was modified + +* `create(java.lang.String,java.lang.String,java.lang.String)` was added +* `updateWithResponse(java.lang.String,java.lang.String,java.lang.String,models.ConnectionUpdateContent,com.azure.core.util.Context)` was added +* `createWithResponse(java.lang.String,java.lang.String,java.lang.String,fluent.models.ConnectionPropertiesV2BasicResourceInner,com.azure.core.util.Context)` was added +* `update(java.lang.String,java.lang.String,java.lang.String)` was added + +#### `models.ConnectionAuthType` was modified + +* `AGENTIC_IDENTITY_TOKEN` was added +* `PROJECT_MANAGED_IDENTITY` was added +* `AGENTIC_USER` was added +* `AGENT_USER_IMPERSONATION` was added +* `USER_ENTRA_TOKEN` was added +* `ACCOUNT_MANAGED_IDENTITY` was added +* `DELEGATED_SAS` was added + +#### `models.ConnectionPropertiesV2BasicResource$Definition` was modified + +* `withExistingProject(java.lang.String,java.lang.String,java.lang.String)` was added + +#### `CognitiveServicesManager` was modified + +* `managedNetworkSettingsOperations()` was added +* `computeOperations()` was added +* `testRaiExternalSafetyProviders()` was added +* `raiExternalSafetyProviders()` was added +* `outboundRules()` was added +* `agentApplications()` was added +* `managedNetworkProvisions()` was added +* `agentDeployments()` was added +* `raiToolLabels()` was added +* `raiExternalSafetyProvidersOperations()` was added +* `outboundRulesOperations()` was added +* `subscriptionRaiPolicies()` was added + +#### `models.RaiPolicyContentSource` was modified + +* `POST_RUN` was added +* `PRE_RUN` was added +* `POST_TOOL_CALL` was added +* `PRE_TOOL_CALL` was added + +#### `models.RaiPolicyProperties` was modified + +* `safetyProviders()` was added +* `withSafetyProviders(java.util.List)` was added + +#### `models.DeploymentProperties` was modified + +* `withServiceTier(models.ServiceTier)` was added +* `withDeploymentState(models.DeploymentState)` was added +* `deploymentState()` was added +* `withRouting(models.DeploymentRouting)` was added +* `routing()` was added +* `serviceTier()` was added + +#### `models.ConnectionOAuth2` was modified + +* `withClientId(java.lang.String)` was added + +#### `models.ModelSkuCapacityProperties` was modified + +* `scopeId()` was added +* `scopeType()` was added + +#### `models.ProjectConnections` was modified + +* `define(java.lang.String)` was added +* `deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was added +* `getById(java.lang.String)` was added +* `deleteById(java.lang.String)` was added +* `getByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was added + +#### `models.Usage` was modified + +* `innerModel()` was added +* `scopeType()` was added +* `scopeId()` was added + +#### `models.AccountCapabilityHosts` was modified + +* `list(java.lang.String,java.lang.String)` was added +* `list(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added + +#### `models.RaiPolicyContentFilter` was modified + +* `action()` was added +* `withAction(models.RaiActionType)` was added + +#### `models.AccountProperties` was modified + +* `withFoundryAutoUpgrade(models.FoundryAutoUpgrade)` was added +* `foundryAutoUpgrade()` was added + +#### `models.Deployment` was modified + +* `pause()` was added +* `pauseWithResponse(com.azure.core.util.Context)` was added +* `resumeWithResponse(com.azure.core.util.Context)` was added +* `resume()` was added + +#### `models.ConnectionCategory` was modified + +* `DATABRICKS` was added +* `POWER_PLATFORM_ENVIRONMENT` was added +* `REMOTE_TOOL` was added +* `SHAREPOINT` was added +* `APP_INSIGHTS` was added +* `MICROSOFT_FABRIC` was added +* `GROUNDING_WITH_CUSTOM_SEARCH` was added +* `API_MANAGEMENT` was added +* `MODEL_GATEWAY` was added +* `AZURE_CONTAINER_APP_ENVIRONMENT` was added +* `REMOTE_A2A` was added +* `APP_CONFIG` was added +* `GROUNDING_WITH_BING_SEARCH` was added +* `AZURE_KEY_VAULT` was added + +#### `models.ProjectCapabilityHosts` was modified + +* `list(java.lang.String,java.lang.String,java.lang.String)` was added +* `list(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `deleteById(java.lang.String)` was added +* `deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was added +* `define(java.lang.String)` was added +* `getByIdWithResponse(java.lang.String,com.azure.core.util.Context)` was added +* `getById(java.lang.String)` was added + +#### `models.Deployments` was modified -### Other Changes +* `resume(java.lang.String,java.lang.String,java.lang.String)` was added +* `pause(java.lang.String,java.lang.String,java.lang.String)` was added +* `pauseWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `resumeWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added ## 1.4.0 (2025-10-24) diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/README.md b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/README.md index d20a904d5ead..33248d47a138 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/README.md +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/README.md @@ -2,7 +2,7 @@ Azure Resource Manager CognitiveServices client library for Java. -This package contains Microsoft Azure SDK for CognitiveServices Management SDK. Cognitive Services Management Client. Package tag package-2025-09-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for CognitiveServices Management SDK. Cognitive Services Management Client. Package api-version 2026-01-15-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-cognitiveservices - 1.4.0 + 1.5.0-beta.1 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/SAMPLE.md b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/SAMPLE.md index 5e03c547aaba..e7b8ecc4774f 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/SAMPLE.md +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/SAMPLE.md @@ -6,6 +6,7 @@ - [CreateOrUpdate](#accountcapabilityhosts_createorupdate) - [Delete](#accountcapabilityhosts_delete) - [Get](#accountcapabilityhosts_get) +- [List](#accountcapabilityhosts_list) ## AccountConnections @@ -29,6 +30,25 @@ - [RegenerateKey](#accounts_regeneratekey) - [Update](#accounts_update) +## AgentApplications + +- [CreateOrUpdate](#agentapplications_createorupdate) +- [Delete](#agentapplications_delete) +- [Disable](#agentapplications_disable) +- [Enable](#agentapplications_enable) +- [Get](#agentapplications_get) +- [List](#agentapplications_list) +- [ListAgents](#agentapplications_listagents) + +## AgentDeployments + +- [CreateOrUpdate](#agentdeployments_createorupdate) +- [Delete](#agentdeployments_delete) +- [Get](#agentdeployments_get) +- [List](#agentdeployments_list) +- [Start](#agentdeployments_start) +- [Stop](#agentdeployments_stop) + ## CommitmentPlans - [CreateOrUpdate](#commitmentplans_createorupdate) @@ -50,6 +70,10 @@ - [List](#commitmenttiers_list) +## ComputeOperations + +- [Get](#computeoperations_get) + ## DefenderForAISettings - [CreateOrUpdate](#defenderforaisettings_createorupdate) @@ -70,6 +94,8 @@ - [Get](#deployments_get) - [List](#deployments_list) - [ListSkus](#deployments_listskus) +- [Pause](#deployments_pause) +- [Resume](#deployments_resume) - [Update](#deployments_update) ## EncryptionScopes @@ -83,6 +109,18 @@ - [List](#locationbasedmodelcapacities_list) +## ManagedNetworkProvisions + +- [ProvisionManagedNetwork](#managednetworkprovisions_provisionmanagednetwork) + +## ManagedNetworkSettingsOperation + +- [Delete](#managednetworksettingsoperation_delete) +- [Get](#managednetworksettingsoperation_get) +- [List](#managednetworksettingsoperation_list) +- [Patch](#managednetworksettingsoperation_patch) +- [Put](#managednetworksettingsoperation_put) + ## ModelCapacities - [List](#modelcapacities_list) @@ -101,6 +139,17 @@ - [List](#operations_list) +## OutboundRule + +- [CreateOrUpdate](#outboundrule_createorupdate) +- [Delete](#outboundrule_delete) +- [Get](#outboundrule_get) +- [List](#outboundrule_list) + +## OutboundRulesOperation + +- [Post](#outboundrulesoperation_post) + ## PrivateEndpointConnections - [CreateOrUpdate](#privateendpointconnections_createorupdate) @@ -117,6 +166,7 @@ - [CreateOrUpdate](#projectcapabilityhosts_createorupdate) - [Delete](#projectcapabilityhosts_delete) - [Get](#projectcapabilityhosts_get) +- [List](#projectcapabilityhosts_list) ## ProjectConnections @@ -162,6 +212,16 @@ - [Get](#raicontentfilters_get) - [List](#raicontentfilters_list) +## RaiExternalSafetyProvider + +- [CreateOrUpdate](#raiexternalsafetyprovider_createorupdate) +- [Delete](#raiexternalsafetyprovider_delete) +- [Get](#raiexternalsafetyprovider_get) + +## RaiExternalSafetyProvidersOperation + +- [List](#raiexternalsafetyprovidersoperation_list) + ## RaiPolicies - [CreateOrUpdate](#raipolicies_createorupdate) @@ -169,6 +229,13 @@ - [Get](#raipolicies_get) - [List](#raipolicies_list) +## RaiToolLabels + +- [CreateOrUpdate](#raitoollabels_createorupdate) +- [Delete](#raitoollabels_delete) +- [Get](#raitoollabels_get) +- [List](#raitoollabels_list) + ## RaiTopics - [CreateOrUpdate](#raitopics_createorupdate) @@ -186,6 +253,16 @@ - [List](#resourceskus_list) +## SubscriptionRaiPolicy + +- [CreateOrUpdate](#subscriptionraipolicy_createorupdate) +- [Delete](#subscriptionraipolicy_delete) +- [Get](#subscriptionraipolicy_get) + +## TestRaiExternalSafetyProvider + +- [CreateOrUpdate](#testraiexternalsafetyprovider_createorupdate) + ## Usages - [List](#usages_list) @@ -199,9 +276,7 @@ import com.azure.resourcemanager.cognitiveservices.models.CapabilityHostProperti */ public final class AccountCapabilityHostsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * AccountCapabilityHost/createOrUpdate.json + * x-ms-original-file: 2026-01-15-preview/AccountCapabilityHost/createOrUpdate.json */ /** * Sample code: CreateOrUpdate Account CapabilityHost. @@ -214,7 +289,8 @@ public final class AccountCapabilityHostsCreateOrUpdateSamples { .define("capabilityHostName") .withExistingAccount("test-rg", "account-1") .withProperties(new CapabilityHostProperties().withCustomerSubnet( - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroups/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet")) + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroups/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet") + .withEnablePublicHostingEnvironment(true)) .create(); } } @@ -228,9 +304,7 @@ public final class AccountCapabilityHostsCreateOrUpdateSamples { */ public final class AccountCapabilityHostsDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * AccountCapabilityHost/delete.json + * x-ms-original-file: 2026-01-15-preview/AccountCapabilityHost/delete.json */ /** * Sample code: Delete Account CapabilityHost. @@ -253,9 +327,7 @@ public final class AccountCapabilityHostsDeleteSamples { */ public final class AccountCapabilityHostsGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * AccountCapabilityHost/get.json + * x-ms-original-file: 2026-01-15-preview/AccountCapabilityHost/get.json */ /** * Sample code: Get Account CapabilityHost. @@ -270,9 +342,32 @@ public final class AccountCapabilityHostsGetSamples { } ``` +### AccountCapabilityHosts_List + +```java +/** + * Samples for AccountCapabilityHosts List. + */ +public final class AccountCapabilityHostsListSamples { + /* + * x-ms-original-file: 2026-01-15-preview/AccountCapabilityHost/list.json + */ + /** + * Sample code: List Account CapabilityHosts. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + listAccountCapabilityHosts(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accountCapabilityHosts().list("test-rg", "account-1", com.azure.core.util.Context.NONE); + } +} +``` + ### AccountConnections_Create ```java +import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; import com.azure.resourcemanager.cognitiveservices.models.ConnectionCategory; import com.azure.resourcemanager.cognitiveservices.models.NoneAuthTypeConnectionProperties; import java.time.OffsetDateTime; @@ -282,9 +377,7 @@ import java.time.OffsetDateTime; */ public final class AccountConnectionsCreateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * AccountConnection/create.json + * x-ms-original-file: 2026-01-15-preview/AccountConnection/create.json */ /** * Sample code: CreateAccountConnection. @@ -294,12 +387,12 @@ public final class AccountConnectionsCreateSamples { public static void createAccountConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { manager.accountConnections() - .define("connection-1") - .withExistingAccount("resourceGroup-1", "account-1") - .withProperties(new NoneAuthTypeConnectionProperties().withCategory(ConnectionCategory.CONTAINER_REGISTRY) - .withExpiryTime(OffsetDateTime.parse("2024-03-15T14:30:00Z")) - .withTarget("[tartget url]")) - .create(); + .createWithResponse("resourceGroup-1", "account-1", "connection-1", + new ConnectionPropertiesV2BasicResourceInner().withProperties( + new NoneAuthTypeConnectionProperties().withCategory(ConnectionCategory.CONTAINER_REGISTRY) + .withExpiryTime(OffsetDateTime.parse("2024-03-15T14:30:00Z")) + .withTarget("[target url]")), + com.azure.core.util.Context.NONE); } } ``` @@ -312,9 +405,7 @@ public final class AccountConnectionsCreateSamples { */ public final class AccountConnectionsDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * AccountConnection/delete.json + * x-ms-original-file: 2026-01-15-preview/AccountConnection/delete.json */ /** * Sample code: DeleteAccountConnection. @@ -337,9 +428,7 @@ public final class AccountConnectionsDeleteSamples { */ public final class AccountConnectionsGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * AccountConnection/get.json + * x-ms-original-file: 2026-01-15-preview/AccountConnection/get.json */ /** * Sample code: GetAccountConnection. @@ -362,9 +451,7 @@ public final class AccountConnectionsGetSamples { */ public final class AccountConnectionsListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * AccountConnection/list.json + * x-ms-original-file: 2026-01-15-preview/AccountConnection/list.json */ /** * Sample code: ListAccountConnections. @@ -374,7 +461,7 @@ public final class AccountConnectionsListSamples { public static void listAccountConnections(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { manager.accountConnections() - .list("resourceGroup-1", "account-1", "[tartget url]", "ContainerRegistry", null, + .list("resourceGroup-1", "account-1", "[target url]", "ContainerRegistry", null, com.azure.core.util.Context.NONE); } } @@ -386,7 +473,7 @@ public final class AccountConnectionsListSamples { import com.azure.resourcemanager.cognitiveservices.models.AccessKeyAuthTypeConnectionProperties; import com.azure.resourcemanager.cognitiveservices.models.ConnectionAccessKey; import com.azure.resourcemanager.cognitiveservices.models.ConnectionCategory; -import com.azure.resourcemanager.cognitiveservices.models.ConnectionPropertiesV2BasicResource; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionUpdateContent; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; @@ -396,9 +483,7 @@ import java.util.Map; */ public final class AccountConnectionsUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * AccountConnection/update.json + * x-ms-original-file: 2026-01-15-preview/AccountConnection/update.json */ /** * Sample code: UpdateAccountConnection. @@ -407,17 +492,16 @@ public final class AccountConnectionsUpdateSamples { */ public static void updateAccountConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - ConnectionPropertiesV2BasicResource resource = manager.accountConnections() - .getWithResponse("test-rg", "account-1", "connection-1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withProperties(new AccessKeyAuthTypeConnectionProperties().withCategory(ConnectionCategory.ADLSGEN2) - .withExpiryTime(OffsetDateTime.parse("2020-01-01T00:00:00Z")) - .withMetadata(mapOf()) - .withTarget("some_string") - .withCredentials(new ConnectionAccessKey().withAccessKeyId("fakeTokenPlaceholder") - .withSecretAccessKey("fakeTokenPlaceholder"))) - .apply(); + manager.accountConnections() + .updateWithResponse("test-rg", "account-1", "connection-1", + new ConnectionUpdateContent().withProperties( + new AccessKeyAuthTypeConnectionProperties().withCategory(ConnectionCategory.ADLSGEN2) + .withExpiryTime(OffsetDateTime.parse("2020-01-01T00:00:00Z")) + .withMetadata(mapOf()) + .withTarget("some_string") + .withCredentials(new ConnectionAccessKey().withAccessKeyId("fakeTokenPlaceholder") + .withSecretAccessKey("fakeTokenPlaceholder"))), + com.azure.core.util.Context.NONE); } // Use "Map.of" if available @@ -452,9 +536,7 @@ import java.util.Arrays; */ public final class AccountsCreateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * CreateAccountMin.json + * x-ms-original-file: 2026-01-15-preview/CreateAccountMin.json */ /** * Sample code: Create Account Min. @@ -466,17 +548,15 @@ public final class AccountsCreateSamples { .define("testCreate1") .withExistingResourceGroup("myResourceGroup") .withRegion("West US") + .withProperties(new AccountProperties()) .withKind("CognitiveServices") .withSku(new Sku().withName("S0")) .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withProperties(new AccountProperties()) .create(); } /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * CreateAccount.json + * x-ms-original-file: 2026-01-15-preview/CreateAccount.json */ /** * Sample code: Create Account. @@ -488,9 +568,6 @@ public final class AccountsCreateSamples { .define("testCreate1") .withExistingResourceGroup("myResourceGroup") .withRegion("West US") - .withKind("Emotion") - .withSku(new Sku().withName("S0")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) .withProperties(new AccountProperties() .withEncryption( new Encryption().withKeyVaultProperties(new KeyVaultProperties().withKeyName("fakeTokenPlaceholder") @@ -498,6 +575,9 @@ public final class AccountsCreateSamples { .withKeyVaultUri("fakeTokenPlaceholder")).withKeySource(KeySource.MICROSOFT_KEY_VAULT)) .withUserOwnedStorage(Arrays.asList(new UserOwnedStorage().withResourceId( "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount")))) + .withKind("Emotion") + .withSku(new Sku().withName("S0")) + .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) .create(); } } @@ -511,9 +591,7 @@ public final class AccountsCreateSamples { */ public final class AccountsDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * DeleteAccount.json + * x-ms-original-file: 2026-01-15-preview/DeleteAccount.json */ /** * Sample code: Delete Account. @@ -534,9 +612,7 @@ public final class AccountsDeleteSamples { */ public final class AccountsGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetAccount.json + * x-ms-original-file: 2026-01-15-preview/GetAccount.json */ /** * Sample code: Get Account. @@ -558,9 +634,7 @@ public final class AccountsGetByResourceGroupSamples { */ public final class AccountsListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListAccountsBySubscription.json + * x-ms-original-file: 2026-01-15-preview/ListAccountsBySubscription.json */ /** * Sample code: List Accounts by Subscription. @@ -582,9 +656,7 @@ public final class AccountsListSamples { */ public final class AccountsListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListAccountsByResourceGroup.json + * x-ms-original-file: 2026-01-15-preview/ListAccountsByResourceGroup.json */ /** * Sample code: List Accounts by Resource Group. @@ -606,9 +678,7 @@ public final class AccountsListByResourceGroupSamples { */ public final class AccountsListKeysSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ListKeys. - * json + * x-ms-original-file: 2026-01-15-preview/ListKeys.json */ /** * Sample code: List Keys. @@ -629,9 +699,7 @@ public final class AccountsListKeysSamples { */ public final class AccountsListModelsSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListAccountModels.json + * x-ms-original-file: 2026-01-15-preview/ListAccountModels.json */ /** * Sample code: List AccountModels. @@ -652,9 +720,7 @@ public final class AccountsListModelsSamples { */ public final class AccountsListSkusSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ListSkus. - * json + * x-ms-original-file: 2026-01-15-preview/ListSkus.json */ /** * Sample code: List SKUs. @@ -675,9 +741,7 @@ public final class AccountsListSkusSamples { */ public final class AccountsListUsagesSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/GetUsages - * .json + * x-ms-original-file: 2026-01-15-preview/GetUsages.json */ /** * Sample code: Get Usages. @@ -688,6 +752,48 @@ public final class AccountsListUsagesSamples { manager.accounts() .listUsagesWithResponse("myResourceGroup", "TestUsage02", null, com.azure.core.util.Context.NONE); } + + /* + * x-ms-original-file: 2026-01-15-preview/GetUsagesClassicScope.json + */ + /** + * Sample code: Get Usages Classic Scope. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + getUsagesClassicScope(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accounts() + .listUsagesWithResponse("myResourceGroup", "TestUsage02", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-01-15-preview/GetUsagesDataZoneScope.json + */ + /** + * Sample code: Get Usages DataZone Scope. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + getUsagesDataZoneScope(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accounts() + .listUsagesWithResponse("myResourceGroup", "TestUsage02", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-01-15-preview/GetUsagesGlobalScope.json + */ + /** + * Sample code: Get Usages Global Scope. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + getUsagesGlobalScope(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accounts() + .listUsagesWithResponse("myResourceGroup", "TestUsage02", null, com.azure.core.util.Context.NONE); + } } ``` @@ -702,9 +808,7 @@ import com.azure.resourcemanager.cognitiveservices.models.RegenerateKeyParameter */ public final class AccountsRegenerateKeySamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * RegenerateKey.json + * x-ms-original-file: 2026-01-15-preview/RegenerateKey.json */ /** * Sample code: Regenerate Keys. @@ -730,9 +834,7 @@ import com.azure.resourcemanager.cognitiveservices.models.Sku; */ public final class AccountsUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * UpdateAccount.json + * x-ms-original-file: 2026-01-15-preview/UpdateAccount.json */ /** * Sample code: Update Account. @@ -748,333 +850,660 @@ public final class AccountsUpdateSamples { } ``` -### CommitmentPlans_CreateOrUpdate +### AgentApplications_CreateOrUpdate ```java -import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanInner; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPeriod; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanProperties; -import com.azure.resourcemanager.cognitiveservices.models.HostingModel; +import com.azure.resourcemanager.cognitiveservices.models.AgenticApplicationProperties; +import java.util.HashMap; +import java.util.Map; /** - * Samples for CommitmentPlans CreateOrUpdate. + * Samples for AgentApplications CreateOrUpdate. */ -public final class CommitmentPlansCreateOrUpdateSamples { +public final class AgentApplicationsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * PutCommitmentPlan.json + * x-ms-original-file: 2026-01-15-preview/AgentApplication/createOrUpdate.json */ /** - * Sample code: PutCommitmentPlan. + * Sample code: Create or Update Account Agent Application. * * @param manager Entry point to CognitiveServicesManager. */ - public static void putCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.commitmentPlans() - .createOrUpdateWithResponse("resourceGroupName", "accountName", "commitmentPlanName", - new CommitmentPlanInner() - .withProperties(new CommitmentPlanProperties().withHostingModel(HostingModel.WEB) - .withPlanType("Speech2Text") - .withCurrent(new CommitmentPeriod().withTier("T1")) - .withAutoRenew(true)), - com.azure.core.util.Context.NONE); + public static void createOrUpdateAccountAgentApplication( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.agentApplications() + .define("agent-app-1") + .withExistingProject("test-rg", "my-cognitive-services-account", "my-project") + .withProperties( + new AgenticApplicationProperties().withDescription("Sample agent application for customer support") + .withTags(mapOf("environment", "production", "team", "ai-platform")) + .withDisplayName("Customer Support Agent")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` -### CommitmentPlans_CreateOrUpdateAssociation +### AgentApplications_Delete ```java /** - * Samples for CommitmentPlans CreateOrUpdateAssociation. + * Samples for AgentApplications Delete. */ -public final class CommitmentPlansCreateOrUpdateAssociationSamples { +public final class AgentApplicationsDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * CreateSharedCommitmentPlanAssociation.json + * x-ms-original-file: 2026-01-15-preview/AgentApplication/delete.json */ /** - * Sample code: PutCommitmentPlan. + * Sample code: Delete Account Agent Application. * * @param manager Entry point to CognitiveServicesManager. */ - public static void putCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.commitmentPlans() - .defineAssociation("commitmentPlanAssociationName") - .withExistingCommitmentPlan("resourceGroupName", "commitmentPlanName") - .withAccountId( - "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.CognitiveServices/accounts/accountName") - .create(); + public static void + deleteAccountAgentApplication(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.agentApplications() + .delete("test-rg", "my-cognitive-services-account", "my-project", "agent-app-1", + com.azure.core.util.Context.NONE); } } ``` -### CommitmentPlans_CreateOrUpdatePlan +### AgentApplications_Disable ```java -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPeriod; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanProperties; -import com.azure.resourcemanager.cognitiveservices.models.HostingModel; -import com.azure.resourcemanager.cognitiveservices.models.Sku; - /** - * Samples for CommitmentPlans CreateOrUpdatePlan. + * Samples for AgentApplications Disable. */ -public final class CommitmentPlansCreateOrUpdatePlanSamples { +public final class AgentApplicationsDisableSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * CreateSharedCommitmentPlan.json + * x-ms-original-file: 2026-01-15-preview/AgentApplication/disable.json */ /** - * Sample code: Create Commitment Plan. + * Sample code: Disable Agent Application. * * @param manager Entry point to CognitiveServicesManager. */ public static void - createCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.commitmentPlans() - .definePlan("commitmentPlanName") - .withExistingResourceGroup("resourceGroupName") - .withRegion("West US") - .withKind("SpeechServices") - .withSku(new Sku().withName("S0")) - .withProperties(new CommitmentPlanProperties().withHostingModel(HostingModel.WEB) - .withPlanType("STT") - .withCurrent(new CommitmentPeriod().withTier("T1")) - .withAutoRenew(true)) - .create(); + disableAgentApplication(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.agentApplications() + .disableWithResponse("test-rg", "my-cognitive-services-account", "my-project", "agent-app-1", + com.azure.core.util.Context.NONE); } } ``` -### CommitmentPlans_Delete +### AgentApplications_Enable ```java /** - * Samples for CommitmentPlans Delete. + * Samples for AgentApplications Enable. */ -public final class CommitmentPlansDeleteSamples { +public final class AgentApplicationsEnableSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * DeleteCommitmentPlan.json + * x-ms-original-file: 2026-01-15-preview/AgentApplication/enable.json */ /** - * Sample code: DeleteCommitmentPlan. + * Sample code: Enable Agent Application. * * @param manager Entry point to CognitiveServicesManager. */ public static void - deleteCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.commitmentPlans() - .delete("resourceGroupName", "accountName", "commitmentPlanName", com.azure.core.util.Context.NONE); + enableAgentApplication(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.agentApplications() + .enableWithResponse("test-rg", "my-cognitive-services-account", "my-project", "agent-app-1", + com.azure.core.util.Context.NONE); } } ``` -### CommitmentPlans_DeleteAssociation +### AgentApplications_Get ```java /** - * Samples for CommitmentPlans DeleteAssociation. + * Samples for AgentApplications Get. */ -public final class CommitmentPlansDeleteAssociationSamples { +public final class AgentApplicationsGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * DeleteSharedCommitmentPlanAssociation.json + * x-ms-original-file: 2026-01-15-preview/AgentApplication/get.json */ /** - * Sample code: DeleteCommitmentPlan. + * Sample code: Get Account Agent Application. * * @param manager Entry point to CognitiveServicesManager. */ public static void - deleteCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.commitmentPlans() - .deleteAssociation("resourceGroupName", "commitmentPlanName", "commitmentPlanAssociationName", + getAccountAgentApplication(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.agentApplications() + .getWithResponse("test-rg", "my-cognitive-services-account", "my-project", "agent-app-1", com.azure.core.util.Context.NONE); } } ``` -### CommitmentPlans_DeletePlan +### AgentApplications_List ```java +import java.util.Arrays; + /** - * Samples for CommitmentPlans DeletePlan. + * Samples for AgentApplications List. */ -public final class CommitmentPlansDeletePlanSamples { +public final class AgentApplicationsListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * DeleteSharedCommitmentPlan.json + * x-ms-original-file: 2026-01-15-preview/AgentApplication/list.json */ /** - * Sample code: Delete Commitment Plan. + * Sample code: List Account Agent Applications. * * @param manager Entry point to CognitiveServicesManager. */ public static void - deleteCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.commitmentPlans() - .deletePlan("resourceGroupName", "commitmentPlanName", com.azure.core.util.Context.NONE); + listAccountAgentApplications(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.agentApplications() + .list("test-rg", "my-cognitive-services-account", "my-project", 30, null, "string", + Arrays.asList("agent-app-1", "agent-app-2"), "test", "name", true, com.azure.core.util.Context.NONE); } } ``` -### CommitmentPlans_Get +### AgentApplications_ListAgents ```java /** - * Samples for CommitmentPlans Get. + * Samples for AgentApplications ListAgents. */ -public final class CommitmentPlansGetSamples { +public final class AgentApplicationsListAgentsSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetCommitmentPlan.json + * x-ms-original-file: 2026-01-15-preview/AgentApplication/listAgents.json */ /** - * Sample code: GetCommitmentPlan. + * Sample code: List Agents for Agent Application. * * @param manager Entry point to CognitiveServicesManager. */ - public static void getCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.commitmentPlans() - .getWithResponse("resourceGroupName", "accountName", "commitmentPlanName", + public static void + listAgentsForAgentApplication(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.agentApplications() + .listAgentsWithResponse("test-rg", "my-cognitive-services-account", "my-project", "agent-app-1", com.azure.core.util.Context.NONE); } } ``` -### CommitmentPlans_GetAssociation +### AgentDeployments_CreateOrUpdate ```java +import com.azure.resourcemanager.cognitiveservices.models.AgentDeploymentState; +import com.azure.resourcemanager.cognitiveservices.models.AgentProtocol; +import com.azure.resourcemanager.cognitiveservices.models.AgentProtocolVersion; +import com.azure.resourcemanager.cognitiveservices.models.ManagedAgentDeployment; +import com.azure.resourcemanager.cognitiveservices.models.VersionedAgentReference; +import java.util.Arrays; + /** - * Samples for CommitmentPlans GetAssociation. + * Samples for AgentDeployments CreateOrUpdate. */ -public final class CommitmentPlansGetAssociationSamples { +public final class AgentDeploymentsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetSharedCommitmentPlanAssociation.json + * x-ms-original-file: 2026-01-15-preview/AgentDeployment/createOrUpdate.json */ /** - * Sample code: GetCommitmentPlan. + * Sample code: Create or Update Agent Deployment. * * @param manager Entry point to CognitiveServicesManager. */ - public static void getCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.commitmentPlans() - .getAssociationWithResponse("resourceGroupName", "commitmentPlanName", "commitmentPlanAssociationName", - com.azure.core.util.Context.NONE); + public static void + createOrUpdateAgentDeployment(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.agentDeployments() + .define("deployment-1") + .withExistingApplication("test-rg", "my-cognitive-services-account", "my-project", "agent-app-1") + .withProperties(new ManagedAgentDeployment().withDisplayName("Production Deployment") + .withState(AgentDeploymentState.STARTING) + .withProtocols( + Arrays.asList(new AgentProtocolVersion().withProtocol(AgentProtocol.AGENT).withVersion("1.0"))) + .withAgents(Arrays.asList(new VersionedAgentReference().withAgentId("agent-123") + .withAgentName("support-agent") + .withAgentVersion("1.0.0")))) + .create(); } } ``` -### CommitmentPlans_GetByResourceGroup +### AgentDeployments_Delete ```java /** - * Samples for CommitmentPlans GetByResourceGroup. + * Samples for AgentDeployments Delete. */ -public final class CommitmentPlansGetByResourceGroupSamples { +public final class AgentDeploymentsDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetSharedCommitmentPlan.json + * x-ms-original-file: 2026-01-15-preview/AgentDeployment/delete.json */ /** - * Sample code: Get Commitment Plan. + * Sample code: Delete Agent Deployment. * * @param manager Entry point to CognitiveServicesManager. */ - public static void getCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.commitmentPlans() - .getByResourceGroupWithResponse("resourceGroupName", "commitmentPlanName", + public static void + deleteAgentDeployment(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.agentDeployments() + .delete("test-rg", "my-cognitive-services-account", "my-project", "agent-app-1", "deployment-1", com.azure.core.util.Context.NONE); } } ``` -### CommitmentPlans_List +### AgentDeployments_Get ```java /** - * Samples for CommitmentPlans List. + * Samples for AgentDeployments Get. */ -public final class CommitmentPlansListSamples { +public final class AgentDeploymentsGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListCommitmentPlans.json + * x-ms-original-file: 2026-01-15-preview/AgentDeployment/get.json */ /** - * Sample code: ListCommitmentPlans. + * Sample code: Get Agent Deployment. * * @param manager Entry point to CognitiveServicesManager. */ public static void - listCommitmentPlans(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.commitmentPlans().list("resourceGroupName", "accountName", com.azure.core.util.Context.NONE); + getAgentDeployment(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.agentDeployments() + .getWithResponse("test-rg", "my-cognitive-services-account", "my-project", "agent-app-1", "deployment-1", + com.azure.core.util.Context.NONE); } } ``` -### CommitmentPlans_ListAssociations +### AgentDeployments_List ```java + /** - * Samples for CommitmentPlans ListAssociations. + * Samples for AgentDeployments List. */ -public final class CommitmentPlansListAssociationsSamples { +public final class AgentDeploymentsListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListSharedCommitmentPlanAssociations.json + * x-ms-original-file: 2026-01-15-preview/AgentDeployment/list.json */ /** - * Sample code: ListCommitmentPlans. + * Sample code: List Agent Deployments. * * @param manager Entry point to CognitiveServicesManager. */ public static void - listCommitmentPlans(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.commitmentPlans() - .listAssociations("resourceGroupName", "commitmentPlanName", com.azure.core.util.Context.NONE); + listAgentDeployments(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.agentDeployments() + .list("test-rg", "my-cognitive-services-account", "my-project", "agent-app-1", null, null, null, null, null, + com.azure.core.util.Context.NONE); } } ``` -### CommitmentPlans_ListByResourceGroup +### AgentDeployments_Start ```java /** - * Samples for CommitmentPlans ListByResourceGroup. + * Samples for AgentDeployments Start. */ -public final class CommitmentPlansListByResourceGroupSamples { +public final class AgentDeploymentsStartSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListSharedCommitmentPlansByResourceGroup.json + * x-ms-original-file: 2026-01-15-preview/AgentDeployment/start.json */ /** - * Sample code: List Commitment Plans by Resource Group. + * Sample code: Start Agent Deployment. * * @param manager Entry point to CognitiveServicesManager. */ - public static void listCommitmentPlansByResourceGroup( - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.commitmentPlans().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + public static void + startAgentDeployment(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.agentDeployments() + .startWithResponse("test-rg", "my-cognitive-services-account", "my-project", "agent-app-1", "deployment-1", + com.azure.core.util.Context.NONE); } } ``` -### CommitmentPlans_ListPlansBySubscription +### AgentDeployments_Stop + +```java +/** + * Samples for AgentDeployments Stop. + */ +public final class AgentDeploymentsStopSamples { + /* + * x-ms-original-file: 2026-01-15-preview/AgentDeployment/stop.json + */ + /** + * Sample code: Stop Agent Deployment. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + stopAgentDeployment(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.agentDeployments() + .stopWithResponse("test-rg", "my-cognitive-services-account", "my-project", "agent-app-1", "deployment-1", + com.azure.core.util.Context.NONE); + } +} +``` + +### CommitmentPlans_CreateOrUpdate + +```java +import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanInner; +import com.azure.resourcemanager.cognitiveservices.models.CommitmentPeriod; +import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanProperties; +import com.azure.resourcemanager.cognitiveservices.models.HostingModel; + +/** + * Samples for CommitmentPlans CreateOrUpdate. + */ +public final class CommitmentPlansCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-15-preview/PutCommitmentPlan.json + */ + /** + * Sample code: PutCommitmentPlan. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void putCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans() + .createOrUpdateWithResponse("resourceGroupName", "accountName", "commitmentPlanName", + new CommitmentPlanInner() + .withProperties(new CommitmentPlanProperties().withHostingModel(HostingModel.WEB) + .withPlanType("Speech2Text") + .withCurrent(new CommitmentPeriod().withTier("T1")) + .withAutoRenew(true)), + com.azure.core.util.Context.NONE); + } +} +``` + +### CommitmentPlans_CreateOrUpdateAssociation + +```java +/** + * Samples for CommitmentPlans CreateOrUpdateAssociation. + */ +public final class CommitmentPlansCreateOrUpdateAssociationSamples { + /* + * x-ms-original-file: 2026-01-15-preview/CreateSharedCommitmentPlanAssociation.json + */ + /** + * Sample code: PutCommitmentPlan. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void putCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans() + .defineAssociation("commitmentPlanAssociationName") + .withExistingCommitmentPlan("resourceGroupName", "commitmentPlanName") + .withAccountId( + "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.CognitiveServices/accounts/accountName") + .create(); + } +} +``` + +### CommitmentPlans_CreateOrUpdatePlan + +```java +import com.azure.resourcemanager.cognitiveservices.models.CommitmentPeriod; +import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanProperties; +import com.azure.resourcemanager.cognitiveservices.models.HostingModel; +import com.azure.resourcemanager.cognitiveservices.models.Sku; + +/** + * Samples for CommitmentPlans CreateOrUpdatePlan. + */ +public final class CommitmentPlansCreateOrUpdatePlanSamples { + /* + * x-ms-original-file: 2026-01-15-preview/CreateSharedCommitmentPlan.json + */ + /** + * Sample code: Create Commitment Plan. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + createCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans() + .definePlan("commitmentPlanName") + .withExistingResourceGroup("resourceGroupName") + .withRegion("West US") + .withProperties(new CommitmentPlanProperties().withHostingModel(HostingModel.WEB) + .withPlanType("STT") + .withCurrent(new CommitmentPeriod().withTier("T1")) + .withAutoRenew(true)) + .withKind("SpeechServices") + .withSku(new Sku().withName("S0")) + .create(); + } +} +``` + +### CommitmentPlans_Delete + +```java +/** + * Samples for CommitmentPlans Delete. + */ +public final class CommitmentPlansDeleteSamples { + /* + * x-ms-original-file: 2026-01-15-preview/DeleteCommitmentPlan.json + */ + /** + * Sample code: DeleteCommitmentPlan. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + deleteCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans() + .delete("resourceGroupName", "accountName", "commitmentPlanName", com.azure.core.util.Context.NONE); + } +} +``` + +### CommitmentPlans_DeleteAssociation + +```java +/** + * Samples for CommitmentPlans DeleteAssociation. + */ +public final class CommitmentPlansDeleteAssociationSamples { + /* + * x-ms-original-file: 2026-01-15-preview/DeleteSharedCommitmentPlanAssociation.json + */ + /** + * Sample code: DeleteCommitmentPlan. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + deleteCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans() + .deleteAssociation("resourceGroupName", "commitmentPlanName", "commitmentPlanAssociationName", + com.azure.core.util.Context.NONE); + } +} +``` + +### CommitmentPlans_DeletePlan + +```java +/** + * Samples for CommitmentPlans DeletePlan. + */ +public final class CommitmentPlansDeletePlanSamples { + /* + * x-ms-original-file: 2026-01-15-preview/DeleteSharedCommitmentPlan.json + */ + /** + * Sample code: Delete Commitment Plan. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + deleteCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans() + .deletePlan("resourceGroupName", "commitmentPlanName", com.azure.core.util.Context.NONE); + } +} +``` + +### CommitmentPlans_Get + +```java +/** + * Samples for CommitmentPlans Get. + */ +public final class CommitmentPlansGetSamples { + /* + * x-ms-original-file: 2026-01-15-preview/GetCommitmentPlan.json + */ + /** + * Sample code: GetCommitmentPlan. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void getCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans() + .getWithResponse("resourceGroupName", "accountName", "commitmentPlanName", + com.azure.core.util.Context.NONE); + } +} +``` + +### CommitmentPlans_GetAssociation + +```java +/** + * Samples for CommitmentPlans GetAssociation. + */ +public final class CommitmentPlansGetAssociationSamples { + /* + * x-ms-original-file: 2026-01-15-preview/GetSharedCommitmentPlanAssociation.json + */ + /** + * Sample code: GetCommitmentPlan. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void getCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans() + .getAssociationWithResponse("resourceGroupName", "commitmentPlanName", "commitmentPlanAssociationName", + com.azure.core.util.Context.NONE); + } +} +``` + +### CommitmentPlans_GetByResourceGroup + +```java +/** + * Samples for CommitmentPlans GetByResourceGroup. + */ +public final class CommitmentPlansGetByResourceGroupSamples { + /* + * x-ms-original-file: 2026-01-15-preview/GetSharedCommitmentPlan.json + */ + /** + * Sample code: Get Commitment Plan. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void getCommitmentPlan(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans() + .getByResourceGroupWithResponse("resourceGroupName", "commitmentPlanName", + com.azure.core.util.Context.NONE); + } +} +``` + +### CommitmentPlans_List + +```java +/** + * Samples for CommitmentPlans List. + */ +public final class CommitmentPlansListSamples { + /* + * x-ms-original-file: 2026-01-15-preview/ListCommitmentPlans.json + */ + /** + * Sample code: ListCommitmentPlans. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + listCommitmentPlans(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans().list("resourceGroupName", "accountName", com.azure.core.util.Context.NONE); + } +} +``` + +### CommitmentPlans_ListAssociations + +```java +/** + * Samples for CommitmentPlans ListAssociations. + */ +public final class CommitmentPlansListAssociationsSamples { + /* + * x-ms-original-file: 2026-01-15-preview/ListSharedCommitmentPlanAssociations.json + */ + /** + * Sample code: ListCommitmentPlans. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + listCommitmentPlans(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans() + .listAssociations("resourceGroupName", "commitmentPlanName", com.azure.core.util.Context.NONE); + } +} +``` + +### CommitmentPlans_ListByResourceGroup + +```java +/** + * Samples for CommitmentPlans ListByResourceGroup. + */ +public final class CommitmentPlansListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-01-15-preview/ListSharedCommitmentPlansByResourceGroup.json + */ + /** + * Sample code: List Commitment Plans by Resource Group. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void listCommitmentPlansByResourceGroup( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.commitmentPlans().listByResourceGroup("resourceGroupName", com.azure.core.util.Context.NONE); + } +} +``` + +### CommitmentPlans_ListPlansBySubscription ```java /** @@ -1082,9 +1511,7 @@ public final class CommitmentPlansListByResourceGroupSamples { */ public final class CommitmentPlansListPlansBySubscriptionSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListSharedCommitmentPlansBySubscription.json + * x-ms-original-file: 2026-01-15-preview/ListSharedCommitmentPlansBySubscription.json */ /** * Sample code: List Accounts by Subscription. @@ -1110,9 +1537,7 @@ import java.util.Map; */ public final class CommitmentPlansUpdatePlanSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * UpdateSharedCommitmentPlan.json + * x-ms-original-file: 2026-01-15-preview/UpdateSharedCommitmentPlan.json */ /** * Sample code: Create Commitment Plan. @@ -1149,9 +1574,7 @@ public final class CommitmentPlansUpdatePlanSamples { */ public final class CommitmentTiersListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListCommitmentTiers.json + * x-ms-original-file: 2026-01-15-preview/ListCommitmentTiers.json */ /** * Sample code: ListCommitmentTiers. @@ -1165,6 +1588,29 @@ public final class CommitmentTiersListSamples { } ``` +### ComputeOperations_Get + +```java +/** + * Samples for ComputeOperations Get. + */ +public final class ComputeOperationsGetSamples { + /* + * x-ms-original-file: 2026-01-15-preview/GetComputeOperationStatus.json + */ + /** + * Sample code: GetComputeOperationStatus. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + getComputeOperationStatus(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.computeOperations() + .getWithResponse("eastus", "00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + } +} +``` + ### DefenderForAISettings_CreateOrUpdate ```java @@ -1175,9 +1621,7 @@ import com.azure.resourcemanager.cognitiveservices.models.DefenderForAISettingSt */ public final class DefenderForAISettingsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * PutDefenderForAISetting.json + * x-ms-original-file: 2026-01-15-preview/PutDefenderForAISetting.json */ /** * Sample code: PutDefenderForAISetting. @@ -1203,9 +1647,7 @@ public final class DefenderForAISettingsCreateOrUpdateSamples { */ public final class DefenderForAISettingsGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetDefenderForAISetting.json + * x-ms-original-file: 2026-01-15-preview/GetDefenderForAISetting.json */ /** * Sample code: GetDefenderForAISetting. @@ -1228,9 +1670,7 @@ public final class DefenderForAISettingsGetSamples { */ public final class DefenderForAISettingsListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListDefenderForAISetting.json + * x-ms-original-file: 2026-01-15-preview/ListDefenderForAISetting.json */ /** * Sample code: ListDefenderForAISetting. @@ -1255,9 +1695,7 @@ import com.azure.resourcemanager.cognitiveservices.models.DefenderForAISettingSt */ public final class DefenderForAISettingsUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * UpdateDefenderForAISetting.json + * x-ms-original-file: 2026-01-15-preview/UpdateDefenderForAISetting.json */ /** * Sample code: UpdateDefenderForAISetting. @@ -1282,9 +1720,7 @@ public final class DefenderForAISettingsUpdateSamples { */ public final class DeletedAccountsGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetDeletedAccount.json + * x-ms-original-file: 2026-01-15-preview/GetDeletedAccount.json */ /** * Sample code: Get Account. @@ -1306,9 +1742,7 @@ public final class DeletedAccountsGetSamples { */ public final class DeletedAccountsListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListDeletedAccountsBySubscription.json + * x-ms-original-file: 2026-01-15-preview/ListDeletedAccountsBySubscription.json */ /** * Sample code: List Deleted Accounts by Subscription. @@ -1330,9 +1764,7 @@ public final class DeletedAccountsListSamples { */ public final class DeletedAccountsPurgeSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * PurgeDeletedAccount.json + * x-ms-original-file: 2026-01-15-preview/PurgeDeletedAccount.json */ /** * Sample code: Delete Account. @@ -1350,6 +1782,8 @@ public final class DeletedAccountsPurgeSamples { ```java import com.azure.resourcemanager.cognitiveservices.models.DeploymentModel; import com.azure.resourcemanager.cognitiveservices.models.DeploymentProperties; +import com.azure.resourcemanager.cognitiveservices.models.DeploymentState; +import com.azure.resourcemanager.cognitiveservices.models.ServiceTier; import com.azure.resourcemanager.cognitiveservices.models.Sku; /** @@ -1357,9 +1791,7 @@ import com.azure.resourcemanager.cognitiveservices.models.Sku; */ public final class DeploymentsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * PutDeployment.json + * x-ms-original-file: 2026-01-15-preview/PutDeployment.json */ /** * Sample code: PutDeployment. @@ -1370,9 +1802,11 @@ public final class DeploymentsCreateOrUpdateSamples { manager.deployments() .define("deploymentName") .withExistingAccount("resourceGroupName", "accountName") - .withSku(new Sku().withName("Standard").withCapacity(1)) .withProperties(new DeploymentProperties() - .withModel(new DeploymentModel().withFormat("OpenAI").withName("ada").withVersion("1"))) + .withModel(new DeploymentModel().withFormat("OpenAI").withName("ada").withVersion("1")) + .withServiceTier(ServiceTier.PRIORITY) + .withDeploymentState(DeploymentState.RUNNING)) + .withSku(new Sku().withName("Standard").withCapacity(1)) .create(); } } @@ -1386,9 +1820,7 @@ public final class DeploymentsCreateOrUpdateSamples { */ public final class DeploymentsDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * DeleteDeployment.json + * x-ms-original-file: 2026-01-15-preview/DeleteDeployment.json */ /** * Sample code: DeleteDeployment. @@ -1410,9 +1842,7 @@ public final class DeploymentsDeleteSamples { */ public final class DeploymentsGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetDeployment.json + * x-ms-original-file: 2026-01-15-preview/GetDeployment.json */ /** * Sample code: GetDeployment. @@ -1434,9 +1864,7 @@ public final class DeploymentsGetSamples { */ public final class DeploymentsListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListDeployments.json + * x-ms-original-file: 2026-01-15-preview/ListDeployments.json */ /** * Sample code: ListDeployments. @@ -1457,9 +1885,7 @@ public final class DeploymentsListSamples { */ public final class DeploymentsListSkusSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListDeploymentSkus.json + * x-ms-original-file: 2026-01-15-preview/ListDeploymentSkus.json */ /** * Sample code: ListDeploymentSkus. @@ -1474,6 +1900,50 @@ public final class DeploymentsListSkusSamples { } ``` +### Deployments_Pause + +```java +/** + * Samples for Deployments Pause. + */ +public final class DeploymentsPauseSamples { + /* + * x-ms-original-file: 2026-01-15-preview/PauseDeployment.json + */ + /** + * Sample code: PauseDeployment. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void pauseDeployment(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.deployments() + .pauseWithResponse("resourceGroupName", "accountName", "deploymentName", com.azure.core.util.Context.NONE); + } +} +``` + +### Deployments_Resume + +```java +/** + * Samples for Deployments Resume. + */ +public final class DeploymentsResumeSamples { + /* + * x-ms-original-file: 2026-01-15-preview/ResumeDeployment.json + */ + /** + * Sample code: ResumeDeployment. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void resumeDeployment(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.deployments() + .resumeWithResponse("resourceGroupName", "accountName", "deploymentName", com.azure.core.util.Context.NONE); + } +} +``` + ### Deployments_Update ```java @@ -1481,162 +1951,390 @@ import com.azure.resourcemanager.cognitiveservices.models.Deployment; import com.azure.resourcemanager.cognitiveservices.models.Sku; /** - * Samples for Deployments Update. + * Samples for Deployments Update. + */ +public final class DeploymentsUpdateSamples { + /* + * x-ms-original-file: 2026-01-15-preview/UpdateDeployment.json + */ + /** + * Sample code: UpdateDeployment. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void updateDeployment(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + Deployment resource = manager.deployments() + .getWithResponse("resourceGroupName", "accountName", "deploymentName", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withSku(new Sku().withName("Standard").withCapacity(1)).apply(); + } +} +``` + +### EncryptionScopes_CreateOrUpdate + +```java +import com.azure.resourcemanager.cognitiveservices.models.EncryptionScopeProperties; +import com.azure.resourcemanager.cognitiveservices.models.EncryptionScopeState; +import com.azure.resourcemanager.cognitiveservices.models.KeySource; +import com.azure.resourcemanager.cognitiveservices.models.KeyVaultProperties; + +/** + * Samples for EncryptionScopes CreateOrUpdate. + */ +public final class EncryptionScopesCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-15-preview/PutEncryptionScope.json + */ + /** + * Sample code: PutEncryptionScope. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + putEncryptionScope(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.encryptionScopes() + .define("encryptionScopeName") + .withExistingAccount("resourceGroupName", "accountName") + .withProperties(new EncryptionScopeProperties() + .withKeyVaultProperties(new KeyVaultProperties().withKeyName("fakeTokenPlaceholder") + .withKeyVersion("fakeTokenPlaceholder") + .withKeyVaultUri("fakeTokenPlaceholder") + .withIdentityClientId("00000000-0000-0000-0000-000000000000")) + .withKeySource(KeySource.MICROSOFT_KEY_VAULT) + .withState(EncryptionScopeState.ENABLED)) + .create(); + } +} +``` + +### EncryptionScopes_Delete + +```java +/** + * Samples for EncryptionScopes Delete. + */ +public final class EncryptionScopesDeleteSamples { + /* + * x-ms-original-file: 2026-01-15-preview/DeleteEncryptionScope.json + */ + /** + * Sample code: DeleteEncryptionScope. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + deleteEncryptionScope(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.encryptionScopes() + .delete("resourceGroupName", "accountName", "encryptionScopeName", com.azure.core.util.Context.NONE); + } +} +``` + +### EncryptionScopes_Get + +```java +/** + * Samples for EncryptionScopes Get. + */ +public final class EncryptionScopesGetSamples { + /* + * x-ms-original-file: 2026-01-15-preview/GetEncryptionScope.json + */ + /** + * Sample code: GetEncryptionScope. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + getEncryptionScope(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.encryptionScopes() + .getWithResponse("resourceGroupName", "accountName", "encryptionScopeName", + com.azure.core.util.Context.NONE); + } +} +``` + +### EncryptionScopes_List + +```java +/** + * Samples for EncryptionScopes List. + */ +public final class EncryptionScopesListSamples { + /* + * x-ms-original-file: 2026-01-15-preview/ListEncryptionScopes.json + */ + /** + * Sample code: ListEncryptionScopes. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + listEncryptionScopes(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.encryptionScopes().list("resourceGroupName", "accountName", com.azure.core.util.Context.NONE); + } +} +``` + +### LocationBasedModelCapacities_List + +```java +/** + * Samples for LocationBasedModelCapacities List. + */ +public final class LocationBasedModelCapacitiesListSamples { + /* + * x-ms-original-file: 2026-01-15-preview/ListLocationBasedModelCapacitiesGlobalScope.json + */ + /** + * Sample code: ListLocationBasedModelCapacities Global Scope. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void listLocationBasedModelCapacitiesGlobalScope( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.locationBasedModelCapacities().list("WestUS", "OpenAI", "ada", "1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-01-15-preview/ListLocationBasedModelCapacitiesClassicScope.json + */ + /** + * Sample code: ListLocationBasedModelCapacities Classic Scope. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void listLocationBasedModelCapacitiesClassicScope( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.locationBasedModelCapacities().list("WestUS", "OpenAI", "ada", "1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-01-15-preview/ListLocationBasedModelCapacitiesDataZoneScope.json + */ + /** + * Sample code: ListLocationBasedModelCapacities DataZone Scope. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void listLocationBasedModelCapacitiesDataZoneScope( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.locationBasedModelCapacities().list("WestUS", "OpenAI", "ada", "1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-01-15-preview/ListLocationBasedModelCapacities.json + */ + /** + * Sample code: ListLocationBasedModelCapacities. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + listLocationBasedModelCapacities(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.locationBasedModelCapacities().list("WestUS", "OpenAI", "ada", "1", com.azure.core.util.Context.NONE); + } +} +``` + +### ManagedNetworkProvisions_ProvisionManagedNetwork + +```java +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkProvisionOptions; + +/** + * Samples for ManagedNetworkProvisions ProvisionManagedNetwork. */ -public final class DeploymentsUpdateSamples { +public final class ManagedNetworkProvisionsProvisionManagedNetworkSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * UpdateDeployment.json + * x-ms-original-file: 2026-01-15-preview/ManagedNetwork/provisionManagedNetwork.json */ /** - * Sample code: UpdateDeployment. + * Sample code: Provision ManagedNetwork. * * @param manager Entry point to CognitiveServicesManager. */ - public static void updateDeployment(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - Deployment resource = manager.deployments() - .getWithResponse("resourceGroupName", "accountName", "deploymentName", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().withSku(new Sku().withName("Standard").withCapacity(1)).apply(); + public static void + provisionManagedNetwork(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.managedNetworkProvisions() + .provisionManagedNetwork("test-rg", "cognitive-account-name", "default", + new ManagedNetworkProvisionOptions(), com.azure.core.util.Context.NONE); } } ``` -### EncryptionScopes_CreateOrUpdate +### ManagedNetworkSettingsOperation_Delete ```java -import com.azure.resourcemanager.cognitiveservices.models.EncryptionScopeProperties; -import com.azure.resourcemanager.cognitiveservices.models.EncryptionScopeState; -import com.azure.resourcemanager.cognitiveservices.models.KeySource; -import com.azure.resourcemanager.cognitiveservices.models.KeyVaultProperties; - /** - * Samples for EncryptionScopes CreateOrUpdate. + * Samples for ManagedNetworkSettingsOperation Delete. */ -public final class EncryptionScopesCreateOrUpdateSamples { +public final class ManagedNetworkSettingsOperationDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * PutEncryptionScope.json + * x-ms-original-file: 2026-01-15-preview/ManagedNetwork/deleteManagedNetworkV2.json */ /** - * Sample code: PutEncryptionScope. + * Sample code: Delete ManagedNetworkSettings. * * @param manager Entry point to CognitiveServicesManager. */ public static void - putEncryptionScope(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.encryptionScopes() - .define("encryptionScopeName") - .withExistingAccount("resourceGroupName", "accountName") - .withProperties(new EncryptionScopeProperties() - .withKeyVaultProperties(new KeyVaultProperties().withKeyName("fakeTokenPlaceholder") - .withKeyVersion("fakeTokenPlaceholder") - .withKeyVaultUri("fakeTokenPlaceholder") - .withIdentityClientId("00000000-0000-0000-0000-000000000000")) - .withKeySource(KeySource.MICROSOFT_KEY_VAULT) - .withState(EncryptionScopeState.ENABLED)) - .create(); + deleteManagedNetworkSettings(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.managedNetworkSettingsOperations() + .delete("test-rg", "cognitive-account-name", "default", com.azure.core.util.Context.NONE); } } ``` -### EncryptionScopes_Delete +### ManagedNetworkSettingsOperation_Get ```java /** - * Samples for EncryptionScopes Delete. + * Samples for ManagedNetworkSettingsOperation Get. */ -public final class EncryptionScopesDeleteSamples { +public final class ManagedNetworkSettingsOperationGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * DeleteEncryptionScope.json + * x-ms-original-file: 2026-01-15-preview/ManagedNetwork/getManagedNetworkV2.json */ /** - * Sample code: DeleteEncryptionScope. + * Sample code: Get ManagedNetworkSettings. * * @param manager Entry point to CognitiveServicesManager. */ public static void - deleteEncryptionScope(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.encryptionScopes() - .delete("resourceGroupName", "accountName", "encryptionScopeName", com.azure.core.util.Context.NONE); + getManagedNetworkSettings(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.managedNetworkSettingsOperations() + .getWithResponse("test-rg", "cognitive-account-name", "default", com.azure.core.util.Context.NONE); } } ``` -### EncryptionScopes_Get +### ManagedNetworkSettingsOperation_List ```java /** - * Samples for EncryptionScopes Get. + * Samples for ManagedNetworkSettingsOperation List. */ -public final class EncryptionScopesGetSamples { +public final class ManagedNetworkSettingsOperationListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetEncryptionScope.json + * x-ms-original-file: 2026-01-15-preview/ManagedNetwork/listManagedNetworkV2.json */ /** - * Sample code: GetEncryptionScope. + * Sample code: List ManagedNetworkSettings. * * @param manager Entry point to CognitiveServicesManager. */ public static void - getEncryptionScope(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.encryptionScopes() - .getWithResponse("resourceGroupName", "accountName", "encryptionScopeName", - com.azure.core.util.Context.NONE); + listManagedNetworkSettings(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.managedNetworkSettingsOperations() + .list("test-rg", "cognitive-account-name", com.azure.core.util.Context.NONE); } } ``` -### EncryptionScopes_List +### ManagedNetworkSettingsOperation_Patch ```java +import com.azure.resourcemanager.cognitiveservices.models.FirewallSku; +import com.azure.resourcemanager.cognitiveservices.models.FqdnOutboundRule; +import com.azure.resourcemanager.cognitiveservices.models.IsolationMode; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsEx; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsProperties; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsPropertiesBasicResource; +import com.azure.resourcemanager.cognitiveservices.models.RuleCategory; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for EncryptionScopes List. + * Samples for ManagedNetworkSettingsOperation Patch. */ -public final class EncryptionScopesListSamples { +public final class ManagedNetworkSettingsOperationPatchSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListEncryptionScopes.json + * x-ms-original-file: 2026-01-15-preview/ManagedNetwork/patchManagedNetworkV2.json */ /** - * Sample code: ListEncryptionScopes. + * Sample code: Patch ManagedNetworkSettings. * * @param manager Entry point to CognitiveServicesManager. */ public static void - listEncryptionScopes(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.encryptionScopes().list("resourceGroupName", "accountName", com.azure.core.util.Context.NONE); + patchManagedNetworkSettings(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + ManagedNetworkSettingsPropertiesBasicResource resource = manager.managedNetworkSettingsOperations() + .getWithResponse("test-rg", "cognitive-account-name", "default", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new ManagedNetworkSettingsProperties().withManagedNetwork( + new ManagedNetworkSettingsEx().withIsolationMode(IsolationMode.ALLOW_ONLY_APPROVED_OUTBOUND) + .withOutboundRules(mapOf("rule_name_1", + new FqdnOutboundRule().withCategory(RuleCategory.USER_DEFINED) + .withDestination("destination_endpoint"))) + .withFirewallSku(FirewallSku.STANDARD))) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` -### LocationBasedModelCapacities_List +### ManagedNetworkSettingsOperation_Put ```java +import com.azure.resourcemanager.cognitiveservices.models.FirewallSku; +import com.azure.resourcemanager.cognitiveservices.models.FqdnOutboundRule; +import com.azure.resourcemanager.cognitiveservices.models.IsolationMode; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsEx; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsProperties; +import com.azure.resourcemanager.cognitiveservices.models.RuleCategory; +import java.util.HashMap; +import java.util.Map; + /** - * Samples for LocationBasedModelCapacities List. + * Samples for ManagedNetworkSettingsOperation Put. */ -public final class LocationBasedModelCapacitiesListSamples { +public final class ManagedNetworkSettingsOperationPutSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListLocationBasedModelCapacities.json + * x-ms-original-file: 2026-01-15-preview/ManagedNetwork/createOrUpdateManagedNetworkV2.json */ /** - * Sample code: ListLocationBasedModelCapacities. + * Sample code: Put ManagedNetworkSettings. * * @param manager Entry point to CognitiveServicesManager. */ public static void - listLocationBasedModelCapacities(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.locationBasedModelCapacities().list("WestUS", "OpenAI", "ada", "1", com.azure.core.util.Context.NONE); + putManagedNetworkSettings(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.managedNetworkSettingsOperations() + .define("default") + .withExistingAccount("test-rg", "cognitive-account-name") + .withProperties(new ManagedNetworkSettingsProperties().withManagedNetwork( + new ManagedNetworkSettingsEx().withIsolationMode(IsolationMode.ALLOW_ONLY_APPROVED_OUTBOUND) + .withOutboundRules(mapOf("rule_name_1", + new FqdnOutboundRule().withCategory(RuleCategory.USER_DEFINED) + .withDestination("destination_endpoint"))) + .withFirewallSku(FirewallSku.STANDARD))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } ``` @@ -1649,9 +2347,7 @@ public final class LocationBasedModelCapacitiesListSamples { */ public final class ModelCapacitiesListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListModelCapacities.json + * x-ms-original-file: 2026-01-15-preview/ListModelCapacities.json */ /** * Sample code: ListModelCapacities. @@ -1662,6 +2358,45 @@ public final class ModelCapacitiesListSamples { listModelCapacities(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { manager.modelCapacities().list("OpenAI", "ada", "1", com.azure.core.util.Context.NONE); } + + /* + * x-ms-original-file: 2026-01-15-preview/ListModelCapacitiesDataZoneScope.json + */ + /** + * Sample code: ListModelCapacities DataZone Scope. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + listModelCapacitiesDataZoneScope(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.modelCapacities().list("OpenAI", "ada", "1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-01-15-preview/ListModelCapacitiesGlobalScope.json + */ + /** + * Sample code: ListModelCapacities Global Scope. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + listModelCapacitiesGlobalScope(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.modelCapacities().list("OpenAI", "ada", "1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-01-15-preview/ListModelCapacitiesClassicScope.json + */ + /** + * Sample code: ListModelCapacities Classic Scope. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + listModelCapacitiesClassicScope(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.modelCapacities().list("OpenAI", "ada", "1", com.azure.core.util.Context.NONE); + } } ``` @@ -1673,9 +2408,7 @@ public final class ModelCapacitiesListSamples { */ public final class ModelsListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListLocationModels.json + * x-ms-original-file: 2026-01-15-preview/ListLocationModels.json */ /** * Sample code: ListLocationModels. @@ -1697,9 +2430,7 @@ public final class ModelsListSamples { */ public final class NetworkSecurityPerimeterConfigurationsGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetNetworkSecurityPerimeterConfigurations.json + * x-ms-original-file: 2026-01-15-preview/GetNetworkSecurityPerimeterConfigurations.json */ /** * Sample code: GetNetworkSecurityPerimeterConfigurations. @@ -1723,9 +2454,7 @@ public final class NetworkSecurityPerimeterConfigurationsGetSamples { */ public final class NetworkSecurityPerimeterConfigurationsListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListNetworkSecurityPerimeterConfigurations.json + * x-ms-original-file: 2026-01-15-preview/ListNetworkSecurityPerimeterConfigurations.json */ /** * Sample code: ListNetworkSecurityPerimeterConfigurations. @@ -1748,9 +2477,7 @@ public final class NetworkSecurityPerimeterConfigurationsListSamples { */ public final class NetworkSecurityPerimeterConfigurationsReconcileSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ReconcileNetworkSecurityPerimeterConfigurations.json + * x-ms-original-file: 2026-01-15-preview/ReconcileNetworkSecurityPerimeterConfigurations.json */ /** * Sample code: ReconcileNetworkSecurityPerimeterConfigurations. @@ -1773,9 +2500,7 @@ public final class NetworkSecurityPerimeterConfigurationsReconcileSamples { */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetOperations.json + * x-ms-original-file: 2026-01-15-preview/GetOperations.json */ /** * Sample code: Get Operations. @@ -1788,6 +2513,155 @@ public final class OperationsListSamples { } ``` +### OutboundRule_CreateOrUpdate + +```java +import com.azure.resourcemanager.cognitiveservices.models.FqdnOutboundRule; +import com.azure.resourcemanager.cognitiveservices.models.RuleCategory; +import com.azure.resourcemanager.cognitiveservices.models.RuleStatus; + +/** + * Samples for OutboundRule CreateOrUpdate. + */ +public final class OutboundRuleCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-15-preview/ManagedNetwork/createOrUpdateRuleV2.json + */ + /** + * Sample code: CreateOrUpdate OutboundRule. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + createOrUpdateOutboundRule(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.outboundRules() + .define("rule_name_1") + .withExistingManagedNetwork("test-rg", "cognitive-account-name", "default") + .withProperties(new FqdnOutboundRule().withCategory(RuleCategory.USER_DEFINED) + .withStatus(RuleStatus.ACTIVE) + .withDestination("destination_endpoint")) + .create(); + } +} +``` + +### OutboundRule_Delete + +```java +/** + * Samples for OutboundRule Delete. + */ +public final class OutboundRuleDeleteSamples { + /* + * x-ms-original-file: 2026-01-15-preview/ManagedNetwork/deleteRuleV2.json + */ + /** + * Sample code: Delete OutboundRule. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + deleteOutboundRule(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.outboundRules() + .delete("test-rg", "cognitive-account-name", "default", "rule-name", com.azure.core.util.Context.NONE); + } +} +``` + +### OutboundRule_Get + +```java +/** + * Samples for OutboundRule Get. + */ +public final class OutboundRuleGetSamples { + /* + * x-ms-original-file: 2026-01-15-preview/ManagedNetwork/getRuleV2.json + */ + /** + * Sample code: Get OutboundRule. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void getOutboundRule(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.outboundRules() + .getWithResponse("test-rg", "cognitive-account-name", "default", "name_of_the_fqdn_rule", + com.azure.core.util.Context.NONE); + } +} +``` + +### OutboundRule_List + +```java +/** + * Samples for OutboundRule List. + */ +public final class OutboundRuleListSamples { + /* + * x-ms-original-file: 2026-01-15-preview/ManagedNetwork/listRuleV2.json + */ + /** + * Sample code: List OutboundRules. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void listOutboundRules(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.outboundRules().list("test-rg", "cognitive-account-name", "default", com.azure.core.util.Context.NONE); + } +} +``` + +### OutboundRulesOperation_Post + +```java +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsBasicResourceInner; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsInner; +import com.azure.resourcemanager.cognitiveservices.models.FirewallSku; +import com.azure.resourcemanager.cognitiveservices.models.FqdnOutboundRule; +import com.azure.resourcemanager.cognitiveservices.models.IsolationMode; +import com.azure.resourcemanager.cognitiveservices.models.RuleCategory; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for OutboundRulesOperation Post. + */ +public final class OutboundRulesOperationPostSamples { + /* + * x-ms-original-file: 2026-01-15-preview/ManagedNetwork/postOutboundRulesV2.json + */ + /** + * Sample code: Post OutboundRules. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void postOutboundRules(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.outboundRulesOperations() + .post("test-rg", "cognitive-account-name", "default", + new ManagedNetworkSettingsBasicResourceInner().withProperties( + new ManagedNetworkSettingsInner().withIsolationMode(IsolationMode.ALLOW_ONLY_APPROVED_OUTBOUND) + .withOutboundRules(mapOf("rule_name_1", + new FqdnOutboundRule().withCategory(RuleCategory.USER_DEFINED) + .withDestination("destination_endpoint"))) + .withFirewallSku(FirewallSku.STANDARD)), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + ### PrivateEndpointConnections_CreateOrUpdate ```java @@ -1800,9 +2674,7 @@ import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkServiceConn */ public final class PrivateEndpointConnectionsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * PutPrivateEndpointConnection.json + * x-ms-original-file: 2026-01-15-preview/PutPrivateEndpointConnection.json */ /** * Sample code: PutPrivateEndpointConnection. @@ -1830,9 +2702,7 @@ public final class PrivateEndpointConnectionsCreateOrUpdateSamples { */ public final class PrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * DeletePrivateEndpointConnection.json + * x-ms-original-file: 2026-01-15-preview/DeletePrivateEndpointConnection.json */ /** * Sample code: DeletePrivateEndpointConnection. @@ -1855,9 +2725,7 @@ public final class PrivateEndpointConnectionsDeleteSamples { */ public final class PrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetPrivateEndpointConnection.json + * x-ms-original-file: 2026-01-15-preview/GetPrivateEndpointConnection.json */ /** * Sample code: GetPrivateEndpointConnection. @@ -1880,9 +2748,7 @@ public final class PrivateEndpointConnectionsGetSamples { */ public final class PrivateEndpointConnectionsListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListPrivateEndpointConnections.json + * x-ms-original-file: 2026-01-15-preview/ListPrivateEndpointConnections.json */ /** * Sample code: GetPrivateEndpointConnection. @@ -1904,9 +2770,7 @@ public final class PrivateEndpointConnectionsListSamples { */ public final class PrivateLinkResourcesListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListPrivateLinkResources.json + * x-ms-original-file: 2026-01-15-preview/ListPrivateLinkResources.json */ /** * Sample code: ListPrivateLinkResources. @@ -1923,17 +2787,15 @@ public final class PrivateLinkResourcesListSamples { ### ProjectCapabilityHosts_CreateOrUpdate ```java -import com.azure.resourcemanager.cognitiveservices.fluent.models.CapabilityHostInner; -import com.azure.resourcemanager.cognitiveservices.models.CapabilityHostProperties; +import com.azure.resourcemanager.cognitiveservices.models.ProjectCapabilityHostProperties; +import java.util.Arrays; /** * Samples for ProjectCapabilityHosts CreateOrUpdate. */ public final class ProjectCapabilityHostsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ProjectCapabilityHost/createOrUpdate.json + * x-ms-original-file: 2026-01-15-preview/ProjectCapabilityHost/createOrUpdate.json */ /** * Sample code: CreateOrUpdate Project CapabilityHost. @@ -1943,10 +2805,14 @@ public final class ProjectCapabilityHostsCreateOrUpdateSamples { public static void createOrUpdateProjectCapabilityHost( com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { manager.projectCapabilityHosts() - .createOrUpdate("test-rg", "account-1", "project-1", "capabilityHostName", - new CapabilityHostInner().withProperties(new CapabilityHostProperties().withCustomerSubnet( - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroups/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet")), - com.azure.core.util.Context.NONE); + .define("capabilityHostName") + .withExistingProject("test-rg", "account-1", "project-1") + .withProperties( + new ProjectCapabilityHostProperties().withAiServicesConnections(Arrays.asList("aoai_connection")) + .withVectorStoreConnections(Arrays.asList("acs_connection")) + .withStorageConnections(Arrays.asList("blob_connection")) + .withThreadStorageConnections(Arrays.asList("aca_connection"))) + .create(); } } ``` @@ -1959,9 +2825,7 @@ public final class ProjectCapabilityHostsCreateOrUpdateSamples { */ public final class ProjectCapabilityHostsDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ProjectCapabilityHost/delete.json + * x-ms-original-file: 2026-01-15-preview/ProjectCapabilityHost/delete.json */ /** * Sample code: Delete Project CapabilityHost. @@ -1984,9 +2848,7 @@ public final class ProjectCapabilityHostsDeleteSamples { */ public final class ProjectCapabilityHostsGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ProjectCapabilityHost/get.json + * x-ms-original-file: 2026-01-15-preview/ProjectCapabilityHost/get.json */ /** * Sample code: Get Project CapabilityHost. @@ -2002,10 +2864,31 @@ public final class ProjectCapabilityHostsGetSamples { } ``` +### ProjectCapabilityHosts_List + +```java +/** + * Samples for ProjectCapabilityHosts List. + */ +public final class ProjectCapabilityHostsListSamples { + /* + * x-ms-original-file: 2026-01-15-preview/ProjectCapabilityHost/list.json + */ + /** + * Sample code: List Project CapabilityHosts. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + listProjectCapabilityHosts(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.projectCapabilityHosts().list("test-rg", "account-1", "project-1", com.azure.core.util.Context.NONE); + } +} +``` + ### ProjectConnections_Create ```java -import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; import com.azure.resourcemanager.cognitiveservices.models.ConnectionCategory; import com.azure.resourcemanager.cognitiveservices.models.NoneAuthTypeConnectionProperties; import java.time.OffsetDateTime; @@ -2015,9 +2898,7 @@ import java.time.OffsetDateTime; */ public final class ProjectConnectionsCreateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ProjectConnection/create.json + * x-ms-original-file: 2026-01-15-preview/ProjectConnection/create.json */ /** * Sample code: CreateProjectConnection. @@ -2027,12 +2908,12 @@ public final class ProjectConnectionsCreateSamples { public static void createProjectConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { manager.projectConnections() - .createWithResponse("resourceGroup-1", "account-1", "project-1", "connection-1", - new ConnectionPropertiesV2BasicResourceInner().withProperties( - new NoneAuthTypeConnectionProperties().withCategory(ConnectionCategory.CONTAINER_REGISTRY) - .withExpiryTime(OffsetDateTime.parse("2024-03-15T14:30:00Z")) - .withTarget("[tartget url]")), - com.azure.core.util.Context.NONE); + .define("connection-1") + .withExistingProject("resourceGroup-1", "account-1", "project-1") + .withProperties(new NoneAuthTypeConnectionProperties().withCategory(ConnectionCategory.CONTAINER_REGISTRY) + .withExpiryTime(OffsetDateTime.parse("2024-03-15T14:30:00Z")) + .withTarget("[target url]")) + .create(); } } ``` @@ -2045,9 +2926,7 @@ public final class ProjectConnectionsCreateSamples { */ public final class ProjectConnectionsDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ProjectConnection/delete.json + * x-ms-original-file: 2026-01-15-preview/ProjectConnection/delete.json */ /** * Sample code: DeleteProjectConnection. @@ -2071,9 +2950,7 @@ public final class ProjectConnectionsDeleteSamples { */ public final class ProjectConnectionsGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ProjectConnection/get.json + * x-ms-original-file: 2026-01-15-preview/ProjectConnection/get.json */ /** * Sample code: GetProjectConnection. @@ -2097,9 +2974,7 @@ public final class ProjectConnectionsGetSamples { */ public final class ProjectConnectionsListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ProjectConnection/list.json + * x-ms-original-file: 2026-01-15-preview/ProjectConnection/list.json */ /** * Sample code: ListProjectConnection. @@ -2109,7 +2984,7 @@ public final class ProjectConnectionsListSamples { public static void listProjectConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { manager.projectConnections() - .list("resourceGroup-1", "account-1", "project-1", "[tartget url]", "ContainerRegistry", null, + .list("resourceGroup-1", "account-1", "project-1", "[target url]", "ContainerRegistry", null, com.azure.core.util.Context.NONE); } } @@ -2121,7 +2996,7 @@ public final class ProjectConnectionsListSamples { import com.azure.resourcemanager.cognitiveservices.models.AccessKeyAuthTypeConnectionProperties; import com.azure.resourcemanager.cognitiveservices.models.ConnectionAccessKey; import com.azure.resourcemanager.cognitiveservices.models.ConnectionCategory; -import com.azure.resourcemanager.cognitiveservices.models.ConnectionUpdateContent; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionPropertiesV2BasicResource; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; @@ -2131,9 +3006,7 @@ import java.util.Map; */ public final class ProjectConnectionsUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ProjectConnection/update.json + * x-ms-original-file: 2026-01-15-preview/ProjectConnection/update.json */ /** * Sample code: UpdateProjectConnection. @@ -2142,16 +3015,17 @@ public final class ProjectConnectionsUpdateSamples { */ public static void updateProjectConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.projectConnections() - .updateWithResponse("test-rg", "account-1", "project-1", "connection-1", - new ConnectionUpdateContent().withProperties( - new AccessKeyAuthTypeConnectionProperties().withCategory(ConnectionCategory.ADLSGEN2) - .withExpiryTime(OffsetDateTime.parse("2020-01-01T00:00:00Z")) - .withMetadata(mapOf()) - .withTarget("some_string") - .withCredentials(new ConnectionAccessKey().withAccessKeyId("fakeTokenPlaceholder") - .withSecretAccessKey("fakeTokenPlaceholder"))), - com.azure.core.util.Context.NONE); + ConnectionPropertiesV2BasicResource resource = manager.projectConnections() + .getWithResponse("test-rg", "account-1", "project-1", "connection-1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new AccessKeyAuthTypeConnectionProperties().withCategory(ConnectionCategory.ADLSGEN2) + .withExpiryTime(OffsetDateTime.parse("2020-01-01T00:00:00Z")) + .withMetadata(mapOf()) + .withTarget("some_string") + .withCredentials(new ConnectionAccessKey().withAccessKeyId("fakeTokenPlaceholder") + .withSecretAccessKey("fakeTokenPlaceholder"))) + .apply(); } // Use "Map.of" if available @@ -2180,9 +3054,7 @@ import com.azure.resourcemanager.cognitiveservices.models.ResourceIdentityType; */ public final class ProjectsCreateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * CreateProjectMin.json + * x-ms-original-file: 2026-01-15-preview/CreateProjectMin.json */ /** * Sample code: Create Project Min. @@ -2194,15 +3066,13 @@ public final class ProjectsCreateSamples { .define("testProject1") .withExistingAccount("myResourceGroup", "testCreate1") .withRegion("West US") - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) .withProperties(new ProjectProperties()) + .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) .create(); } /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * CreateProject.json + * x-ms-original-file: 2026-01-15-preview/CreateProject.json */ /** * Sample code: Create Project. @@ -2214,9 +3084,9 @@ public final class ProjectsCreateSamples { .define("testProject1") .withExistingAccount("myResourceGroup", "testCreate1") .withRegion("West US") - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) .withProperties( new ProjectProperties().withDisplayName("p1").withDescription("Description of this project")) + .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) .create(); } } @@ -2230,9 +3100,7 @@ public final class ProjectsCreateSamples { */ public final class ProjectsDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * DeleteProject.json + * x-ms-original-file: 2026-01-15-preview/DeleteProject.json */ /** * Sample code: Delete Project. @@ -2253,9 +3121,7 @@ public final class ProjectsDeleteSamples { */ public final class ProjectsGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetProject.json + * x-ms-original-file: 2026-01-15-preview/GetProject.json */ /** * Sample code: Get Project. @@ -2277,9 +3143,7 @@ public final class ProjectsGetSamples { */ public final class ProjectsListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListProjects.json + * x-ms-original-file: 2026-01-15-preview/ListProjects.json */ /** * Sample code: List Project. @@ -2303,9 +3167,7 @@ import com.azure.resourcemanager.cognitiveservices.models.ProjectProperties; */ public final class ProjectsUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * UpdateProjects.json + * x-ms-original-file: 2026-01-15-preview/UpdateProjects.json */ /** * Sample code: Update Project. @@ -2332,9 +3194,7 @@ import com.azure.resourcemanager.cognitiveservices.models.TierUpgradePolicy; */ public final class QuotaTiersCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * CreateOrUpdateQuotaTier.json + * x-ms-original-file: 2026-01-15-preview/CreateOrUpdateQuotaTier.json */ /** * Sample code: Update the quota tier resource for a subscription. @@ -2359,9 +3219,7 @@ public final class QuotaTiersCreateOrUpdateSamples { */ public final class QuotaTiersGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetQuotaTier.json + * x-ms-original-file: 2026-01-15-preview/GetQuotaTier.json */ /** * Sample code: Get the Quota Tier information for a subscription. @@ -2383,9 +3241,7 @@ public final class QuotaTiersGetSamples { */ public final class QuotaTiersListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListQuotaTiers.json + * x-ms-original-file: 2026-01-15-preview/ListQuotaTiers.json */ /** * Sample code: List the Quota Tier for a subscription. @@ -2411,9 +3267,7 @@ import com.azure.resourcemanager.cognitiveservices.models.TierUpgradePolicy; */ public final class QuotaTiersUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * UpdateQuotaTier.json + * x-ms-original-file: 2026-01-15-preview/UpdateQuotaTier.json */ /** * Sample code: Update the quota tier resource for a subscription. @@ -2443,9 +3297,7 @@ import java.util.Arrays; */ public final class RaiBlocklistItemsBatchAddSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * AddRaiBlocklistItems.json + * x-ms-original-file: 2026-01-15-preview/AddRaiBlocklistItems.json */ /** * Sample code: AddRaiBlocklistItems. @@ -2470,31 +3322,25 @@ public final class RaiBlocklistItemsBatchAddSamples { ### RaiBlocklistItems_BatchDelete ```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import java.io.IOException; +import java.util.Arrays; /** * Samples for RaiBlocklistItems BatchDelete. */ public final class RaiBlocklistItemsBatchDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * DeleteRaiBlocklistItems.json + * x-ms-original-file: 2026-01-15-preview/DeleteRaiBlocklistItems.json */ /** * Sample code: DeleteRaiBlocklistItems. * * @param manager Entry point to CognitiveServicesManager. */ - public static void deleteRaiBlocklistItems( - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) throws IOException { + public static void + deleteRaiBlocklistItems(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { manager.raiBlocklistItems() .batchDeleteWithResponse("resourceGroupName", "accountName", "raiBlocklistName", - SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize("[\"myblocklistitem1\",\"myblocklistitem2\"]", Object.class, SerializerEncoding.JSON), - com.azure.core.util.Context.NONE); + Arrays.asList("myblocklistitem1", "myblocklistitem2"), com.azure.core.util.Context.NONE); } } ``` @@ -2509,9 +3355,7 @@ import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItemProper */ public final class RaiBlocklistItemsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * PutRaiBlocklistItem.json + * x-ms-original-file: 2026-01-15-preview/PutRaiBlocklistItem.json */ /** * Sample code: PutRaiBlocklistItem. @@ -2537,9 +3381,7 @@ public final class RaiBlocklistItemsCreateOrUpdateSamples { */ public final class RaiBlocklistItemsDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * DeleteRaiBlocklistItem.json + * x-ms-original-file: 2026-01-15-preview/DeleteRaiBlocklistItem.json */ /** * Sample code: DeleteRaiBlocklistItem. @@ -2563,9 +3405,7 @@ public final class RaiBlocklistItemsDeleteSamples { */ public final class RaiBlocklistItemsGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetRaiBlocklistItem.json + * x-ms-original-file: 2026-01-15-preview/GetRaiBlocklistItem.json */ /** * Sample code: GetRaiBlocklistItem. @@ -2589,9 +3429,7 @@ public final class RaiBlocklistItemsGetSamples { */ public final class RaiBlocklistItemsListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListBlocklistItems.json + * x-ms-original-file: 2026-01-15-preview/ListBlocklistItems.json */ /** * Sample code: ListBlocklistItems. @@ -2616,9 +3454,7 @@ import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistProperties */ public final class RaiBlocklistsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * PutRaiBlocklist.json + * x-ms-original-file: 2026-01-15-preview/PutRaiBlocklist.json */ /** * Sample code: PutRaiBlocklist. @@ -2643,9 +3479,7 @@ public final class RaiBlocklistsCreateOrUpdateSamples { */ public final class RaiBlocklistsDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * DeleteRaiBlocklist.json + * x-ms-original-file: 2026-01-15-preview/DeleteRaiBlocklist.json */ /** * Sample code: DeleteRaiBlocklist. @@ -2668,9 +3502,7 @@ public final class RaiBlocklistsDeleteSamples { */ public final class RaiBlocklistsGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetRaiBlocklist.json + * x-ms-original-file: 2026-01-15-preview/GetRaiBlocklist.json */ /** * Sample code: GetRaiBlocklist. @@ -2692,9 +3524,7 @@ public final class RaiBlocklistsGetSamples { */ public final class RaiBlocklistsListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListBlocklists.json + * x-ms-original-file: 2026-01-15-preview/ListBlocklists.json */ /** * Sample code: ListBlocklists. @@ -2715,9 +3545,7 @@ public final class RaiBlocklistsListSamples { */ public final class RaiContentFiltersGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetRaiContentFilter.json + * x-ms-original-file: 2026-01-15-preview/GetRaiContentFilter.json */ /** * Sample code: GetRaiContentFilters. @@ -2739,9 +3567,7 @@ public final class RaiContentFiltersGetSamples { */ public final class RaiContentFiltersListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListRaiContentFilters.json + * x-ms-original-file: 2026-01-15-preview/ListRaiContentFilters.json */ /** * Sample code: ListRaiContentFilters. @@ -2755,6 +3581,105 @@ public final class RaiContentFiltersListSamples { } ``` +### RaiExternalSafetyProvider_CreateOrUpdate + +```java +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderSchemaInner; +import com.azure.resourcemanager.cognitiveservices.models.RaiExternalSafetyProviderSchemaProperties; + +/** + * Samples for RaiExternalSafetyProvider CreateOrUpdate. + */ +public final class RaiExternalSafetyProviderCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-15-preview/PutRaiExternalSafetyProvider.json + */ + /** + * Sample code: PutRaiExternalSafetyProvider. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + putRaiExternalSafetyProvider(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiExternalSafetyProviders() + .createOrUpdateWithResponse("safetyProviderName", new RaiExternalSafetyProviderSchemaInner().withProperties( + new RaiExternalSafetyProviderSchemaProperties().withProviderId("00000000-0000-0000-0000-000000000000") + .withProviderName("safetyProviderName") + .withMode("sync") + .withUrl("https://example.webhook.endpoint") + .withSecretName("fakeTokenPlaceholder") + .withManagedIdentity("00000000-0000-0000-0000-000000000000") + .withKeyVaultUri("fakeTokenPlaceholder")), + com.azure.core.util.Context.NONE); + } +} +``` + +### RaiExternalSafetyProvider_Delete + +```java +/** + * Samples for RaiExternalSafetyProvider Delete. + */ +public final class RaiExternalSafetyProviderDeleteSamples { + /* + * x-ms-original-file: 2026-01-15-preview/DeleteRaiExternalSafetyProvider.json + */ + /** + * Sample code: DeleteRaiTopic. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void deleteRaiTopic(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiExternalSafetyProviders().delete("safetyProviderName", com.azure.core.util.Context.NONE); + } +} +``` + +### RaiExternalSafetyProvider_Get + +```java +/** + * Samples for RaiExternalSafetyProvider Get. + */ +public final class RaiExternalSafetyProviderGetSamples { + /* + * x-ms-original-file: 2026-01-15-preview/GetRaiExternalSafetyProvider.json + */ + /** + * Sample code: GetRaiExternalSafetyProvider. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + getRaiExternalSafetyProvider(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiExternalSafetyProviders().getWithResponse("safetyProviderName", com.azure.core.util.Context.NONE); + } +} +``` + +### RaiExternalSafetyProvidersOperation_List + +```java +/** + * Samples for RaiExternalSafetyProvidersOperation List. + */ +public final class RaiExternalSafetyProvidersOperationListSamples { + /* + * x-ms-original-file: 2026-01-15-preview/ListRaiExternalSafetyProviders.json + */ + /** + * Sample code: ListRaiExternalSafetyProviders. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + listRaiExternalSafetyProviders(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiExternalSafetyProvidersOperations().list(com.azure.core.util.Context.NONE); + } +} +``` + ### RaiPolicies_CreateOrUpdate ```java @@ -2770,9 +3695,7 @@ import java.util.Arrays; */ public final class RaiPoliciesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * PutRaiPolicy.json + * x-ms-original-file: 2026-01-15-preview/PutRaiPolicy.json */ /** * Sample code: PutRaiPolicy. @@ -2855,9 +3778,7 @@ public final class RaiPoliciesCreateOrUpdateSamples { */ public final class RaiPoliciesDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * DeleteRaiPolicy.json + * x-ms-original-file: 2026-01-15-preview/DeleteRaiPolicy.json */ /** * Sample code: DeleteRaiPolicy. @@ -2879,9 +3800,7 @@ public final class RaiPoliciesDeleteSamples { */ public final class RaiPoliciesGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetRaiPolicy.json + * x-ms-original-file: 2026-01-15-preview/GetRaiPolicy.json */ /** * Sample code: GetRaiPolicy. @@ -2903,9 +3822,7 @@ public final class RaiPoliciesGetSamples { */ public final class RaiPoliciesListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListRaiPolicies.json + * x-ms-original-file: 2026-01-15-preview/ListRaiPolicies.json */ /** * Sample code: ListRaiPolicies. @@ -2918,6 +3835,123 @@ public final class RaiPoliciesListSamples { } ``` +### RaiToolLabels_CreateOrUpdate + +```java +import com.azure.resourcemanager.cognitiveservices.models.RaiToolLabelProperties; +import com.azure.resourcemanager.cognitiveservices.models.RaiToolLabelPropertiesAccountScope; +import com.azure.resourcemanager.cognitiveservices.models.RaiToolLabelPropertiesProjectScopesItem; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RaiToolLabels CreateOrUpdate. + */ +public final class RaiToolLabelsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-15-preview/PutRaiToolLabel.json + */ + /** + * Sample code: PutRaiToolLabel. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void putRaiToolLabel(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiToolLabels() + .define("Web_Search") + .withExistingAccount("resourceGroupName", "accountName") + .withProperties(new RaiToolLabelProperties().withToolConnectionName("Web_Search") + .withAccountScope( + new RaiToolLabelPropertiesAccountScope().withLabelValues(mapOf("confidentiality", "low"))) + .withProjectScopes(Arrays.asList( + new RaiToolLabelPropertiesProjectScopesItem().withProject("test-project") + .withLabelValues(mapOf("confidentiality", "low")), + new RaiToolLabelPropertiesProjectScopesItem().withProject("sample-project") + .withLabelValues(mapOf("confidentiality", "low"))))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### RaiToolLabels_Delete + +```java +/** + * Samples for RaiToolLabels Delete. + */ +public final class RaiToolLabelsDeleteSamples { + /* + * x-ms-original-file: 2026-01-15-preview/DeleteRaiToolLabel.json + */ + /** + * Sample code: DeleteRaiToolLabel. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + deleteRaiToolLabel(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiToolLabels() + .delete("resourceGroupName", "accountName", "Web_Search", com.azure.core.util.Context.NONE); + } +} +``` + +### RaiToolLabels_Get + +```java +/** + * Samples for RaiToolLabels Get. + */ +public final class RaiToolLabelsGetSamples { + /* + * x-ms-original-file: 2026-01-15-preview/GetRaiToolLabel.json + */ + /** + * Sample code: GetRaiToolLabel. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void getRaiToolLabel(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiToolLabels() + .getWithResponse("resourceGroupName", "accountName", "ToolLabelName", com.azure.core.util.Context.NONE); + } +} +``` + +### RaiToolLabels_List + +```java +/** + * Samples for RaiToolLabels List. + */ +public final class RaiToolLabelsListSamples { + /* + * x-ms-original-file: 2026-01-15-preview/ListRaiToolLabels.json + */ + /** + * Sample code: ListRaiToolLabels. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void listRaiToolLabels(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiToolLabels().list("resourceGroupName", "accountName", com.azure.core.util.Context.NONE); + } +} +``` + ### RaiTopics_CreateOrUpdate ```java @@ -2928,9 +3962,7 @@ import com.azure.resourcemanager.cognitiveservices.models.RaiTopicProperties; */ public final class RaiTopicsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * PutRaiTopic.json + * x-ms-original-file: 2026-01-15-preview/PutRaiTopic.json */ /** * Sample code: PutRaiTopic. @@ -2957,9 +3989,7 @@ public final class RaiTopicsCreateOrUpdateSamples { */ public final class RaiTopicsDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * DeleteRaiTopic.json + * x-ms-original-file: 2026-01-15-preview/DeleteRaiTopic.json */ /** * Sample code: DeleteRaiTopic. @@ -2981,9 +4011,7 @@ public final class RaiTopicsDeleteSamples { */ public final class RaiTopicsGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetRaiTopic.json + * x-ms-original-file: 2026-01-15-preview/GetRaiTopic.json */ /** * Sample code: GetRaiTopic. @@ -3005,9 +4033,7 @@ public final class RaiTopicsGetSamples { */ public final class RaiTopicsListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListRaiTopics.json + * x-ms-original-file: 2026-01-15-preview/ListRaiTopics.json */ /** * Sample code: ListRaiTopics. @@ -3034,9 +4060,7 @@ import java.util.Arrays; */ public final class ResourceProviderCalculateModelCapacitySamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * CalculateModelCapacity.json + * x-ms-original-file: 2026-01-15-preview/CalculateModelCapacity.json */ /** * Sample code: Calculate Model Capacity. @@ -3071,9 +4095,7 @@ import com.azure.resourcemanager.cognitiveservices.models.CheckDomainAvailabilit */ public final class ResourceProviderCheckDomainAvailabilitySamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * CheckDomainAvailability.json + * x-ms-original-file: 2026-01-15-preview/CheckDomainAvailability.json */ /** * Sample code: Check SKU Availability. @@ -3102,9 +4124,7 @@ import java.util.Arrays; */ public final class ResourceProviderCheckSkuAvailabilitySamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * CheckSkuAvailability.json + * x-ms-original-file: 2026-01-15-preview/CheckSkuAvailability.json */ /** * Sample code: Check SKU Availability. @@ -3131,9 +4151,7 @@ public final class ResourceProviderCheckSkuAvailabilitySamples { */ public final class ResourceSkusListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/GetSkus. - * json + * x-ms-original-file: 2026-01-15-preview/GetSkus.json */ /** * Sample code: Regenerate Keys. @@ -3146,6 +4164,174 @@ public final class ResourceSkusListSamples { } ``` +### SubscriptionRaiPolicy_CreateOrUpdate + +```java +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiPolicyInner; +import com.azure.resourcemanager.cognitiveservices.models.ContentLevel; +import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentFilter; +import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentSource; +import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyMode; +import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyProperties; +import java.util.Arrays; + +/** + * Samples for SubscriptionRaiPolicy CreateOrUpdate. + */ +public final class SubscriptionRaiPolicyCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-15-preview/PutSubscriptionRaiPolicy.json + */ + /** + * Sample code: PutRaiPolicy. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void putRaiPolicy(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.subscriptionRaiPolicies() + .createOrUpdateWithResponse("raiPolicyName", + new RaiPolicyInner() + .withProperties(new RaiPolicyProperties().withMode(RaiPolicyMode.ASYNCHRONOUS_FILTER) + .withBasePolicyName("Microsoft.Default") + .withContentFilters(Arrays.asList( + new RaiPolicyContentFilter().withName("Hate") + .withEnabled(false) + .withSeverityThreshold(ContentLevel.HIGH) + .withBlocking(false) + .withSource(RaiPolicyContentSource.PROMPT), + new RaiPolicyContentFilter().withName("Hate") + .withEnabled(true) + .withSeverityThreshold(ContentLevel.MEDIUM) + .withBlocking(true) + .withSource(RaiPolicyContentSource.COMPLETION), + new RaiPolicyContentFilter().withName("Sexual") + .withEnabled(true) + .withSeverityThreshold(ContentLevel.HIGH) + .withBlocking(true) + .withSource(RaiPolicyContentSource.PROMPT), + new RaiPolicyContentFilter().withName("Sexual") + .withEnabled(true) + .withSeverityThreshold(ContentLevel.MEDIUM) + .withBlocking(true) + .withSource(RaiPolicyContentSource.COMPLETION), + new RaiPolicyContentFilter().withName("Selfharm") + .withEnabled(true) + .withSeverityThreshold(ContentLevel.HIGH) + .withBlocking(true) + .withSource(RaiPolicyContentSource.PROMPT), + new RaiPolicyContentFilter().withName("Selfharm") + .withEnabled(true) + .withSeverityThreshold(ContentLevel.MEDIUM) + .withBlocking(true) + .withSource(RaiPolicyContentSource.COMPLETION), + new RaiPolicyContentFilter().withName("Violence") + .withEnabled(true) + .withSeverityThreshold(ContentLevel.MEDIUM) + .withBlocking(true) + .withSource(RaiPolicyContentSource.PROMPT), + new RaiPolicyContentFilter().withName("Violence") + .withEnabled(true) + .withSeverityThreshold(ContentLevel.MEDIUM) + .withBlocking(true) + .withSource(RaiPolicyContentSource.COMPLETION), + new RaiPolicyContentFilter().withName("Jailbreak") + .withEnabled(true) + .withBlocking(true) + .withSource(RaiPolicyContentSource.PROMPT), + new RaiPolicyContentFilter().withName("Protected Material Text") + .withEnabled(true) + .withBlocking(true) + .withSource(RaiPolicyContentSource.COMPLETION), + new RaiPolicyContentFilter().withName("Protected Material Code") + .withEnabled(true) + .withBlocking(true) + .withSource(RaiPolicyContentSource.COMPLETION), + new RaiPolicyContentFilter().withName("Profanity") + .withEnabled(true) + .withBlocking(true) + .withSource(RaiPolicyContentSource.PROMPT)))), + com.azure.core.util.Context.NONE); + } +} +``` + +### SubscriptionRaiPolicy_Delete + +```java +/** + * Samples for SubscriptionRaiPolicy Delete. + */ +public final class SubscriptionRaiPolicyDeleteSamples { + /* + * x-ms-original-file: 2026-01-15-preview/DeleteSubscriptionRaiPolicy.json + */ + /** + * Sample code: DeleteRaiPolicy. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void deleteRaiPolicy(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.subscriptionRaiPolicies().delete("raiPolicyName", com.azure.core.util.Context.NONE); + } +} +``` + +### SubscriptionRaiPolicy_Get + +```java +/** + * Samples for SubscriptionRaiPolicy Get. + */ +public final class SubscriptionRaiPolicyGetSamples { + /* + * x-ms-original-file: 2026-01-15-preview/GetSubscriptionRaiPolicy.json + */ + /** + * Sample code: GetRaiPolicy. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void getRaiPolicy(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.subscriptionRaiPolicies().getWithResponse("raiPolicyName", com.azure.core.util.Context.NONE); + } +} +``` + +### TestRaiExternalSafetyProvider_CreateOrUpdate + +```java +import com.azure.resourcemanager.cognitiveservices.models.RaiExternalSafetyProviderSchemaProperties; + +/** + * Samples for TestRaiExternalSafetyProvider CreateOrUpdate. + */ +public final class TestRaiExternalSafetyProviderCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-15-preview/TestRaiExternalSafetyProvider.json + */ + /** + * Sample code: TestRaiExternalSafetyProvider. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + testRaiExternalSafetyProvider(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.testRaiExternalSafetyProviders() + .define("mySafetyProvider") + .withExistingAccount("myResourceGroup", "myCognitiveAccount") + .withProperties( + new RaiExternalSafetyProviderSchemaProperties().withProviderId("00000000-0000-0000-0000-000000000000") + .withProviderName("safetyProviderName") + .withMode("sync") + .withUrl("https://example-safety-provider.contoso.com/webhook") + .withSecretName("fakeTokenPlaceholder") + .withManagedIdentity("f3b9c2e7-4aad-4b1f-9d9c-9e9b1e9b1f9b") + .withKeyVaultUri("fakeTokenPlaceholder")) + .create(); + } +} +``` + ### Usages_List ```java @@ -3154,9 +4340,7 @@ public final class ResourceSkusListSamples { */ public final class UsagesListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListUsages.json + * x-ms-original-file: 2026-01-15-preview/ListUsages.json */ /** * Sample code: Get Usages. @@ -3166,6 +4350,45 @@ public final class UsagesListSamples { public static void getUsages(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { manager.usages().list("WestUS", null, com.azure.core.util.Context.NONE); } + + /* + * x-ms-original-file: 2026-01-15-preview/ListUsagesClassicScope.json + */ + /** + * Sample code: Get Usages Classic Scope. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + getUsagesClassicScope(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.usages().list("WestUS", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-01-15-preview/ListUsagesDataZoneScope.json + */ + /** + * Sample code: Get Usages DataZone Scope. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + getUsagesDataZoneScope(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.usages().list("WestUS", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-01-15-preview/ListUsagesGlobalScope.json + */ + /** + * Sample code: Get Usages Global Scope. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + getUsagesGlobalScope(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.usages().list("WestUS", null, com.azure.core.util.Context.NONE); + } } ``` diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/pom.xml b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/pom.xml index c9db996a2475..7b7883d45698 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/pom.xml +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/pom.xml @@ -1,9 +1,9 @@ - + 4.0.0 com.azure @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for CognitiveServices Management - This package contains Microsoft Azure SDK for CognitiveServices Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Cognitive Services Management Client. Package tag package-2025-09-01. + This package contains Microsoft Azure SDK for CognitiveServices Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Cognitive Services Management Client. Package api-version 2026-01-15-preview. https://github.com/Azure/azure-sdk-for-java @@ -45,6 +45,7 @@ UTF-8 0 0 + true diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/CognitiveServicesManager.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/CognitiveServicesManager.java index bf1287d8103f..250727eb5d11 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/CognitiveServicesManager.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/CognitiveServicesManager.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices; @@ -28,18 +28,25 @@ import com.azure.resourcemanager.cognitiveservices.implementation.AccountCapabilityHostsImpl; import com.azure.resourcemanager.cognitiveservices.implementation.AccountConnectionsImpl; import com.azure.resourcemanager.cognitiveservices.implementation.AccountsImpl; +import com.azure.resourcemanager.cognitiveservices.implementation.AgentApplicationsImpl; +import com.azure.resourcemanager.cognitiveservices.implementation.AgentDeploymentsImpl; import com.azure.resourcemanager.cognitiveservices.implementation.CognitiveServicesManagementClientBuilder; import com.azure.resourcemanager.cognitiveservices.implementation.CommitmentPlansImpl; import com.azure.resourcemanager.cognitiveservices.implementation.CommitmentTiersImpl; +import com.azure.resourcemanager.cognitiveservices.implementation.ComputeOperationsImpl; import com.azure.resourcemanager.cognitiveservices.implementation.DefenderForAISettingsImpl; import com.azure.resourcemanager.cognitiveservices.implementation.DeletedAccountsImpl; import com.azure.resourcemanager.cognitiveservices.implementation.DeploymentsImpl; import com.azure.resourcemanager.cognitiveservices.implementation.EncryptionScopesImpl; import com.azure.resourcemanager.cognitiveservices.implementation.LocationBasedModelCapacitiesImpl; +import com.azure.resourcemanager.cognitiveservices.implementation.ManagedNetworkProvisionsImpl; +import com.azure.resourcemanager.cognitiveservices.implementation.ManagedNetworkSettingsOperationsImpl; import com.azure.resourcemanager.cognitiveservices.implementation.ModelCapacitiesImpl; import com.azure.resourcemanager.cognitiveservices.implementation.ModelsImpl; import com.azure.resourcemanager.cognitiveservices.implementation.NetworkSecurityPerimeterConfigurationsImpl; import com.azure.resourcemanager.cognitiveservices.implementation.OperationsImpl; +import com.azure.resourcemanager.cognitiveservices.implementation.OutboundRulesImpl; +import com.azure.resourcemanager.cognitiveservices.implementation.OutboundRulesOperationsImpl; import com.azure.resourcemanager.cognitiveservices.implementation.PrivateEndpointConnectionsImpl; import com.azure.resourcemanager.cognitiveservices.implementation.PrivateLinkResourcesImpl; import com.azure.resourcemanager.cognitiveservices.implementation.ProjectCapabilityHostsImpl; @@ -49,25 +56,37 @@ import com.azure.resourcemanager.cognitiveservices.implementation.RaiBlocklistItemsImpl; import com.azure.resourcemanager.cognitiveservices.implementation.RaiBlocklistsImpl; import com.azure.resourcemanager.cognitiveservices.implementation.RaiContentFiltersImpl; +import com.azure.resourcemanager.cognitiveservices.implementation.RaiExternalSafetyProvidersImpl; +import com.azure.resourcemanager.cognitiveservices.implementation.RaiExternalSafetyProvidersOperationsImpl; import com.azure.resourcemanager.cognitiveservices.implementation.RaiPoliciesImpl; +import com.azure.resourcemanager.cognitiveservices.implementation.RaiToolLabelsImpl; import com.azure.resourcemanager.cognitiveservices.implementation.RaiTopicsImpl; import com.azure.resourcemanager.cognitiveservices.implementation.ResourceProvidersImpl; import com.azure.resourcemanager.cognitiveservices.implementation.ResourceSkusImpl; +import com.azure.resourcemanager.cognitiveservices.implementation.SubscriptionRaiPoliciesImpl; +import com.azure.resourcemanager.cognitiveservices.implementation.TestRaiExternalSafetyProvidersImpl; import com.azure.resourcemanager.cognitiveservices.implementation.UsagesImpl; import com.azure.resourcemanager.cognitiveservices.models.AccountCapabilityHosts; import com.azure.resourcemanager.cognitiveservices.models.AccountConnections; import com.azure.resourcemanager.cognitiveservices.models.Accounts; +import com.azure.resourcemanager.cognitiveservices.models.AgentApplications; +import com.azure.resourcemanager.cognitiveservices.models.AgentDeployments; import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlans; import com.azure.resourcemanager.cognitiveservices.models.CommitmentTiers; +import com.azure.resourcemanager.cognitiveservices.models.ComputeOperations; import com.azure.resourcemanager.cognitiveservices.models.DefenderForAISettings; import com.azure.resourcemanager.cognitiveservices.models.DeletedAccounts; import com.azure.resourcemanager.cognitiveservices.models.Deployments; import com.azure.resourcemanager.cognitiveservices.models.EncryptionScopes; import com.azure.resourcemanager.cognitiveservices.models.LocationBasedModelCapacities; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkProvisions; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsOperations; import com.azure.resourcemanager.cognitiveservices.models.ModelCapacities; import com.azure.resourcemanager.cognitiveservices.models.Models; import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterConfigurations; import com.azure.resourcemanager.cognitiveservices.models.Operations; +import com.azure.resourcemanager.cognitiveservices.models.OutboundRules; +import com.azure.resourcemanager.cognitiveservices.models.OutboundRulesOperations; import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointConnections; import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkResources; import com.azure.resourcemanager.cognitiveservices.models.ProjectCapabilityHosts; @@ -77,10 +96,15 @@ import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItems; import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklists; import com.azure.resourcemanager.cognitiveservices.models.RaiContentFilters; +import com.azure.resourcemanager.cognitiveservices.models.RaiExternalSafetyProviders; +import com.azure.resourcemanager.cognitiveservices.models.RaiExternalSafetyProvidersOperations; import com.azure.resourcemanager.cognitiveservices.models.RaiPolicies; +import com.azure.resourcemanager.cognitiveservices.models.RaiToolLabels; import com.azure.resourcemanager.cognitiveservices.models.RaiTopics; import com.azure.resourcemanager.cognitiveservices.models.ResourceProviders; import com.azure.resourcemanager.cognitiveservices.models.ResourceSkus; +import com.azure.resourcemanager.cognitiveservices.models.SubscriptionRaiPolicies; +import com.azure.resourcemanager.cognitiveservices.models.TestRaiExternalSafetyProviders; import com.azure.resourcemanager.cognitiveservices.models.Usages; import java.time.Duration; import java.time.temporal.ChronoUnit; @@ -95,30 +119,16 @@ * Cognitive Services Management Client. */ public final class CognitiveServicesManager { - private Accounts accounts; - - private DeletedAccounts deletedAccounts; - - private ResourceSkus resourceSkus; - - private Usages usages; - - private Operations operations; - private ResourceProviders resourceProviders; - private CommitmentTiers commitmentTiers; - - private Models models; + private Operations operations; - private LocationBasedModelCapacities locationBasedModelCapacities; + private Accounts accounts; - private ModelCapacities modelCapacities; + private DeletedAccounts deletedAccounts; private PrivateEndpointConnections privateEndpointConnections; - private PrivateLinkResources privateLinkResources; - private Deployments deployments; private CommitmentPlans commitmentPlans; @@ -127,12 +137,16 @@ public final class CognitiveServicesManager { private RaiPolicies raiPolicies; - private RaiBlocklists raiBlocklists; + private SubscriptionRaiPolicies subscriptionRaiPolicies; private RaiBlocklistItems raiBlocklistItems; + private RaiBlocklists raiBlocklists; + private RaiTopics raiTopics; + private RaiToolLabels raiToolLabels; + private RaiContentFilters raiContentFilters; private NetworkSecurityPerimeterConfigurations networkSecurityPerimeterConfigurations; @@ -141,16 +155,50 @@ public final class CognitiveServicesManager { private Projects projects; - private AccountConnections accountConnections; - private ProjectConnections projectConnections; - private AccountCapabilityHosts accountCapabilityHosts; - private ProjectCapabilityHosts projectCapabilityHosts; private QuotaTiers quotaTiers; + private AgentApplications agentApplications; + + private ComputeOperations computeOperations; + + private PrivateLinkResources privateLinkResources; + + private TestRaiExternalSafetyProviders testRaiExternalSafetyProviders; + + private RaiExternalSafetyProviders raiExternalSafetyProviders; + + private RaiExternalSafetyProvidersOperations raiExternalSafetyProvidersOperations; + + private AccountConnections accountConnections; + + private AccountCapabilityHosts accountCapabilityHosts; + + private OutboundRules outboundRules; + + private ManagedNetworkSettingsOperations managedNetworkSettingsOperations; + + private OutboundRulesOperations outboundRulesOperations; + + private ManagedNetworkProvisions managedNetworkProvisions; + + private AgentDeployments agentDeployments; + + private ResourceSkus resourceSkus; + + private Usages usages; + + private CommitmentTiers commitmentTiers; + + private Models models; + + private LocationBasedModelCapacities locationBasedModelCapacities; + + private ModelCapacities modelCapacities; + private final CognitiveServicesManagementClient clientObject; private CognitiveServicesManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -366,66 +414,6 @@ public CognitiveServicesManager authenticate(TokenCredential credential, AzurePr } } - /** - * Gets the resource collection API of Accounts. It manages Account. - * - * @return Resource collection API of Accounts. - */ - public Accounts accounts() { - if (this.accounts == null) { - this.accounts = new AccountsImpl(clientObject.getAccounts(), this); - } - return accounts; - } - - /** - * Gets the resource collection API of DeletedAccounts. - * - * @return Resource collection API of DeletedAccounts. - */ - public DeletedAccounts deletedAccounts() { - if (this.deletedAccounts == null) { - this.deletedAccounts = new DeletedAccountsImpl(clientObject.getDeletedAccounts(), this); - } - return deletedAccounts; - } - - /** - * Gets the resource collection API of ResourceSkus. - * - * @return Resource collection API of ResourceSkus. - */ - public ResourceSkus resourceSkus() { - if (this.resourceSkus == null) { - this.resourceSkus = new ResourceSkusImpl(clientObject.getResourceSkus(), this); - } - return resourceSkus; - } - - /** - * Gets the resource collection API of Usages. - * - * @return Resource collection API of Usages. - */ - public Usages usages() { - if (this.usages == null) { - this.usages = new UsagesImpl(clientObject.getUsages(), this); - } - return usages; - } - - /** - * Gets the resource collection API of Operations. - * - * @return Resource collection API of Operations. - */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); - } - return operations; - } - /** * Gets the resource collection API of ResourceProviders. * @@ -439,52 +427,39 @@ public ResourceProviders resourceProviders() { } /** - * Gets the resource collection API of CommitmentTiers. - * - * @return Resource collection API of CommitmentTiers. - */ - public CommitmentTiers commitmentTiers() { - if (this.commitmentTiers == null) { - this.commitmentTiers = new CommitmentTiersImpl(clientObject.getCommitmentTiers(), this); - } - return commitmentTiers; - } - - /** - * Gets the resource collection API of Models. + * Gets the resource collection API of Operations. * - * @return Resource collection API of Models. + * @return Resource collection API of Operations. */ - public Models models() { - if (this.models == null) { - this.models = new ModelsImpl(clientObject.getModels(), this); + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); } - return models; + return operations; } /** - * Gets the resource collection API of LocationBasedModelCapacities. + * Gets the resource collection API of Accounts. It manages Account. * - * @return Resource collection API of LocationBasedModelCapacities. + * @return Resource collection API of Accounts. */ - public LocationBasedModelCapacities locationBasedModelCapacities() { - if (this.locationBasedModelCapacities == null) { - this.locationBasedModelCapacities - = new LocationBasedModelCapacitiesImpl(clientObject.getLocationBasedModelCapacities(), this); + public Accounts accounts() { + if (this.accounts == null) { + this.accounts = new AccountsImpl(clientObject.getAccounts(), this); } - return locationBasedModelCapacities; + return accounts; } /** - * Gets the resource collection API of ModelCapacities. + * Gets the resource collection API of DeletedAccounts. * - * @return Resource collection API of ModelCapacities. + * @return Resource collection API of DeletedAccounts. */ - public ModelCapacities modelCapacities() { - if (this.modelCapacities == null) { - this.modelCapacities = new ModelCapacitiesImpl(clientObject.getModelCapacities(), this); + public DeletedAccounts deletedAccounts() { + if (this.deletedAccounts == null) { + this.deletedAccounts = new DeletedAccountsImpl(clientObject.getDeletedAccounts(), this); } - return modelCapacities; + return deletedAccounts; } /** @@ -500,18 +475,6 @@ public PrivateEndpointConnections privateEndpointConnections() { return privateEndpointConnections; } - /** - * Gets the resource collection API of PrivateLinkResources. - * - * @return Resource collection API of PrivateLinkResources. - */ - public PrivateLinkResources privateLinkResources() { - if (this.privateLinkResources == null) { - this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); - } - return privateLinkResources; - } - /** * Gets the resource collection API of Deployments. It manages Deployment. * @@ -561,15 +524,16 @@ public RaiPolicies raiPolicies() { } /** - * Gets the resource collection API of RaiBlocklists. It manages RaiBlocklist. + * Gets the resource collection API of SubscriptionRaiPolicies. * - * @return Resource collection API of RaiBlocklists. + * @return Resource collection API of SubscriptionRaiPolicies. */ - public RaiBlocklists raiBlocklists() { - if (this.raiBlocklists == null) { - this.raiBlocklists = new RaiBlocklistsImpl(clientObject.getRaiBlocklists(), this); + public SubscriptionRaiPolicies subscriptionRaiPolicies() { + if (this.subscriptionRaiPolicies == null) { + this.subscriptionRaiPolicies + = new SubscriptionRaiPoliciesImpl(clientObject.getSubscriptionRaiPolicies(), this); } - return raiBlocklists; + return subscriptionRaiPolicies; } /** @@ -584,6 +548,18 @@ public RaiBlocklistItems raiBlocklistItems() { return raiBlocklistItems; } + /** + * Gets the resource collection API of RaiBlocklists. It manages RaiBlocklist. + * + * @return Resource collection API of RaiBlocklists. + */ + public RaiBlocklists raiBlocklists() { + if (this.raiBlocklists == null) { + this.raiBlocklists = new RaiBlocklistsImpl(clientObject.getRaiBlocklists(), this); + } + return raiBlocklists; + } + /** * Gets the resource collection API of RaiTopics. It manages RaiTopic. * @@ -596,6 +572,18 @@ public RaiTopics raiTopics() { return raiTopics; } + /** + * Gets the resource collection API of RaiToolLabels. It manages RaiToolLabel. + * + * @return Resource collection API of RaiToolLabels. + */ + public RaiToolLabels raiToolLabels() { + if (this.raiToolLabels == null) { + this.raiToolLabels = new RaiToolLabelsImpl(clientObject.getRaiToolLabels(), this); + } + return raiToolLabels; + } + /** * Gets the resource collection API of RaiContentFilters. * @@ -646,27 +634,127 @@ public Projects projects() { } /** - * Gets the resource collection API of AccountConnections. It manages ConnectionPropertiesV2BasicResource. + * Gets the resource collection API of ProjectConnections. It manages ConnectionPropertiesV2BasicResource. * - * @return Resource collection API of AccountConnections. + * @return Resource collection API of ProjectConnections. */ - public AccountConnections accountConnections() { - if (this.accountConnections == null) { - this.accountConnections = new AccountConnectionsImpl(clientObject.getAccountConnections(), this); + public ProjectConnections projectConnections() { + if (this.projectConnections == null) { + this.projectConnections = new ProjectConnectionsImpl(clientObject.getProjectConnections(), this); } - return accountConnections; + return projectConnections; } /** - * Gets the resource collection API of ProjectConnections. + * Gets the resource collection API of ProjectCapabilityHosts. It manages ProjectCapabilityHost. * - * @return Resource collection API of ProjectConnections. + * @return Resource collection API of ProjectCapabilityHosts. */ - public ProjectConnections projectConnections() { - if (this.projectConnections == null) { - this.projectConnections = new ProjectConnectionsImpl(clientObject.getProjectConnections(), this); + public ProjectCapabilityHosts projectCapabilityHosts() { + if (this.projectCapabilityHosts == null) { + this.projectCapabilityHosts + = new ProjectCapabilityHostsImpl(clientObject.getProjectCapabilityHosts(), this); } - return projectConnections; + return projectCapabilityHosts; + } + + /** + * Gets the resource collection API of QuotaTiers. It manages QuotaTier. + * + * @return Resource collection API of QuotaTiers. + */ + public QuotaTiers quotaTiers() { + if (this.quotaTiers == null) { + this.quotaTiers = new QuotaTiersImpl(clientObject.getQuotaTiers(), this); + } + return quotaTiers; + } + + /** + * Gets the resource collection API of AgentApplications. It manages AgentApplication. + * + * @return Resource collection API of AgentApplications. + */ + public AgentApplications agentApplications() { + if (this.agentApplications == null) { + this.agentApplications = new AgentApplicationsImpl(clientObject.getAgentApplications(), this); + } + return agentApplications; + } + + /** + * Gets the resource collection API of ComputeOperations. + * + * @return Resource collection API of ComputeOperations. + */ + public ComputeOperations computeOperations() { + if (this.computeOperations == null) { + this.computeOperations = new ComputeOperationsImpl(clientObject.getComputeOperations(), this); + } + return computeOperations; + } + + /** + * Gets the resource collection API of PrivateLinkResources. + * + * @return Resource collection API of PrivateLinkResources. + */ + public PrivateLinkResources privateLinkResources() { + if (this.privateLinkResources == null) { + this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this); + } + return privateLinkResources; + } + + /** + * Gets the resource collection API of TestRaiExternalSafetyProviders. It manages RaiExternalSafetyProviderSchema. + * + * @return Resource collection API of TestRaiExternalSafetyProviders. + */ + public TestRaiExternalSafetyProviders testRaiExternalSafetyProviders() { + if (this.testRaiExternalSafetyProviders == null) { + this.testRaiExternalSafetyProviders + = new TestRaiExternalSafetyProvidersImpl(clientObject.getTestRaiExternalSafetyProviders(), this); + } + return testRaiExternalSafetyProviders; + } + + /** + * Gets the resource collection API of RaiExternalSafetyProviders. + * + * @return Resource collection API of RaiExternalSafetyProviders. + */ + public RaiExternalSafetyProviders raiExternalSafetyProviders() { + if (this.raiExternalSafetyProviders == null) { + this.raiExternalSafetyProviders + = new RaiExternalSafetyProvidersImpl(clientObject.getRaiExternalSafetyProviders(), this); + } + return raiExternalSafetyProviders; + } + + /** + * Gets the resource collection API of RaiExternalSafetyProvidersOperations. + * + * @return Resource collection API of RaiExternalSafetyProvidersOperations. + */ + public RaiExternalSafetyProvidersOperations raiExternalSafetyProvidersOperations() { + if (this.raiExternalSafetyProvidersOperations == null) { + this.raiExternalSafetyProvidersOperations = new RaiExternalSafetyProvidersOperationsImpl( + clientObject.getRaiExternalSafetyProvidersOperations(), this); + } + return raiExternalSafetyProvidersOperations; + } + + /** + * Gets the resource collection API of AccountConnections. + * + * @return Resource collection API of AccountConnections. + */ + public AccountConnections accountConnections() { + if (this.accountConnections == null) { + this.accountConnections = new AccountConnectionsImpl(clientObject.getAccountConnections(), this); + } + return accountConnections; } /** @@ -683,28 +771,140 @@ public AccountCapabilityHosts accountCapabilityHosts() { } /** - * Gets the resource collection API of ProjectCapabilityHosts. + * Gets the resource collection API of OutboundRules. It manages OutboundRuleBasicResource. * - * @return Resource collection API of ProjectCapabilityHosts. + * @return Resource collection API of OutboundRules. */ - public ProjectCapabilityHosts projectCapabilityHosts() { - if (this.projectCapabilityHosts == null) { - this.projectCapabilityHosts - = new ProjectCapabilityHostsImpl(clientObject.getProjectCapabilityHosts(), this); + public OutboundRules outboundRules() { + if (this.outboundRules == null) { + this.outboundRules = new OutboundRulesImpl(clientObject.getOutboundRules(), this); } - return projectCapabilityHosts; + return outboundRules; } /** - * Gets the resource collection API of QuotaTiers. It manages QuotaTier. + * Gets the resource collection API of ManagedNetworkSettingsOperations. It manages + * ManagedNetworkSettingsPropertiesBasicResource. * - * @return Resource collection API of QuotaTiers. + * @return Resource collection API of ManagedNetworkSettingsOperations. */ - public QuotaTiers quotaTiers() { - if (this.quotaTiers == null) { - this.quotaTiers = new QuotaTiersImpl(clientObject.getQuotaTiers(), this); + public ManagedNetworkSettingsOperations managedNetworkSettingsOperations() { + if (this.managedNetworkSettingsOperations == null) { + this.managedNetworkSettingsOperations + = new ManagedNetworkSettingsOperationsImpl(clientObject.getManagedNetworkSettingsOperations(), this); } - return quotaTiers; + return managedNetworkSettingsOperations; + } + + /** + * Gets the resource collection API of OutboundRulesOperations. + * + * @return Resource collection API of OutboundRulesOperations. + */ + public OutboundRulesOperations outboundRulesOperations() { + if (this.outboundRulesOperations == null) { + this.outboundRulesOperations + = new OutboundRulesOperationsImpl(clientObject.getOutboundRulesOperations(), this); + } + return outboundRulesOperations; + } + + /** + * Gets the resource collection API of ManagedNetworkProvisions. + * + * @return Resource collection API of ManagedNetworkProvisions. + */ + public ManagedNetworkProvisions managedNetworkProvisions() { + if (this.managedNetworkProvisions == null) { + this.managedNetworkProvisions + = new ManagedNetworkProvisionsImpl(clientObject.getManagedNetworkProvisions(), this); + } + return managedNetworkProvisions; + } + + /** + * Gets the resource collection API of AgentDeployments. It manages AgentDeployment. + * + * @return Resource collection API of AgentDeployments. + */ + public AgentDeployments agentDeployments() { + if (this.agentDeployments == null) { + this.agentDeployments = new AgentDeploymentsImpl(clientObject.getAgentDeployments(), this); + } + return agentDeployments; + } + + /** + * Gets the resource collection API of ResourceSkus. + * + * @return Resource collection API of ResourceSkus. + */ + public ResourceSkus resourceSkus() { + if (this.resourceSkus == null) { + this.resourceSkus = new ResourceSkusImpl(clientObject.getResourceSkus(), this); + } + return resourceSkus; + } + + /** + * Gets the resource collection API of Usages. + * + * @return Resource collection API of Usages. + */ + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(clientObject.getUsages(), this); + } + return usages; + } + + /** + * Gets the resource collection API of CommitmentTiers. + * + * @return Resource collection API of CommitmentTiers. + */ + public CommitmentTiers commitmentTiers() { + if (this.commitmentTiers == null) { + this.commitmentTiers = new CommitmentTiersImpl(clientObject.getCommitmentTiers(), this); + } + return commitmentTiers; + } + + /** + * Gets the resource collection API of Models. + * + * @return Resource collection API of Models. + */ + public Models models() { + if (this.models == null) { + this.models = new ModelsImpl(clientObject.getModels(), this); + } + return models; + } + + /** + * Gets the resource collection API of LocationBasedModelCapacities. + * + * @return Resource collection API of LocationBasedModelCapacities. + */ + public LocationBasedModelCapacities locationBasedModelCapacities() { + if (this.locationBasedModelCapacities == null) { + this.locationBasedModelCapacities + = new LocationBasedModelCapacitiesImpl(clientObject.getLocationBasedModelCapacities(), this); + } + return locationBasedModelCapacities; + } + + /** + * Gets the resource collection API of ModelCapacities. + * + * @return Resource collection API of ModelCapacities. + */ + public ModelCapacities modelCapacities() { + if (this.modelCapacities == null) { + this.modelCapacities = new ModelCapacitiesImpl(clientObject.getModelCapacities(), this); + } + return modelCapacities; } /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountCapabilityHostsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountCapabilityHostsClient.java index 159390aa4da7..baaa0c2a3778 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountCapabilityHostsClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountCapabilityHostsClient.java @@ -1,11 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; @@ -17,156 +18,183 @@ */ public interface AccountCapabilityHostsClient { /** - * Delete account capabilityHost. + * Get account capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return account capabilityHost along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, - String capabilityHostname); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, + String capabilityHostName, Context context); /** - * Delete account capabilityHost. + * Get account capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param context The context to associate with this operation. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return account capabilityHost. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, - String capabilityHostname, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + CapabilityHostInner get(String resourceGroupName, String accountName, String capabilityHostName); /** - * Delete account capabilityHost. + * Create or update account capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHost CapabilityHost definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String accountName, String capabilityHostname); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CapabilityHostInner> beginCreateOrUpdate(String resourceGroupName, + String accountName, String capabilityHostName, CapabilityHostInner capabilityHost); /** - * Delete account capabilityHost. + * Create or update account capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHost CapabilityHost definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String accountName, String capabilityHostname, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CapabilityHostInner> beginCreateOrUpdate(String resourceGroupName, + String accountName, String capabilityHostName, CapabilityHostInner capabilityHost, Context context); /** - * Get account capabilityHost. + * Create or update account capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param context The context to associate with this operation. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHost CapabilityHost definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return account capabilityHost along with {@link Response}. + * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String accountName, - String capabilityHostname, Context context); + CapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String capabilityHostName, + CapabilityHostInner capabilityHost); /** - * Get account capabilityHost. + * Create or update account capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHost CapabilityHost definition. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return account capabilityHost. + * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - CapabilityHostInner get(String resourceGroupName, String accountName, String capabilityHostname); + CapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String capabilityHostName, + CapabilityHostInner capabilityHost, Context context); /** - * Create or update account capabilityHost. + * Delete account capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CapabilityHostInner> beginCreateOrUpdate(String resourceGroupName, - String accountName, String capabilityHostname, CapabilityHostInner capabilityHost); + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String capabilityHostName); /** - * Create or update account capabilityHost. + * Delete account capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CapabilityHostInner> beginCreateOrUpdate(String resourceGroupName, - String accountName, String capabilityHostname, CapabilityHostInner capabilityHost, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String capabilityHostName, Context context); /** - * Create or update account capabilityHost. + * Delete account capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - CapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String capabilityHostname, - CapabilityHostInner capabilityHost); + void delete(String resourceGroupName, String accountName, String capabilityHostName); /** - * Create or update account capabilityHost. + * Delete account capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - CapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String capabilityHostname, - CapabilityHostInner capabilityHost, Context context); + void delete(String resourceGroupName, String accountName, String capabilityHostName, Context context); + + /** + * List capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Capability Host entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * List capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Capability Host entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountConnectionsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountConnectionsClient.java index 642abe20c5fa..cd71b737a640 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountConnectionsClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountConnectionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent; @@ -17,7 +17,7 @@ */ public interface AccountConnectionsClient { /** - * Delete Cognitive Services account connection by name. + * Lists Cognitive Services account connection by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -26,14 +26,14 @@ public interface AccountConnectionsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return connection base resource schema along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String accountName, String connectionName, - Context context); + Response getWithResponse(String resourceGroupName, String accountName, + String connectionName, Context context); /** - * Delete Cognitive Services account connection by name. + * Lists Cognitive Services account connection by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -41,16 +41,18 @@ Response deleteWithResponse(String resourceGroupName, String accountName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String accountName, String connectionName); + ConnectionPropertiesV2BasicResourceInner get(String resourceGroupName, String accountName, String connectionName); /** - * Lists Cognitive Services account connection by name. + * Create or update Cognitive Services account connection under the specified account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param connectionName Friendly name of the connection. + * @param connection The object for creating or updating a new account connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -58,11 +60,11 @@ Response deleteWithResponse(String resourceGroupName, String accountName, * @return connection base resource schema along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String accountName, - String connectionName, Context context); + Response createWithResponse(String resourceGroupName, String accountName, + String connectionName, ConnectionPropertiesV2BasicResourceInner connection, Context context); /** - * Lists Cognitive Services account connection by name. + * Create or update Cognitive Services account connection under the specified account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -73,7 +75,8 @@ Response getWithResponse(String resour * @return connection base resource schema. */ @ServiceMethod(returns = ReturnType.SINGLE) - ConnectionPropertiesV2BasicResourceInner get(String resourceGroupName, String accountName, String connectionName); + ConnectionPropertiesV2BasicResourceInner create(String resourceGroupName, String accountName, + String connectionName); /** * Update Cognitive Services account connection under the specified account. @@ -108,24 +111,23 @@ ConnectionPropertiesV2BasicResourceInner update(String resourceGroupName, String String connectionName); /** - * Create or update Cognitive Services account connection under the specified account. + * Delete Cognitive Services account connection by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param connectionName Friendly name of the connection. - * @param connection The object for creating or updating a new account connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse(String resourceGroupName, String accountName, - String connectionName, ConnectionPropertiesV2BasicResourceInner connection, Context context); + Response deleteWithResponse(String resourceGroupName, String accountName, String connectionName, + Context context); /** - * Create or update Cognitive Services account connection under the specified account. + * Delete Cognitive Services account connection by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -133,11 +135,9 @@ Response createWithResponse(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema. */ @ServiceMethod(returns = ReturnType.SINGLE) - ConnectionPropertiesV2BasicResourceInner create(String resourceGroupName, String accountName, - String connectionName); + void delete(String resourceGroupName, String accountName, String connectionName); /** * Lists all the available Cognitive Services account connections under the specified account. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountsClient.java index d9ba5fb3ee05..0e89180537dc 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountsClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent; @@ -22,6 +22,36 @@ * An instance of this class provides access to all the operations defined in AccountsClient. */ public interface AccountsClient { + /** + * Returns a Cognitive Services account specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location + * and SKU along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, + Context context); + + /** + * Returns a Cognitive Services account specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location + * and SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccountInner getByResourceGroup(String resourceGroupName, String accountName); + /** * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the keys for * developer to access intelligent APIs. It's also the resource type for billing. @@ -206,36 +236,6 @@ SyncPoller, AccountInner> beginUpdate(String resourceGr @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String accountName, Context context); - /** - * Returns a Cognitive Services account specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, - Context context); - - /** - * Returns a Cognitive Services account specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AccountInner getByResourceGroup(String resourceGroupName, String accountName); - /** * Returns all the resources of a particular type belonging to a resource group. * diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AgentApplicationsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AgentApplicationsClient.java new file mode 100644 index 000000000000..b478a77d2526 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AgentApplicationsClient.java @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentApplicationInner; +import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentReferenceResourceArmPaginatedResultInner; +import java.util.List; + +/** + * An instance of this class provides access to all the operations defined in AgentApplicationsClient. + */ +public interface AgentApplicationsClient { + /** + * Gets an Agent Application by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Agent Application by name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, String projectName, + String name, Context context); + + /** + * Gets an Agent Application by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Agent Application by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AgentApplicationInner get(String resourceGroupName, String accountName, String projectName, String name); + + /** + * Creates or updates an Agent Application (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param body Agent Application definition object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of agent Application resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AgentApplicationInner> beginCreateOrUpdate(String resourceGroupName, + String accountName, String projectName, String name, AgentApplicationInner body); + + /** + * Creates or updates an Agent Application (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param body Agent Application definition object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of agent Application resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AgentApplicationInner> beginCreateOrUpdate(String resourceGroupName, + String accountName, String projectName, String name, AgentApplicationInner body, Context context); + + /** + * Creates or updates an Agent Application (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param body Agent Application definition object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return agent Application resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AgentApplicationInner createOrUpdate(String resourceGroupName, String accountName, String projectName, String name, + AgentApplicationInner body); + + /** + * Creates or updates an Agent Application (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param body Agent Application definition object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return agent Application resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AgentApplicationInner createOrUpdate(String resourceGroupName, String accountName, String projectName, String name, + AgentApplicationInner body, Context context); + + /** + * Delete Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, String projectName, + String name); + + /** + * Delete Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, String projectName, + String name, Context context); + + /** + * Delete Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String projectName, String name); + + /** + * Delete Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String projectName, String name, Context context); + + /** + * Lists Agent Applications in the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Application entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, String projectName); + + /** + * Lists Agent Applications in the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param count Number of agent applications to be retrieved in a page of results. + * @param skip Number of agent applications to skip. + * @param skipToken Continuation token for pagination. + * @param names Names of agent applications to retrieve. + * @param searchText Search text for filtering agent applications. + * @param orderBy Field to order by. + * @param orderByAsc Whether to order in ascending order. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Application entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, String projectName, + Integer count, Integer skip, String skipToken, List names, String searchText, String orderBy, + Boolean orderByAsc, Context context); + + /** + * Lists agents for an Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Reference entities along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listAgentsWithResponse(String resourceGroupName, + String accountName, String projectName, String name, Context context); + + /** + * Lists agents for an Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Reference entities. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AgentReferenceResourceArmPaginatedResultInner listAgents(String resourceGroupName, String accountName, + String projectName, String name); + + /** + * Enables an Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response enableWithResponse(String resourceGroupName, String accountName, String projectName, String name, + Context context); + + /** + * Enables an Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void enable(String resourceGroupName, String accountName, String projectName, String name); + + /** + * Disables an Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response disableWithResponse(String resourceGroupName, String accountName, String projectName, String name, + Context context); + + /** + * Disables an Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void disable(String resourceGroupName, String accountName, String projectName, String name); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AgentDeploymentsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AgentDeploymentsClient.java new file mode 100644 index 000000000000..881f9556f1f8 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AgentDeploymentsClient.java @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentDeploymentInner; +import java.util.List; + +/** + * An instance of this class provides access to all the operations defined in AgentDeploymentsClient. + */ +public interface AgentDeploymentsClient { + /** + * Gets an Agent Deployment by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Agent Deployment by name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, String projectName, + String appName, String deploymentName, Context context); + + /** + * Gets an Agent Deployment by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Agent Deployment by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AgentDeploymentInner get(String resourceGroupName, String accountName, String projectName, String appName, + String deploymentName); + + /** + * Creates or updates an Agent Deployment (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param body Agent Deployment definition object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of agent Deployment resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AgentDeploymentInner> beginCreateOrUpdate(String resourceGroupName, + String accountName, String projectName, String appName, String deploymentName, AgentDeploymentInner body); + + /** + * Creates or updates an Agent Deployment (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param body Agent Deployment definition object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of agent Deployment resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, AgentDeploymentInner> beginCreateOrUpdate(String resourceGroupName, + String accountName, String projectName, String appName, String deploymentName, AgentDeploymentInner body, + Context context); + + /** + * Creates or updates an Agent Deployment (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param body Agent Deployment definition object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return agent Deployment resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AgentDeploymentInner createOrUpdate(String resourceGroupName, String accountName, String projectName, + String appName, String deploymentName, AgentDeploymentInner body); + + /** + * Creates or updates an Agent Deployment (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param body Agent Deployment definition object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return agent Deployment resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AgentDeploymentInner createOrUpdate(String resourceGroupName, String accountName, String projectName, + String appName, String deploymentName, AgentDeploymentInner body, Context context); + + /** + * Delete Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, String projectName, + String appName, String deploymentName); + + /** + * Delete Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, String projectName, + String appName, String deploymentName, Context context); + + /** + * Delete Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String projectName, String appName, + String deploymentName); + + /** + * Delete Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String projectName, String appName, String deploymentName, + Context context); + + /** + * Lists Agent Deployments in the application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Deployment entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, String projectName, + String appName); + + /** + * Lists Agent Deployments in the application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param count Number of agent deployments to be retrieved in a page of results. + * @param skipToken Continuation token for pagination. + * @param names Names of agent deployments to retrieve. + * @param orderBy Field to order by. + * @param orderByAsc Whether to order in ascending order. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Deployment entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, String projectName, + String appName, Integer count, String skipToken, List names, String orderBy, Boolean orderByAsc, + Context context); + + /** + * Starts an Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response startWithResponse(String resourceGroupName, String accountName, String projectName, String appName, + String deploymentName, Context context); + + /** + * Starts an Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String accountName, String projectName, String appName, String deploymentName); + + /** + * Stops an Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response stopWithResponse(String resourceGroupName, String accountName, String projectName, String appName, + String deploymentName, Context context); + + /** + * Stops an Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void stop(String resourceGroupName, String accountName, String projectName, String appName, String deploymentName); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CognitiveServicesManagementClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CognitiveServicesManagementClient.java index 9bf984b41e94..61ed2e9750b4 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CognitiveServicesManagementClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CognitiveServicesManagementClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent; @@ -12,26 +12,26 @@ */ public interface CognitiveServicesManagementClient { /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ String getEndpoint(); /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ String getApiVersion(); + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + /** * Gets The HTTP pipeline to send requests through. * @@ -46,41 +46,6 @@ public interface CognitiveServicesManagementClient { */ Duration getDefaultPollInterval(); - /** - * Gets the AccountsClient object to access its operations. - * - * @return the AccountsClient object. - */ - AccountsClient getAccounts(); - - /** - * Gets the DeletedAccountsClient object to access its operations. - * - * @return the DeletedAccountsClient object. - */ - DeletedAccountsClient getDeletedAccounts(); - - /** - * Gets the ResourceSkusClient object to access its operations. - * - * @return the ResourceSkusClient object. - */ - ResourceSkusClient getResourceSkus(); - - /** - * Gets the UsagesClient object to access its operations. - * - * @return the UsagesClient object. - */ - UsagesClient getUsages(); - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - OperationsClient getOperations(); - /** * Gets the ResourceProvidersClient object to access its operations. * @@ -89,32 +54,25 @@ public interface CognitiveServicesManagementClient { ResourceProvidersClient getResourceProviders(); /** - * Gets the CommitmentTiersClient object to access its operations. - * - * @return the CommitmentTiersClient object. - */ - CommitmentTiersClient getCommitmentTiers(); - - /** - * Gets the ModelsClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the ModelsClient object. + * @return the OperationsClient object. */ - ModelsClient getModels(); + OperationsClient getOperations(); /** - * Gets the LocationBasedModelCapacitiesClient object to access its operations. + * Gets the AccountsClient object to access its operations. * - * @return the LocationBasedModelCapacitiesClient object. + * @return the AccountsClient object. */ - LocationBasedModelCapacitiesClient getLocationBasedModelCapacities(); + AccountsClient getAccounts(); /** - * Gets the ModelCapacitiesClient object to access its operations. + * Gets the DeletedAccountsClient object to access its operations. * - * @return the ModelCapacitiesClient object. + * @return the DeletedAccountsClient object. */ - ModelCapacitiesClient getModelCapacities(); + DeletedAccountsClient getDeletedAccounts(); /** * Gets the PrivateEndpointConnectionsClient object to access its operations. @@ -123,13 +81,6 @@ public interface CognitiveServicesManagementClient { */ PrivateEndpointConnectionsClient getPrivateEndpointConnections(); - /** - * Gets the PrivateLinkResourcesClient object to access its operations. - * - * @return the PrivateLinkResourcesClient object. - */ - PrivateLinkResourcesClient getPrivateLinkResources(); - /** * Gets the DeploymentsClient object to access its operations. * @@ -159,11 +110,11 @@ public interface CognitiveServicesManagementClient { RaiPoliciesClient getRaiPolicies(); /** - * Gets the RaiBlocklistsClient object to access its operations. + * Gets the SubscriptionRaiPoliciesClient object to access its operations. * - * @return the RaiBlocklistsClient object. + * @return the SubscriptionRaiPoliciesClient object. */ - RaiBlocklistsClient getRaiBlocklists(); + SubscriptionRaiPoliciesClient getSubscriptionRaiPolicies(); /** * Gets the RaiBlocklistItemsClient object to access its operations. @@ -172,6 +123,13 @@ public interface CognitiveServicesManagementClient { */ RaiBlocklistItemsClient getRaiBlocklistItems(); + /** + * Gets the RaiBlocklistsClient object to access its operations. + * + * @return the RaiBlocklistsClient object. + */ + RaiBlocklistsClient getRaiBlocklists(); + /** * Gets the RaiTopicsClient object to access its operations. * @@ -179,6 +137,13 @@ public interface CognitiveServicesManagementClient { */ RaiTopicsClient getRaiTopics(); + /** + * Gets the RaiToolLabelsClient object to access its operations. + * + * @return the RaiToolLabelsClient object. + */ + RaiToolLabelsClient getRaiToolLabels(); + /** * Gets the RaiContentFiltersClient object to access its operations. * @@ -208,18 +173,74 @@ public interface CognitiveServicesManagementClient { ProjectsClient getProjects(); /** - * Gets the AccountConnectionsClient object to access its operations. + * Gets the ProjectConnectionsClient object to access its operations. * - * @return the AccountConnectionsClient object. + * @return the ProjectConnectionsClient object. */ - AccountConnectionsClient getAccountConnections(); + ProjectConnectionsClient getProjectConnections(); /** - * Gets the ProjectConnectionsClient object to access its operations. + * Gets the ProjectCapabilityHostsClient object to access its operations. * - * @return the ProjectConnectionsClient object. + * @return the ProjectCapabilityHostsClient object. */ - ProjectConnectionsClient getProjectConnections(); + ProjectCapabilityHostsClient getProjectCapabilityHosts(); + + /** + * Gets the QuotaTiersClient object to access its operations. + * + * @return the QuotaTiersClient object. + */ + QuotaTiersClient getQuotaTiers(); + + /** + * Gets the AgentApplicationsClient object to access its operations. + * + * @return the AgentApplicationsClient object. + */ + AgentApplicationsClient getAgentApplications(); + + /** + * Gets the ComputeOperationsClient object to access its operations. + * + * @return the ComputeOperationsClient object. + */ + ComputeOperationsClient getComputeOperations(); + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + PrivateLinkResourcesClient getPrivateLinkResources(); + + /** + * Gets the TestRaiExternalSafetyProvidersClient object to access its operations. + * + * @return the TestRaiExternalSafetyProvidersClient object. + */ + TestRaiExternalSafetyProvidersClient getTestRaiExternalSafetyProviders(); + + /** + * Gets the RaiExternalSafetyProvidersClient object to access its operations. + * + * @return the RaiExternalSafetyProvidersClient object. + */ + RaiExternalSafetyProvidersClient getRaiExternalSafetyProviders(); + + /** + * Gets the RaiExternalSafetyProvidersOperationsClient object to access its operations. + * + * @return the RaiExternalSafetyProvidersOperationsClient object. + */ + RaiExternalSafetyProvidersOperationsClient getRaiExternalSafetyProvidersOperations(); + + /** + * Gets the AccountConnectionsClient object to access its operations. + * + * @return the AccountConnectionsClient object. + */ + AccountConnectionsClient getAccountConnections(); /** * Gets the AccountCapabilityHostsClient object to access its operations. @@ -229,16 +250,79 @@ public interface CognitiveServicesManagementClient { AccountCapabilityHostsClient getAccountCapabilityHosts(); /** - * Gets the ProjectCapabilityHostsClient object to access its operations. + * Gets the OutboundRulesClient object to access its operations. * - * @return the ProjectCapabilityHostsClient object. + * @return the OutboundRulesClient object. */ - ProjectCapabilityHostsClient getProjectCapabilityHosts(); + OutboundRulesClient getOutboundRules(); /** - * Gets the QuotaTiersClient object to access its operations. + * Gets the ManagedNetworkSettingsOperationsClient object to access its operations. * - * @return the QuotaTiersClient object. + * @return the ManagedNetworkSettingsOperationsClient object. */ - QuotaTiersClient getQuotaTiers(); + ManagedNetworkSettingsOperationsClient getManagedNetworkSettingsOperations(); + + /** + * Gets the OutboundRulesOperationsClient object to access its operations. + * + * @return the OutboundRulesOperationsClient object. + */ + OutboundRulesOperationsClient getOutboundRulesOperations(); + + /** + * Gets the ManagedNetworkProvisionsClient object to access its operations. + * + * @return the ManagedNetworkProvisionsClient object. + */ + ManagedNetworkProvisionsClient getManagedNetworkProvisions(); + + /** + * Gets the AgentDeploymentsClient object to access its operations. + * + * @return the AgentDeploymentsClient object. + */ + AgentDeploymentsClient getAgentDeployments(); + + /** + * Gets the ResourceSkusClient object to access its operations. + * + * @return the ResourceSkusClient object. + */ + ResourceSkusClient getResourceSkus(); + + /** + * Gets the UsagesClient object to access its operations. + * + * @return the UsagesClient object. + */ + UsagesClient getUsages(); + + /** + * Gets the CommitmentTiersClient object to access its operations. + * + * @return the CommitmentTiersClient object. + */ + CommitmentTiersClient getCommitmentTiers(); + + /** + * Gets the ModelsClient object to access its operations. + * + * @return the ModelsClient object. + */ + ModelsClient getModels(); + + /** + * Gets the LocationBasedModelCapacitiesClient object to access its operations. + * + * @return the LocationBasedModelCapacitiesClient object. + */ + LocationBasedModelCapacitiesClient getLocationBasedModelCapacities(); + + /** + * Gets the ModelCapacitiesClient object to access its operations. + * + * @return the ModelCapacitiesClient object. + */ + ModelCapacitiesClient getModelCapacities(); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CommitmentPlansClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CommitmentPlansClient.java index 8dd086f4a8b2..293086410077 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CommitmentPlansClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CommitmentPlansClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent; @@ -19,35 +19,6 @@ * An instance of this class provides access to all the operations defined in CommitmentPlansClient. */ public interface CommitmentPlansClient { - /** - * Gets the commitmentPlans associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the commitmentPlans associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Gets the commitmentPlans associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the commitmentPlans associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, Context context); - /** * Gets the specified commitmentPlans associated with the Cognitive Services account. * @@ -169,6 +140,63 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String accountName, String commitmentPlanName, Context context); + /** + * Gets the commitmentPlans associated with the Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the commitmentPlans associated with the Cognitive Services account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Gets the commitmentPlans associated with the Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the commitmentPlans associated with the Cognitive Services account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * Returns a Cognitive Services commitment plan specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account commitment plan along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String commitmentPlanName, + Context context); + + /** + * Returns a Cognitive Services commitment plan specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account commitment plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CommitmentPlanInner getByResourceGroup(String resourceGroupName, String commitmentPlanName); + /** * Create Cognitive Services commitment plan. * @@ -346,34 +374,6 @@ SyncPoller, Void> beginDeletePlan(String resourceGroupName, Str @ServiceMethod(returns = ReturnType.SINGLE) void deletePlan(String resourceGroupName, String commitmentPlanName, Context context); - /** - * Returns a Cognitive Services commitment plan specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account commitment plan along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String commitmentPlanName, - Context context); - - /** - * Returns a Cognitive Services commitment plan specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account commitment plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CommitmentPlanInner getByResourceGroup(String resourceGroupName, String commitmentPlanName); - /** * Returns all the resources of a particular type belonging to a resource group. * @@ -425,37 +425,6 @@ Response getByResourceGroupWithResponse(String resourceGrou @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listPlansBySubscription(Context context); - /** - * Gets the associations of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the associations of the Cognitive Services commitment plan as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAssociations(String resourceGroupName, - String commitmentPlanName); - - /** - * Gets the associations of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the associations of the Cognitive Services commitment plan as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAssociations(String resourceGroupName, - String commitmentPlanName, Context context); - /** * Gets the association of the Cognitive Services commitment plan. * @@ -623,4 +592,35 @@ SyncPoller, Void> beginDeleteAssociation(String resourceGroupNa @ServiceMethod(returns = ReturnType.SINGLE) void deleteAssociation(String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName, Context context); + + /** + * Gets the associations of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the associations of the Cognitive Services commitment plan as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAssociations(String resourceGroupName, + String commitmentPlanName); + + /** + * Gets the associations of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the associations of the Cognitive Services commitment plan as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAssociations(String resourceGroupName, + String commitmentPlanName, Context context); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CommitmentTiersClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CommitmentTiersClient.java index 51f081c2c70b..c86ecf3d7005 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CommitmentTiersClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CommitmentTiersClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent; @@ -17,7 +17,7 @@ public interface CommitmentTiersClient { /** * List Commitment Tiers. * - * @param location Resource location. + * @param location The location name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -30,7 +30,7 @@ public interface CommitmentTiersClient { /** * List Commitment Tiers. * - * @param location Resource location. + * @param location The location name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ComputeOperationsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ComputeOperationsClient.java new file mode 100644 index 000000000000..863b7ee341a7 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ComputeOperationsClient.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ComputeOperationStatusInner; + +/** + * An instance of this class provides access to all the operations defined in ComputeOperationsClient. + */ +public interface ComputeOperationsClient { + /** + * Gets the status of a compute operation. + * + * @param location The name of the Azure region. + * @param operationId The ID of the compute operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a compute operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String location, String operationId, Context context); + + /** + * Gets the status of a compute operation. + * + * @param location The name of the Azure region. + * @param operationId The ID of the compute operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a compute operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ComputeOperationStatusInner get(String location, String operationId); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/DefenderForAISettingsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/DefenderForAISettingsClient.java index 0dc188b3173e..0cb87c84525f 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/DefenderForAISettingsClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/DefenderForAISettingsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent; @@ -15,33 +15,6 @@ * An instance of this class provides access to all the operations defined in DefenderForAISettingsClient. */ public interface DefenderForAISettingsClient { - /** - * Lists the Defender for AI settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services Defender for AI Settings as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Lists the Defender for AI settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services Defender for AI Settings as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, Context context); - /** * Gets the specified Defender for AI setting by name. * @@ -137,4 +110,31 @@ Response updateWithResponse(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) DefenderForAISettingInner update(String resourceGroupName, String accountName, String defenderForAISettingName, DefenderForAISettingInner defenderForAISettings); + + /** + * Lists the Defender for AI settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cognitive services Defender for AI Settings as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Lists the Defender for AI settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cognitive services Defender for AI Settings as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/DeletedAccountsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/DeletedAccountsClient.java index 2f6bf8df45c7..562148b336b0 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/DeletedAccountsClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/DeletedAccountsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent; @@ -20,7 +20,7 @@ public interface DeletedAccountsClient { /** * Returns a Cognitive Services account specified by the parameters. * - * @param location Resource location. + * @param location The location name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param context The context to associate with this operation. @@ -37,7 +37,7 @@ Response getWithResponse(String location, String resourceGroupName /** * Returns a Cognitive Services account specified by the parameters. * - * @param location Resource location. + * @param location The location name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -52,7 +52,7 @@ Response getWithResponse(String location, String resourceGroupName /** * Deletes a Cognitive Services account from the resource group. * - * @param location Resource location. + * @param location The location name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -66,7 +66,7 @@ Response getWithResponse(String location, String resourceGroupName /** * Deletes a Cognitive Services account from the resource group. * - * @param location Resource location. + * @param location The location name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param context The context to associate with this operation. @@ -82,7 +82,7 @@ SyncPoller, Void> beginPurge(String location, String resourceGr /** * Deletes a Cognitive Services account from the resource group. * - * @param location Resource location. + * @param location The location name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -95,7 +95,7 @@ SyncPoller, Void> beginPurge(String location, String resourceGr /** * Deletes a Cognitive Services account from the resource group. * - * @param location Resource location. + * @param location The location name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param context The context to associate with this operation. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/DeploymentsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/DeploymentsClient.java index 69bf70d703b2..e65adb9091ce 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/DeploymentsClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/DeploymentsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent; @@ -19,35 +19,6 @@ * An instance of this class provides access to all the operations defined in DeploymentsClient. */ public interface DeploymentsClient { - /** - * Gets the deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployments associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Gets the deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployments associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, Context context); - /** * Gets the specified deployments associated with the Cognitive Services account. * @@ -267,6 +238,35 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String accountName, String deploymentName, Context context); + /** + * Gets the deployments associated with the Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployments associated with the Cognitive Services account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Gets the deployments associated with the Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployments associated with the Cognitive Services account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); + /** * Lists the specified deployments skus associated with the Cognitive Services account. * @@ -298,4 +298,82 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listSkus(String resourceGroupName, String accountName, String deploymentName, Context context); + + /** + * Pause a deployment + * + * Pauses inferencing on a deployment by setting the deploymentState to 'Paused' (see + * #/definitions/DeploymentProperties/properties/deploymentState). Only Standard, DataZoneStandard, and + * GlobalStandard SKUs support this operation. Inference requests to the paused deployment endpoint will receive + * HTTP 423 (Locked). This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account deployment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response pauseWithResponse(String resourceGroupName, String accountName, String deploymentName, + Context context); + + /** + * Pause a deployment + * + * Pauses inferencing on a deployment by setting the deploymentState to 'Paused' (see + * #/definitions/DeploymentProperties/properties/deploymentState). Only Standard, DataZoneStandard, and + * GlobalStandard SKUs support this operation. Inference requests to the paused deployment endpoint will receive + * HTTP 423 (Locked). This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account deployment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentInner pause(String resourceGroupName, String accountName, String deploymentName); + + /** + * Resume a deployment + * + * Resumes inferencing on a previously paused deployment by setting the deploymentState to 'Running' (see + * #/definitions/DeploymentProperties/properties/deploymentState). This operation is idempotent and can be safely + * called on already running deployments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account deployment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response resumeWithResponse(String resourceGroupName, String accountName, String deploymentName, + Context context); + + /** + * Resume a deployment + * + * Resumes inferencing on a previously paused deployment by setting the deploymentState to 'Running' (see + * #/definitions/DeploymentProperties/properties/deploymentState). This operation is idempotent and can be safely + * called on already running deployments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account deployment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DeploymentInner resume(String resourceGroupName, String accountName, String deploymentName); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/EncryptionScopesClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/EncryptionScopesClient.java index 2b324d36afaf..903ee81eb979 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/EncryptionScopesClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/EncryptionScopesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent; @@ -17,35 +17,6 @@ * An instance of this class provides access to all the operations defined in EncryptionScopesClient. */ public interface EncryptionScopesClient { - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, Context context); - /** * Gets the specified EncryptionScope associated with the Cognitive Services account. * @@ -166,4 +137,33 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String accountName, String encryptionScopeName, Context context); + + /** + * Gets the content filters associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the content filters associated with the Azure OpenAI account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Gets the content filters associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the content filters associated with the Azure OpenAI account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/LocationBasedModelCapacitiesClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/LocationBasedModelCapacitiesClient.java index e90257236132..68c57b227b5c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/LocationBasedModelCapacitiesClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/LocationBasedModelCapacitiesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent; @@ -17,7 +17,7 @@ public interface LocationBasedModelCapacitiesClient { /** * List Location Based ModelCapacities. * - * @param location Resource location. + * @param location The location name. * @param modelFormat The format of the Model. * @param modelName The name of the Model. * @param modelVersion The version of the Model. @@ -34,7 +34,7 @@ PagedIterable list(String location, Strin /** * List Location Based ModelCapacities. * - * @param location Resource location. + * @param location The location name. * @param modelFormat The format of the Model. * @param modelName The name of the Model. * @param modelVersion The version of the Model. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ManagedNetworkProvisionsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ManagedNetworkProvisionsClient.java new file mode 100644 index 000000000000..2d15386b47c7 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ManagedNetworkProvisionsClient.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkProvisionStatusInner; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkProvisionOptions; + +/** + * An instance of this class provides access to all the operations defined in ManagedNetworkProvisionsClient. + */ +public interface ManagedNetworkProvisionsClient { + /** + * Provisions the managed network of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedNetworkProvisionStatusInner> + beginProvisionManagedNetwork(String resourceGroupName, String accountName, String managedNetworkName); + + /** + * Provisions the managed network of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body Managed Network Provisioning Options for a cognitive services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedNetworkProvisionStatusInner> + beginProvisionManagedNetwork(String resourceGroupName, String accountName, String managedNetworkName, + ManagedNetworkProvisionOptions body, Context context); + + /** + * Provisions the managed network of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedNetworkProvisionStatusInner provisionManagedNetwork(String resourceGroupName, String accountName, + String managedNetworkName); + + /** + * Provisions the managed network of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body Managed Network Provisioning Options for a cognitive services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedNetworkProvisionStatusInner provisionManagedNetwork(String resourceGroupName, String accountName, + String managedNetworkName, ManagedNetworkProvisionOptions body, Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ManagedNetworkSettingsOperationsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ManagedNetworkSettingsOperationsClient.java new file mode 100644 index 000000000000..9b75c48f2d2a --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ManagedNetworkSettingsOperationsClient.java @@ -0,0 +1,290 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsPropertiesBasicResourceInner; + +/** + * An instance of this class provides access to all the operations defined in ManagedNetworkSettingsOperationsClient. + */ +public interface ManagedNetworkSettingsOperationsClient { + /** + * Get API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI for managed network settings of a cognitive services account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, + String accountName, String managedNetworkName, Context context); + + /** + * Get API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI for managed network settings of a cognitive services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedNetworkSettingsPropertiesBasicResourceInner get(String resourceGroupName, String accountName, + String managedNetworkName); + + /** + * PUT API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete proxy resource types can be created by aliasing this type + * using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedNetworkSettingsPropertiesBasicResourceInner> + beginPut(String resourceGroupName, String accountName, String managedNetworkName, + ManagedNetworkSettingsPropertiesBasicResourceInner body); + + /** + * PUT API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete proxy resource types can be created by aliasing this type + * using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedNetworkSettingsPropertiesBasicResourceInner> + beginPut(String resourceGroupName, String accountName, String managedNetworkName, + ManagedNetworkSettingsPropertiesBasicResourceInner body, Context context); + + /** + * PUT API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedNetworkSettingsPropertiesBasicResourceInner put(String resourceGroupName, String accountName, + String managedNetworkName, ManagedNetworkSettingsPropertiesBasicResourceInner body); + + /** + * PUT API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedNetworkSettingsPropertiesBasicResourceInner put(String resourceGroupName, String accountName, + String managedNetworkName, ManagedNetworkSettingsPropertiesBasicResourceInner body, Context context); + + /** + * Patch API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete proxy resource types can be created by aliasing this type + * using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedNetworkSettingsPropertiesBasicResourceInner> + beginPatch(String resourceGroupName, String accountName, String managedNetworkName); + + /** + * Patch API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete proxy resource types can be created by aliasing this type + * using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedNetworkSettingsPropertiesBasicResourceInner> + beginPatch(String resourceGroupName, String accountName, String managedNetworkName, + ManagedNetworkSettingsPropertiesBasicResourceInner body, Context context); + + /** + * Patch API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedNetworkSettingsPropertiesBasicResourceInner patch(String resourceGroupName, String accountName, + String managedNetworkName); + + /** + * Patch API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedNetworkSettingsPropertiesBasicResourceInner patch(String resourceGroupName, String accountName, + String managedNetworkName, ManagedNetworkSettingsPropertiesBasicResourceInner body, Context context); + + /** + * Delete API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String managedNetworkName); + + /** + * Delete API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String managedNetworkName, Context context); + + /** + * Delete API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String managedNetworkName); + + /** + * Delete API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String managedNetworkName, Context context); + + /** + * List API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed networks of a cognitive services account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, + String accountName); + + /** + * List API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed networks of a cognitive services account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, + Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ModelCapacitiesClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ModelCapacitiesClient.java index a4617d1d16ec..10378e4991e7 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ModelCapacitiesClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ModelCapacitiesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ModelsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ModelsClient.java index d6a0c2438caa..deee54503676 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ModelsClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ModelsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent; @@ -17,7 +17,7 @@ public interface ModelsClient { /** * List Models. * - * @param location Resource location. + * @param location The location name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -29,7 +29,7 @@ public interface ModelsClient { /** * List Models. * - * @param location Resource location. + * @param location The location name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/NetworkSecurityPerimeterConfigurationsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/NetworkSecurityPerimeterConfigurationsClient.java index 516cbee930bc..f4f0a1118722 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/NetworkSecurityPerimeterConfigurationsClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/NetworkSecurityPerimeterConfigurationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent; @@ -19,63 +19,63 @@ */ public interface NetworkSecurityPerimeterConfigurationsClient { /** - * Gets a list of NSP configurations for an account. + * Gets the specified NSP configurations for an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. + * @param nspConfigurationName The name of the NSP Configuration. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of NSP configurations for an account as paginated response with {@link PagedIterable}. + * @return the specified NSP configurations for an account along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, + String nspConfigurationName, Context context); /** - * Gets a list of NSP configurations for an account. + * Gets the specified NSP configurations for an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. + * @param nspConfigurationName The name of the NSP Configuration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of NSP configurations for an account as paginated response with {@link PagedIterable}. + * @return the specified NSP configurations for an account. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, - Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkSecurityPerimeterConfigurationInner get(String resourceGroupName, String accountName, + String nspConfigurationName); /** - * Gets the specified NSP configurations for an account. + * Gets a list of NSP configurations for an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP Configuration. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified NSP configurations for an account along with {@link Response}. + * @return a list of NSP configurations for an account as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String accountName, - String nspConfigurationName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); /** - * Gets the specified NSP configurations for an account. + * Gets a list of NSP configurations for an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP Configuration. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified NSP configurations for an account. + * @return a list of NSP configurations for an account as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - NetworkSecurityPerimeterConfigurationInner get(String resourceGroupName, String accountName, - String nspConfigurationName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, + Context context); /** * Reconcile the NSP configuration for an account. @@ -86,7 +86,7 @@ NetworkSecurityPerimeterConfigurationInner get(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of nSP Configuration for an Cognitive Services account. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, NetworkSecurityPerimeterConfigurationInner> @@ -102,7 +102,7 @@ NetworkSecurityPerimeterConfigurationInner get(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of nSP Configuration for an Cognitive Services account. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, NetworkSecurityPerimeterConfigurationInner> @@ -117,7 +117,7 @@ NetworkSecurityPerimeterConfigurationInner get(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSP Configuration for an Cognitive Services account. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) NetworkSecurityPerimeterConfigurationInner reconcile(String resourceGroupName, String accountName, @@ -133,7 +133,7 @@ NetworkSecurityPerimeterConfigurationInner reconcile(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSP Configuration for an Cognitive Services account. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) NetworkSecurityPerimeterConfigurationInner reconcile(String resourceGroupName, String accountName, diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/OperationsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/OperationsClient.java index 13b47cb904a2..1aa03a7b9f9d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/OperationsClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/OperationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/OutboundRulesClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/OutboundRulesClient.java new file mode 100644 index 000000000000..836b79ab6a84 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/OutboundRulesClient.java @@ -0,0 +1,247 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cognitiveservices.fluent.models.OutboundRuleBasicResourceInner; + +/** + * An instance of this class provides access to all the operations defined in OutboundRulesClient. + */ +public interface OutboundRulesClient { + /** + * The GET API for retrieving a single outbound rule of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, + String managedNetworkName, String ruleName, Context context); + + /** + * The GET API for retrieving a single outbound rule of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OutboundRuleBasicResourceInner get(String resourceGroupName, String accountName, String managedNetworkName, + String ruleName); + + /** + * The PUT API for creating or updating a single outbound rule of the managed network associated with the cognitive + * services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete proxy resource types can be created by aliasing this type + * using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OutboundRuleBasicResourceInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, String managedNetworkName, String ruleName, + OutboundRuleBasicResourceInner body); + + /** + * The PUT API for creating or updating a single outbound rule of the managed network associated with the cognitive + * services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @param body The body parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete proxy resource types can be created by aliasing this type + * using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OutboundRuleBasicResourceInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, String managedNetworkName, String ruleName, + OutboundRuleBasicResourceInner body, Context context); + + /** + * The PUT API for creating or updating a single outbound rule of the managed network associated with the cognitive + * services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OutboundRuleBasicResourceInner createOrUpdate(String resourceGroupName, String accountName, + String managedNetworkName, String ruleName, OutboundRuleBasicResourceInner body); + + /** + * The PUT API for creating or updating a single outbound rule of the managed network associated with the cognitive + * services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @param body The body parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OutboundRuleBasicResourceInner createOrUpdate(String resourceGroupName, String accountName, + String managedNetworkName, String ruleName, OutboundRuleBasicResourceInner body, Context context); + + /** + * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String managedNetworkName, String ruleName); + + /** + * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String managedNetworkName, String ruleName, Context context); + + /** + * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String managedNetworkName, String ruleName); + + /** + * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String managedNetworkName, String ruleName, + Context context); + + /** + * The GET API for retrieving the list of outbound rules of the managed network associated with the cognitive + * services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a cognitive services account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, + String managedNetworkName); + + /** + * The GET API for retrieving the list of outbound rules of the managed network associated with the cognitive + * services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a cognitive services account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, + String managedNetworkName, Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/OutboundRulesOperationsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/OutboundRulesOperationsClient.java new file mode 100644 index 000000000000..165bfa86b042 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/OutboundRulesOperationsClient.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsBasicResourceInner; +import com.azure.resourcemanager.cognitiveservices.fluent.models.OutboundRuleListResultInner; + +/** + * An instance of this class provides access to all the operations defined in OutboundRulesOperationsClient. + */ +public interface OutboundRulesOperationsClient { + /** + * The POST API for updating the outbound rules of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OutboundRuleListResultInner> beginPost(String resourceGroupName, + String accountName, String managedNetworkName, ManagedNetworkSettingsBasicResourceInner body); + + /** + * The POST API for updating the outbound rules of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OutboundRuleListResultInner> beginPost(String resourceGroupName, + String accountName, String managedNetworkName, ManagedNetworkSettingsBasicResourceInner body, Context context); + + /** + * The POST API for updating the outbound rules of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OutboundRuleListResultInner post(String resourceGroupName, String accountName, String managedNetworkName, + ManagedNetworkSettingsBasicResourceInner body); + + /** + * The POST API for updating the outbound rules of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OutboundRuleListResultInner post(String resourceGroupName, String accountName, String managedNetworkName, + ManagedNetworkSettingsBasicResourceInner body, Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/PrivateEndpointConnectionsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/PrivateEndpointConnectionsClient.java index 54aa828a43f9..f85e861e910a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/PrivateEndpointConnectionsClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/PrivateEndpointConnectionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent; @@ -17,35 +17,6 @@ * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ public interface PrivateEndpointConnectionsClient { - /** - * Gets the private endpoint connections associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connections associated with the Cognitive Services account along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String resourceGroupName, String accountName, - Context context); - - /** - * Gets the private endpoint connections associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connections associated with the Cognitive Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateEndpointConnectionListResultInner list(String resourceGroupName, String accountName); - /** * Gets the specified private endpoint connection associated with the Cognitive Services account. * @@ -213,4 +184,33 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context); + + /** + * Gets the private endpoint connections associated with the Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connections associated with the Cognitive Services account along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, String accountName, + Context context); + + /** + * Gets the private endpoint connections associated with the Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connections associated with the Cognitive Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionListResultInner list(String resourceGroupName, String accountName); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/PrivateLinkResourcesClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/PrivateLinkResourcesClient.java index 0e6342b1c3b0..e8547e071a4a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/PrivateLinkResourcesClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/PrivateLinkResourcesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectCapabilityHostsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectCapabilityHostsClient.java index 1023fcd84b05..b3914f0c1b13 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectCapabilityHostsClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectCapabilityHostsClient.java @@ -1,185 +1,219 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CapabilityHostInner; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ProjectCapabilityHostInner; /** * An instance of this class provides access to all the operations defined in ProjectCapabilityHostsClient. */ public interface ProjectCapabilityHostsClient { /** - * Delete project capabilityHost. + * Get project capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return project capabilityHost along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, String projectName, - String capabilityHostname); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, + String projectName, String capabilityHostName, Context context); /** - * Delete project capabilityHost. + * Get project capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param context The context to associate with this operation. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return project capabilityHost. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, String projectName, - String capabilityHostname, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectCapabilityHostInner get(String resourceGroupName, String accountName, String projectName, + String capabilityHostName); /** - * Delete project capabilityHost. + * Create or update project capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHost CapabilityHost definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope for Project + * CapabilityHost. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostname); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProjectCapabilityHostInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, String projectName, String capabilityHostName, + ProjectCapabilityHostInner capabilityHost); /** - * Delete project capabilityHost. + * Create or update project capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHost CapabilityHost definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope for Project + * CapabilityHost. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostname, - Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ProjectCapabilityHostInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, String projectName, String capabilityHostName, + ProjectCapabilityHostInner capabilityHost, Context context); /** - * Get project capabilityHost. + * Create or update project capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param context The context to associate with this operation. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHost CapabilityHost definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return project capabilityHost along with {@link Response}. + * @return azure Resource Manager resource envelope for Project CapabilityHost. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String accountName, String projectName, - String capabilityHostname, Context context); + ProjectCapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String projectName, + String capabilityHostName, ProjectCapabilityHostInner capabilityHost); /** - * Get project capabilityHost. + * Create or update project capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHost CapabilityHost definition. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return project capabilityHost. + * @return azure Resource Manager resource envelope for Project CapabilityHost. */ @ServiceMethod(returns = ReturnType.SINGLE) - CapabilityHostInner get(String resourceGroupName, String accountName, String projectName, - String capabilityHostname); + ProjectCapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String projectName, + String capabilityHostName, ProjectCapabilityHostInner capabilityHost, Context context); /** - * Create or update project capabilityHost. + * Delete project capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CapabilityHostInner> beginCreateOrUpdate(String resourceGroupName, - String accountName, String projectName, String capabilityHostname, CapabilityHostInner capabilityHost); + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, String projectName, + String capabilityHostName); /** - * Create or update project capabilityHost. + * Delete project capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CapabilityHostInner> beginCreateOrUpdate(String resourceGroupName, - String accountName, String projectName, String capabilityHostname, CapabilityHostInner capabilityHost, - Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, String projectName, + String capabilityHostName, Context context); /** - * Create or update project capabilityHost. + * Delete project capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - CapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String projectName, - String capabilityHostname, CapabilityHostInner capabilityHost); + void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostName); /** - * Create or update project capabilityHost. + * Delete project capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - CapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String projectName, - String capabilityHostname, CapabilityHostInner capabilityHost, Context context); + void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostName, + Context context); + + /** + * List capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Project Capability Host entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, String projectName); + + /** + * List capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Project Capability Host entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, String projectName, + Context context); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectConnectionsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectConnectionsClient.java index 3a9ead792dbc..36755aa712a3 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectConnectionsClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectConnectionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent; @@ -17,7 +17,7 @@ */ public interface ProjectConnectionsClient { /** - * Delete Cognitive Services project connection by name. + * Lists Cognitive Services project connection by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -27,14 +27,14 @@ public interface ProjectConnectionsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return connection base resource schema along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String accountName, String projectName, - String connectionName, Context context); + Response getWithResponse(String resourceGroupName, String accountName, + String projectName, String connectionName, Context context); /** - * Delete Cognitive Services project connection by name. + * Lists Cognitive Services project connection by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -43,17 +43,20 @@ Response deleteWithResponse(String resourceGroupName, String accountName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String accountName, String projectName, String connectionName); + ConnectionPropertiesV2BasicResourceInner get(String resourceGroupName, String accountName, String projectName, + String connectionName); /** - * Lists Cognitive Services project connection by name. + * Create or update Cognitive Services project connection under the specified project. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. * @param connectionName Friendly name of the connection. + * @param connection The object for creating or updating a new account connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -61,11 +64,12 @@ Response deleteWithResponse(String resourceGroupName, String accountName, * @return connection base resource schema along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String accountName, - String projectName, String connectionName, Context context); + Response createWithResponse(String resourceGroupName, String accountName, + String projectName, String connectionName, ConnectionPropertiesV2BasicResourceInner connection, + Context context); /** - * Lists Cognitive Services project connection by name. + * Create or update Cognitive Services project connection under the specified project. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -77,7 +81,7 @@ Response getWithResponse(String resour * @return connection base resource schema. */ @ServiceMethod(returns = ReturnType.SINGLE) - ConnectionPropertiesV2BasicResourceInner get(String resourceGroupName, String accountName, String projectName, + ConnectionPropertiesV2BasicResourceInner create(String resourceGroupName, String accountName, String projectName, String connectionName); /** @@ -115,26 +119,24 @@ ConnectionPropertiesV2BasicResourceInner update(String resourceGroupName, String String connectionName); /** - * Create or update Cognitive Services project connection under the specified project. + * Delete Cognitive Services project connection by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. * @param connectionName Friendly name of the connection. - * @param connection The object for creating or updating a new account connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse(String resourceGroupName, String accountName, - String projectName, String connectionName, ConnectionPropertiesV2BasicResourceInner connection, - Context context); + Response deleteWithResponse(String resourceGroupName, String accountName, String projectName, + String connectionName, Context context); /** - * Create or update Cognitive Services project connection under the specified project. + * Delete Cognitive Services project connection by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -143,11 +145,9 @@ Response createWithResponse(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema. */ @ServiceMethod(returns = ReturnType.SINGLE) - ConnectionPropertiesV2BasicResourceInner create(String resourceGroupName, String accountName, String projectName, - String connectionName); + void delete(String resourceGroupName, String accountName, String projectName, String connectionName); /** * Lists all the available Cognitive Services project connections under the specified project. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectsClient.java index 1ebfb264756e..d2b8ab429d77 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectsClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent; @@ -17,6 +17,38 @@ * An instance of this class provides access to all the operations defined in ProjectsClient. */ public interface ProjectsClient { + /** + * Returns a Cognitive Services project specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, String projectName, + Context context); + + /** + * Returns a Cognitive Services project specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProjectInner get(String resourceGroupName, String accountName, String projectName); + /** * 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. @@ -216,38 +248,6 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String accountName, String projectName, Context context); - /** - * Returns a Cognitive Services project specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String accountName, String projectName, - Context context); - - /** - * Returns a Cognitive Services project specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProjectInner get(String resourceGroupName, String accountName, String projectName); - /** * Returns all the projects in a Cognitive Services account. * diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/QuotaTiersClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/QuotaTiersClient.java index f8157e57459f..63bfc211e0a1 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/QuotaTiersClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/QuotaTiersClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent; @@ -15,40 +15,20 @@ * An instance of this class provides access to all the operations defined in QuotaTiersClient. */ public interface QuotaTiersClient { - /** - * Returns all the resources of a particular type belonging to a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Quota Tiers response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Returns all the resources of a particular type belonging to a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Quota Tiers response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - /** * Gets the Quota Tier for a subscription * * Gets the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It * holds current tier information. * - * @param defaultParameter Default parameter. Leave the value as "default". + * @param defaultParameter Default parameter. Leave the value as default. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Quota Tier information for the given subscription along with {@link Response}. + * @return the Quota Tier for a subscription + * + * Gets the Quota Tier information for the given subscription along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String defaultParameter, Context context); @@ -59,23 +39,24 @@ public interface QuotaTiersClient { * Gets the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It * holds current tier information. * - * @param defaultParameter Default parameter. Leave the value as "default". + * @param defaultParameter Default parameter. Leave the value as default. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Quota Tier information for the given subscription. + * @return the Quota Tier for a subscription + * + * Gets the Quota Tier information for the given subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) QuotaTierInner get(String defaultParameter); /** - * Updates the Quota Tier resource for a subscription. The only properties that can be updated are - * "tierUpgradePolicy" + * Updates the Quota Tier resource for a subscription. * * Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It * holds current tier information. * - * @param defaultParameter Default parameter. Leave the value as "default". + * @param defaultParameter Default parameter. Leave the value as default. * @param tier The parameters to provide for the quota tier resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -84,16 +65,15 @@ public interface QuotaTiersClient { * @return the quota tier information for the subscription along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String defaultParameter, QuotaTierInner tier, Context context); + Response createOrUpdateWithResponse(String defaultParameter, QuotaTierInner tier, Context context); /** - * Updates the Quota Tier resource for a subscription. The only properties that can be updated are - * "tierUpgradePolicy" + * Updates the Quota Tier resource for a subscription. * * Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It * holds current tier information. * - * @param defaultParameter Default parameter. Leave the value as "default". + * @param defaultParameter Default parameter. Leave the value as default. * @param tier The parameters to provide for the quota tier resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -101,15 +81,16 @@ public interface QuotaTiersClient { * @return the quota tier information for the subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - QuotaTierInner update(String defaultParameter, QuotaTierInner tier); + QuotaTierInner createOrUpdate(String defaultParameter, QuotaTierInner tier); /** - * Updates the Quota Tier resource for a subscription. + * Updates the Quota Tier resource for a subscription. The only properties that can be updated are + * "tierUpgradePolicy" * * Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It * holds current tier information. * - * @param defaultParameter Default parameter. Leave the value as "default". + * @param defaultParameter Default parameter. Leave the value as default. * @param tier The parameters to provide for the quota tier resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -118,15 +99,16 @@ public interface QuotaTiersClient { * @return the quota tier information for the subscription along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String defaultParameter, QuotaTierInner tier, Context context); + Response updateWithResponse(String defaultParameter, QuotaTierInner tier, Context context); /** - * Updates the Quota Tier resource for a subscription. + * Updates the Quota Tier resource for a subscription. The only properties that can be updated are + * "tierUpgradePolicy" * * Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It * holds current tier information. * - * @param defaultParameter Default parameter. Leave the value as "default". + * @param defaultParameter Default parameter. Leave the value as default. * @param tier The parameters to provide for the quota tier resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -134,5 +116,27 @@ public interface QuotaTiersClient { * @return the quota tier information for the subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - QuotaTierInner createOrUpdate(String defaultParameter, QuotaTierInner tier); + QuotaTierInner update(String defaultParameter, QuotaTierInner tier); + + /** + * Returns all the resources of a particular type belonging to a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Quota Tiers response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Returns all the resources of a particular type belonging to a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Quota Tiers response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiBlocklistItemsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiBlocklistItemsClient.java index 1840d5fdd038..4b265caf0566 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiBlocklistItemsClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiBlocklistItemsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent; @@ -20,38 +20,6 @@ * An instance of this class provides access to all the operations defined in RaiBlocklistItemsClient. */ public interface RaiBlocklistItemsClient { - /** - * Gets the blocklist items associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blocklist items associated with the custom blocklist as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, String raiBlocklistName); - - /** - * Gets the blocklist items associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blocklist items associated with the custom blocklist as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, String raiBlocklistName, - Context context); - /** * Gets the specified custom blocklist Item associated with the custom blocklist. * @@ -183,6 +151,38 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String void delete(String resourceGroupName, String accountName, String raiBlocklistName, String raiBlocklistItemName, Context context); + /** + * Gets the blocklist items associated with the custom blocklist. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blocklist items associated with the custom blocklist as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, String raiBlocklistName); + + /** + * Gets the blocklist items associated with the custom blocklist. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blocklist items associated with the custom blocklist as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, String raiBlocklistName, + Context context); + /** * Batch operation to add blocklist items. * @@ -231,7 +231,7 @@ RaiBlocklistInner batchAdd(String resourceGroupName, String accountName, String */ @ServiceMethod(returns = ReturnType.SINGLE) Response batchDeleteWithResponse(String resourceGroupName, String accountName, String raiBlocklistName, - Object raiBlocklistItemsNames, Context context); + List raiBlocklistItemsNames, Context context); /** * Batch operation to delete blocklist items. @@ -246,5 +246,5 @@ Response batchDeleteWithResponse(String resourceGroupName, String accountN */ @ServiceMethod(returns = ReturnType.SINGLE) void batchDelete(String resourceGroupName, String accountName, String raiBlocklistName, - Object raiBlocklistItemsNames); + List raiBlocklistItemsNames); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiBlocklistsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiBlocklistsClient.java index bc601f7c2055..ed1a4642c4e4 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiBlocklistsClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiBlocklistsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent; @@ -17,35 +17,6 @@ * An instance of this class provides access to all the operations defined in RaiBlocklistsClient. */ public interface RaiBlocklistsClient { - /** - * Gets the custom blocklists associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the custom blocklists associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Gets the custom blocklists associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the custom blocklists associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, Context context); - /** * Gets the specified custom blocklist associated with the Azure OpenAI account. * @@ -166,4 +137,33 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String accountName, String raiBlocklistName, Context context); + + /** + * Gets the custom blocklists associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom blocklists associated with the Azure OpenAI account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Gets the custom blocklists associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom blocklists associated with the Azure OpenAI account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiContentFiltersClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiContentFiltersClient.java index 80c045ee3e06..571e90f0d8dd 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiContentFiltersClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiContentFiltersClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent; @@ -16,54 +16,54 @@ */ public interface RaiContentFiltersClient { /** - * List Content Filters types. + * Get Content Filters by Name. * - * @param location Resource location. + * @param location The name of the Azure region. + * @param filterName The name of the RAI Content Filter. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Content Filters as paginated response with {@link PagedIterable}. + * @return content Filters by Name along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String location, String filterName, Context context); /** - * List Content Filters types. + * Get Content Filters by Name. * - * @param location Resource location. - * @param context The context to associate with this operation. + * @param location The name of the Azure region. + * @param filterName The name of the RAI Content Filter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Content Filters as paginated response with {@link PagedIterable}. + * @return content Filters by Name. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + RaiContentFilterInner get(String location, String filterName); /** - * Get Content Filters by Name. + * List Content Filters types. * - * @param location Resource location. - * @param filterName The name of the RAI Content Filter. - * @param context The context to associate with this operation. + * @param location The name of the Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return content Filters by Name along with {@link Response}. + * @return the list of Content Filters as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String location, String filterName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location); /** - * Get Content Filters by Name. + * List Content Filters types. * - * @param location Resource location. - * @param filterName The name of the RAI Content Filter. + * @param location The name of the Azure region. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return content Filters by Name. + * @return the list of Content Filters as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - RaiContentFilterInner get(String location, String filterName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, Context context); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiExternalSafetyProvidersClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiExternalSafetyProvidersClient.java new file mode 100644 index 000000000000..13a6f675b2aa --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiExternalSafetyProvidersClient.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderSchemaInner; + +/** + * An instance of this class provides access to all the operations defined in RaiExternalSafetyProvidersClient. + */ +public interface RaiExternalSafetyProvidersClient { + /** + * Gets the specified external safety provider associated with the Subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified external safety provider associated with the Subscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String safetyProviderName, Context context); + + /** + * Gets the specified external safety provider associated with the Subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified external safety provider associated with the Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RaiExternalSafetyProviderSchemaInner get(String safetyProviderName); + + /** + * Create the rai safety provider associated with the subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @param safetyProvider Properties describing the rai external safety provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services Rai External Safety provider Schema along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String safetyProviderName, + RaiExternalSafetyProviderSchemaInner safetyProvider, Context context); + + /** + * Create the rai safety provider associated with the subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @param safetyProvider Properties describing the rai external safety provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services Rai External Safety provider Schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProxyResource createOrUpdate(String safetyProviderName, RaiExternalSafetyProviderSchemaInner safetyProvider); + + /** + * Deletes the specified custom topic associated with the subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String safetyProviderName); + + /** + * Deletes the specified custom topic associated with the subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String safetyProviderName, Context context); + + /** + * Deletes the specified custom topic associated with the subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String safetyProviderName); + + /** + * Deletes the specified custom topic associated with the subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String safetyProviderName, Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiExternalSafetyProvidersOperationsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiExternalSafetyProvidersOperationsClient.java new file mode 100644 index 000000000000..b115f57125fb --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiExternalSafetyProvidersOperationsClient.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderSchemaInner; + +/** + * An instance of this class provides access to all the operations defined in + * RaiExternalSafetyProvidersOperationsClient. + */ +public interface RaiExternalSafetyProvidersOperationsClient { + /** + * Gets the safety providers associated with the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the safety providers associated with the subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Gets the safety providers associated with the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the safety providers associated with the subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiPoliciesClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiPoliciesClient.java index 6da6c893195b..d850bea71a3a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiPoliciesClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiPoliciesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent; @@ -17,35 +17,6 @@ * An instance of this class provides access to all the operations defined in RaiPoliciesClient. */ public interface RaiPoliciesClient { - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, Context context); - /** * Gets the specified Content Filters associated with the Azure OpenAI account. * @@ -165,4 +136,33 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String accountName, String raiPolicyName, Context context); + + /** + * Gets the content filters associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the content filters associated with the Azure OpenAI account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Gets the content filters associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the content filters associated with the Azure OpenAI account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiToolLabelsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiToolLabelsClient.java new file mode 100644 index 000000000000..8ed03ad13aab --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiToolLabelsClient.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiToolLabelInner; + +/** + * An instance of this class provides access to all the operations defined in RaiToolLabelsClient. + */ +public interface RaiToolLabelsClient { + /** + * Gets the specified RAI Tool Label associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiToolConnectionName The name of the Rai Tool Label. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified RAI Tool Label associated with the Azure OpenAI account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, + String raiToolConnectionName, Context context); + + /** + * Gets the specified RAI Tool Label associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiToolConnectionName The name of the Rai Tool Label. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified RAI Tool Label associated with the Azure OpenAI account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RaiToolLabelInner get(String resourceGroupName, String accountName, String raiToolConnectionName); + + /** + * Creates the RAI Tool Label associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiToolConnectionName The name of the Rai Tool Label. + * @param raiToolLabel Properties describing the RAI Tool Label. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services RAI Tool Label resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String accountName, + String raiToolConnectionName, RaiToolLabelInner raiToolLabel, Context context); + + /** + * Creates the RAI Tool Label associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiToolConnectionName The name of the Rai Tool Label. + * @param raiToolLabel Properties describing the RAI Tool Label. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services RAI Tool Label resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RaiToolLabelInner createOrUpdate(String resourceGroupName, String accountName, String raiToolConnectionName, + RaiToolLabelInner raiToolLabel); + + /** + * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiToolConnectionName The name of the Rai Tool Label. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String raiToolConnectionName); + + /** + * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiToolConnectionName The name of the Rai Tool Label. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String raiToolConnectionName, Context context); + + /** + * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiToolConnectionName The name of the Rai Tool Label. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String raiToolConnectionName); + + /** + * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiToolConnectionName The name of the Rai Tool Label. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String raiToolConnectionName, Context context); + + /** + * Lists all RAI Tool Labels associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Cognitive Services RAI Tool Labels as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Lists all RAI Tool Labels associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Cognitive Services RAI Tool Labels as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiTopicsClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiTopicsClient.java index b7f92d7dc351..c00cab6b710a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiTopicsClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiTopicsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ResourceProvidersClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ResourceProvidersClient.java index 63e85577aec3..f48ca445ca38 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ResourceProvidersClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ResourceProvidersClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent; @@ -22,8 +22,8 @@ public interface ResourceProvidersClient { /** * Check available SKUs. * - * @param location Resource location. - * @param parameters Check SKU Availability POST body. + * @param location The location name. + * @param parameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -37,8 +37,8 @@ Response checkSkuAvailabilityWithResponse(String /** * Check available SKUs. * - * @param location Resource location. - * @param parameters Check SKU Availability POST body. + * @param location The location name. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -50,7 +50,7 @@ Response checkSkuAvailabilityWithResponse(String /** * Check whether a domain is available. * - * @param parameters Check Domain Availability parameter. + * @param parameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -64,7 +64,7 @@ Response checkDomainAvailabilityWithResponse(CheckDomai /** * Check whether a domain is available. * - * @param parameters Check Domain Availability parameter. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -76,7 +76,7 @@ Response checkDomainAvailabilityWithResponse(CheckDomai /** * Model capacity calculator. * - * @param parameters Check Domain Availability parameter. + * @param parameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -90,7 +90,7 @@ Response checkDomainAvailabilityWithResponse(CheckDomai /** * Model capacity calculator. * - * @param parameters Check Domain Availability parameter. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ResourceSkusClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ResourceSkusClient.java index 3c98b0764195..c071140a4e84 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ResourceSkusClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ResourceSkusClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/SubscriptionRaiPoliciesClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/SubscriptionRaiPoliciesClient.java new file mode 100644 index 000000000000..89bb23f4ab15 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/SubscriptionRaiPoliciesClient.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiPolicyInner; + +/** + * An instance of this class provides access to all the operations defined in SubscriptionRaiPoliciesClient. + */ +public interface SubscriptionRaiPoliciesClient { + /** + * Gets the specified Content Filters associated with the Subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Content Filters associated with the Subscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String raiPolicyName, Context context); + + /** + * Gets the specified Content Filters associated with the Subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Content Filters associated with the Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RaiPolicyInner get(String raiPolicyName); + + /** + * Update the state of specified Content Filters associated with the subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @param raiPolicy Properties describing the Content Filters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services RaiPolicy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String raiPolicyName, RaiPolicyInner raiPolicy, + Context context); + + /** + * Update the state of specified Content Filters associated with the subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @param raiPolicy Properties describing the Content Filters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services RaiPolicy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RaiPolicyInner createOrUpdate(String raiPolicyName, RaiPolicyInner raiPolicy); + + /** + * Deletes the specified Content Filters associated with the subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String raiPolicyName); + + /** + * Deletes the specified Content Filters associated with the subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String raiPolicyName, Context context); + + /** + * Deletes the specified Content Filters associated with the subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String raiPolicyName); + + /** + * Deletes the specified Content Filters associated with the subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String raiPolicyName, Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/TestRaiExternalSafetyProvidersClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/TestRaiExternalSafetyProvidersClient.java new file mode 100644 index 000000000000..82c0a160933e --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/TestRaiExternalSafetyProvidersClient.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderSchemaInner; + +/** + * An instance of this class provides access to all the operations defined in TestRaiExternalSafetyProvidersClient. + */ +public interface TestRaiExternalSafetyProvidersClient { + /** + * Test the rai safety provider associated with the subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @param safetyProvider Properties describing the rai external safety provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services Rai External Safety provider Schema along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, + String accountName, String safetyProviderName, RaiExternalSafetyProviderSchemaInner safetyProvider, + Context context); + + /** + * Test the rai safety provider associated with the subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @param safetyProvider Properties describing the rai external safety provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services Rai External Safety provider Schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RaiExternalSafetyProviderSchemaInner createOrUpdate(String resourceGroupName, String accountName, + String safetyProviderName, RaiExternalSafetyProviderSchemaInner safetyProvider); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/UsagesClient.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/UsagesClient.java index f048be7c8be9..b864822815e6 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/UsagesClient.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/UsagesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent; @@ -8,7 +8,7 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.models.Usage; +import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageInner; /** * An instance of this class provides access to all the operations defined in UsagesClient. @@ -17,19 +17,19 @@ public interface UsagesClient { /** * Get usages for the requested subscription. * - * @param location Resource location. + * @param location The location name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return usages for the requested subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location); + PagedIterable list(String location); /** * Get usages for the requested subscription. * - * @param location Resource location. + * @param location The location name. * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is * name.value (name of the metric, can have an or of multiple names). * @param context The context to associate with this operation. @@ -39,5 +39,5 @@ public interface UsagesClient { * @return usages for the requested subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String location, String filter, Context context); + PagedIterable list(String location, String filter, Context context); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountInner.java index 57d6dee10655..7fb7a4e2834e 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountInner.java @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.cognitiveservices.models.AccountProperties; -import com.azure.resourcemanager.cognitiveservices.models.AzureEntityResource; import com.azure.resourcemanager.cognitiveservices.models.Identity; import com.azure.resourcemanager.cognitiveservices.models.Sku; import java.io.IOException; @@ -20,46 +20,46 @@ * Cognitive Services account is an Azure resource representing the provisioned account, it's type, location and SKU. */ @Fluent -public final class AccountInner extends AzureEntityResource { +public final class AccountInner extends ProxyResource { /* - * The Kind of the resource. + * Properties of Cognitive Services account. */ - private String kind; + private AccountProperties properties; /* - * The resource model definition representing SKU + * Resource tags. */ - private Sku sku; + private Map tags; /* - * Identity for the resource. + * The geo-location where the resource lives */ - private Identity identity; + private String location; /* - * Resource tags. + * Resource Etag. */ - private Map tags; + private String etag; /* - * The geo-location where the resource lives + * The kind (type) of cognitive service account. */ - private String location; + private String kind; /* - * Properties of Cognitive Services account. + * The resource model definition representing SKU */ - private AccountProperties properties; + private Sku sku; /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Identity for the resource. */ - private SystemData systemData; + private Identity identity; /* - * Resource Etag. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - private String etag; + private SystemData systemData; /* * The type of the resource. @@ -83,122 +83,131 @@ public AccountInner() { } /** - * Get the kind property: The Kind of the resource. + * Get the properties property: Properties of Cognitive Services account. * - * @return the kind value. + * @return the properties value. */ - public String kind() { - return this.kind; + public AccountProperties properties() { + return this.properties; } /** - * Set the kind property: The Kind of the resource. + * Set the properties property: Properties of Cognitive Services account. * - * @param kind the kind value to set. + * @param properties the properties value to set. * @return the AccountInner object itself. */ - public AccountInner withKind(String kind) { - this.kind = kind; + public AccountInner withProperties(AccountProperties properties) { + this.properties = properties; return this; } /** - * Get the sku property: The resource model definition representing SKU. + * Get the tags property: Resource tags. * - * @return the sku value. + * @return the tags value. */ - public Sku sku() { - return this.sku; + public Map tags() { + return this.tags; } /** - * Set the sku property: The resource model definition representing SKU. + * Set the tags property: Resource tags. * - * @param sku the sku value to set. + * @param tags the tags value to set. * @return the AccountInner object itself. */ - public AccountInner withSku(Sku sku) { - this.sku = sku; + public AccountInner withTags(Map tags) { + this.tags = tags; return this; } /** - * Get the identity property: Identity for the resource. + * Get the location property: The geo-location where the resource lives. * - * @return the identity value. + * @return the location value. */ - public Identity identity() { - return this.identity; + public String location() { + return this.location; } /** - * Set the identity property: Identity for the resource. + * Set the location property: The geo-location where the resource lives. * - * @param identity the identity value to set. + * @param location the location value to set. * @return the AccountInner object itself. */ - public AccountInner withIdentity(Identity identity) { - this.identity = identity; + public AccountInner withLocation(String location) { + this.location = location; return this; } /** - * Get the tags property: Resource tags. + * Get the etag property: Resource Etag. * - * @return the tags value. + * @return the etag value. */ - public Map tags() { - return this.tags; + public String etag() { + return this.etag; } /** - * Set the tags property: Resource tags. + * Get the kind property: The kind (type) of cognitive service account. * - * @param tags the tags value to set. + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Set the kind property: The kind (type) of cognitive service account. + * + * @param kind the kind value to set. * @return the AccountInner object itself. */ - public AccountInner withTags(Map tags) { - this.tags = tags; + public AccountInner withKind(String kind) { + this.kind = kind; return this; } /** - * Get the location property: The geo-location where the resource lives. + * Get the sku property: The resource model definition representing SKU. * - * @return the location value. + * @return the sku value. */ - public String location() { - return this.location; + public Sku sku() { + return this.sku; } /** - * Set the location property: The geo-location where the resource lives. + * Set the sku property: The resource model definition representing SKU. * - * @param location the location value to set. + * @param sku the sku value to set. * @return the AccountInner object itself. */ - public AccountInner withLocation(String location) { - this.location = location; + public AccountInner withSku(Sku sku) { + this.sku = sku; return this; } /** - * Get the properties property: Properties of Cognitive Services account. + * Get the identity property: Identity for the resource. * - * @return the properties value. + * @return the identity value. */ - public AccountProperties properties() { - return this.properties; + public Identity identity() { + return this.identity; } /** - * Set the properties property: Properties of Cognitive Services account. + * Set the identity property: Identity for the resource. * - * @param properties the properties value to set. + * @param identity the identity value to set. * @return the AccountInner object itself. */ - public AccountInner withProperties(AccountProperties properties) { - this.properties = properties; + public AccountInner withIdentity(Identity identity) { + this.identity = identity; return this; } @@ -207,21 +216,10 @@ public AccountInner withProperties(AccountProperties properties) { * * @return the systemData value. */ - @Override public SystemData systemData() { return this.systemData; } - /** - * Get the etag property: Resource Etag. - * - * @return the etag value. - */ - @Override - public String etag() { - return this.etag; - } - /** * Get the type property: The type of the resource. * @@ -252,36 +250,18 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (identity() != null) { - identity().validate(); - } - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); jsonWriter.writeStringField("kind", this.kind); jsonWriter.writeJsonField("sku", this.sku); jsonWriter.writeJsonField("identity", this.identity); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("location", this.location); - jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -307,23 +287,23 @@ public static AccountInner fromJson(JsonReader jsonReader) throws IOException { deserializedAccountInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedAccountInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAccountInner.properties = AccountProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAccountInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedAccountInner.location = reader.getString(); } else if ("etag".equals(fieldName)) { deserializedAccountInner.etag = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedAccountInner.systemData = SystemData.fromJson(reader); } else if ("kind".equals(fieldName)) { deserializedAccountInner.kind = reader.getString(); } else if ("sku".equals(fieldName)) { deserializedAccountInner.sku = Sku.fromJson(reader); } else if ("identity".equals(fieldName)) { deserializedAccountInner.identity = Identity.fromJson(reader); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedAccountInner.tags = tags; - } else if ("location".equals(fieldName)) { - deserializedAccountInner.location = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedAccountInner.properties = AccountProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAccountInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountModelInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountModelInner.java index 5e1c5391e1f3..8e65a7fd2535 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountModelInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountModelInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -22,7 +22,7 @@ /** * Cognitive Services account Model. */ -@Fluent +@Immutable public final class AccountModelInner extends DeploymentModel { /* * Properties of Cognitive Services account deployment model. @@ -87,7 +87,7 @@ public final class AccountModelInner extends DeploymentModel { /** * Creates an instance of AccountModelInner class. */ - public AccountModelInner() { + private AccountModelInner() { } /** @@ -99,17 +99,6 @@ public DeploymentModel baseModel() { return this.baseModel; } - /** - * Set the baseModel property: Properties of Cognitive Services account deployment model. - * - * @param baseModel the baseModel value to set. - * @return the AccountModelInner object itself. - */ - public AccountModelInner withBaseModel(DeploymentModel baseModel) { - this.baseModel = baseModel; - return this; - } - /** * Get the isDefaultVersion property: If the model is default version. * @@ -119,17 +108,6 @@ public Boolean isDefaultVersion() { return this.isDefaultVersion; } - /** - * Set the isDefaultVersion property: If the model is default version. - * - * @param isDefaultVersion the isDefaultVersion value to set. - * @return the AccountModelInner object itself. - */ - public AccountModelInner withIsDefaultVersion(Boolean isDefaultVersion) { - this.isDefaultVersion = isDefaultVersion; - return this; - } - /** * Get the skus property: The list of Model Sku. * @@ -139,17 +117,6 @@ public List skus() { return this.skus; } - /** - * Set the skus property: The list of Model Sku. - * - * @param skus the skus value to set. - * @return the AccountModelInner object itself. - */ - public AccountModelInner withSkus(List skus) { - this.skus = skus; - return this; - } - /** * Get the maxCapacity property: The max capacity. * @@ -159,17 +126,6 @@ public Integer maxCapacity() { return this.maxCapacity; } - /** - * Set the maxCapacity property: The max capacity. - * - * @param maxCapacity the maxCapacity value to set. - * @return the AccountModelInner object itself. - */ - public AccountModelInner withMaxCapacity(Integer maxCapacity) { - this.maxCapacity = maxCapacity; - return this; - } - /** * Get the capabilities property: The capabilities. * @@ -179,17 +135,6 @@ public Map capabilities() { return this.capabilities; } - /** - * Set the capabilities property: The capabilities. - * - * @param capabilities the capabilities value to set. - * @return the AccountModelInner object itself. - */ - public AccountModelInner withCapabilities(Map capabilities) { - this.capabilities = capabilities; - return this; - } - /** * Get the finetuneCapabilities property: The capabilities for finetune models. * @@ -199,17 +144,6 @@ public Map finetuneCapabilities() { return this.finetuneCapabilities; } - /** - * Set the finetuneCapabilities property: The capabilities for finetune models. - * - * @param finetuneCapabilities the finetuneCapabilities value to set. - * @return the AccountModelInner object itself. - */ - public AccountModelInner withFinetuneCapabilities(Map finetuneCapabilities) { - this.finetuneCapabilities = finetuneCapabilities; - return this; - } - /** * Get the deprecation property: Cognitive Services account ModelDeprecationInfo. * @@ -219,17 +153,6 @@ public ModelDeprecationInfo deprecation() { return this.deprecation; } - /** - * Set the deprecation property: Cognitive Services account ModelDeprecationInfo. - * - * @param deprecation the deprecation value to set. - * @return the AccountModelInner object itself. - */ - public AccountModelInner withDeprecation(ModelDeprecationInfo deprecation) { - this.deprecation = deprecation; - return this; - } - /** * Get the replacementConfig property: Configuration for model replacement. * @@ -239,17 +162,6 @@ public ReplacementConfig replacementConfig() { return this.replacementConfig; } - /** - * Set the replacementConfig property: Configuration for model replacement. - * - * @param replacementConfig the replacementConfig value to set. - * @return the AccountModelInner object itself. - */ - public AccountModelInner withReplacementConfig(ReplacementConfig replacementConfig) { - this.replacementConfig = replacementConfig; - return this; - } - /** * Get the modelCatalogAssetId property: Asset identifier for the model in the model catalog. * @@ -259,17 +171,6 @@ public String modelCatalogAssetId() { return this.modelCatalogAssetId; } - /** - * Set the modelCatalogAssetId property: Asset identifier for the model in the model catalog. - * - * @param modelCatalogAssetId the modelCatalogAssetId value to set. - * @return the AccountModelInner object itself. - */ - public AccountModelInner withModelCatalogAssetId(String modelCatalogAssetId) { - this.modelCatalogAssetId = modelCatalogAssetId; - return this; - } - /** * Get the lifecycleStatus property: Model lifecycle status. * @@ -279,17 +180,6 @@ public ModelLifecycleStatus lifecycleStatus() { return this.lifecycleStatus; } - /** - * Set the lifecycleStatus property: Model lifecycle status. - * - * @param lifecycleStatus the lifecycleStatus value to set. - * @return the AccountModelInner object itself. - */ - public AccountModelInner withLifecycleStatus(ModelLifecycleStatus lifecycleStatus) { - this.lifecycleStatus = lifecycleStatus; - return this; - } - /** * Get the systemData property: Metadata pertaining to creation and last modification of the resource. * @@ -309,84 +199,6 @@ public CallRateLimit callRateLimit() { return this.callRateLimit; } - /** - * {@inheritDoc} - */ - @Override - public AccountModelInner withPublisher(String publisher) { - super.withPublisher(publisher); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AccountModelInner withFormat(String format) { - super.withFormat(format); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AccountModelInner withName(String name) { - super.withName(name); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AccountModelInner withVersion(String version) { - super.withVersion(version); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AccountModelInner withSource(String source) { - super.withSource(source); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public AccountModelInner withSourceAccount(String sourceAccount) { - super.withSourceAccount(sourceAccount); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (baseModel() != null) { - baseModel().validate(); - } - if (skus() != null) { - skus().forEach(e -> e.validate()); - } - if (deprecation() != null) { - deprecation().validate(); - } - if (replacementConfig() != null) { - replacementConfig().validate(); - } - if (callRateLimit() != null) { - callRateLimit().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountSkuListResultInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountSkuListResultInner.java index 21a61ea40ba4..cdaaa98777a3 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountSkuListResultInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountSkuListResultInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The list of cognitive services accounts operation response. */ -@Fluent +@Immutable public final class AccountSkuListResultInner implements JsonSerializable { /* * Gets the list of Cognitive Services accounts and their properties. @@ -26,7 +26,7 @@ public final class AccountSkuListResultInner implements JsonSerializable value() { return this.value; } - /** - * Set the value property: Gets the list of Cognitive Services accounts and their properties. - * - * @param value the value value to set. - * @return the AccountSkuListResultInner object itself. - */ - public AccountSkuListResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AgentApplicationInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AgentApplicationInner.java new file mode 100644 index 000000000000..4fa0de73bf6f --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AgentApplicationInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cognitiveservices.models.AgenticApplicationProperties; +import java.io.IOException; + +/** + * Agent Application resource. + */ +@Fluent +public final class AgentApplicationInner extends ProxyResource { + /* + * [Required] Additional attributes of the entity. + */ + private AgenticApplicationProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of AgentApplicationInner class. + */ + public AgentApplicationInner() { + } + + /** + * Get the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + public AgenticApplicationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: [Required] Additional attributes of the entity. + * + * @param properties the properties value to set. + * @return the AgentApplicationInner object itself. + */ + public AgentApplicationInner withProperties(AgenticApplicationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentApplicationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentApplicationInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AgentApplicationInner. + */ + public static AgentApplicationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentApplicationInner deserializedAgentApplicationInner = new AgentApplicationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAgentApplicationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAgentApplicationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAgentApplicationInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAgentApplicationInner.properties = AgenticApplicationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAgentApplicationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAgentApplicationInner; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AgentDeploymentInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AgentDeploymentInner.java new file mode 100644 index 000000000000..04b0639f6b43 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AgentDeploymentInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cognitiveservices.models.AgentDeploymentProperties; +import java.io.IOException; + +/** + * Agent Deployment resource. + */ +@Fluent +public final class AgentDeploymentInner extends ProxyResource { + /* + * [Required] Additional attributes of the entity. + */ + private AgentDeploymentProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of AgentDeploymentInner class. + */ + public AgentDeploymentInner() { + } + + /** + * Get the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + public AgentDeploymentProperties properties() { + return this.properties; + } + + /** + * Set the properties property: [Required] Additional attributes of the entity. + * + * @param properties the properties value to set. + * @return the AgentDeploymentInner object itself. + */ + public AgentDeploymentInner withProperties(AgentDeploymentProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentDeploymentInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentDeploymentInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AgentDeploymentInner. + */ + public static AgentDeploymentInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentDeploymentInner deserializedAgentDeploymentInner = new AgentDeploymentInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAgentDeploymentInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAgentDeploymentInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAgentDeploymentInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAgentDeploymentInner.properties = AgentDeploymentProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAgentDeploymentInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAgentDeploymentInner; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AgentReferenceResourceArmPaginatedResultInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AgentReferenceResourceArmPaginatedResultInner.java new file mode 100644 index 000000000000..112f4f610bcc --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AgentReferenceResourceArmPaginatedResultInner.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cognitiveservices.models.AgentReference; +import java.io.IOException; +import java.util.List; + +/** + * A paginated list of Agent Reference entities. + */ +@Immutable +public final class AgentReferenceResourceArmPaginatedResultInner + implements JsonSerializable { + /* + * The link to the next page of Agent Reference objects. If null, there are no additional pages. + */ + private String nextLink; + + /* + * An array of objects of type Agent Reference. + */ + private List value; + + /** + * Creates an instance of AgentReferenceResourceArmPaginatedResultInner class. + */ + private AgentReferenceResourceArmPaginatedResultInner() { + } + + /** + * Get the nextLink property: The link to the next page of Agent Reference objects. If null, there are no additional + * pages. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: An array of objects of type Agent Reference. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentReferenceResourceArmPaginatedResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentReferenceResourceArmPaginatedResultInner if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AgentReferenceResourceArmPaginatedResultInner. + */ + public static AgentReferenceResourceArmPaginatedResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentReferenceResourceArmPaginatedResultInner deserializedAgentReferenceResourceArmPaginatedResultInner + = new AgentReferenceResourceArmPaginatedResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedAgentReferenceResourceArmPaginatedResultInner.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> AgentReference.fromJson(reader1)); + deserializedAgentReferenceResourceArmPaginatedResultInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedAgentReferenceResourceArmPaginatedResultInner; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ApiKeysInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ApiKeysInner.java index 1b63b051c5d5..816274b98909 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ApiKeysInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ApiKeysInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * The access keys for the cognitive services account. */ -@Fluent +@Immutable public final class ApiKeysInner implements JsonSerializable { /* * Gets the value of key 1. @@ -29,7 +29,7 @@ public final class ApiKeysInner implements JsonSerializable { /** * Creates an instance of ApiKeysInner class. */ - public ApiKeysInner() { + private ApiKeysInner() { } /** @@ -41,17 +41,6 @@ public String key1() { return this.key1; } - /** - * Set the key1 property: Gets the value of key 1. - * - * @param key1 the key1 value to set. - * @return the ApiKeysInner object itself. - */ - public ApiKeysInner withKey1(String key1) { - this.key1 = key1; - return this; - } - /** * Get the key2 property: Gets the value of key 2. * @@ -61,25 +50,6 @@ public String key2() { return this.key2; } - /** - * Set the key2 property: Gets the value of key 2. - * - * @param key2 the key2 value to set. - * @return the ApiKeysInner object itself. - */ - public ApiKeysInner withKey2(String key2) { - this.key2 = key2; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CalculateModelCapacityResultInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CalculateModelCapacityResultInner.java index 17bf7358025c..52cac0416dfa 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CalculateModelCapacityResultInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CalculateModelCapacityResultInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * Calculate Model Capacity result. */ -@Fluent +@Immutable public final class CalculateModelCapacityResultInner implements JsonSerializable { /* * Properties of Cognitive Services account deployment model. @@ -36,7 +36,7 @@ public final class CalculateModelCapacityResultInner implements JsonSerializable /** * Creates an instance of CalculateModelCapacityResultInner class. */ - public CalculateModelCapacityResultInner() { + private CalculateModelCapacityResultInner() { } /** @@ -48,17 +48,6 @@ public DeploymentModel model() { return this.model; } - /** - * Set the model property: Properties of Cognitive Services account deployment model. - * - * @param model the model value to set. - * @return the CalculateModelCapacityResultInner object itself. - */ - public CalculateModelCapacityResultInner withModel(DeploymentModel model) { - this.model = model; - return this; - } - /** * Get the skuName property: The skuName property. * @@ -68,17 +57,6 @@ public String skuName() { return this.skuName; } - /** - * Set the skuName property: The skuName property. - * - * @param skuName the skuName value to set. - * @return the CalculateModelCapacityResultInner object itself. - */ - public CalculateModelCapacityResultInner withSkuName(String skuName) { - this.skuName = skuName; - return this; - } - /** * Get the estimatedCapacity property: Model Estimated Capacity. * @@ -88,32 +66,6 @@ public CalculateModelCapacityResultEstimatedCapacity estimatedCapacity() { return this.estimatedCapacity; } - /** - * Set the estimatedCapacity property: Model Estimated Capacity. - * - * @param estimatedCapacity the estimatedCapacity value to set. - * @return the CalculateModelCapacityResultInner object itself. - */ - public CalculateModelCapacityResultInner - withEstimatedCapacity(CalculateModelCapacityResultEstimatedCapacity estimatedCapacity) { - this.estimatedCapacity = estimatedCapacity; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (model() != null) { - model().validate(); - } - if (estimatedCapacity() != null) { - estimatedCapacity().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CapabilityHostInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CapabilityHostInner.java index b8b1d42c82bf..79f87625dd23 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CapabilityHostInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CapabilityHostInner.java @@ -1,13 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -109,22 +108,6 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property properties in model CapabilityHostInner")); - } else { - properties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(CapabilityHostInner.class); - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanAccountAssociationInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanAccountAssociationInner.java index 3c465a6bfb42..4ad40dc4a856 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanAccountAssociationInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanAccountAssociationInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; @@ -18,6 +18,11 @@ */ @Fluent public final class CommitmentPlanAccountAssociationInner extends ProxyResource { + /* + * Properties of Cognitive Services account commitment plan association. + */ + private CommitmentPlanAccountAssociationProperties innerProperties; + /* * Resource Etag. */ @@ -28,11 +33,6 @@ public final class CommitmentPlanAccountAssociationInner extends ProxyResource { */ private Map tags; - /* - * Properties of Cognitive Services account commitment plan association. - */ - private CommitmentPlanAccountAssociationProperties innerProperties; - /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @@ -59,6 +59,15 @@ public final class CommitmentPlanAccountAssociationInner extends ProxyResource { public CommitmentPlanAccountAssociationInner() { } + /** + * Get the innerProperties property: Properties of Cognitive Services account commitment plan association. + * + * @return the innerProperties value. + */ + private CommitmentPlanAccountAssociationProperties innerProperties() { + return this.innerProperties; + } + /** * Get the etag property: Resource Etag. * @@ -88,15 +97,6 @@ public CommitmentPlanAccountAssociationInner withTags(Map tags) return this; } - /** - * Get the innerProperties property: Properties of Cognitive Services account commitment plan association. - * - * @return the innerProperties value. - */ - private CommitmentPlanAccountAssociationProperties innerProperties() { - return this.innerProperties; - } - /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -159,25 +159,14 @@ public CommitmentPlanAccountAssociationInner withAccountId(String accountId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -204,14 +193,14 @@ public static CommitmentPlanAccountAssociationInner fromJson(JsonReader jsonRead deserializedCommitmentPlanAccountAssociationInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedCommitmentPlanAccountAssociationInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedCommitmentPlanAccountAssociationInner.innerProperties + = CommitmentPlanAccountAssociationProperties.fromJson(reader); } else if ("etag".equals(fieldName)) { deserializedCommitmentPlanAccountAssociationInner.etag = reader.getString(); } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedCommitmentPlanAccountAssociationInner.tags = tags; - } else if ("properties".equals(fieldName)) { - deserializedCommitmentPlanAccountAssociationInner.innerProperties - = CommitmentPlanAccountAssociationProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedCommitmentPlanAccountAssociationInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanAccountAssociationProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanAccountAssociationProperties.java index 51ae6c480784..ea9bd4bdfadd 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanAccountAssociationProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanAccountAssociationProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; @@ -48,14 +48,6 @@ public CommitmentPlanAccountAssociationProperties withAccountId(String accountId return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanInner.java index 5924e0afef17..e69b3ab758cd 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; @@ -21,34 +21,34 @@ @Fluent public final class CommitmentPlanInner extends ProxyResource { /* - * Resource Etag. + * Properties of Cognitive Services account commitment plan. */ - private String etag; + private CommitmentPlanProperties properties; /* - * The Kind of the resource. + * Resource tags. */ - private String kind; + private Map tags; /* - * The resource model definition representing SKU + * The geo-location where the resource lives */ - private Sku sku; + private String location; /* - * Resource tags. + * Resource Etag. */ - private Map tags; + private String etag; /* - * The geo-location where the resource lives + * The kind (type) of cognitive service account. */ - private String location; + private String kind; /* - * Properties of Cognitive Services account commitment plan. + * The resource model definition representing SKU */ - private CommitmentPlanProperties properties; + private Sku sku; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -77,51 +77,22 @@ public CommitmentPlanInner() { } /** - * Get the etag property: Resource Etag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the kind property: The Kind of the resource. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Set the kind property: The Kind of the resource. - * - * @param kind the kind value to set. - * @return the CommitmentPlanInner object itself. - */ - public CommitmentPlanInner withKind(String kind) { - this.kind = kind; - return this; - } - - /** - * Get the sku property: The resource model definition representing SKU. + * Get the properties property: Properties of Cognitive Services account commitment plan. * - * @return the sku value. + * @return the properties value. */ - public Sku sku() { - return this.sku; + public CommitmentPlanProperties properties() { + return this.properties; } /** - * Set the sku property: The resource model definition representing SKU. + * Set the properties property: Properties of Cognitive Services account commitment plan. * - * @param sku the sku value to set. + * @param properties the properties value to set. * @return the CommitmentPlanInner object itself. */ - public CommitmentPlanInner withSku(Sku sku) { - this.sku = sku; + public CommitmentPlanInner withProperties(CommitmentPlanProperties properties) { + this.properties = properties; return this; } @@ -166,22 +137,51 @@ public CommitmentPlanInner withLocation(String location) { } /** - * Get the properties property: Properties of Cognitive Services account commitment plan. + * Get the etag property: Resource Etag. * - * @return the properties value. + * @return the etag value. */ - public CommitmentPlanProperties properties() { - return this.properties; + public String etag() { + return this.etag; } /** - * Set the properties property: Properties of Cognitive Services account commitment plan. + * Get the kind property: The kind (type) of cognitive service account. * - * @param properties the properties value to set. + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Set the kind property: The kind (type) of cognitive service account. + * + * @param kind the kind value to set. * @return the CommitmentPlanInner object itself. */ - public CommitmentPlanInner withProperties(CommitmentPlanProperties properties) { - this.properties = properties; + public CommitmentPlanInner withKind(String kind) { + this.kind = kind; + return this; + } + + /** + * Get the sku property: The resource model definition representing SKU. + * + * @return the sku value. + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the sku property: The resource model definition representing SKU. + * + * @param sku the sku value to set. + * @return the CommitmentPlanInner object itself. + */ + public CommitmentPlanInner withSku(Sku sku) { + this.sku = sku; return this; } @@ -224,31 +224,17 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("kind", this.kind); - jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeJsonField("properties", this.properties); jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); jsonWriter.writeStringField("location", this.location); - jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeStringField("kind", this.kind); + jsonWriter.writeJsonField("sku", this.sku); return jsonWriter.writeEndObject(); } @@ -274,19 +260,19 @@ public static CommitmentPlanInner fromJson(JsonReader jsonReader) throws IOExcep deserializedCommitmentPlanInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedCommitmentPlanInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedCommitmentPlanInner.properties = CommitmentPlanProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCommitmentPlanInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedCommitmentPlanInner.location = reader.getString(); } else if ("etag".equals(fieldName)) { deserializedCommitmentPlanInner.etag = reader.getString(); } else if ("kind".equals(fieldName)) { deserializedCommitmentPlanInner.kind = reader.getString(); } else if ("sku".equals(fieldName)) { deserializedCommitmentPlanInner.sku = Sku.fromJson(reader); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedCommitmentPlanInner.tags = tags; - } else if ("location".equals(fieldName)) { - deserializedCommitmentPlanInner.location = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedCommitmentPlanInner.properties = CommitmentPlanProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedCommitmentPlanInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentTierInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentTierInner.java index d1d6a0a60c10..a1684b3ee5d3 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentTierInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentTierInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,10 +17,10 @@ /** * Cognitive Services account commitment tier. */ -@Fluent +@Immutable public final class CommitmentTierInner implements JsonSerializable { /* - * The Kind of the resource. + * The kind (type) of cognitive service account. */ private String kind; @@ -62,11 +62,11 @@ public final class CommitmentTierInner implements JsonSerializable { + ComputeOperationStatusInner deserializedComputeOperationStatusInner = new ComputeOperationStatusInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedComputeOperationStatusInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedComputeOperationStatusInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedComputeOperationStatusInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedComputeOperationStatusInner.properties + = ComputeOperationStatusProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedComputeOperationStatusInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedComputeOperationStatusInner; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ConnectionPropertiesV2BasicResourceInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ConnectionPropertiesV2BasicResourceInner.java index dfa65646681c..62673b7c6fb6 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ConnectionPropertiesV2BasicResourceInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ConnectionPropertiesV2BasicResourceInner.java @@ -1,13 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -109,23 +108,6 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property properties in model ConnectionPropertiesV2BasicResourceInner")); - } else { - properties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ConnectionPropertiesV2BasicResourceInner.class); - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DefenderForAISettingInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DefenderForAISettingInner.java index 6f67d711ee20..a7ae1b622d74 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DefenderForAISettingInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DefenderForAISettingInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; @@ -19,6 +19,11 @@ */ @Fluent public final class DefenderForAISettingInner extends ProxyResource { + /* + * The Defender for AI resource properties. + */ + private DefenderForAISettingProperties innerProperties; + /* * Resource Etag. */ @@ -29,11 +34,6 @@ public final class DefenderForAISettingInner extends ProxyResource { */ private Map tags; - /* - * The Defender for AI resource properties. - */ - private DefenderForAISettingProperties innerProperties; - /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @@ -60,6 +60,15 @@ public final class DefenderForAISettingInner extends ProxyResource { public DefenderForAISettingInner() { } + /** + * Get the innerProperties property: The Defender for AI resource properties. + * + * @return the innerProperties value. + */ + private DefenderForAISettingProperties innerProperties() { + return this.innerProperties; + } + /** * Get the etag property: Resource Etag. * @@ -89,15 +98,6 @@ public DefenderForAISettingInner withTags(Map tags) { return this; } - /** - * Get the innerProperties property: The Defender for AI resource properties. - * - * @return the innerProperties value. - */ - private DefenderForAISettingProperties innerProperties() { - return this.innerProperties; - } - /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -160,25 +160,14 @@ public DefenderForAISettingInner withState(DefenderForAISettingState state) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -204,14 +193,14 @@ public static DefenderForAISettingInner fromJson(JsonReader jsonReader) throws I deserializedDefenderForAISettingInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedDefenderForAISettingInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDefenderForAISettingInner.innerProperties + = DefenderForAISettingProperties.fromJson(reader); } else if ("etag".equals(fieldName)) { deserializedDefenderForAISettingInner.etag = reader.getString(); } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedDefenderForAISettingInner.tags = tags; - } else if ("properties".equals(fieldName)) { - deserializedDefenderForAISettingInner.innerProperties - = DefenderForAISettingProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedDefenderForAISettingInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DefenderForAISettingProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DefenderForAISettingProperties.java index af5874f09d64..08a7ffc7c2db 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DefenderForAISettingProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DefenderForAISettingProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; @@ -48,14 +48,6 @@ public DefenderForAISettingProperties withState(DefenderForAISettingState state) return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DeploymentInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DeploymentInner.java index 5d66d008f15b..651a5a5a634d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DeploymentInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DeploymentInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; @@ -20,6 +20,11 @@ */ @Fluent public final class DeploymentInner extends ProxyResource { + /* + * Properties of Cognitive Services account deployment. + */ + private DeploymentProperties properties; + /* * The resource model definition representing SKU */ @@ -35,11 +40,6 @@ public final class DeploymentInner extends ProxyResource { */ private Map tags; - /* - * Properties of Cognitive Services account deployment. - */ - private DeploymentProperties properties; - /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @@ -66,6 +66,26 @@ public final class DeploymentInner extends ProxyResource { public DeploymentInner() { } + /** + * Get the properties property: Properties of Cognitive Services account deployment. + * + * @return the properties value. + */ + public DeploymentProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of Cognitive Services account deployment. + * + * @param properties the properties value to set. + * @return the DeploymentInner object itself. + */ + public DeploymentInner withProperties(DeploymentProperties properties) { + this.properties = properties; + return this; + } + /** * Get the sku property: The resource model definition representing SKU. * @@ -115,26 +135,6 @@ public DeploymentInner withTags(Map tags) { return this; } - /** - * Get the properties property: Properties of Cognitive Services account deployment. - * - * @return the properties value. - */ - public DeploymentProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of Cognitive Services account deployment. - * - * @param properties the properties value to set. - * @return the DeploymentInner object itself. - */ - public DeploymentInner withProperties(DeploymentProperties properties) { - this.properties = properties; - return this; - } - /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -174,29 +174,15 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); jsonWriter.writeJsonField("sku", this.sku); jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -222,6 +208,8 @@ public static DeploymentInner fromJson(JsonReader jsonReader) throws IOException deserializedDeploymentInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedDeploymentInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDeploymentInner.properties = DeploymentProperties.fromJson(reader); } else if ("sku".equals(fieldName)) { deserializedDeploymentInner.sku = Sku.fromJson(reader); } else if ("etag".equals(fieldName)) { @@ -229,8 +217,6 @@ public static DeploymentInner fromJson(JsonReader jsonReader) throws IOException } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedDeploymentInner.tags = tags; - } else if ("properties".equals(fieldName)) { - deserializedDeploymentInner.properties = DeploymentProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedDeploymentInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DomainAvailabilityInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DomainAvailabilityInner.java index b0114fe5a54c..3b87aa821c4a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DomainAvailabilityInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DomainAvailabilityInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Domain availability. */ -@Fluent +@Immutable public final class DomainAvailabilityInner implements JsonSerializable { /* * Indicates the given SKU is available or not. @@ -37,14 +37,14 @@ public final class DomainAvailabilityInner implements JsonSerializable tags; - /* - * Properties of Cognitive Services EncryptionScope. - */ - private EncryptionScopeProperties properties; - /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @@ -60,6 +60,26 @@ public final class EncryptionScopeInner extends ProxyResource { public EncryptionScopeInner() { } + /** + * Get the properties property: Properties of Cognitive Services EncryptionScope. + * + * @return the properties value. + */ + public EncryptionScopeProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of Cognitive Services EncryptionScope. + * + * @param properties the properties value to set. + * @return the EncryptionScopeInner object itself. + */ + public EncryptionScopeInner withProperties(EncryptionScopeProperties properties) { + this.properties = properties; + return this; + } + /** * Get the etag property: Resource Etag. * @@ -89,26 +109,6 @@ public EncryptionScopeInner withTags(Map tags) { return this; } - /** - * Get the properties property: Properties of Cognitive Services EncryptionScope. - * - * @return the properties value. - */ - public EncryptionScopeProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of Cognitive Services EncryptionScope. - * - * @param properties the properties value to set. - * @return the EncryptionScopeInner object itself. - */ - public EncryptionScopeInner withProperties(EncryptionScopeProperties properties) { - this.properties = properties; - return this; - } - /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -148,25 +148,14 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -192,13 +181,13 @@ public static EncryptionScopeInner fromJson(JsonReader jsonReader) throws IOExce deserializedEncryptionScopeInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedEncryptionScopeInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedEncryptionScopeInner.properties = EncryptionScopeProperties.fromJson(reader); } else if ("etag".equals(fieldName)) { deserializedEncryptionScopeInner.etag = reader.getString(); } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedEncryptionScopeInner.tags = tags; - } else if ("properties".equals(fieldName)) { - deserializedEncryptionScopeInner.properties = EncryptionScopeProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedEncryptionScopeInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkProvisionStatusInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkProvisionStatusInner.java new file mode 100644 index 000000000000..fc94b09913b5 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkProvisionStatusInner.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkStatus; +import java.io.IOException; + +/** + * Status of the Provisioning for the managed network of a cognitive services account. + */ +@Fluent +public final class ManagedNetworkProvisionStatusInner implements JsonSerializable { + /* + * Status for the managed network of a cognitive services account. + */ + private ManagedNetworkStatus status; + + /** + * Creates an instance of ManagedNetworkProvisionStatusInner class. + */ + public ManagedNetworkProvisionStatusInner() { + } + + /** + * Get the status property: Status for the managed network of a cognitive services account. + * + * @return the status value. + */ + public ManagedNetworkStatus status() { + return this.status; + } + + /** + * Set the status property: Status for the managed network of a cognitive services account. + * + * @param status the status value to set. + * @return the ManagedNetworkProvisionStatusInner object itself. + */ + public ManagedNetworkProvisionStatusInner withStatus(ManagedNetworkStatus status) { + this.status = status; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedNetworkProvisionStatusInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedNetworkProvisionStatusInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedNetworkProvisionStatusInner. + */ + public static ManagedNetworkProvisionStatusInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedNetworkProvisionStatusInner deserializedManagedNetworkProvisionStatusInner + = new ManagedNetworkProvisionStatusInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedManagedNetworkProvisionStatusInner.status + = ManagedNetworkStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedNetworkProvisionStatusInner; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkSettingsBasicResourceInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkSettingsBasicResourceInner.java new file mode 100644 index 000000000000..5467f8ef3ef3 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkSettingsBasicResourceInner.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ManagedNetworkSettingsBasicResource model. + */ +@Fluent +public final class ManagedNetworkSettingsBasicResourceInner extends ProxyResource { + /* + * Managed Network settings for a cognitive services account. + */ + private ManagedNetworkSettingsInner properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ManagedNetworkSettingsBasicResourceInner class. + */ + public ManagedNetworkSettingsBasicResourceInner() { + } + + /** + * Get the properties property: Managed Network settings for a cognitive services account. + * + * @return the properties value. + */ + public ManagedNetworkSettingsInner properties() { + return this.properties; + } + + /** + * Set the properties property: Managed Network settings for a cognitive services account. + * + * @param properties the properties value to set. + * @return the ManagedNetworkSettingsBasicResourceInner object itself. + */ + public ManagedNetworkSettingsBasicResourceInner withProperties(ManagedNetworkSettingsInner properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedNetworkSettingsBasicResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedNetworkSettingsBasicResourceInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedNetworkSettingsBasicResourceInner. + */ + public static ManagedNetworkSettingsBasicResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedNetworkSettingsBasicResourceInner deserializedManagedNetworkSettingsBasicResourceInner + = new ManagedNetworkSettingsBasicResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedManagedNetworkSettingsBasicResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedManagedNetworkSettingsBasicResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedManagedNetworkSettingsBasicResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedManagedNetworkSettingsBasicResourceInner.properties + = ManagedNetworkSettingsInner.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedManagedNetworkSettingsBasicResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedNetworkSettingsBasicResourceInner; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkSettingsInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkSettingsInner.java new file mode 100644 index 000000000000..b030f2bdf17d --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkSettingsInner.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cognitiveservices.models.FirewallSku; +import com.azure.resourcemanager.cognitiveservices.models.IsolationMode; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkKind; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkProvisioningState; +import com.azure.resourcemanager.cognitiveservices.models.OutboundRule; +import java.io.IOException; +import java.util.Map; + +/** + * Managed Network settings for a cognitive services account. + */ +@Fluent +public class ManagedNetworkSettingsInner implements JsonSerializable { + /* + * Isolation mode for the managed network of a cognitive services account. + */ + private IsolationMode isolationMode; + + /* + * The networkId property. + */ + private String networkId; + + /* + * Dictionary of + */ + private Map outboundRules; + + /* + * Status of the Provisioning for the managed network of a cognitive services account. + */ + private ManagedNetworkProvisionStatusInner status; + + /* + * Firewall Sku used for FQDN Rules + */ + private FirewallSku firewallSku; + + /* + * The Kind of the managed network. Users can switch from V1 to V2 for granular access controls, but cannot switch + * back to V1 once V2 is enabled. + */ + private ManagedNetworkKind managedNetworkKind; + + /* + * Public IP address assigned to the Azure Firewall. + */ + private String firewallPublicIpAddress; + + /* + * The provisioning state of the managed network settings. + */ + private ManagedNetworkProvisioningState provisioningState; + + /** + * Creates an instance of ManagedNetworkSettingsInner class. + */ + public ManagedNetworkSettingsInner() { + } + + /** + * Get the isolationMode property: Isolation mode for the managed network of a cognitive services account. + * + * @return the isolationMode value. + */ + public IsolationMode isolationMode() { + return this.isolationMode; + } + + /** + * Set the isolationMode property: Isolation mode for the managed network of a cognitive services account. + * + * @param isolationMode the isolationMode value to set. + * @return the ManagedNetworkSettingsInner object itself. + */ + public ManagedNetworkSettingsInner withIsolationMode(IsolationMode isolationMode) { + this.isolationMode = isolationMode; + return this; + } + + /** + * Get the networkId property: The networkId property. + * + * @return the networkId value. + */ + public String networkId() { + return this.networkId; + } + + /** + * Set the networkId property: The networkId property. + * + * @param networkId the networkId value to set. + * @return the ManagedNetworkSettingsInner object itself. + */ + ManagedNetworkSettingsInner withNetworkId(String networkId) { + this.networkId = networkId; + return this; + } + + /** + * Get the outboundRules property: Dictionary of <OutboundRule>. + * + * @return the outboundRules value. + */ + public Map outboundRules() { + return this.outboundRules; + } + + /** + * Set the outboundRules property: Dictionary of <OutboundRule>. + * + * @param outboundRules the outboundRules value to set. + * @return the ManagedNetworkSettingsInner object itself. + */ + public ManagedNetworkSettingsInner withOutboundRules(Map outboundRules) { + this.outboundRules = outboundRules; + return this; + } + + /** + * Get the status property: Status of the Provisioning for the managed network of a cognitive services account. + * + * @return the status value. + */ + public ManagedNetworkProvisionStatusInner status() { + return this.status; + } + + /** + * Set the status property: Status of the Provisioning for the managed network of a cognitive services account. + * + * @param status the status value to set. + * @return the ManagedNetworkSettingsInner object itself. + */ + public ManagedNetworkSettingsInner withStatus(ManagedNetworkProvisionStatusInner status) { + this.status = status; + return this; + } + + /** + * Get the firewallSku property: Firewall Sku used for FQDN Rules. + * + * @return the firewallSku value. + */ + public FirewallSku firewallSku() { + return this.firewallSku; + } + + /** + * Set the firewallSku property: Firewall Sku used for FQDN Rules. + * + * @param firewallSku the firewallSku value to set. + * @return the ManagedNetworkSettingsInner object itself. + */ + public ManagedNetworkSettingsInner withFirewallSku(FirewallSku firewallSku) { + this.firewallSku = firewallSku; + return this; + } + + /** + * Get the managedNetworkKind property: The Kind of the managed network. Users can switch from V1 to V2 for granular + * access controls, but cannot switch back to V1 once V2 is enabled. + * + * @return the managedNetworkKind value. + */ + public ManagedNetworkKind managedNetworkKind() { + return this.managedNetworkKind; + } + + /** + * Set the managedNetworkKind property: The Kind of the managed network. Users can switch from V1 to V2 for granular + * access controls, but cannot switch back to V1 once V2 is enabled. + * + * @param managedNetworkKind the managedNetworkKind value to set. + * @return the ManagedNetworkSettingsInner object itself. + */ + public ManagedNetworkSettingsInner withManagedNetworkKind(ManagedNetworkKind managedNetworkKind) { + this.managedNetworkKind = managedNetworkKind; + return this; + } + + /** + * Get the firewallPublicIpAddress property: Public IP address assigned to the Azure Firewall. + * + * @return the firewallPublicIpAddress value. + */ + public String firewallPublicIpAddress() { + return this.firewallPublicIpAddress; + } + + /** + * Set the firewallPublicIpAddress property: Public IP address assigned to the Azure Firewall. + * + * @param firewallPublicIpAddress the firewallPublicIpAddress value to set. + * @return the ManagedNetworkSettingsInner object itself. + */ + ManagedNetworkSettingsInner withFirewallPublicIpAddress(String firewallPublicIpAddress) { + this.firewallPublicIpAddress = firewallPublicIpAddress; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the managed network settings. + * + * @return the provisioningState value. + */ + public ManagedNetworkProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioning state of the managed network settings. + * + * @param provisioningState the provisioningState value to set. + * @return the ManagedNetworkSettingsInner object itself. + */ + ManagedNetworkSettingsInner withProvisioningState(ManagedNetworkProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("isolationMode", this.isolationMode == null ? null : this.isolationMode.toString()); + jsonWriter.writeMapField("outboundRules", this.outboundRules, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("status", this.status); + jsonWriter.writeStringField("firewallSku", this.firewallSku == null ? null : this.firewallSku.toString()); + jsonWriter.writeStringField("managedNetworkKind", + this.managedNetworkKind == null ? null : this.managedNetworkKind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedNetworkSettingsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedNetworkSettingsInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedNetworkSettingsInner. + */ + public static ManagedNetworkSettingsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedNetworkSettingsInner deserializedManagedNetworkSettingsInner = new ManagedNetworkSettingsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("isolationMode".equals(fieldName)) { + deserializedManagedNetworkSettingsInner.isolationMode + = IsolationMode.fromString(reader.getString()); + } else if ("networkId".equals(fieldName)) { + deserializedManagedNetworkSettingsInner.networkId = reader.getString(); + } else if ("outboundRules".equals(fieldName)) { + Map outboundRules = reader.readMap(reader1 -> OutboundRule.fromJson(reader1)); + deserializedManagedNetworkSettingsInner.outboundRules = outboundRules; + } else if ("status".equals(fieldName)) { + deserializedManagedNetworkSettingsInner.status + = ManagedNetworkProvisionStatusInner.fromJson(reader); + } else if ("firewallSku".equals(fieldName)) { + deserializedManagedNetworkSettingsInner.firewallSku = FirewallSku.fromString(reader.getString()); + } else if ("managedNetworkKind".equals(fieldName)) { + deserializedManagedNetworkSettingsInner.managedNetworkKind + = ManagedNetworkKind.fromString(reader.getString()); + } else if ("firewallPublicIpAddress".equals(fieldName)) { + deserializedManagedNetworkSettingsInner.firewallPublicIpAddress = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedManagedNetworkSettingsInner.provisioningState + = ManagedNetworkProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedNetworkSettingsInner; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkSettingsPropertiesBasicResourceInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkSettingsPropertiesBasicResourceInner.java new file mode 100644 index 000000000000..1d309ef8a0ea --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkSettingsPropertiesBasicResourceInner.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsProperties; +import java.io.IOException; + +/** + * Concrete proxy resource types can be created by aliasing this type using a specific property type. + */ +@Fluent +public final class ManagedNetworkSettingsPropertiesBasicResourceInner extends ProxyResource { + /* + * The properties of the managed network settings of a cognitive services account. + */ + private ManagedNetworkSettingsProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ManagedNetworkSettingsPropertiesBasicResourceInner class. + */ + public ManagedNetworkSettingsPropertiesBasicResourceInner() { + } + + /** + * Get the properties property: The properties of the managed network settings of a cognitive services account. + * + * @return the properties value. + */ + public ManagedNetworkSettingsProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties of the managed network settings of a cognitive services account. + * + * @param properties the properties value to set. + * @return the ManagedNetworkSettingsPropertiesBasicResourceInner object itself. + */ + public ManagedNetworkSettingsPropertiesBasicResourceInner + withProperties(ManagedNetworkSettingsProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedNetworkSettingsPropertiesBasicResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedNetworkSettingsPropertiesBasicResourceInner if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ManagedNetworkSettingsPropertiesBasicResourceInner. + */ + public static ManagedNetworkSettingsPropertiesBasicResourceInner fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + ManagedNetworkSettingsPropertiesBasicResourceInner deserializedManagedNetworkSettingsPropertiesBasicResourceInner + = new ManagedNetworkSettingsPropertiesBasicResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedManagedNetworkSettingsPropertiesBasicResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedManagedNetworkSettingsPropertiesBasicResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedManagedNetworkSettingsPropertiesBasicResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedManagedNetworkSettingsPropertiesBasicResourceInner.properties + = ManagedNetworkSettingsProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedManagedNetworkSettingsPropertiesBasicResourceInner.systemData + = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedNetworkSettingsPropertiesBasicResourceInner; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ModelCapacityListResultValueItemInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ModelCapacityListResultValueItemInner.java index c9c11f95427e..dac42cd62078 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ModelCapacityListResultValueItemInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ModelCapacityListResultValueItemInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; @@ -16,7 +16,7 @@ /** * The ModelCapacityListResultValueItem model. */ -@Fluent +@Immutable public final class ModelCapacityListResultValueItemInner extends ProxyResource { /* * The location of the Model Sku Capacity. @@ -51,7 +51,7 @@ public final class ModelCapacityListResultValueItemInner extends ProxyResource { /** * Creates an instance of ModelCapacityListResultValueItemInner class. */ - public ModelCapacityListResultValueItemInner() { + private ModelCapacityListResultValueItemInner() { } /** @@ -63,17 +63,6 @@ public String location() { return this.location; } - /** - * Set the location property: The location of the Model Sku Capacity. - * - * @param location the location value to set. - * @return the ModelCapacityListResultValueItemInner object itself. - */ - public ModelCapacityListResultValueItemInner withLocation(String location) { - this.location = location; - return this; - } - /** * Get the properties property: Cognitive Services account ModelSkuCapacity. * @@ -83,17 +72,6 @@ public ModelSkuCapacityProperties properties() { return this.properties; } - /** - * Set the properties property: Cognitive Services account ModelSkuCapacity. - * - * @param properties the properties value to set. - * @return the ModelCapacityListResultValueItemInner object itself. - */ - public ModelCapacityListResultValueItemInner withProperties(ModelSkuCapacityProperties properties) { - this.properties = properties; - return this; - } - /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -133,17 +111,6 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ModelInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ModelInner.java index dd8e11cfbd26..3aad74fea3ad 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ModelInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ModelInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Cognitive Services Model. */ -@Fluent +@Immutable public final class ModelInner implements JsonSerializable { /* * Cognitive Services account Model. @@ -39,7 +39,7 @@ public final class ModelInner implements JsonSerializable { /** * Creates an instance of ModelInner class. */ - public ModelInner() { + private ModelInner() { } /** @@ -51,17 +51,6 @@ public AccountModelInner model() { return this.model; } - /** - * Set the model property: Cognitive Services account Model. - * - * @param model the model value to set. - * @return the ModelInner object itself. - */ - public ModelInner withModel(AccountModelInner model) { - this.model = model; - return this; - } - /** * Get the kind property: The kind (type) of cognitive service account. * @@ -71,17 +60,6 @@ public String kind() { return this.kind; } - /** - * Set the kind property: The kind (type) of cognitive service account. - * - * @param kind the kind value to set. - * @return the ModelInner object itself. - */ - public ModelInner withKind(String kind) { - this.kind = kind; - return this; - } - /** * Get the skuName property: The name of SKU. * @@ -91,17 +69,6 @@ public String skuName() { return this.skuName; } - /** - * Set the skuName property: The name of SKU. - * - * @param skuName the skuName value to set. - * @return the ModelInner object itself. - */ - public ModelInner withSkuName(String skuName) { - this.skuName = skuName; - return this; - } - /** * Get the description property: The description of the model. * @@ -111,28 +78,6 @@ public String description() { return this.description; } - /** - * Set the description property: The description of the model. - * - * @param description the description value to set. - * @return the ModelInner object itself. - */ - public ModelInner withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (model() != null) { - model().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/NetworkSecurityPerimeterConfigurationInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/NetworkSecurityPerimeterConfigurationInner.java index bff7708b70e5..564005596d9a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/NetworkSecurityPerimeterConfigurationInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/NetworkSecurityPerimeterConfigurationInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; @@ -16,7 +16,7 @@ /** * NSP Configuration for an Cognitive Services account. */ -@Fluent +@Immutable public final class NetworkSecurityPerimeterConfigurationInner extends ProxyResource { /* * NSP Configuration properties. @@ -46,7 +46,7 @@ public final class NetworkSecurityPerimeterConfigurationInner extends ProxyResou /** * Creates an instance of NetworkSecurityPerimeterConfigurationInner class. */ - public NetworkSecurityPerimeterConfigurationInner() { + private NetworkSecurityPerimeterConfigurationInner() { } /** @@ -58,18 +58,6 @@ public NetworkSecurityPerimeterConfigurationProperties properties() { return this.properties; } - /** - * Set the properties property: NSP Configuration properties. - * - * @param properties the properties value to set. - * @return the NetworkSecurityPerimeterConfigurationInner object itself. - */ - public NetworkSecurityPerimeterConfigurationInner - withProperties(NetworkSecurityPerimeterConfigurationProperties properties) { - this.properties = properties; - return this; - } - /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -109,17 +97,6 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/OperationInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/OperationInner.java index e0fdd3977d84..ec5f8e471ce9 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/OperationInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/OperationInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -19,7 +19,7 @@ * * Details of a REST API operation, returned from the Resource Provider Operations API. */ -@Fluent +@Immutable public final class OperationInner implements JsonSerializable { /* * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: @@ -28,8 +28,8 @@ public final class OperationInner implements JsonSerializable { private String name; /* - * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for - * ARM/control-plane operations. + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure + * Resource Manager/control-plane operations. */ private Boolean isDataAction; @@ -45,14 +45,14 @@ public final class OperationInner implements JsonSerializable { private Origin origin; /* - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ private ActionType actionType; /** * Creates an instance of OperationInner class. */ - public OperationInner() { + private OperationInner() { } /** @@ -67,7 +67,7 @@ public String name() { /** * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for ARM/control-plane operations. + * operations and "false" for Azure Resource Manager/control-plane operations. * * @return the isDataAction value. */ @@ -84,17 +84,6 @@ public OperationDisplay display() { return this.display; } - /** - * Set the display property: Localized display information for this particular operation. - * - * @param display the display value to set. - * @return the OperationInner object itself. - */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - /** * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and * audit logs UX. Default value is "user,system". @@ -106,8 +95,8 @@ public Origin origin() { } /** - * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal - * only APIs. + * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. * * @return the actionType value. */ @@ -115,17 +104,6 @@ public ActionType actionType() { return this.actionType; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/OutboundRuleBasicResourceInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/OutboundRuleBasicResourceInner.java new file mode 100644 index 000000000000..e07183554069 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/OutboundRuleBasicResourceInner.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cognitiveservices.models.OutboundRule; +import java.io.IOException; + +/** + * Concrete proxy resource types can be created by aliasing this type using a specific property type. + */ +@Fluent +public final class OutboundRuleBasicResourceInner extends ProxyResource { + /* + * Outbound Rule for the managed network of a cognitive services account. + */ + private OutboundRule properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of OutboundRuleBasicResourceInner class. + */ + public OutboundRuleBasicResourceInner() { + } + + /** + * Get the properties property: Outbound Rule for the managed network of a cognitive services account. + * + * @return the properties value. + */ + public OutboundRule properties() { + return this.properties; + } + + /** + * Set the properties property: Outbound Rule for the managed network of a cognitive services account. + * + * @param properties the properties value to set. + * @return the OutboundRuleBasicResourceInner object itself. + */ + public OutboundRuleBasicResourceInner withProperties(OutboundRule properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OutboundRuleBasicResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OutboundRuleBasicResourceInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OutboundRuleBasicResourceInner. + */ + public static OutboundRuleBasicResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OutboundRuleBasicResourceInner deserializedOutboundRuleBasicResourceInner + = new OutboundRuleBasicResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedOutboundRuleBasicResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOutboundRuleBasicResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedOutboundRuleBasicResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedOutboundRuleBasicResourceInner.properties = OutboundRule.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedOutboundRuleBasicResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOutboundRuleBasicResourceInner; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/OutboundRuleListResultInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/OutboundRuleListResultInner.java new file mode 100644 index 000000000000..9422cec813af --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/OutboundRuleListResultInner.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * List of outbound rules for the managed network of a cognitive services account. + */ +@Immutable +public final class OutboundRuleListResultInner implements JsonSerializable { + /* + * The link to the next page constructed using the continuationToken. If null, there are no additional pages. + */ + private String nextLink; + + /* + * The list of cognitive services accounts. Since this list may be incomplete, the nextLink field should be used to + * request the next list of cognitive services accounts. + */ + private List value; + + /** + * Creates an instance of OutboundRuleListResultInner class. + */ + private OutboundRuleListResultInner() { + } + + /** + * Get the nextLink property: The link to the next page constructed using the continuationToken. If null, there are + * no additional pages. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: The list of cognitive services accounts. Since this list may be incomplete, the nextLink + * field should be used to request the next list of cognitive services accounts. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OutboundRuleListResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OutboundRuleListResultInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the OutboundRuleListResultInner. + */ + public static OutboundRuleListResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OutboundRuleListResultInner deserializedOutboundRuleListResultInner = new OutboundRuleListResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedOutboundRuleListResultInner.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> OutboundRuleBasicResourceInner.fromJson(reader1)); + deserializedOutboundRuleListResultInner.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedOutboundRuleListResultInner; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/PrivateEndpointConnectionInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/PrivateEndpointConnectionInner.java index 3302bb02933f..0d5e9c736088 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/PrivateEndpointConnectionInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/PrivateEndpointConnectionInner.java @@ -1,15 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.models.AzureEntityResource; import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointConnectionProperties; import java.io.IOException; @@ -17,12 +17,17 @@ * The Private Endpoint Connection resource. */ @Fluent -public final class PrivateEndpointConnectionInner extends AzureEntityResource { +public final class PrivateEndpointConnectionInner extends ProxyResource { /* * Resource properties. */ private PrivateEndpointConnectionProperties properties; + /* + * Resource Etag. + */ + private String etag; + /* * The location of the private endpoint connection */ @@ -33,11 +38,6 @@ public final class PrivateEndpointConnectionInner extends AzureEntityResource { */ private SystemData systemData; - /* - * Resource Etag. - */ - private String etag; - /* * The type of the resource. */ @@ -79,6 +79,15 @@ public PrivateEndpointConnectionInner withProperties(PrivateEndpointConnectionPr return this; } + /** + * Get the etag property: Resource Etag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + /** * Get the location property: The location of the private endpoint connection. * @@ -104,21 +113,10 @@ public PrivateEndpointConnectionInner withLocation(String location) { * * @return the systemData value. */ - @Override public SystemData systemData() { return this.systemData; } - /** - * Get the etag property: Resource Etag. - * - * @return the etag value. - */ - @Override - public String etag() { - return this.etag; - } - /** * Get the type property: The type of the resource. * @@ -149,18 +147,6 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ @@ -195,15 +181,15 @@ public static PrivateEndpointConnectionInner fromJson(JsonReader jsonReader) thr deserializedPrivateEndpointConnectionInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedPrivateEndpointConnectionInner.type = reader.getString(); - } else if ("etag".equals(fieldName)) { - deserializedPrivateEndpointConnectionInner.etag = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedPrivateEndpointConnectionInner.systemData = SystemData.fromJson(reader); } else if ("properties".equals(fieldName)) { deserializedPrivateEndpointConnectionInner.properties = PrivateEndpointConnectionProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.etag = reader.getString(); } else if ("location".equals(fieldName)) { deserializedPrivateEndpointConnectionInner.location = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/PrivateEndpointConnectionListResultInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/PrivateEndpointConnectionListResultInner.java index 1bf21a7fa57f..af06021b4115 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/PrivateEndpointConnectionListResultInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/PrivateEndpointConnectionListResultInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * A list of private endpoint connections. */ -@Fluent +@Immutable public final class PrivateEndpointConnectionListResultInner implements JsonSerializable { /* @@ -26,7 +26,7 @@ public final class PrivateEndpointConnectionListResultInner /** * Creates an instance of PrivateEndpointConnectionListResultInner class. */ - public PrivateEndpointConnectionListResultInner() { + private PrivateEndpointConnectionListResultInner() { } /** @@ -38,28 +38,6 @@ public List value() { return this.value; } - /** - * Set the value property: Array of private endpoint connections. - * - * @param value the value value to set. - * @return the PrivateEndpointConnectionListResultInner object itself. - */ - public PrivateEndpointConnectionListResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/PrivateLinkResourceListResultInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/PrivateLinkResourceListResultInner.java index cfc160804ca8..f65081bbbf27 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/PrivateLinkResourceListResultInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/PrivateLinkResourceListResultInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * A list of private link resources. */ -@Fluent +@Immutable public final class PrivateLinkResourceListResultInner implements JsonSerializable { /* * Array of private link resources @@ -26,7 +26,7 @@ public final class PrivateLinkResourceListResultInner implements JsonSerializabl /** * Creates an instance of PrivateLinkResourceListResultInner class. */ - public PrivateLinkResourceListResultInner() { + private PrivateLinkResourceListResultInner() { } /** @@ -38,28 +38,6 @@ public List value() { return this.value; } - /** - * Set the value property: Array of private link resources. - * - * @param value the value value to set. - * @return the PrivateLinkResourceListResultInner object itself. - */ - public PrivateLinkResourceListResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ProjectCapabilityHostInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ProjectCapabilityHostInner.java new file mode 100644 index 000000000000..e15587667c97 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ProjectCapabilityHostInner.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cognitiveservices.models.ProjectCapabilityHostProperties; +import java.io.IOException; + +/** + * Azure Resource Manager resource envelope for Project CapabilityHost. + */ +@Fluent +public final class ProjectCapabilityHostInner extends ProxyResource { + /* + * [Required] Additional attributes of the entity. + */ + private ProjectCapabilityHostProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ProjectCapabilityHostInner class. + */ + public ProjectCapabilityHostInner() { + } + + /** + * Get the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + public ProjectCapabilityHostProperties properties() { + return this.properties; + } + + /** + * Set the properties property: [Required] Additional attributes of the entity. + * + * @param properties the properties value to set. + * @return the ProjectCapabilityHostInner object itself. + */ + public ProjectCapabilityHostInner withProperties(ProjectCapabilityHostProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProjectCapabilityHostInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectCapabilityHostInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ProjectCapabilityHostInner. + */ + public static ProjectCapabilityHostInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectCapabilityHostInner deserializedProjectCapabilityHostInner = new ProjectCapabilityHostInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedProjectCapabilityHostInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedProjectCapabilityHostInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedProjectCapabilityHostInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedProjectCapabilityHostInner.properties + = ProjectCapabilityHostProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedProjectCapabilityHostInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProjectCapabilityHostInner; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ProjectInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ProjectInner.java index d4eaf8ced35e..dd8f1230b06d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ProjectInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ProjectInner.java @@ -1,15 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.models.AzureEntityResource; import com.azure.resourcemanager.cognitiveservices.models.Identity; import com.azure.resourcemanager.cognitiveservices.models.ProjectProperties; import java.io.IOException; @@ -20,11 +20,11 @@ * and SKU. */ @Fluent -public final class ProjectInner extends AzureEntityResource { +public final class ProjectInner extends ProxyResource { /* - * Identity for the resource. + * Properties of Cognitive Services project. */ - private Identity identity; + private ProjectProperties properties; /* * Resource tags. @@ -37,19 +37,19 @@ public final class ProjectInner extends AzureEntityResource { private String location; /* - * Properties of Cognitive Services project. + * Resource Etag. */ - private ProjectProperties properties; + private String etag; /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Identity for the resource. */ - private SystemData systemData; + private Identity identity; /* - * Resource Etag. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - private String etag; + private SystemData systemData; /* * The type of the resource. @@ -73,22 +73,22 @@ public ProjectInner() { } /** - * Get the identity property: Identity for the resource. + * Get the properties property: Properties of Cognitive Services project. * - * @return the identity value. + * @return the properties value. */ - public Identity identity() { - return this.identity; + public ProjectProperties properties() { + return this.properties; } /** - * Set the identity property: Identity for the resource. + * Set the properties property: Properties of Cognitive Services project. * - * @param identity the identity value to set. + * @param properties the properties value to set. * @return the ProjectInner object itself. */ - public ProjectInner withIdentity(Identity identity) { - this.identity = identity; + public ProjectInner withProperties(ProjectProperties properties) { + this.properties = properties; return this; } @@ -133,22 +133,31 @@ public ProjectInner withLocation(String location) { } /** - * Get the properties property: Properties of Cognitive Services project. + * Get the etag property: Resource Etag. * - * @return the properties value. + * @return the etag value. */ - public ProjectProperties properties() { - return this.properties; + public String etag() { + return this.etag; } /** - * Set the properties property: Properties of Cognitive Services project. + * Get the identity property: Identity for the resource. * - * @param properties the properties value to set. + * @return the identity value. + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity property: Identity for the resource. + * + * @param identity the identity value to set. * @return the ProjectInner object itself. */ - public ProjectInner withProperties(ProjectProperties properties) { - this.properties = properties; + public ProjectInner withIdentity(Identity identity) { + this.identity = identity; return this; } @@ -157,21 +166,10 @@ public ProjectInner withProperties(ProjectProperties properties) { * * @return the systemData value. */ - @Override public SystemData systemData() { return this.systemData; } - /** - * Get the etag property: Resource Etag. - * - * @return the etag value. - */ - @Override - public String etag() { - return this.etag; - } - /** * Get the type property: The type of the resource. * @@ -202,31 +200,16 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (identity() != null) { - identity().validate(); - } - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeJsonField("properties", this.properties); jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); jsonWriter.writeStringField("location", this.location); - jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -252,19 +235,19 @@ public static ProjectInner fromJson(JsonReader jsonReader) throws IOException { deserializedProjectInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedProjectInner.type = reader.getString(); - } else if ("etag".equals(fieldName)) { - deserializedProjectInner.etag = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedProjectInner.systemData = SystemData.fromJson(reader); - } else if ("identity".equals(fieldName)) { - deserializedProjectInner.identity = Identity.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedProjectInner.properties = ProjectProperties.fromJson(reader); } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedProjectInner.tags = tags; } else if ("location".equals(fieldName)) { deserializedProjectInner.location = reader.getString(); - } else if ("properties".equals(fieldName)) { - deserializedProjectInner.properties = ProjectProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedProjectInner.etag = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedProjectInner.identity = Identity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedProjectInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/QuotaTierInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/QuotaTierInner.java index c639e63b4da7..10407bc5e199 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/QuotaTierInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/QuotaTierInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; @@ -108,17 +108,6 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiBlocklistInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiBlocklistInner.java index 97e5c78b9bb0..5bf5a5c9ffe1 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiBlocklistInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiBlocklistInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; @@ -19,6 +19,11 @@ */ @Fluent public final class RaiBlocklistInner extends ProxyResource { + /* + * Properties of Cognitive Services RaiBlocklist. + */ + private RaiBlocklistProperties properties; + /* * Resource Etag. */ @@ -29,11 +34,6 @@ public final class RaiBlocklistInner extends ProxyResource { */ private Map tags; - /* - * Properties of Cognitive Services RaiBlocklist. - */ - private RaiBlocklistProperties properties; - /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @@ -60,6 +60,26 @@ public final class RaiBlocklistInner extends ProxyResource { public RaiBlocklistInner() { } + /** + * Get the properties property: Properties of Cognitive Services RaiBlocklist. + * + * @return the properties value. + */ + public RaiBlocklistProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of Cognitive Services RaiBlocklist. + * + * @param properties the properties value to set. + * @return the RaiBlocklistInner object itself. + */ + public RaiBlocklistInner withProperties(RaiBlocklistProperties properties) { + this.properties = properties; + return this; + } + /** * Get the etag property: Resource Etag. * @@ -89,26 +109,6 @@ public RaiBlocklistInner withTags(Map tags) { return this; } - /** - * Get the properties property: Properties of Cognitive Services RaiBlocklist. - * - * @return the properties value. - */ - public RaiBlocklistProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of Cognitive Services RaiBlocklist. - * - * @param properties the properties value to set. - * @return the RaiBlocklistInner object itself. - */ - public RaiBlocklistInner withProperties(RaiBlocklistProperties properties) { - this.properties = properties; - return this; - } - /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -148,25 +148,14 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -192,13 +181,13 @@ public static RaiBlocklistInner fromJson(JsonReader jsonReader) throws IOExcepti deserializedRaiBlocklistInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedRaiBlocklistInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedRaiBlocklistInner.properties = RaiBlocklistProperties.fromJson(reader); } else if ("etag".equals(fieldName)) { deserializedRaiBlocklistInner.etag = reader.getString(); } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedRaiBlocklistInner.tags = tags; - } else if ("properties".equals(fieldName)) { - deserializedRaiBlocklistInner.properties = RaiBlocklistProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedRaiBlocklistInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiBlocklistItemInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiBlocklistItemInner.java index a8342348a9fd..74191f3006cf 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiBlocklistItemInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiBlocklistItemInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; @@ -19,6 +19,11 @@ */ @Fluent public final class RaiBlocklistItemInner extends ProxyResource { + /* + * Properties of Cognitive Services RaiBlocklist Item. + */ + private RaiBlocklistItemProperties properties; + /* * Resource Etag. */ @@ -29,11 +34,6 @@ public final class RaiBlocklistItemInner extends ProxyResource { */ private Map tags; - /* - * Properties of Cognitive Services RaiBlocklist Item. - */ - private RaiBlocklistItemProperties properties; - /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @@ -60,6 +60,26 @@ public final class RaiBlocklistItemInner extends ProxyResource { public RaiBlocklistItemInner() { } + /** + * Get the properties property: Properties of Cognitive Services RaiBlocklist Item. + * + * @return the properties value. + */ + public RaiBlocklistItemProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of Cognitive Services RaiBlocklist Item. + * + * @param properties the properties value to set. + * @return the RaiBlocklistItemInner object itself. + */ + public RaiBlocklistItemInner withProperties(RaiBlocklistItemProperties properties) { + this.properties = properties; + return this; + } + /** * Get the etag property: Resource Etag. * @@ -89,26 +109,6 @@ public RaiBlocklistItemInner withTags(Map tags) { return this; } - /** - * Get the properties property: Properties of Cognitive Services RaiBlocklist Item. - * - * @return the properties value. - */ - public RaiBlocklistItemProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of Cognitive Services RaiBlocklist Item. - * - * @param properties the properties value to set. - * @return the RaiBlocklistItemInner object itself. - */ - public RaiBlocklistItemInner withProperties(RaiBlocklistItemProperties properties) { - this.properties = properties; - return this; - } - /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -148,25 +148,14 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -192,13 +181,13 @@ public static RaiBlocklistItemInner fromJson(JsonReader jsonReader) throws IOExc deserializedRaiBlocklistItemInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedRaiBlocklistItemInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedRaiBlocklistItemInner.properties = RaiBlocklistItemProperties.fromJson(reader); } else if ("etag".equals(fieldName)) { deserializedRaiBlocklistItemInner.etag = reader.getString(); } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedRaiBlocklistItemInner.tags = tags; - } else if ("properties".equals(fieldName)) { - deserializedRaiBlocklistItemInner.properties = RaiBlocklistItemProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedRaiBlocklistItemInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiContentFilterInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiContentFilterInner.java index 9de2882f4a96..cd081801120d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiContentFilterInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiContentFilterInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; @@ -16,7 +16,7 @@ /** * Azure OpenAI Content Filter. */ -@Fluent +@Immutable public final class RaiContentFilterInner extends ProxyResource { /* * Azure OpenAI Content Filter Properties. @@ -46,7 +46,7 @@ public final class RaiContentFilterInner extends ProxyResource { /** * Creates an instance of RaiContentFilterInner class. */ - public RaiContentFilterInner() { + private RaiContentFilterInner() { } /** @@ -58,17 +58,6 @@ public RaiContentFilterProperties properties() { return this.properties; } - /** - * Set the properties property: Azure OpenAI Content Filter Properties. - * - * @param properties the properties value to set. - * @return the RaiContentFilterInner object itself. - */ - public RaiContentFilterInner withProperties(RaiContentFilterProperties properties) { - this.properties = properties; - return this; - } - /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -108,17 +97,6 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiExternalSafetyProviderInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiExternalSafetyProviderInner.java new file mode 100644 index 000000000000..de164d0e2b67 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiExternalSafetyProviderInner.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cognitiveservices.models.RaiExternalSafetyProviderProperties; +import java.io.IOException; +import java.util.Map; + +/** + * Cognitive Services Rai External Safety provider. + */ +@Immutable +public final class RaiExternalSafetyProviderInner extends ProxyResource { + /* + * Resource Etag. + */ + private String etag; + + /* + * Resource tags. + */ + private Map tags; + + /* + * Properties of Cognitive Services Rai External Safety provider. + */ + private RaiExternalSafetyProviderProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of RaiExternalSafetyProviderInner class. + */ + private RaiExternalSafetyProviderInner() { + } + + /** + * Get the etag property: Resource Etag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the properties property: Properties of Cognitive Services Rai External Safety provider. + * + * @return the properties value. + */ + public RaiExternalSafetyProviderProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RaiExternalSafetyProviderInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RaiExternalSafetyProviderInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RaiExternalSafetyProviderInner. + */ + public static RaiExternalSafetyProviderInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RaiExternalSafetyProviderInner deserializedRaiExternalSafetyProviderInner + = new RaiExternalSafetyProviderInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRaiExternalSafetyProviderInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRaiExternalSafetyProviderInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRaiExternalSafetyProviderInner.type = reader.getString(); + } else if ("etag".equals(fieldName)) { + deserializedRaiExternalSafetyProviderInner.etag = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRaiExternalSafetyProviderInner.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedRaiExternalSafetyProviderInner.properties + = RaiExternalSafetyProviderProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedRaiExternalSafetyProviderInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRaiExternalSafetyProviderInner; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiExternalSafetyProviderSchemaInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiExternalSafetyProviderSchemaInner.java new file mode 100644 index 000000000000..b6c3755e6389 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiExternalSafetyProviderSchemaInner.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cognitiveservices.models.RaiExternalSafetyProviderSchemaProperties; +import java.io.IOException; +import java.util.Map; + +/** + * Cognitive Services Rai External Safety provider Schema. + */ +@Fluent +public final class RaiExternalSafetyProviderSchemaInner extends ProxyResource { + /* + * Properties of Cognitive Services Rai External Safety provider. + */ + private RaiExternalSafetyProviderSchemaProperties properties; + + /* + * Resource Etag. + */ + private String etag; + + /* + * Resource tags. + */ + private Map tags; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of RaiExternalSafetyProviderSchemaInner class. + */ + public RaiExternalSafetyProviderSchemaInner() { + } + + /** + * Get the properties property: Properties of Cognitive Services Rai External Safety provider. + * + * @return the properties value. + */ + public RaiExternalSafetyProviderSchemaProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of Cognitive Services Rai External Safety provider. + * + * @param properties the properties value to set. + * @return the RaiExternalSafetyProviderSchemaInner object itself. + */ + public RaiExternalSafetyProviderSchemaInner withProperties(RaiExternalSafetyProviderSchemaProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the etag property: Resource Etag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RaiExternalSafetyProviderSchemaInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RaiExternalSafetyProviderSchemaInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RaiExternalSafetyProviderSchemaInner. + */ + public static RaiExternalSafetyProviderSchemaInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RaiExternalSafetyProviderSchemaInner deserializedRaiExternalSafetyProviderSchemaInner + = new RaiExternalSafetyProviderSchemaInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRaiExternalSafetyProviderSchemaInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRaiExternalSafetyProviderSchemaInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRaiExternalSafetyProviderSchemaInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedRaiExternalSafetyProviderSchemaInner.properties + = RaiExternalSafetyProviderSchemaProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedRaiExternalSafetyProviderSchemaInner.etag = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRaiExternalSafetyProviderSchemaInner.tags = tags; + } else if ("systemData".equals(fieldName)) { + deserializedRaiExternalSafetyProviderSchemaInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRaiExternalSafetyProviderSchemaInner; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiPolicyInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiPolicyInner.java index 2f8fa6d6fe0b..644765d705a3 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiPolicyInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiPolicyInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; @@ -19,6 +19,11 @@ */ @Fluent public final class RaiPolicyInner extends ProxyResource { + /* + * Properties of Cognitive Services RaiPolicy. + */ + private RaiPolicyProperties properties; + /* * Resource Etag. */ @@ -29,11 +34,6 @@ public final class RaiPolicyInner extends ProxyResource { */ private Map tags; - /* - * Properties of Cognitive Services RaiPolicy. - */ - private RaiPolicyProperties properties; - /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @@ -60,6 +60,26 @@ public final class RaiPolicyInner extends ProxyResource { public RaiPolicyInner() { } + /** + * Get the properties property: Properties of Cognitive Services RaiPolicy. + * + * @return the properties value. + */ + public RaiPolicyProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of Cognitive Services RaiPolicy. + * + * @param properties the properties value to set. + * @return the RaiPolicyInner object itself. + */ + public RaiPolicyInner withProperties(RaiPolicyProperties properties) { + this.properties = properties; + return this; + } + /** * Get the etag property: Resource Etag. * @@ -89,26 +109,6 @@ public RaiPolicyInner withTags(Map tags) { return this; } - /** - * Get the properties property: Properties of Cognitive Services RaiPolicy. - * - * @return the properties value. - */ - public RaiPolicyProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of Cognitive Services RaiPolicy. - * - * @param properties the properties value to set. - * @return the RaiPolicyInner object itself. - */ - public RaiPolicyInner withProperties(RaiPolicyProperties properties) { - this.properties = properties; - return this; - } - /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -148,25 +148,14 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -192,13 +181,13 @@ public static RaiPolicyInner fromJson(JsonReader jsonReader) throws IOException deserializedRaiPolicyInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedRaiPolicyInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedRaiPolicyInner.properties = RaiPolicyProperties.fromJson(reader); } else if ("etag".equals(fieldName)) { deserializedRaiPolicyInner.etag = reader.getString(); } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedRaiPolicyInner.tags = tags; - } else if ("properties".equals(fieldName)) { - deserializedRaiPolicyInner.properties = RaiPolicyProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedRaiPolicyInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiToolLabelInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiToolLabelInner.java new file mode 100644 index 000000000000..367df659c6c3 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiToolLabelInner.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cognitiveservices.models.RaiToolLabelProperties; +import java.io.IOException; +import java.util.Map; + +/** + * Cognitive Services RAI Tool Label resource. + */ +@Fluent +public final class RaiToolLabelInner extends ProxyResource { + /* + * Properties of the RAI Tool Label. + */ + private RaiToolLabelProperties properties; + + /* + * Resource Etag. + */ + private String etag; + + /* + * Resource tags. + */ + private Map tags; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of RaiToolLabelInner class. + */ + public RaiToolLabelInner() { + } + + /** + * Get the properties property: Properties of the RAI Tool Label. + * + * @return the properties value. + */ + public RaiToolLabelProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the RAI Tool Label. + * + * @param properties the properties value to set. + * @return the RaiToolLabelInner object itself. + */ + public RaiToolLabelInner withProperties(RaiToolLabelProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the etag property: Resource Etag. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the RaiToolLabelInner object itself. + */ + public RaiToolLabelInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RaiToolLabelInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RaiToolLabelInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RaiToolLabelInner. + */ + public static RaiToolLabelInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RaiToolLabelInner deserializedRaiToolLabelInner = new RaiToolLabelInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRaiToolLabelInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRaiToolLabelInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRaiToolLabelInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedRaiToolLabelInner.properties = RaiToolLabelProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedRaiToolLabelInner.etag = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRaiToolLabelInner.tags = tags; + } else if ("systemData".equals(fieldName)) { + deserializedRaiToolLabelInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRaiToolLabelInner; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiTopicInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiTopicInner.java index 058fa0570e60..bfe590a684cf 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiTopicInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiTopicInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; @@ -19,6 +19,11 @@ */ @Fluent public final class RaiTopicInner extends ProxyResource { + /* + * Properties of Cognitive Services Rai Topic. + */ + private RaiTopicProperties properties; + /* * Resource Etag. */ @@ -29,11 +34,6 @@ public final class RaiTopicInner extends ProxyResource { */ private Map tags; - /* - * Properties of Cognitive Services Rai Topic. - */ - private RaiTopicProperties properties; - /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @@ -60,6 +60,26 @@ public final class RaiTopicInner extends ProxyResource { public RaiTopicInner() { } + /** + * Get the properties property: Properties of Cognitive Services Rai Topic. + * + * @return the properties value. + */ + public RaiTopicProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of Cognitive Services Rai Topic. + * + * @param properties the properties value to set. + * @return the RaiTopicInner object itself. + */ + public RaiTopicInner withProperties(RaiTopicProperties properties) { + this.properties = properties; + return this; + } + /** * Get the etag property: Resource Etag. * @@ -89,26 +109,6 @@ public RaiTopicInner withTags(Map tags) { return this; } - /** - * Get the properties property: Properties of Cognitive Services Rai Topic. - * - * @return the properties value. - */ - public RaiTopicProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Properties of Cognitive Services Rai Topic. - * - * @param properties the properties value to set. - * @return the RaiTopicInner object itself. - */ - public RaiTopicInner withProperties(RaiTopicProperties properties) { - this.properties = properties; - return this; - } - /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -148,25 +148,14 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -192,13 +181,13 @@ public static RaiTopicInner fromJson(JsonReader jsonReader) throws IOException { deserializedRaiTopicInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedRaiTopicInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedRaiTopicInner.properties = RaiTopicProperties.fromJson(reader); } else if ("etag".equals(fieldName)) { deserializedRaiTopicInner.etag = reader.getString(); } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedRaiTopicInner.tags = tags; - } else if ("properties".equals(fieldName)) { - deserializedRaiTopicInner.properties = RaiTopicProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedRaiTopicInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ResourceSkuInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ResourceSkuInner.java index 098466c88c25..21b70f53c87e 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ResourceSkuInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ResourceSkuInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * Describes an available Cognitive Services SKU. */ -@Fluent +@Immutable public final class ResourceSkuInner implements JsonSerializable { /* * The type of resource the SKU applies to. @@ -51,7 +51,7 @@ public final class ResourceSkuInner implements JsonSerializable locations() { return this.locations; } - /** - * Set the locations property: The set of locations that the SKU is available. - * - * @param locations the locations value to set. - * @return the ResourceSkuInner object itself. - */ - public ResourceSkuInner withLocations(List locations) { - this.locations = locations; - return this; - } - /** * Get the restrictions property: The restrictions because of which SKU cannot be used. This is empty if there are * no restrictions. @@ -164,29 +109,6 @@ public List restrictions() { return this.restrictions; } - /** - * Set the restrictions property: The restrictions because of which SKU cannot be used. This is empty if there are - * no restrictions. - * - * @param restrictions the restrictions value to set. - * @return the ResourceSkuInner object itself. - */ - public ResourceSkuInner withRestrictions(List restrictions) { - this.restrictions = restrictions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (restrictions() != null) { - restrictions().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/SkuAvailabilityListResultInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/SkuAvailabilityListResultInner.java index 6e99cbd6fb76..ae1d741c13c5 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/SkuAvailabilityListResultInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/SkuAvailabilityListResultInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * Check SKU availability result list. */ -@Fluent +@Immutable public final class SkuAvailabilityListResultInner implements JsonSerializable { /* * Check SKU availability result list. @@ -26,7 +26,7 @@ public final class SkuAvailabilityListResultInner implements JsonSerializable value() { return this.value; } - /** - * Set the value property: Check SKU availability result list. - * - * @param value the value value to set. - * @return the SkuAvailabilityListResultInner object itself. - */ - public SkuAvailabilityListResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/SkuResourceInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/SkuResourceInner.java index b65df4a3b14a..4af8ab6da149 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/SkuResourceInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/SkuResourceInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * Properties of Cognitive Services account resource sku resource properties. */ -@Fluent +@Immutable public final class SkuResourceInner implements JsonSerializable { /* * The resource type name. @@ -36,7 +36,7 @@ public final class SkuResourceInner implements JsonSerializable { + /* + * The unit of the metric. + */ + private UnitType unit; + + /* + * The name information for the metric. + */ + private MetricName name; + + /* + * The quota period used to summarize the usage values. + */ + private String quotaPeriod; + + /* + * Maximum value for this metric. + */ + private Double limit; + + /* + * Current value for this metric. + */ + private Double currentValue; + + /* + * Next reset time for current quota. + */ + private String nextResetTime; + + /* + * Cognitive Services account quota usage status. + */ + private QuotaUsageStatus status; + + /* + * The scope type of the quota usage. + */ + private QuotaScopeType scopeType; + + /* + * The scope identifier of the quota usage. + */ + private String scopeId; + + /** + * Creates an instance of UsageInner class. + */ + private UsageInner() { + } + + /** + * Get the unit property: The unit of the metric. + * + * @return the unit value. + */ + public UnitType unit() { + return this.unit; + } + + /** + * Get the name property: The name information for the metric. + * + * @return the name value. + */ + public MetricName name() { + return this.name; + } + + /** + * Get the quotaPeriod property: The quota period used to summarize the usage values. + * + * @return the quotaPeriod value. + */ + public String quotaPeriod() { + return this.quotaPeriod; + } + + /** + * Get the limit property: Maximum value for this metric. + * + * @return the limit value. + */ + public Double limit() { + return this.limit; + } + + /** + * Get the currentValue property: Current value for this metric. + * + * @return the currentValue value. + */ + public Double currentValue() { + return this.currentValue; + } + + /** + * Get the nextResetTime property: Next reset time for current quota. + * + * @return the nextResetTime value. + */ + public String nextResetTime() { + return this.nextResetTime; + } + + /** + * Get the status property: Cognitive Services account quota usage status. + * + * @return the status value. + */ + public QuotaUsageStatus status() { + return this.status; + } + + /** + * Get the scopeType property: The scope type of the quota usage. + * + * @return the scopeType value. + */ + public QuotaScopeType scopeType() { + return this.scopeType; + } + + /** + * Get the scopeId property: The scope identifier of the quota usage. + * + * @return the scopeId value. + */ + public String scopeId() { + return this.scopeId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("unit", this.unit == null ? null : this.unit.toString()); + jsonWriter.writeJsonField("name", this.name); + jsonWriter.writeStringField("quotaPeriod", this.quotaPeriod); + jsonWriter.writeNumberField("limit", this.limit); + jsonWriter.writeNumberField("currentValue", this.currentValue); + jsonWriter.writeStringField("nextResetTime", this.nextResetTime); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("scopeType", this.scopeType == null ? null : this.scopeType.toString()); + jsonWriter.writeStringField("scopeId", this.scopeId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UsageInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UsageInner if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the UsageInner. + */ + public static UsageInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UsageInner deserializedUsageInner = new UsageInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("unit".equals(fieldName)) { + deserializedUsageInner.unit = UnitType.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + deserializedUsageInner.name = MetricName.fromJson(reader); + } else if ("quotaPeriod".equals(fieldName)) { + deserializedUsageInner.quotaPeriod = reader.getString(); + } else if ("limit".equals(fieldName)) { + deserializedUsageInner.limit = reader.getNullable(JsonReader::getDouble); + } else if ("currentValue".equals(fieldName)) { + deserializedUsageInner.currentValue = reader.getNullable(JsonReader::getDouble); + } else if ("nextResetTime".equals(fieldName)) { + deserializedUsageInner.nextResetTime = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedUsageInner.status = QuotaUsageStatus.fromString(reader.getString()); + } else if ("scopeType".equals(fieldName)) { + deserializedUsageInner.scopeType = QuotaScopeType.fromString(reader.getString()); + } else if ("scopeId".equals(fieldName)) { + deserializedUsageInner.scopeId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUsageInner; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/UsageListResultInner.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/UsageListResultInner.java index c80dd85bdc1e..fe922360633c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/UsageListResultInner.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/UsageListResultInner.java @@ -1,22 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cognitiveservices.models.Usage; import java.io.IOException; import java.util.List; /** * The response to a list usage request. */ -@Fluent +@Immutable public final class UsageListResultInner implements JsonSerializable { /* * The link used to get the next page of Usages. @@ -26,12 +25,12 @@ public final class UsageListResultInner implements JsonSerializable value; + private List value; /** * Creates an instance of UsageListResultInner class. */ - public UsageListResultInner() { + private UsageListResultInner() { } /** @@ -43,48 +42,15 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link used to get the next page of Usages. - * - * @param nextLink the nextLink value to set. - * @return the UsageListResultInner object itself. - */ - public UsageListResultInner withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Get the value property: The list of usages for Cognitive Service account. * * @return the value value. */ - public List value() { + public List value() { return this.value; } - /** - * Set the value property: The list of usages for Cognitive Service account. - * - * @param value the value value to set. - * @return the UsageListResultInner object itself. - */ - public UsageListResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -114,7 +80,7 @@ public static UsageListResultInner fromJson(JsonReader jsonReader) throws IOExce if ("nextLink".equals(fieldName)) { deserializedUsageListResultInner.nextLink = reader.getString(); } else if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> Usage.fromJson(reader1)); + List value = reader.readArray(reader1 -> UsageInner.fromJson(reader1)); deserializedUsageListResultInner.value = value; } else { reader.skipChildren(); diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/package-info.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/package-info.java index 5acee7cee841..73c9f706a1ba 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/package-info.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the inner data models for CognitiveServicesManagementClient. + * Package containing the inner data models for CognitiveServices. * Cognitive Services Management Client. */ package com.azure.resourcemanager.cognitiveservices.fluent.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/package-info.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/package-info.java index d10fd427eba0..2262c602d6ed 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/package-info.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the service clients for CognitiveServicesManagementClient. + * Package containing the service clients for CognitiveServices. * Cognitive Services Management Client. */ package com.azure.resourcemanager.cognitiveservices.fluent; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountCapabilityHostsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountCapabilityHostsClientImpl.java index 8b761700d244..2ace56548063 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountCapabilityHostsClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountCapabilityHostsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -19,6 +19,10 @@ import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; @@ -26,11 +30,11 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.cognitiveservices.fluent.AccountCapabilityHostsClient; import com.azure.resourcemanager.cognitiveservices.fluent.models.CapabilityHostInner; +import com.azure.resourcemanager.cognitiveservices.implementation.models.CapabilityHostResourceArmPaginatedResult; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -64,682 +68,703 @@ public final class AccountCapabilityHostsClientImpl implements AccountCapability * The interface defining all the services for CognitiveServicesManagementClientAccountCapabilityHosts to be used by * the proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CognitiveServicesManagementClientAccountCapabilityHosts") public interface AccountCapabilityHostsService { @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("capabilityHostName") String capabilityHostName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("capabilityHostName") String capabilityHostName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("capabilityHostName") String capabilityHostName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CapabilityHostInner capabilityHost, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("capabilityHostName") String capabilityHostName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CapabilityHostInner capabilityHost, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("capabilityHostName") String capabilityHostname, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("capabilityHostName") String capabilityHostName, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("capabilityHostName") String capabilityHostname, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("capabilityHostName") String capabilityHostName, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("capabilityHostName") String capabilityHostname, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("capabilityHostName") String capabilityHostname, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName}") - @ExpectedResponses({ 200, 201 }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("capabilityHostName") String capabilityHostname, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CapabilityHostInner capabilityHost, @HeaderParam("Accept") String accept, - Context context); + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/capabilityHosts/{capabilityHostName}") - @ExpectedResponses({ 200, 201 }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("capabilityHostName") String capabilityHostname, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CapabilityHostInner capabilityHost, @HeaderParam("Accept") String accept, - Context context); + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** - * Delete account capabilityHost. + * Get account capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return account capabilityHost along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, - String capabilityHostname) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (capabilityHostname == null) { - return Mono - .error(new IllegalArgumentException("Parameter capabilityHostname is required and cannot be null.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String capabilityHostName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, capabilityHostname, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, capabilityHostName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete account capabilityHost. + * Get account capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. + * @return account capabilityHost on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String accountName, - String capabilityHostname) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (capabilityHostname == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter capabilityHostname is required and cannot be null.")); - } + private Mono getAsync(String resourceGroupName, String accountName, + String capabilityHostName) { + return getWithResponseAsync(resourceGroupName, accountName, capabilityHostName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return account capabilityHost along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, + String capabilityHostName, Context context) { final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, capabilityHostname, this.client.getApiVersion(), accept, Context.NONE); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, capabilityHostName, accept, context); } /** - * Delete account capabilityHost. + * Get account capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return account capabilityHost. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CapabilityHostInner get(String resourceGroupName, String accountName, String capabilityHostName) { + return getWithResponse(resourceGroupName, accountName, capabilityHostName, Context.NONE).getValue(); + } + + /** + * Create or update account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHost CapabilityHost definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String accountName, String capabilityHostName, CapabilityHostInner capabilityHost) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, capabilityHostName, contentType, + accept, capabilityHost, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHost CapabilityHost definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, + String capabilityHostName, CapabilityHostInner capabilityHost) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, capabilityHostName, contentType, accept, + capabilityHost, Context.NONE); + } + + /** + * Create or update account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHost CapabilityHost definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. + * @return azure Resource Manager resource envelope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String accountName, - String capabilityHostname, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (capabilityHostname == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter capabilityHostname is required and cannot be null.")); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, + String capabilityHostName, CapabilityHostInner capabilityHost, Context context) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, capabilityHostname, this.client.getApiVersion(), accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, capabilityHostName, contentType, accept, + capabilityHost, context); } /** - * Delete account capabilityHost. + * Create or update account capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHost CapabilityHost definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String accountName, - String capabilityHostname) { + private PollerFlux, CapabilityHostInner> beginCreateOrUpdateAsync( + String resourceGroupName, String accountName, String capabilityHostName, CapabilityHostInner capabilityHost) { Mono>> mono - = deleteWithResponseAsync(resourceGroupName, accountName, capabilityHostname); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + = createOrUpdateWithResponseAsync(resourceGroupName, accountName, capabilityHostName, capabilityHost); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CapabilityHostInner.class, CapabilityHostInner.class, this.client.getContext()); } /** - * Delete account capabilityHost. + * Create or update account capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHost CapabilityHost definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, - String capabilityHostname) { - Response response = deleteWithResponse(resourceGroupName, accountName, capabilityHostname); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + public SyncPoller, CapabilityHostInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, String capabilityHostName, CapabilityHostInner capabilityHost) { + Response response + = createOrUpdateWithResponse(resourceGroupName, accountName, capabilityHostName, capabilityHost); + return this.client.getLroResult(response, CapabilityHostInner.class, + CapabilityHostInner.class, Context.NONE); } /** - * Delete account capabilityHost. + * Create or update account capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHost CapabilityHost definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, - String capabilityHostname, Context context) { - Response response = deleteWithResponse(resourceGroupName, accountName, capabilityHostname, context); - return this.client.getLroResult(response, Void.class, Void.class, context); + public SyncPoller, CapabilityHostInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, String capabilityHostName, CapabilityHostInner capabilityHost, + Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, accountName, capabilityHostName, capabilityHost, context); + return this.client.getLroResult(response, CapabilityHostInner.class, + CapabilityHostInner.class, context); } /** - * Delete account capabilityHost. + * Create or update account capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHost CapabilityHost definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String accountName, String capabilityHostname) { - return beginDeleteAsync(resourceGroupName, accountName, capabilityHostname).last() + private Mono createOrUpdateAsync(String resourceGroupName, String accountName, + String capabilityHostName, CapabilityHostInner capabilityHost) { + return beginCreateOrUpdateAsync(resourceGroupName, accountName, capabilityHostName, capabilityHost).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Delete account capabilityHost. + * Create or update account capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHost CapabilityHost definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String capabilityHostname) { - beginDelete(resourceGroupName, accountName, capabilityHostname).getFinalResult(); + public CapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String capabilityHostName, + CapabilityHostInner capabilityHost) { + return beginCreateOrUpdate(resourceGroupName, accountName, capabilityHostName, capabilityHost).getFinalResult(); } /** - * Delete account capabilityHost. + * Create or update account capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHost CapabilityHost definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String capabilityHostname, Context context) { - beginDelete(resourceGroupName, accountName, capabilityHostname, context).getFinalResult(); + public CapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String capabilityHostName, + CapabilityHostInner capabilityHost, Context context) { + return beginCreateOrUpdate(resourceGroupName, accountName, capabilityHostName, capabilityHost, context) + .getFinalResult(); } /** - * Get account capabilityHost. + * Delete account capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return account capabilityHost along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String accountName, - String capabilityHostname) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (capabilityHostname == null) { - return Mono - .error(new IllegalArgumentException("Parameter capabilityHostname is required and cannot be null.")); - } - final String accept = "application/json"; + private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, + String capabilityHostName) { return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, capabilityHostname, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, capabilityHostName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get account capabilityHost. + * Delete account capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return account capabilityHost on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String accountName, - String capabilityHostname) { - return getWithResponseAsync(resourceGroupName, accountName, capabilityHostname) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Response deleteWithResponse(String resourceGroupName, String accountName, + String capabilityHostName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, capabilityHostName, Context.NONE); } /** - * Get account capabilityHost. + * Delete account capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return account capabilityHost along with {@link Response}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String accountName, - String capabilityHostname, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (capabilityHostname == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter capabilityHostname is required and cannot be null.")); - } - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, capabilityHostname, this.client.getApiVersion(), accept, context); + private Response deleteWithResponse(String resourceGroupName, String accountName, + String capabilityHostName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, capabilityHostName, context); } /** - * Get account capabilityHost. + * Delete account capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return account capabilityHost. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CapabilityHostInner get(String resourceGroupName, String accountName, String capabilityHostname) { - return getWithResponse(resourceGroupName, accountName, capabilityHostname, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String accountName, + String capabilityHostName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, accountName, capabilityHostName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * Create or update account capabilityHost. + * Delete account capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of - * {@link Mono}. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String capabilityHostName) { + Response response = deleteWithResponse(resourceGroupName, accountName, capabilityHostName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String capabilityHostName, Context context) { + Response response = deleteWithResponse(resourceGroupName, accountName, capabilityHostName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String accountName, String capabilityHostname, CapabilityHostInner capabilityHost) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (capabilityHostname == null) { - return Mono - .error(new IllegalArgumentException("Parameter capabilityHostname is required and cannot be null.")); - } - if (capabilityHost == null) { - return Mono.error(new IllegalArgumentException("Parameter capabilityHost is required and cannot be null.")); - } else { - capabilityHost.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, capabilityHostname, this.client.getApiVersion(), capabilityHost, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Mono deleteAsync(String resourceGroupName, String accountName, String capabilityHostName) { + return beginDeleteAsync(resourceGroupName, accountName, capabilityHostName).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Create or update account capabilityHost. + * Delete account capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String capabilityHostname, CapabilityHostInner capabilityHost) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (capabilityHostname == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter capabilityHostname is required and cannot be null.")); - } - if (capabilityHost == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter capabilityHost is required and cannot be null.")); - } else { - capabilityHost.validate(); - } - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, capabilityHostname, this.client.getApiVersion(), capabilityHost, accept, Context.NONE); + public void delete(String resourceGroupName, String accountName, String capabilityHostName) { + beginDelete(resourceGroupName, accountName, capabilityHostName).getFinalResult(); } /** - * Create or update account capabilityHost. + * Delete account capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String capabilityHostname, CapabilityHostInner capabilityHost, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (capabilityHostname == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter capabilityHostname is required and cannot be null.")); - } - if (capabilityHost == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter capabilityHost is required and cannot be null.")); - } else { - capabilityHost.validate(); - } - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, capabilityHostname, this.client.getApiVersion(), capabilityHost, accept, context); + public void delete(String resourceGroupName, String accountName, String capabilityHostName, Context context) { + beginDelete(resourceGroupName, accountName, capabilityHostName, context).getFinalResult(); } /** - * Create or update account capabilityHost. + * List capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + * @return a paginated list of Capability Host entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CapabilityHostInner> beginCreateOrUpdateAsync( - String resourceGroupName, String accountName, String capabilityHostname, CapabilityHostInner capabilityHost) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, accountName, capabilityHostname, capabilityHost); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - CapabilityHostInner.class, CapabilityHostInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or update account capabilityHost. + * List capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + * @return a paginated list of Capability Host entities as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CapabilityHostInner> beginCreateOrUpdate( - String resourceGroupName, String accountName, String capabilityHostname, CapabilityHostInner capabilityHost) { - Response response - = createOrUpdateWithResponse(resourceGroupName, accountName, capabilityHostname, capabilityHost); - return this.client.getLroResult(response, CapabilityHostInner.class, - CapabilityHostInner.class, Context.NONE); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Create or update account capabilityHost. + * List capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + * @return a paginated list of Capability Host entities along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CapabilityHostInner> beginCreateOrUpdate( - String resourceGroupName, String accountName, String capabilityHostname, CapabilityHostInner capabilityHost, - Context context) { - Response response - = createOrUpdateWithResponse(resourceGroupName, accountName, capabilityHostname, capabilityHost, context); - return this.client.getLroResult(response, CapabilityHostInner.class, - CapabilityHostInner.class, context); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String accountName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Create or update account capabilityHost. + * List capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + * @return a paginated list of Capability Host entities along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String accountName, - String capabilityHostname, CapabilityHostInner capabilityHost) { - return beginCreateOrUpdateAsync(resourceGroupName, accountName, capabilityHostname, capabilityHost).last() - .flatMap(this.client::getLroFinalResultOrError); + private PagedResponse listSinglePage(String resourceGroupName, String accountName, + Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Create or update account capabilityHost. + * List capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope. + * @return a paginated list of Capability Host entities as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String capabilityHostname, - CapabilityHostInner capabilityHost) { - return beginCreateOrUpdate(resourceGroupName, accountName, capabilityHostname, capabilityHost).getFinalResult(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), + nextLink -> listNextSinglePage(nextLink)); } /** - * Create or update account capabilityHost. + * List capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope. + * @return a paginated list of Capability Host entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * List capabilityHost. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Capability Host entities along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String capabilityHostname, - CapabilityHostInner capabilityHost, Context context) { - return beginCreateOrUpdate(resourceGroupName, accountName, capabilityHostname, capabilityHost, context) - .getFinalResult(); + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - private static final ClientLogger LOGGER = new ClientLogger(AccountCapabilityHostsClientImpl.class); + /** + * List capabilityHost. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Capability Host entities along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List capabilityHost. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Capability Host entities along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountCapabilityHostsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountCapabilityHostsImpl.java index 443f74406126..bef777151b77 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountCapabilityHostsImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountCapabilityHostsImpl.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; @@ -26,28 +27,16 @@ public AccountCapabilityHostsImpl(AccountCapabilityHostsClient innerClient, this.serviceManager = serviceManager; } - public void delete(String resourceGroupName, String accountName, String capabilityHostname) { - this.serviceClient().delete(resourceGroupName, accountName, capabilityHostname); - } - - public void delete(String resourceGroupName, String accountName, String capabilityHostname, Context context) { - this.serviceClient().delete(resourceGroupName, accountName, capabilityHostname, context); - } - public Response getWithResponse(String resourceGroupName, String accountName, - String capabilityHostname, Context context) { + String capabilityHostName, Context context) { Response inner - = this.serviceClient().getWithResponse(resourceGroupName, accountName, capabilityHostname, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CapabilityHostImpl(inner.getValue(), this.manager())); - } else { - return null; - } + = this.serviceClient().getWithResponse(resourceGroupName, accountName, capabilityHostName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CapabilityHostImpl(inner.getValue(), this.manager())); } - public CapabilityHost get(String resourceGroupName, String accountName, String capabilityHostname) { - CapabilityHostInner inner = this.serviceClient().get(resourceGroupName, accountName, capabilityHostname); + public CapabilityHost get(String resourceGroupName, String accountName, String capabilityHostName) { + CapabilityHostInner inner = this.serviceClient().get(resourceGroupName, accountName, capabilityHostName); if (inner != null) { return new CapabilityHostImpl(inner, this.manager()); } else { @@ -55,6 +44,24 @@ public CapabilityHost get(String resourceGroupName, String accountName, String c } } + public void delete(String resourceGroupName, String accountName, String capabilityHostName) { + this.serviceClient().delete(resourceGroupName, accountName, capabilityHostName); + } + + public void delete(String resourceGroupName, String accountName, String capabilityHostName, Context context) { + this.serviceClient().delete(resourceGroupName, accountName, capabilityHostName, context); + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CapabilityHostImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CapabilityHostImpl(inner1, this.manager())); + } + public CapabilityHost getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { @@ -66,12 +73,12 @@ public CapabilityHost getById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); } - String capabilityHostname = ResourceManagerUtils.getValueFromIdByName(id, "capabilityHosts"); - if (capabilityHostname == null) { + String capabilityHostName = ResourceManagerUtils.getValueFromIdByName(id, "capabilityHosts"); + if (capabilityHostName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'capabilityHosts'.", id))); } - return this.getWithResponse(resourceGroupName, accountName, capabilityHostname, Context.NONE).getValue(); + return this.getWithResponse(resourceGroupName, accountName, capabilityHostName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { @@ -85,12 +92,12 @@ public Response getByIdWithResponse(String id, Context context) throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); } - String capabilityHostname = ResourceManagerUtils.getValueFromIdByName(id, "capabilityHosts"); - if (capabilityHostname == null) { + String capabilityHostName = ResourceManagerUtils.getValueFromIdByName(id, "capabilityHosts"); + if (capabilityHostName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'capabilityHosts'.", id))); } - return this.getWithResponse(resourceGroupName, accountName, capabilityHostname, context); + return this.getWithResponse(resourceGroupName, accountName, capabilityHostName, context); } public void deleteById(String id) { @@ -104,12 +111,12 @@ public void deleteById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); } - String capabilityHostname = ResourceManagerUtils.getValueFromIdByName(id, "capabilityHosts"); - if (capabilityHostname == null) { + String capabilityHostName = ResourceManagerUtils.getValueFromIdByName(id, "capabilityHosts"); + if (capabilityHostName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'capabilityHosts'.", id))); } - this.delete(resourceGroupName, accountName, capabilityHostname, Context.NONE); + this.delete(resourceGroupName, accountName, capabilityHostName, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { @@ -123,12 +130,12 @@ public void deleteByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); } - String capabilityHostname = ResourceManagerUtils.getValueFromIdByName(id, "capabilityHosts"); - if (capabilityHostname == null) { + String capabilityHostName = ResourceManagerUtils.getValueFromIdByName(id, "capabilityHosts"); + if (capabilityHostName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'capabilityHosts'.", id))); } - this.delete(resourceGroupName, accountName, capabilityHostname, context); + this.delete(resourceGroupName, accountName, capabilityHostName, context); } private AccountCapabilityHostsClient serviceClient() { diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountConnectionsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountConnectionsClientImpl.java index fc17d9b5a2fc..a2c8f310fa6a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountConnectionsClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountConnectionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -29,10 +29,9 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.cognitiveservices.fluent.AccountConnectionsClient; import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; -import com.azure.resourcemanager.cognitiveservices.models.ConnectionPropertiesV2BasicResourceArmPaginatedResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.ConnectionPropertiesV2BasicResourceArmPaginatedResult; import com.azure.resourcemanager.cognitiveservices.models.ConnectionUpdateContent; import reactor.core.publisher.Mono; @@ -65,121 +64,112 @@ public final class AccountConnectionsClientImpl implements AccountConnectionsCli * The interface defining all the services for CognitiveServicesManagementClientAccountConnections to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CognitiveServicesManagementClientAccountConnections") public interface AccountConnectionsService { @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}") - @ExpectedResponses({ 200, 204 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("connectionName") String connectionName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("connectionName") String connectionName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}") - @ExpectedResponses({ 200, 204 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("connectionName") String connectionName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("connectionName") String connectionName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}") + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("connectionName") String connectionName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("connectionName") String connectionName, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConnectionPropertiesV2BasicResourceInner connection, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}") + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("connectionName") String connectionName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("connectionName") String connectionName, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConnectionPropertiesV2BasicResourceInner connection, Context context); @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("connectionName") String connectionName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ConnectionUpdateContent connection, @HeaderParam("Accept") String accept, - Context context); + @PathParam("connectionName") String connectionName, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConnectionUpdateContent connection, Context context); @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("connectionName") String connectionName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ConnectionUpdateContent connection, @HeaderParam("Accept") String accept, - Context context); + @PathParam("connectionName") String connectionName, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConnectionUpdateContent connection, Context context); - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}") - @ExpectedResponses({ 200 }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("connectionName") String connectionName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ConnectionPropertiesV2BasicResourceInner connection, - @HeaderParam("Accept") String accept, Context context); + @PathParam("connectionName") String connectionName, Context context); - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}") - @ExpectedResponses({ 200 }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections/{connectionName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response createSync(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("connectionName") String connectionName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ConnectionPropertiesV2BasicResourceInner connection, - @HeaderParam("Accept") String accept, Context context); + @PathParam("connectionName") String connectionName, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @QueryParam("target") String target, @QueryParam("category") String category, - @QueryParam("api-version") String apiVersion, @QueryParam("includeAll") Boolean includeAll, - @HeaderParam("Accept") String accept, Context context); + @QueryParam("includeAll") Boolean includeAll, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/connections") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @QueryParam("target") String target, @QueryParam("category") String category, - @QueryParam("api-version") String apiVersion, @QueryParam("includeAll") Boolean includeAll, - @HeaderParam("Accept") String accept, Context context); + @QueryParam("includeAll") Boolean includeAll, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -187,12 +177,12 @@ Mono> listNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Delete Cognitive Services account connection by name. + * Lists Cognitive Services account connection by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -200,38 +190,20 @@ Response listNextSync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return connection base resource schema along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String accountName, - String connectionName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (connectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, + String accountName, String connectionName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, connectionName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, connectionName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete Cognitive Services account connection by name. + * Lists Cognitive Services account connection by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -239,15 +211,17 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return connection base resource schema on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String accountName, String connectionName) { - return deleteWithResponseAsync(resourceGroupName, accountName, connectionName).flatMap(ignored -> Mono.empty()); + private Mono getAsync(String resourceGroupName, String accountName, + String connectionName) { + return getWithResponseAsync(resourceGroupName, accountName, connectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Delete Cognitive Services account connection by name. + * Lists Cognitive Services account connection by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -256,40 +230,18 @@ private Mono deleteAsync(String resourceGroupName, String accountName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return connection base resource schema along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String accountName, String connectionName, - Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (connectionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } + public Response getWithResponse(String resourceGroupName, + String accountName, String connectionName, Context context) { final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, connectionName, this.client.getApiVersion(), accept, context); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, connectionName, accept, context); } /** - * Delete Cognitive Services account connection by name. + * Lists Cognitive Services account connection by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -297,53 +249,39 @@ public Response deleteWithResponse(String resourceGroupName, String accoun * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String connectionName) { - deleteWithResponse(resourceGroupName, accountName, connectionName, Context.NONE); + public ConnectionPropertiesV2BasicResourceInner get(String resourceGroupName, String accountName, + String connectionName) { + return getWithResponse(resourceGroupName, accountName, connectionName, Context.NONE).getValue(); } /** - * Lists Cognitive Services account connection by name. + * Create or update Cognitive Services account connection under the specified account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param connectionName Friendly name of the connection. + * @param connection The object for creating or updating a new account connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return connection base resource schema along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String accountName, String connectionName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (connectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } + private Mono> createWithResponseAsync(String resourceGroupName, + String accountName, String connectionName, ConnectionPropertiesV2BasicResourceInner connection) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, connectionName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, connectionName, accept, connection, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists Cognitive Services account connection by name. + * Create or update Cognitive Services account connection under the specified account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -354,18 +292,20 @@ private Mono> getWithResponse * @return connection base resource schema on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String accountName, + private Mono createAsync(String resourceGroupName, String accountName, String connectionName) { - return getWithResponseAsync(resourceGroupName, accountName, connectionName) + final ConnectionPropertiesV2BasicResourceInner connection = null; + return createWithResponseAsync(resourceGroupName, accountName, connectionName, connection) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Lists Cognitive Services account connection by name. + * Create or update Cognitive Services account connection under the specified account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param connectionName Friendly name of the connection. + * @param connection The object for creating or updating a new account connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -373,37 +313,17 @@ private Mono getAsync(String resourceG * @return connection base resource schema along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, - String accountName, String connectionName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (connectionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } + public Response createWithResponse(String resourceGroupName, + String accountName, String connectionName, ConnectionPropertiesV2BasicResourceInner connection, + Context context) { final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, connectionName, this.client.getApiVersion(), accept, context); + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, connectionName, accept, connection, + context); } /** - * Lists Cognitive Services account connection by name. + * Create or update Cognitive Services account connection under the specified account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -414,9 +334,10 @@ public Response getWithResponse(String * @return connection base resource schema. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectionPropertiesV2BasicResourceInner get(String resourceGroupName, String accountName, + public ConnectionPropertiesV2BasicResourceInner create(String resourceGroupName, String accountName, String connectionName) { - return getWithResponse(resourceGroupName, accountName, connectionName, Context.NONE).getValue(); + final ConnectionPropertiesV2BasicResourceInner connection = null; + return createWithResponse(resourceGroupName, accountName, connectionName, connection, Context.NONE).getValue(); } /** @@ -434,32 +355,11 @@ public ConnectionPropertiesV2BasicResourceInner get(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String accountName, String connectionName, ConnectionUpdateContent connection) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (connectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } - if (connection != null) { - connection.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, connectionName, this.client.getApiVersion(), connection, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, connectionName, accept, connection, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -498,34 +398,10 @@ private Mono updateAsync(String resour @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse(String resourceGroupName, String accountName, String connectionName, ConnectionUpdateContent connection, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (connectionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } - if (connection != null) { - connection.validate(); - } final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, connectionName, this.client.getApiVersion(), connection, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, connectionName, accept, connection, + context); } /** @@ -547,51 +423,27 @@ public ConnectionPropertiesV2BasicResourceInner update(String resourceGroupName, } /** - * Create or update Cognitive Services account connection under the specified account. + * Delete Cognitive Services account connection by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param connectionName Friendly name of the connection. - * @param connection The object for creating or updating a new account connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String resourceGroupName, - String accountName, String connectionName, ConnectionPropertiesV2BasicResourceInner connection) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (connectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } - if (connection != null) { - connection.validate(); - } - final String accept = "application/json"; + private Mono> deleteWithResponseAsync(String resourceGroupName, String accountName, + String connectionName) { return FluxUtil - .withContext( - context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, connectionName, this.client.getApiVersion(), connection, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, connectionName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or update Cognitive Services account connection under the specified account. + * Delete Cognitive Services account connection by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -599,65 +451,34 @@ private Mono> createWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String accountName, - String connectionName) { - final ConnectionPropertiesV2BasicResourceInner connection = null; - return createWithResponseAsync(resourceGroupName, accountName, connectionName, connection) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono deleteAsync(String resourceGroupName, String accountName, String connectionName) { + return deleteWithResponseAsync(resourceGroupName, accountName, connectionName).flatMap(ignored -> Mono.empty()); } /** - * Create or update Cognitive Services account connection under the specified account. + * Delete Cognitive Services account connection by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param connectionName Friendly name of the connection. - * @param connection The object for creating or updating a new account connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse(String resourceGroupName, - String accountName, String connectionName, ConnectionPropertiesV2BasicResourceInner connection, + public Response deleteWithResponse(String resourceGroupName, String accountName, String connectionName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (connectionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } - if (connection != null) { - connection.validate(); - } - final String accept = "application/json"; - return service.createSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, connectionName, this.client.getApiVersion(), connection, accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, connectionName, context); } /** - * Create or update Cognitive Services account connection under the specified account. + * Delete Cognitive Services account connection by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -665,13 +486,10 @@ public Response createWithResponse(Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectionPropertiesV2BasicResourceInner create(String resourceGroupName, String accountName, - String connectionName) { - final ConnectionPropertiesV2BasicResourceInner connection = null; - return createWithResponse(resourceGroupName, accountName, connectionName, connection, Context.NONE).getValue(); + public void delete(String resourceGroupName, String accountName, String connectionName) { + deleteWithResponse(resourceGroupName, accountName, connectionName, Context.NONE); } /** @@ -691,26 +509,11 @@ public ConnectionPropertiesV2BasicResourceInner create(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String accountName, String target, String category, Boolean includeAll) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, target, category, this.client.getApiVersion(), includeAll, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, target, category, includeAll, accept, + context)) .>map( res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -775,28 +578,10 @@ private PagedFlux listAsync(String res @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String accountName, String target, String category, Boolean includeAll) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } final String accept = "application/json"; Response res - = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, target, category, this.client.getApiVersion(), includeAll, accept, Context.NONE); + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, target, category, includeAll, accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -819,28 +604,10 @@ private PagedResponse listSinglePage(S @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String accountName, String target, String category, Boolean includeAll, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } final String accept = "application/json"; Response res - = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, target, category, this.client.getApiVersion(), includeAll, accept, context); + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, target, category, includeAll, accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -900,13 +667,6 @@ public PagedIterable list(String resou */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( @@ -928,15 +688,6 @@ private Mono> listNextSi */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -959,21 +710,10 @@ private PagedResponse listNextSinglePa @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(AccountConnectionsClientImpl.class); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountConnectionsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountConnectionsImpl.java index 52111f23a59a..1a0fdff296a1 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountConnectionsImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountConnectionsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -13,6 +13,7 @@ import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; import com.azure.resourcemanager.cognitiveservices.models.AccountConnections; import com.azure.resourcemanager.cognitiveservices.models.ConnectionPropertiesV2BasicResource; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionUpdateContent; public final class AccountConnectionsImpl implements AccountConnections { private static final ClientLogger LOGGER = new ClientLogger(AccountConnectionsImpl.class); @@ -27,31 +28,57 @@ public AccountConnectionsImpl(AccountConnectionsClient innerClient, this.serviceManager = serviceManager; } - public Response deleteWithResponse(String resourceGroupName, String accountName, String connectionName, - Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, connectionName, context); - } - - public void delete(String resourceGroupName, String accountName, String connectionName) { - this.serviceClient().delete(resourceGroupName, accountName, connectionName); - } - public Response getWithResponse(String resourceGroupName, String accountName, String connectionName, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, accountName, connectionName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ConnectionPropertiesV2BasicResourceImpl(inner.getValue(), this.manager())); + } + + public ConnectionPropertiesV2BasicResource get(String resourceGroupName, String accountName, + String connectionName) { + ConnectionPropertiesV2BasicResourceInner inner + = this.serviceClient().get(resourceGroupName, accountName, connectionName); + if (inner != null) { + return new ConnectionPropertiesV2BasicResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createWithResponse(String resourceGroupName, + String accountName, String connectionName, ConnectionPropertiesV2BasicResourceInner connection, + Context context) { + Response inner = this.serviceClient() + .createWithResponse(resourceGroupName, accountName, connectionName, connection, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ConnectionPropertiesV2BasicResourceImpl(inner.getValue(), this.manager())); + } + + public ConnectionPropertiesV2BasicResource create(String resourceGroupName, String accountName, + String connectionName) { + ConnectionPropertiesV2BasicResourceInner inner + = this.serviceClient().create(resourceGroupName, accountName, connectionName); if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ConnectionPropertiesV2BasicResourceImpl(inner.getValue(), this.manager())); + return new ConnectionPropertiesV2BasicResourceImpl(inner, this.manager()); } else { return null; } } - public ConnectionPropertiesV2BasicResource get(String resourceGroupName, String accountName, + public Response updateWithResponse(String resourceGroupName, + String accountName, String connectionName, ConnectionUpdateContent connection, Context context) { + Response inner = this.serviceClient() + .updateWithResponse(resourceGroupName, accountName, connectionName, connection, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ConnectionPropertiesV2BasicResourceImpl(inner.getValue(), this.manager())); + } + + public ConnectionPropertiesV2BasicResource update(String resourceGroupName, String accountName, String connectionName) { ConnectionPropertiesV2BasicResourceInner inner - = this.serviceClient().get(resourceGroupName, accountName, connectionName); + = this.serviceClient().update(resourceGroupName, accountName, connectionName); if (inner != null) { return new ConnectionPropertiesV2BasicResourceImpl(inner, this.manager()); } else { @@ -59,6 +86,15 @@ public ConnectionPropertiesV2BasicResource get(String resourceGroupName, String } } + public Response deleteWithResponse(String resourceGroupName, String accountName, String connectionName, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, accountName, connectionName, context); + } + + public void delete(String resourceGroupName, String accountName, String connectionName) { + this.serviceClient().delete(resourceGroupName, accountName, connectionName); + } + public PagedIterable list(String resourceGroupName, String accountName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); @@ -74,82 +110,6 @@ public PagedIterable list(String resourceGr inner1 -> new ConnectionPropertiesV2BasicResourceImpl(inner1, this.manager())); } - public ConnectionPropertiesV2BasicResource getById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String connectionName = ResourceManagerUtils.getValueFromIdByName(id, "connections"); - if (connectionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, connectionName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String connectionName = ResourceManagerUtils.getValueFromIdByName(id, "connections"); - if (connectionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); - } - return this.getWithResponse(resourceGroupName, accountName, connectionName, context); - } - - public void deleteById(String id) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String connectionName = ResourceManagerUtils.getValueFromIdByName(id, "connections"); - if (connectionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); - } - this.deleteWithResponse(resourceGroupName, accountName, connectionName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (accountName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); - } - String connectionName = ResourceManagerUtils.getValueFromIdByName(id, "connections"); - if (connectionName == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); - } - return this.deleteWithResponse(resourceGroupName, accountName, connectionName, context); - } - private AccountConnectionsClient serviceClient() { return this.innerClient; } @@ -157,8 +117,4 @@ private AccountConnectionsClient serviceClient() { private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { return this.serviceManager; } - - public ConnectionPropertiesV2BasicResourceImpl define(String name) { - return new ConnectionPropertiesV2BasicResourceImpl(name, this.manager()); - } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountImpl.java index e81b47bbb6e5..a5df28d63d4c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -35,12 +35,25 @@ public String type() { return this.innerModel().type(); } - public String etag() { - return this.innerModel().etag(); + public AccountProperties properties() { + return this.innerModel().properties(); } - public SystemData systemData() { - return this.innerModel().systemData(); + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public String location() { + return this.innerModel().location(); + } + + public String etag() { + return this.innerModel().etag(); } public String kind() { @@ -55,21 +68,8 @@ public Identity identity() { return this.innerModel().identity(); } - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String location() { - return this.innerModel().location(); - } - - public AccountProperties properties() { - return this.innerModel().properties(); + public SystemData systemData() { + return this.innerModel().systemData(); } public Region region() { @@ -194,6 +194,11 @@ public AccountImpl withTags(Map tags) { return this; } + public AccountImpl withProperties(AccountProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + public AccountImpl withKind(String kind) { this.innerModel().withKind(kind); return this; @@ -208,9 +213,4 @@ public AccountImpl withIdentity(Identity identity) { this.innerModel().withIdentity(identity); return this; } - - public AccountImpl withProperties(AccountProperties properties) { - this.innerModel().withProperties(properties); - return this; - } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountModelImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountModelImpl.java index 5ca104c65530..67070fc41db6 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountModelImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountModelImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountSkuListResultImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountSkuListResultImpl.java index 3b0d724f98d4..cd9cb4a5738c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountSkuListResultImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountSkuListResultImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountsClientImpl.java index a68f034d38a9..ea31c10b88d5 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountsClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -32,7 +32,6 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.cognitiveservices.fluent.AccountsClient; @@ -41,8 +40,8 @@ import com.azure.resourcemanager.cognitiveservices.fluent.models.AccountSkuListResultInner; import com.azure.resourcemanager.cognitiveservices.fluent.models.ApiKeysInner; import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageListResultInner; -import com.azure.resourcemanager.cognitiveservices.models.AccountListResult; -import com.azure.resourcemanager.cognitiveservices.models.AccountModelListResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.AccountListResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.AccountModelListResult; import com.azure.resourcemanager.cognitiveservices.models.RegenerateKeyParameters; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -76,104 +75,104 @@ public final class AccountsClientImpl implements AccountsClient { * The interface defining all the services for CognitiveServicesManagementClientAccounts to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CognitiveServicesManagementClientAccounts") public interface AccountsService { @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}") - @ExpectedResponses({ 200, 201, 202 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") AccountInner account, @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}") @ExpectedResponses({ 200, 201, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response createSync(@HostParam("$host") String endpoint, + Mono>> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AccountInner account, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") AccountInner account, @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AccountInner account, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono>> update(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") AccountInner account, @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AccountInner account, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response updateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") AccountInner account, @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AccountInner account, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getByResourceGroupSync(@HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listByResourceGroupSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/accounts") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @@ -181,7 +180,7 @@ Mono> list(@HostParam("$host") String endpoint, @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/accounts") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @@ -189,92 +188,90 @@ Response listSync(@HostParam("$host") String endpoint, @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/listKeys") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listKeys(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono> listKeys(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/listKeys") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listKeysSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response listKeysSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/regenerateKey") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> regenerateKey(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono> regenerateKey(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RegenerateKeyParameters parameters, @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RegenerateKeyParameters parameters, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/regenerateKey") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response regenerateKeySync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response regenerateKeySync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RegenerateKeyParameters parameters, @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RegenerateKeyParameters parameters, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/skus") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSkus(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono> listSkus(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/skus") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listSkusSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response listSkusSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/usages") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listUsages(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono> listUsages(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/usages") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listUsagesSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response listUsagesSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/models") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listModels(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono> listModels(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/models") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listModelsSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response listModelsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -282,7 +279,7 @@ Response listModelsSync(@HostParam("$host") String endpo @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -290,7 +287,7 @@ Mono> listByResourceGroupNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listByResourceGroupNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -298,21 +295,21 @@ Response listByResourceGroupNextSync( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listModelsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -320,10 +317,84 @@ Mono> listModelsNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listModelsNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } + /** + * Returns a Cognitive Services account specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location + * and SKU along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String accountName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a Cognitive Services account specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location + * and SKU on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String accountName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, accountName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns a Cognitive Services account specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location + * and SKU along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, + Context context) { + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context); + } + + /** + * Returns a Cognitive Services account specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location + * and SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccountInner getByResourceGroup(String resourceGroupName, String accountName) { + return getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + } + /** * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the keys for * developer to access intelligent APIs. It's also the resource type for billing. @@ -340,30 +411,11 @@ Response listModelsNextSync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync(String resourceGroupName, String accountName, AccountInner account) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (account == null) { - return Mono.error(new IllegalArgumentException("Parameter account is required and cannot be null.")); - } else { - account.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), account, accept, context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, contentType, accept, account, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -383,33 +435,11 @@ private Mono>> createWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response createWithResponse(String resourceGroupName, String accountName, AccountInner account) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (account == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter account is required and cannot be null.")); - } else { - account.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), account, accept, Context.NONE); + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, contentType, accept, account, + Context.NONE); } /** @@ -429,33 +459,10 @@ private Response createWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response createWithResponse(String resourceGroupName, String accountName, AccountInner account, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (account == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter account is required and cannot be null.")); - } else { - account.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), account, accept, context); + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, contentType, accept, account, context); } /** @@ -593,30 +600,11 @@ public AccountInner create(String resourceGroupName, String accountName, Account @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String accountName, AccountInner account) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (account == null) { - return Mono.error(new IllegalArgumentException("Parameter account is required and cannot be null.")); - } else { - account.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), account, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, contentType, accept, account, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -635,33 +623,11 @@ private Mono>> updateWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response updateWithResponse(String resourceGroupName, String accountName, AccountInner account) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (account == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter account is required and cannot be null.")); - } else { - account.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), account, accept, Context.NONE); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, contentType, accept, account, + Context.NONE); } /** @@ -680,33 +646,10 @@ private Response updateWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response updateWithResponse(String resourceGroupName, String accountName, AccountInner account, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (account == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter account is required and cannot be null.")); - } else { - account.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), account, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, contentType, accept, account, context); } /** @@ -835,25 +778,9 @@ public AccountInner update(String resourceGroupName, String accountName, Account */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -869,27 +796,8 @@ private Mono>> deleteWithResponseAsync(String resource */ @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, Context.NONE); } /** @@ -905,27 +813,8 @@ private Response deleteWithResponse(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String accountName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, context); } /** @@ -1023,113 +912,6 @@ public void delete(String resourceGroupName, String accountName, Context context beginDelete(resourceGroupName, accountName, context).getFinalResult(); } - /** - * Returns a Cognitive Services account specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String accountName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, - accountName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a Cognitive Services account specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String accountName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, accountName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a Cognitive Services account specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, - Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return service.getByResourceGroupSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); - } - - /** - * Returns a Cognitive Services account specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccountInner getByResourceGroup(String resourceGroupName, String accountName) { - return getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); - } - /** * Returns all the resources of a particular type belonging to a resource group. * @@ -1142,22 +924,10 @@ public AccountInner getByResourceGroup(String resourceGroupName, String accountN */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1189,23 +959,9 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupNam */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; - Response res = service.listByResourceGroupSync(this.client.getEndpoint(), resourceGroupName, - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, Context.NONE); + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -1222,23 +978,9 @@ private PagedResponse listByResourceGroupSinglePage(String resourc */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; - Response res = service.listByResourceGroupSync(this.client.getEndpoint(), resourceGroupName, - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -1286,14 +1028,6 @@ public PagedIterable listByResourceGroup(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), @@ -1324,16 +1058,6 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage() { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); @@ -1352,16 +1076,6 @@ private PagedResponse listSinglePage() { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); @@ -1410,25 +1124,10 @@ public PagedIterable list(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listKeysWithResponseAsync(String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listKeys(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.listKeys(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1461,27 +1160,9 @@ private Mono listKeysAsync(String resourceGroupName, String accoun */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listKeysWithResponse(String resourceGroupName, String accountName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; - return service.listKeysSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service.listKeysSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context); } /** @@ -1514,30 +1195,12 @@ public ApiKeysInner listKeys(String resourceGroupName, String accountName) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono> regenerateKeyWithResponseAsync(String resourceGroupName, String accountName, RegenerateKeyParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.regenerateKey(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.regenerateKey(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, contentType, accept, parameters, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1574,33 +1237,10 @@ private Mono regenerateKeyAsync(String resourceGroupName, String a @ServiceMethod(returns = ReturnType.SINGLE) public Response regenerateKeyWithResponse(String resourceGroupName, String accountName, RegenerateKeyParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.regenerateKeySync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + return service.regenerateKeySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, contentType, accept, parameters, context); } /** @@ -1634,25 +1274,10 @@ public ApiKeysInner regenerateKey(String resourceGroupName, String accountName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSkusWithResponseAsync(String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listSkus(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.listSkus(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1686,27 +1311,9 @@ private Mono listSkusAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public Response listSkusWithResponse(String resourceGroupName, String accountName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; - return service.listSkusSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service.listSkusSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context); } /** @@ -1740,25 +1347,10 @@ public AccountSkuListResultInner listSkus(String resourceGroupName, String accou @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listUsagesWithResponseAsync(String resourceGroupName, String accountName, String filter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listUsages(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), filter, accept, context)) + .withContext(context -> service.listUsages(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, filter, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1795,27 +1387,9 @@ private Mono listUsagesAsync(String resourceGroupName, Str @ServiceMethod(returns = ReturnType.SINGLE) public Response listUsagesWithResponse(String resourceGroupName, String accountName, String filter, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; - return service.listUsagesSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), filter, accept, context); + return service.listUsagesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, filter, accept, context); } /** @@ -1848,25 +1422,10 @@ public UsageListResultInner listUsages(String resourceGroupName, String accountN @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listModelsSinglePageAsync(String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listModels(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.listModels(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1900,27 +1459,10 @@ private PagedFlux listModelsAsync(String resourceGroupName, S */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listModelsSinglePage(String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; - Response res = service.listModelsSync(this.client.getEndpoint(), resourceGroupName, - accountName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + Response res + = service.listModelsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -1939,27 +1481,10 @@ private PagedResponse listModelsSinglePage(String resourceGro @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listModelsSinglePage(String resourceGroupName, String accountName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; - Response res = service.listModelsSync(this.client.getEndpoint(), resourceGroupName, - accountName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + Response res + = service.listModelsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -2011,13 +1536,6 @@ public PagedIterable listModels(String resourceGroupName, Str */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -2038,15 +1556,6 @@ private Mono> listByResourceGroupNextSinglePageAsync */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -2066,15 +1575,6 @@ private PagedResponse listByResourceGroupNextSinglePage(String nex */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); @@ -2094,13 +1594,6 @@ private PagedResponse listByResourceGroupNextSinglePage(String nex */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), @@ -2119,15 +1612,6 @@ private Mono> listNextSinglePageAsync(String nextLin */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -2147,15 +1631,6 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), @@ -2174,13 +1649,6 @@ private PagedResponse listNextSinglePage(String nextLink, Context */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listModelsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listModelsNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -2200,15 +1668,6 @@ private Mono> listModelsNextSinglePageAsync(Str */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listModelsNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listModelsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -2228,21 +1687,10 @@ private PagedResponse listModelsNextSinglePage(String nextLin */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listModelsNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listModelsNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(AccountsClientImpl.class); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountsImpl.java index 7d79feec8277..1a5e65814871 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountsImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -36,24 +36,12 @@ public AccountsImpl(AccountsClient innerClient, this.serviceManager = serviceManager; } - public void deleteByResourceGroup(String resourceGroupName, String accountName) { - this.serviceClient().delete(resourceGroupName, accountName); - } - - public void delete(String resourceGroupName, String accountName, Context context) { - this.serviceClient().delete(resourceGroupName, accountName, context); - } - public Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, Context context) { Response inner = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, accountName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AccountImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AccountImpl(inner.getValue(), this.manager())); } public Account getByResourceGroup(String resourceGroupName, String accountName) { @@ -65,6 +53,14 @@ public Account getByResourceGroup(String resourceGroupName, String accountName) } } + public void deleteByResourceGroup(String resourceGroupName, String accountName) { + this.serviceClient().delete(resourceGroupName, accountName); + } + + public void delete(String resourceGroupName, String accountName, Context context) { + this.serviceClient().delete(resourceGroupName, accountName, context); + } + public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); return ResourceManagerUtils.mapPage(inner, inner1 -> new AccountImpl(inner1, this.manager())); @@ -88,12 +84,8 @@ public PagedIterable list(Context context) { public Response listKeysWithResponse(String resourceGroupName, String accountName, Context context) { Response inner = this.serviceClient().listKeysWithResponse(resourceGroupName, accountName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ApiKeysImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ApiKeysImpl(inner.getValue(), this.manager())); } public ApiKeys listKeys(String resourceGroupName, String accountName) { @@ -109,12 +101,8 @@ public Response regenerateKeyWithResponse(String resourceGroupName, Str RegenerateKeyParameters parameters, Context context) { Response inner = this.serviceClient().regenerateKeyWithResponse(resourceGroupName, accountName, parameters, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ApiKeysImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ApiKeysImpl(inner.getValue(), this.manager())); } public ApiKeys regenerateKey(String resourceGroupName, String accountName, RegenerateKeyParameters parameters) { @@ -130,12 +118,8 @@ public Response listSkusWithResponse(String resourceGroupN Context context) { Response inner = this.serviceClient().listSkusWithResponse(resourceGroupName, accountName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AccountSkuListResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AccountSkuListResultImpl(inner.getValue(), this.manager())); } public AccountSkuListResult listSkus(String resourceGroupName, String accountName) { @@ -151,12 +135,8 @@ public Response listUsagesWithResponse(String resourceGroupName Context context) { Response inner = this.serviceClient().listUsagesWithResponse(resourceGroupName, accountName, filter, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new UsageListResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new UsageListResultImpl(inner.getValue(), this.manager())); } public UsageListResult listUsages(String resourceGroupName, String accountName) { diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentApplicationImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentApplicationImpl.java new file mode 100644 index 000000000000..99d1901c3e98 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentApplicationImpl.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentApplicationInner; +import com.azure.resourcemanager.cognitiveservices.models.AgentApplication; +import com.azure.resourcemanager.cognitiveservices.models.AgentReferenceResourceArmPaginatedResult; +import com.azure.resourcemanager.cognitiveservices.models.AgenticApplicationProperties; + +public final class AgentApplicationImpl + implements AgentApplication, AgentApplication.Definition, AgentApplication.Update { + private AgentApplicationInner innerObject; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public AgenticApplicationProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public AgentApplicationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String projectName; + + private String name; + + public AgentApplicationImpl withExistingProject(String resourceGroupName, String accountName, String projectName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.projectName = projectName; + return this; + } + + public AgentApplication create() { + this.innerObject = serviceManager.serviceClient() + .getAgentApplications() + .createOrUpdate(resourceGroupName, accountName, projectName, name, this.innerModel(), Context.NONE); + return this; + } + + public AgentApplication create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAgentApplications() + .createOrUpdate(resourceGroupName, accountName, projectName, name, this.innerModel(), context); + return this; + } + + AgentApplicationImpl(String name, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = new AgentApplicationInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public AgentApplicationImpl update() { + return this; + } + + public AgentApplication apply() { + this.innerObject = serviceManager.serviceClient() + .getAgentApplications() + .createOrUpdate(resourceGroupName, accountName, projectName, name, this.innerModel(), Context.NONE); + return this; + } + + public AgentApplication apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAgentApplications() + .createOrUpdate(resourceGroupName, accountName, projectName, name, this.innerModel(), context); + return this; + } + + AgentApplicationImpl(AgentApplicationInner innerObject, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); + this.projectName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "projects"); + this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "applications"); + } + + public AgentApplication refresh() { + this.innerObject = serviceManager.serviceClient() + .getAgentApplications() + .getWithResponse(resourceGroupName, accountName, projectName, name, Context.NONE) + .getValue(); + return this; + } + + public AgentApplication refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAgentApplications() + .getWithResponse(resourceGroupName, accountName, projectName, name, context) + .getValue(); + return this; + } + + public Response listAgentsWithResponse(Context context) { + return serviceManager.agentApplications() + .listAgentsWithResponse(resourceGroupName, accountName, projectName, name, context); + } + + public AgentReferenceResourceArmPaginatedResult listAgents() { + return serviceManager.agentApplications().listAgents(resourceGroupName, accountName, projectName, name); + } + + public Response enableWithResponse(Context context) { + return serviceManager.agentApplications() + .enableWithResponse(resourceGroupName, accountName, projectName, name, context); + } + + public void enable() { + serviceManager.agentApplications().enable(resourceGroupName, accountName, projectName, name); + } + + public Response disableWithResponse(Context context) { + return serviceManager.agentApplications() + .disableWithResponse(resourceGroupName, accountName, projectName, name, context); + } + + public void disable() { + serviceManager.agentApplications().disable(resourceGroupName, accountName, projectName, name); + } + + public AgentApplicationImpl withProperties(AgenticApplicationProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentApplicationsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentApplicationsClientImpl.java new file mode 100644 index 000000000000..a77b0a6deb44 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentApplicationsClientImpl.java @@ -0,0 +1,1185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cognitiveservices.fluent.AgentApplicationsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentApplicationInner; +import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentReferenceResourceArmPaginatedResultInner; +import com.azure.resourcemanager.cognitiveservices.implementation.models.AgentApplicationResourceArmPaginatedResult; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AgentApplicationsClient. + */ +public final class AgentApplicationsClientImpl implements AgentApplicationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AgentApplicationsService service; + + /** + * The service client containing this operation class. + */ + private final CognitiveServicesManagementClientImpl client; + + /** + * Initializes an instance of AgentApplicationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AgentApplicationsClientImpl(CognitiveServicesManagementClientImpl client) { + this.service + = RestProxy.create(AgentApplicationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CognitiveServicesManagementClientAgentApplications to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CognitiveServicesManagementClientAgentApplications") + public interface AgentApplicationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AgentApplicationInner body, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{name}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") AgentApplicationInner body, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{name}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("name") String name, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @QueryParam("count") Integer count, + @QueryParam("$skip") Integer skip, @QueryParam("$skipToken") String skipToken, + @QueryParam(value = "names", multipleQueryParams = true) List names, + @QueryParam("searchText") String searchText, @QueryParam("orderBy") String orderBy, + @QueryParam("orderByAsc") Boolean orderByAsc, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @QueryParam("count") Integer count, + @QueryParam("$skip") Integer skip, @QueryParam("$skipToken") String skipToken, + @QueryParam(value = "names", multipleQueryParams = true) List names, + @QueryParam("searchText") String searchText, @QueryParam("orderBy") String orderBy, + @QueryParam("orderByAsc") Boolean orderByAsc, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{name}/listAgents") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAgents(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{name}/listAgents") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listAgentsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("name") String name, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{name}/enable") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> enable(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{name}/enable") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response enableSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{name}/disable") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> disable(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("name") String name, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{name}/disable") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response disableSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("name") String name, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets an Agent Application by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Agent Application by name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String projectName, String name) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an Agent Application by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Agent Application by name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String projectName, + String name) { + return getWithResponseAsync(resourceGroupName, accountName, projectName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an Agent Application by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Agent Application by name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, + String projectName, String name, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, projectName, name, accept, context); + } + + /** + * Gets an Agent Application by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Agent Application by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentApplicationInner get(String resourceGroupName, String accountName, String projectName, String name) { + return getWithResponse(resourceGroupName, accountName, projectName, name, Context.NONE).getValue(); + } + + /** + * Creates or updates an Agent Application (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param body Agent Application definition object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return agent Application resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String accountName, String projectName, String name, AgentApplicationInner body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, name, contentType, accept, + body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an Agent Application (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param body Agent Application definition object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return agent Application resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, + String projectName, String name, AgentApplicationInner body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, name, contentType, accept, + body, Context.NONE); + } + + /** + * Creates or updates an Agent Application (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param body Agent Application definition object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return agent Application resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, + String projectName, String name, AgentApplicationInner body, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, name, contentType, accept, + body, context); + } + + /** + * Creates or updates an Agent Application (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param body Agent Application definition object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of agent Application resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AgentApplicationInner> beginCreateOrUpdateAsync( + String resourceGroupName, String accountName, String projectName, String name, AgentApplicationInner body) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, accountName, projectName, name, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), AgentApplicationInner.class, AgentApplicationInner.class, + this.client.getContext()); + } + + /** + * Creates or updates an Agent Application (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param body Agent Application definition object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of agent Application resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AgentApplicationInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, String projectName, String name, AgentApplicationInner body) { + Response response + = createOrUpdateWithResponse(resourceGroupName, accountName, projectName, name, body); + return this.client.getLroResult(response, + AgentApplicationInner.class, AgentApplicationInner.class, Context.NONE); + } + + /** + * Creates or updates an Agent Application (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param body Agent Application definition object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of agent Application resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AgentApplicationInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, String projectName, String name, AgentApplicationInner body, + Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, accountName, projectName, name, body, context); + return this.client.getLroResult(response, + AgentApplicationInner.class, AgentApplicationInner.class, context); + } + + /** + * Creates or updates an Agent Application (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param body Agent Application definition object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return agent Application resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String accountName, + String projectName, String name, AgentApplicationInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, accountName, projectName, name, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an Agent Application (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param body Agent Application definition object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return agent Application resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentApplicationInner createOrUpdate(String resourceGroupName, String accountName, String projectName, + String name, AgentApplicationInner body) { + return beginCreateOrUpdate(resourceGroupName, accountName, projectName, name, body).getFinalResult(); + } + + /** + * Creates or updates an Agent Application (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param body Agent Application definition object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return agent Application resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentApplicationInner createOrUpdate(String resourceGroupName, String accountName, String projectName, + String name, AgentApplicationInner body, Context context) { + return beginCreateOrUpdate(resourceGroupName, accountName, projectName, name, body, context).getFinalResult(); + } + + /** + * Delete Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, + String projectName, String name) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, name, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String accountName, String projectName, + String name) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, name, Context.NONE); + } + + /** + * Delete Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String accountName, String projectName, + String name, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, name, context); + } + + /** + * Delete Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String accountName, + String projectName, String name) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, accountName, projectName, name); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String projectName, String name) { + Response response = deleteWithResponse(resourceGroupName, accountName, projectName, name); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String projectName, String name, Context context) { + Response response = deleteWithResponse(resourceGroupName, accountName, projectName, name, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String projectName, String name) { + return beginDeleteAsync(resourceGroupName, accountName, projectName, name).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String projectName, String name) { + beginDelete(resourceGroupName, accountName, projectName, name).getFinalResult(); + } + + /** + * Delete Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String projectName, String name, Context context) { + beginDelete(resourceGroupName, accountName, projectName, name, context).getFinalResult(); + } + + /** + * Lists Agent Applications in the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param count Number of agent applications to be retrieved in a page of results. + * @param skip Number of agent applications to skip. + * @param skipToken Continuation token for pagination. + * @param names Names of agent applications to retrieve. + * @param searchText Search text for filtering agent applications. + * @param orderBy Field to order by. + * @param orderByAsc Whether to order in ascending order. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Application entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String accountName, + String projectName, Integer count, Integer skip, String skipToken, List names, String searchText, + String orderBy, Boolean orderByAsc) { + final String accept = "application/json"; + List namesConverted = (names == null) + ? new ArrayList<>() + : names.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, count, skip, skipToken, + namesConverted, searchText, orderBy, orderByAsc, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists Agent Applications in the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param count Number of agent applications to be retrieved in a page of results. + * @param skip Number of agent applications to skip. + * @param skipToken Continuation token for pagination. + * @param names Names of agent applications to retrieve. + * @param searchText Search text for filtering agent applications. + * @param orderBy Field to order by. + * @param orderByAsc Whether to order in ascending order. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Application entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, String projectName, + Integer count, Integer skip, String skipToken, List names, String searchText, String orderBy, + Boolean orderByAsc) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, projectName, count, skip, + skipToken, names, searchText, orderBy, orderByAsc), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists Agent Applications in the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Application entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, + String projectName) { + final Integer count = null; + final Integer skip = null; + final String skipToken = null; + final List names = null; + final String searchText = null; + final String orderBy = null; + final Boolean orderByAsc = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, projectName, count, skip, + skipToken, names, searchText, orderBy, orderByAsc), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists Agent Applications in the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param count Number of agent applications to be retrieved in a page of results. + * @param skip Number of agent applications to skip. + * @param skipToken Continuation token for pagination. + * @param names Names of agent applications to retrieve. + * @param searchText Search text for filtering agent applications. + * @param orderBy Field to order by. + * @param orderByAsc Whether to order in ascending order. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Application entities along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String accountName, + String projectName, Integer count, Integer skip, String skipToken, List names, String searchText, + String orderBy, Boolean orderByAsc) { + final String accept = "application/json"; + List namesConverted = (names == null) + ? new ArrayList<>() + : names.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, + count, skip, skipToken, namesConverted, searchText, orderBy, orderByAsc, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists Agent Applications in the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param count Number of agent applications to be retrieved in a page of results. + * @param skip Number of agent applications to skip. + * @param skipToken Continuation token for pagination. + * @param names Names of agent applications to retrieve. + * @param searchText Search text for filtering agent applications. + * @param orderBy Field to order by. + * @param orderByAsc Whether to order in ascending order. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Application entities along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String accountName, + String projectName, Integer count, Integer skip, String skipToken, List names, String searchText, + String orderBy, Boolean orderByAsc, Context context) { + final String accept = "application/json"; + List namesConverted = (names == null) + ? new ArrayList<>() + : names.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, + count, skip, skipToken, namesConverted, searchText, orderBy, orderByAsc, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists Agent Applications in the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Application entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, String projectName) { + final Integer count = null; + final Integer skip = null; + final String skipToken = null; + final List names = null; + final String searchText = null; + final String orderBy = null; + final Boolean orderByAsc = null; + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, projectName, count, skip, + skipToken, names, searchText, orderBy, orderByAsc), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Lists Agent Applications in the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param count Number of agent applications to be retrieved in a page of results. + * @param skip Number of agent applications to skip. + * @param skipToken Continuation token for pagination. + * @param names Names of agent applications to retrieve. + * @param searchText Search text for filtering agent applications. + * @param orderBy Field to order by. + * @param orderByAsc Whether to order in ascending order. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Application entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, String projectName, + Integer count, Integer skip, String skipToken, List names, String searchText, String orderBy, + Boolean orderByAsc, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, projectName, count, skip, + skipToken, names, searchText, orderBy, orderByAsc, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Lists agents for an Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Reference entities along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listAgentsWithResponseAsync(String resourceGroupName, String accountName, String projectName, String name) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listAgents(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, name, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists agents for an Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Reference entities on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAgentsAsync(String resourceGroupName, + String accountName, String projectName, String name) { + return listAgentsWithResponseAsync(resourceGroupName, accountName, projectName, name) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Lists agents for an Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Reference entities along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listAgentsWithResponse(String resourceGroupName, + String accountName, String projectName, String name, Context context) { + final String accept = "application/json"; + return service.listAgentsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, name, accept, context); + } + + /** + * Lists agents for an Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Reference entities. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentReferenceResourceArmPaginatedResultInner listAgents(String resourceGroupName, String accountName, + String projectName, String name) { + return listAgentsWithResponse(resourceGroupName, accountName, projectName, name, Context.NONE).getValue(); + } + + /** + * Enables an Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> enableWithResponseAsync(String resourceGroupName, String accountName, + String projectName, String name) { + return FluxUtil + .withContext(context -> service.enable(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, name, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Enables an Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono enableAsync(String resourceGroupName, String accountName, String projectName, String name) { + return enableWithResponseAsync(resourceGroupName, accountName, projectName, name) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Enables an Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response enableWithResponse(String resourceGroupName, String accountName, String projectName, + String name, Context context) { + return service.enableSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, name, context); + } + + /** + * Enables an Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void enable(String resourceGroupName, String accountName, String projectName, String name) { + enableWithResponse(resourceGroupName, accountName, projectName, name, Context.NONE); + } + + /** + * Disables an Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> disableWithResponseAsync(String resourceGroupName, String accountName, + String projectName, String name) { + return FluxUtil + .withContext(context -> service.disable(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, name, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Disables an Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono disableAsync(String resourceGroupName, String accountName, String projectName, String name) { + return disableWithResponseAsync(resourceGroupName, accountName, projectName, name) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Disables an Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response disableWithResponse(String resourceGroupName, String accountName, String projectName, + String name, Context context) { + return service.disableSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, name, context); + } + + /** + * Disables an Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void disable(String resourceGroupName, String accountName, String projectName, String name) { + disableWithResponse(resourceGroupName, accountName, projectName, name, Context.NONE); + } + + /** + * Lists Agent Applications in the project. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Application entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists Agent Applications in the project. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Application entities along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists Agent Applications in the project. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Application entities along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentApplicationsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentApplicationsImpl.java new file mode 100644 index 000000000000..30d27328f362 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentApplicationsImpl.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cognitiveservices.fluent.AgentApplicationsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentApplicationInner; +import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentReferenceResourceArmPaginatedResultInner; +import com.azure.resourcemanager.cognitiveservices.models.AgentApplication; +import com.azure.resourcemanager.cognitiveservices.models.AgentApplications; +import com.azure.resourcemanager.cognitiveservices.models.AgentReferenceResourceArmPaginatedResult; +import java.util.List; + +public final class AgentApplicationsImpl implements AgentApplications { + private static final ClientLogger LOGGER = new ClientLogger(AgentApplicationsImpl.class); + + private final AgentApplicationsClient innerClient; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + public AgentApplicationsImpl(AgentApplicationsClient innerClient, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String accountName, String projectName, + String name, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, accountName, projectName, name, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AgentApplicationImpl(inner.getValue(), this.manager())); + } + + public AgentApplication get(String resourceGroupName, String accountName, String projectName, String name) { + AgentApplicationInner inner = this.serviceClient().get(resourceGroupName, accountName, projectName, name); + if (inner != null) { + return new AgentApplicationImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String projectName, String name) { + this.serviceClient().delete(resourceGroupName, accountName, projectName, name); + } + + public void delete(String resourceGroupName, String accountName, String projectName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, accountName, projectName, name, context); + } + + public PagedIterable list(String resourceGroupName, String accountName, String projectName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, accountName, projectName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AgentApplicationImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, String projectName, + Integer count, Integer skip, String skipToken, List names, String searchText, String orderBy, + Boolean orderByAsc, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, accountName, projectName, count, skip, skipToken, names, searchText, orderBy, + orderByAsc, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AgentApplicationImpl(inner1, this.manager())); + } + + public Response listAgentsWithResponse(String resourceGroupName, + String accountName, String projectName, String name, Context context) { + Response inner + = this.serviceClient().listAgentsWithResponse(resourceGroupName, accountName, projectName, name, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AgentReferenceResourceArmPaginatedResultImpl(inner.getValue(), this.manager())); + } + + public AgentReferenceResourceArmPaginatedResult listAgents(String resourceGroupName, String accountName, + String projectName, String name) { + AgentReferenceResourceArmPaginatedResultInner inner + = this.serviceClient().listAgents(resourceGroupName, accountName, projectName, name); + if (inner != null) { + return new AgentReferenceResourceArmPaginatedResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response enableWithResponse(String resourceGroupName, String accountName, String projectName, + String name, Context context) { + return this.serviceClient().enableWithResponse(resourceGroupName, accountName, projectName, name, context); + } + + public void enable(String resourceGroupName, String accountName, String projectName, String name) { + this.serviceClient().enable(resourceGroupName, accountName, projectName, name); + } + + public Response disableWithResponse(String resourceGroupName, String accountName, String projectName, + String name, Context context) { + return this.serviceClient().disableWithResponse(resourceGroupName, accountName, projectName, name, context); + } + + public void disable(String resourceGroupName, String accountName, String projectName, String name) { + this.serviceClient().disable(resourceGroupName, accountName, projectName, name); + } + + public AgentApplication getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "applications"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, projectName, name, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "applications"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, projectName, name, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "applications"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + this.delete(resourceGroupName, accountName, projectName, name, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String name = ResourceManagerUtils.getValueFromIdByName(id, "applications"); + if (name == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + this.delete(resourceGroupName, accountName, projectName, name, context); + } + + private AgentApplicationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } + + public AgentApplicationImpl define(String name) { + return new AgentApplicationImpl(name, this.manager()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentDeploymentImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentDeploymentImpl.java new file mode 100644 index 000000000000..acc2215db8e0 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentDeploymentImpl.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentDeploymentInner; +import com.azure.resourcemanager.cognitiveservices.models.AgentDeployment; +import com.azure.resourcemanager.cognitiveservices.models.AgentDeploymentProperties; + +public final class AgentDeploymentImpl implements AgentDeployment, AgentDeployment.Definition, AgentDeployment.Update { + private AgentDeploymentInner innerObject; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public AgentDeploymentProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public AgentDeploymentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String projectName; + + private String appName; + + private String deploymentName; + + public AgentDeploymentImpl withExistingApplication(String resourceGroupName, String accountName, String projectName, + String appName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.projectName = projectName; + this.appName = appName; + return this; + } + + public AgentDeployment create() { + this.innerObject = serviceManager.serviceClient() + .getAgentDeployments() + .createOrUpdate(resourceGroupName, accountName, projectName, appName, deploymentName, this.innerModel(), + Context.NONE); + return this; + } + + public AgentDeployment create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAgentDeployments() + .createOrUpdate(resourceGroupName, accountName, projectName, appName, deploymentName, this.innerModel(), + context); + return this; + } + + AgentDeploymentImpl(String name, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = new AgentDeploymentInner(); + this.serviceManager = serviceManager; + this.deploymentName = name; + } + + public AgentDeploymentImpl update() { + return this; + } + + public AgentDeployment apply() { + this.innerObject = serviceManager.serviceClient() + .getAgentDeployments() + .createOrUpdate(resourceGroupName, accountName, projectName, appName, deploymentName, this.innerModel(), + Context.NONE); + return this; + } + + public AgentDeployment apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAgentDeployments() + .createOrUpdate(resourceGroupName, accountName, projectName, appName, deploymentName, this.innerModel(), + context); + return this; + } + + AgentDeploymentImpl(AgentDeploymentInner innerObject, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); + this.projectName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "projects"); + this.appName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "applications"); + this.deploymentName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "agentDeployments"); + } + + public AgentDeployment refresh() { + this.innerObject = serviceManager.serviceClient() + .getAgentDeployments() + .getWithResponse(resourceGroupName, accountName, projectName, appName, deploymentName, Context.NONE) + .getValue(); + return this; + } + + public AgentDeployment refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getAgentDeployments() + .getWithResponse(resourceGroupName, accountName, projectName, appName, deploymentName, context) + .getValue(); + return this; + } + + public Response startWithResponse(Context context) { + return serviceManager.agentDeployments() + .startWithResponse(resourceGroupName, accountName, projectName, appName, deploymentName, context); + } + + public void start() { + serviceManager.agentDeployments().start(resourceGroupName, accountName, projectName, appName, deploymentName); + } + + public Response stopWithResponse(Context context) { + return serviceManager.agentDeployments() + .stopWithResponse(resourceGroupName, accountName, projectName, appName, deploymentName, context); + } + + public void stop() { + serviceManager.agentDeployments().stop(resourceGroupName, accountName, projectName, appName, deploymentName); + } + + public AgentDeploymentImpl withProperties(AgentDeploymentProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentDeploymentsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentDeploymentsClientImpl.java new file mode 100644 index 000000000000..1a38bd3fa2c8 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentDeploymentsClientImpl.java @@ -0,0 +1,1135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cognitiveservices.fluent.AgentDeploymentsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentDeploymentInner; +import com.azure.resourcemanager.cognitiveservices.implementation.models.AgentDeploymentResourceArmPaginatedResult; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AgentDeploymentsClient. + */ +public final class AgentDeploymentsClientImpl implements AgentDeploymentsClient { + /** + * The proxy service used to perform REST calls. + */ + private final AgentDeploymentsService service; + + /** + * The service client containing this operation class. + */ + private final CognitiveServicesManagementClientImpl client; + + /** + * Initializes an instance of AgentDeploymentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AgentDeploymentsClientImpl(CognitiveServicesManagementClientImpl client) { + this.service + = RestProxy.create(AgentDeploymentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CognitiveServicesManagementClientAgentDeployments to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CognitiveServicesManagementClientAgentDeployments") + public interface AgentDeploymentsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments/{deploymentName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments/{deploymentName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments/{deploymentName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") AgentDeploymentInner body, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments/{deploymentName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") AgentDeploymentInner body, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments/{deploymentName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments/{deploymentName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("appName") String appName, + @QueryParam("count") Integer count, @QueryParam("$skipToken") String skipToken, + @QueryParam(value = "names", multipleQueryParams = true) List names, + @QueryParam("orderBy") String orderBy, @QueryParam("orderByAsc") Boolean orderByAsc, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("appName") String appName, + @QueryParam("count") Integer count, @QueryParam("$skipToken") String skipToken, + @QueryParam(value = "names", multipleQueryParams = true) List names, + @QueryParam("orderBy") String orderBy, @QueryParam("orderByAsc") Boolean orderByAsc, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments/{deploymentName}/start") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> start(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments/{deploymentName}/start") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response startSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments/{deploymentName}/stop") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> stop(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/applications/{appName}/agentDeployments/{deploymentName}/stop") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response stopSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("appName") String appName, + @PathParam("deploymentName") String deploymentName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets an Agent Deployment by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Agent Deployment by name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String projectName, String appName, String deploymentName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, appName, deploymentName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets an Agent Deployment by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Agent Deployment by name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String projectName, + String appName, String deploymentName) { + return getWithResponseAsync(resourceGroupName, accountName, projectName, appName, deploymentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets an Agent Deployment by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Agent Deployment by name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, + String projectName, String appName, String deploymentName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, projectName, appName, deploymentName, accept, context); + } + + /** + * Gets an Agent Deployment by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Agent Deployment by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentDeploymentInner get(String resourceGroupName, String accountName, String projectName, String appName, + String deploymentName) { + return getWithResponse(resourceGroupName, accountName, projectName, appName, deploymentName, Context.NONE) + .getValue(); + } + + /** + * Creates or updates an Agent Deployment (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param body Agent Deployment definition object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return agent Deployment resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String accountName, String projectName, String appName, String deploymentName, AgentDeploymentInner body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, appName, deploymentName, + contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an Agent Deployment (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param body Agent Deployment definition object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return agent Deployment resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, + String projectName, String appName, String deploymentName, AgentDeploymentInner body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, appName, deploymentName, + contentType, accept, body, Context.NONE); + } + + /** + * Creates or updates an Agent Deployment (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param body Agent Deployment definition object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return agent Deployment resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, + String projectName, String appName, String deploymentName, AgentDeploymentInner body, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, appName, deploymentName, + contentType, accept, body, context); + } + + /** + * Creates or updates an Agent Deployment (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param body Agent Deployment definition object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of agent Deployment resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, AgentDeploymentInner> beginCreateOrUpdateAsync( + String resourceGroupName, String accountName, String projectName, String appName, String deploymentName, + AgentDeploymentInner body) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, accountName, + projectName, appName, deploymentName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AgentDeploymentInner.class, AgentDeploymentInner.class, this.client.getContext()); + } + + /** + * Creates or updates an Agent Deployment (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param body Agent Deployment definition object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of agent Deployment resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AgentDeploymentInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, String projectName, String appName, String deploymentName, + AgentDeploymentInner body) { + Response response + = createOrUpdateWithResponse(resourceGroupName, accountName, projectName, appName, deploymentName, body); + return this.client.getLroResult(response, + AgentDeploymentInner.class, AgentDeploymentInner.class, Context.NONE); + } + + /** + * Creates or updates an Agent Deployment (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param body Agent Deployment definition object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of agent Deployment resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, AgentDeploymentInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, String projectName, String appName, String deploymentName, + AgentDeploymentInner body, Context context) { + Response response = createOrUpdateWithResponse(resourceGroupName, accountName, projectName, appName, + deploymentName, body, context); + return this.client.getLroResult(response, + AgentDeploymentInner.class, AgentDeploymentInner.class, context); + } + + /** + * Creates or updates an Agent Deployment (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param body Agent Deployment definition object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return agent Deployment resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String accountName, + String projectName, String appName, String deploymentName, AgentDeploymentInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, accountName, projectName, appName, deploymentName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an Agent Deployment (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param body Agent Deployment definition object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return agent Deployment resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentDeploymentInner createOrUpdate(String resourceGroupName, String accountName, String projectName, + String appName, String deploymentName, AgentDeploymentInner body) { + return beginCreateOrUpdate(resourceGroupName, accountName, projectName, appName, deploymentName, body) + .getFinalResult(); + } + + /** + * Creates or updates an Agent Deployment (asynchronous). + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param body Agent Deployment definition object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return agent Deployment resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentDeploymentInner createOrUpdate(String resourceGroupName, String accountName, String projectName, + String appName, String deploymentName, AgentDeploymentInner body, Context context) { + return beginCreateOrUpdate(resourceGroupName, accountName, projectName, appName, deploymentName, body, context) + .getFinalResult(); + } + + /** + * Delete Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, + String projectName, String appName, String deploymentName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, appName, deploymentName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String accountName, String projectName, + String appName, String deploymentName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, appName, deploymentName, + Context.NONE); + } + + /** + * Delete Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String accountName, String projectName, + String appName, String deploymentName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, appName, deploymentName, + context); + } + + /** + * Delete Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String accountName, + String projectName, String appName, String deploymentName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, accountName, projectName, appName, deploymentName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String projectName, String appName, String deploymentName) { + Response response + = deleteWithResponse(resourceGroupName, accountName, projectName, appName, deploymentName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String projectName, String appName, String deploymentName, Context context) { + Response response + = deleteWithResponse(resourceGroupName, accountName, projectName, appName, deploymentName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String projectName, String appName, + String deploymentName) { + return beginDeleteAsync(resourceGroupName, accountName, projectName, appName, deploymentName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String projectName, String appName, + String deploymentName) { + beginDelete(resourceGroupName, accountName, projectName, appName, deploymentName).getFinalResult(); + } + + /** + * Delete Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String projectName, String appName, + String deploymentName, Context context) { + beginDelete(resourceGroupName, accountName, projectName, appName, deploymentName, context).getFinalResult(); + } + + /** + * Lists Agent Deployments in the application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param count Number of agent deployments to be retrieved in a page of results. + * @param skipToken Continuation token for pagination. + * @param names Names of agent deployments to retrieve. + * @param orderBy Field to order by. + * @param orderByAsc Whether to order in ascending order. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Deployment entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String accountName, + String projectName, String appName, Integer count, String skipToken, List names, String orderBy, + Boolean orderByAsc) { + final String accept = "application/json"; + List namesConverted = (names == null) + ? new ArrayList<>() + : names.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, appName, count, skipToken, + namesConverted, orderBy, orderByAsc, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists Agent Deployments in the application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param count Number of agent deployments to be retrieved in a page of results. + * @param skipToken Continuation token for pagination. + * @param names Names of agent deployments to retrieve. + * @param orderBy Field to order by. + * @param orderByAsc Whether to order in ascending order. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Deployment entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, String projectName, + String appName, Integer count, String skipToken, List names, String orderBy, Boolean orderByAsc) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, projectName, appName, count, + skipToken, names, orderBy, orderByAsc), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists Agent Deployments in the application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Deployment entities as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, String projectName, + String appName) { + final Integer count = null; + final String skipToken = null; + final List names = null; + final String orderBy = null; + final Boolean orderByAsc = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, projectName, appName, count, + skipToken, names, orderBy, orderByAsc), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists Agent Deployments in the application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param count Number of agent deployments to be retrieved in a page of results. + * @param skipToken Continuation token for pagination. + * @param names Names of agent deployments to retrieve. + * @param orderBy Field to order by. + * @param orderByAsc Whether to order in ascending order. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Deployment entities along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String accountName, + String projectName, String appName, Integer count, String skipToken, List names, String orderBy, + Boolean orderByAsc) { + final String accept = "application/json"; + List namesConverted = (names == null) + ? new ArrayList<>() + : names.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, + appName, count, skipToken, namesConverted, orderBy, orderByAsc, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists Agent Deployments in the application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param count Number of agent deployments to be retrieved in a page of results. + * @param skipToken Continuation token for pagination. + * @param names Names of agent deployments to retrieve. + * @param orderBy Field to order by. + * @param orderByAsc Whether to order in ascending order. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Deployment entities along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String accountName, + String projectName, String appName, Integer count, String skipToken, List names, String orderBy, + Boolean orderByAsc, Context context) { + final String accept = "application/json"; + List namesConverted = (names == null) + ? new ArrayList<>() + : names.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, + appName, count, skipToken, namesConverted, orderBy, orderByAsc, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists Agent Deployments in the application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Deployment entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, String projectName, + String appName) { + final Integer count = null; + final String skipToken = null; + final List names = null; + final String orderBy = null; + final Boolean orderByAsc = null; + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, projectName, appName, count, + skipToken, names, orderBy, orderByAsc), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Lists Agent Deployments in the application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param count Number of agent deployments to be retrieved in a page of results. + * @param skipToken Continuation token for pagination. + * @param names Names of agent deployments to retrieve. + * @param orderBy Field to order by. + * @param orderByAsc Whether to order in ascending order. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Deployment entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, String projectName, + String appName, Integer count, String skipToken, List names, String orderBy, Boolean orderByAsc, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, projectName, appName, count, + skipToken, names, orderBy, orderByAsc, context), nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Starts an Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> startWithResponseAsync(String resourceGroupName, String accountName, + String projectName, String appName, String deploymentName) { + return FluxUtil + .withContext(context -> service.start(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, appName, deploymentName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts an Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono startAsync(String resourceGroupName, String accountName, String projectName, String appName, + String deploymentName) { + return startWithResponseAsync(resourceGroupName, accountName, projectName, appName, deploymentName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Starts an Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response startWithResponse(String resourceGroupName, String accountName, String projectName, + String appName, String deploymentName, Context context) { + return service.startSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, appName, deploymentName, + context); + } + + /** + * Starts an Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String accountName, String projectName, String appName, + String deploymentName) { + startWithResponse(resourceGroupName, accountName, projectName, appName, deploymentName, Context.NONE); + } + + /** + * Stops an Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> stopWithResponseAsync(String resourceGroupName, String accountName, String projectName, + String appName, String deploymentName) { + return FluxUtil + .withContext(context -> service.stop(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, appName, deploymentName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stops an Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono stopAsync(String resourceGroupName, String accountName, String projectName, String appName, + String deploymentName) { + return stopWithResponseAsync(resourceGroupName, accountName, projectName, appName, deploymentName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Stops an Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response stopWithResponse(String resourceGroupName, String accountName, String projectName, + String appName, String deploymentName, Context context) { + return service.stopSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, projectName, appName, deploymentName, context); + } + + /** + * Stops an Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void stop(String resourceGroupName, String accountName, String projectName, String appName, + String deploymentName) { + stopWithResponse(resourceGroupName, accountName, projectName, appName, deploymentName, Context.NONE); + } + + /** + * Lists Agent Deployments in the application. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Deployment entities along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists Agent Deployments in the application. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Deployment entities along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists Agent Deployments in the application. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Deployment entities along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentDeploymentsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentDeploymentsImpl.java new file mode 100644 index 000000000000..595f1df8a293 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentDeploymentsImpl.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cognitiveservices.fluent.AgentDeploymentsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentDeploymentInner; +import com.azure.resourcemanager.cognitiveservices.models.AgentDeployment; +import com.azure.resourcemanager.cognitiveservices.models.AgentDeployments; +import java.util.List; + +public final class AgentDeploymentsImpl implements AgentDeployments { + private static final ClientLogger LOGGER = new ClientLogger(AgentDeploymentsImpl.class); + + private final AgentDeploymentsClient innerClient; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + public AgentDeploymentsImpl(AgentDeploymentsClient innerClient, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String accountName, String projectName, + String appName, String deploymentName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, accountName, projectName, appName, deploymentName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AgentDeploymentImpl(inner.getValue(), this.manager())); + } + + public AgentDeployment get(String resourceGroupName, String accountName, String projectName, String appName, + String deploymentName) { + AgentDeploymentInner inner + = this.serviceClient().get(resourceGroupName, accountName, projectName, appName, deploymentName); + if (inner != null) { + return new AgentDeploymentImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String projectName, String appName, + String deploymentName) { + this.serviceClient().delete(resourceGroupName, accountName, projectName, appName, deploymentName); + } + + public void delete(String resourceGroupName, String accountName, String projectName, String appName, + String deploymentName, Context context) { + this.serviceClient().delete(resourceGroupName, accountName, projectName, appName, deploymentName, context); + } + + public PagedIterable list(String resourceGroupName, String accountName, String projectName, + String appName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, accountName, projectName, appName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AgentDeploymentImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, String projectName, + String appName, Integer count, String skipToken, List names, String orderBy, Boolean orderByAsc, + Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, accountName, projectName, appName, count, skipToken, names, orderBy, orderByAsc, + context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AgentDeploymentImpl(inner1, this.manager())); + } + + public Response startWithResponse(String resourceGroupName, String accountName, String projectName, + String appName, String deploymentName, Context context) { + return this.serviceClient() + .startWithResponse(resourceGroupName, accountName, projectName, appName, deploymentName, context); + } + + public void start(String resourceGroupName, String accountName, String projectName, String appName, + String deploymentName) { + this.serviceClient().start(resourceGroupName, accountName, projectName, appName, deploymentName); + } + + public Response stopWithResponse(String resourceGroupName, String accountName, String projectName, + String appName, String deploymentName, Context context) { + return this.serviceClient() + .stopWithResponse(resourceGroupName, accountName, projectName, appName, deploymentName, context); + } + + public void stop(String resourceGroupName, String accountName, String projectName, String appName, + String deploymentName) { + this.serviceClient().stop(resourceGroupName, accountName, projectName, appName, deploymentName); + } + + public AgentDeployment getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String appName = ResourceManagerUtils.getValueFromIdByName(id, "applications"); + if (appName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "agentDeployments"); + if (deploymentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'agentDeployments'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, projectName, appName, deploymentName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String appName = ResourceManagerUtils.getValueFromIdByName(id, "applications"); + if (appName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "agentDeployments"); + if (deploymentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'agentDeployments'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, projectName, appName, deploymentName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String appName = ResourceManagerUtils.getValueFromIdByName(id, "applications"); + if (appName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "agentDeployments"); + if (deploymentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'agentDeployments'.", id))); + } + this.delete(resourceGroupName, accountName, projectName, appName, deploymentName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String appName = ResourceManagerUtils.getValueFromIdByName(id, "applications"); + if (appName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); + } + String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "agentDeployments"); + if (deploymentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'agentDeployments'.", id))); + } + this.delete(resourceGroupName, accountName, projectName, appName, deploymentName, context); + } + + private AgentDeploymentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } + + public AgentDeploymentImpl define(String name) { + return new AgentDeploymentImpl(name, this.manager()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentReferenceResourceArmPaginatedResultImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentReferenceResourceArmPaginatedResultImpl.java new file mode 100644 index 000000000000..0d50f9e15b49 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentReferenceResourceArmPaginatedResultImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentReferenceResourceArmPaginatedResultInner; +import com.azure.resourcemanager.cognitiveservices.models.AgentReference; +import com.azure.resourcemanager.cognitiveservices.models.AgentReferenceResourceArmPaginatedResult; +import java.util.Collections; +import java.util.List; + +public final class AgentReferenceResourceArmPaginatedResultImpl implements AgentReferenceResourceArmPaginatedResult { + private AgentReferenceResourceArmPaginatedResultInner innerObject; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + AgentReferenceResourceArmPaginatedResultImpl(AgentReferenceResourceArmPaginatedResultInner innerObject, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public AgentReferenceResourceArmPaginatedResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ApiKeysImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ApiKeysImpl.java index 0ea76ba4b639..6b9b6c2563c8 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ApiKeysImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ApiKeysImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CalculateModelCapacityResultImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CalculateModelCapacityResultImpl.java index 02d701cef8a2..cf00eb713d00 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CalculateModelCapacityResultImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CalculateModelCapacityResultImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CapabilityHostImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CapabilityHostImpl.java index a2ad414395e4..0a6e59233ec0 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CapabilityHostImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CapabilityHostImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -51,7 +51,7 @@ private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager man private String accountName; - private String capabilityHostname; + private String capabilityHostName; public CapabilityHostImpl withExistingAccount(String resourceGroupName, String accountName) { this.resourceGroupName = resourceGroupName; @@ -62,14 +62,14 @@ public CapabilityHostImpl withExistingAccount(String resourceGroupName, String a public CapabilityHost create() { this.innerObject = serviceManager.serviceClient() .getAccountCapabilityHosts() - .createOrUpdate(resourceGroupName, accountName, capabilityHostname, this.innerModel(), Context.NONE); + .createOrUpdate(resourceGroupName, accountName, capabilityHostName, this.innerModel(), Context.NONE); return this; } public CapabilityHost create(Context context) { this.innerObject = serviceManager.serviceClient() .getAccountCapabilityHosts() - .createOrUpdate(resourceGroupName, accountName, capabilityHostname, this.innerModel(), context); + .createOrUpdate(resourceGroupName, accountName, capabilityHostName, this.innerModel(), context); return this; } @@ -77,7 +77,7 @@ public CapabilityHost create(Context context) { com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { this.innerObject = new CapabilityHostInner(); this.serviceManager = serviceManager; - this.capabilityHostname = name; + this.capabilityHostName = name; } public CapabilityHostImpl update() { @@ -87,14 +87,14 @@ public CapabilityHostImpl update() { public CapabilityHost apply() { this.innerObject = serviceManager.serviceClient() .getAccountCapabilityHosts() - .createOrUpdate(resourceGroupName, accountName, capabilityHostname, this.innerModel(), Context.NONE); + .createOrUpdate(resourceGroupName, accountName, capabilityHostName, this.innerModel(), Context.NONE); return this; } public CapabilityHost apply(Context context) { this.innerObject = serviceManager.serviceClient() .getAccountCapabilityHosts() - .createOrUpdate(resourceGroupName, accountName, capabilityHostname, this.innerModel(), context); + .createOrUpdate(resourceGroupName, accountName, capabilityHostName, this.innerModel(), context); return this; } @@ -104,13 +104,13 @@ public CapabilityHost apply(Context context) { this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); - this.capabilityHostname = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "capabilityHosts"); + this.capabilityHostName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "capabilityHosts"); } public CapabilityHost refresh() { this.innerObject = serviceManager.serviceClient() .getAccountCapabilityHosts() - .getWithResponse(resourceGroupName, accountName, capabilityHostname, Context.NONE) + .getWithResponse(resourceGroupName, accountName, capabilityHostName, Context.NONE) .getValue(); return this; } @@ -118,7 +118,7 @@ public CapabilityHost refresh() { public CapabilityHost refresh(Context context) { this.innerObject = serviceManager.serviceClient() .getAccountCapabilityHosts() - .getWithResponse(resourceGroupName, accountName, capabilityHostname, context) + .getWithResponse(resourceGroupName, accountName, capabilityHostName, context) .getValue(); return this; } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CognitiveServicesManagementClientBuilder.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CognitiveServicesManagementClientBuilder.java index 044b45b4c1a1..647cb160abe7 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CognitiveServicesManagementClientBuilder.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CognitiveServicesManagementClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -20,34 +20,34 @@ @ServiceClientBuilder(serviceClients = { CognitiveServicesManagementClientImpl.class }) public final class CognitiveServicesManagementClientBuilder { /* - * The ID of the target subscription. + * Service host */ - private String subscriptionId; + private String endpoint; /** - * Sets The ID of the target subscription. + * Sets Service host. * - * @param subscriptionId the subscriptionId value. + * @param endpoint the endpoint value. * @return the CognitiveServicesManagementClientBuilder. */ - public CognitiveServicesManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public CognitiveServicesManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; return this; } /* - * server parameter + * The ID of the target subscription. The value must be an UUID. */ - private String endpoint; + private String subscriptionId; /** - * Sets server parameter. + * Sets The ID of the target subscription. The value must be an UUID. * - * @param endpoint the endpoint value. + * @param subscriptionId the subscriptionId value. * @return the CognitiveServicesManagementClientBuilder. */ - public CognitiveServicesManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public CognitiveServicesManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -132,7 +132,7 @@ public CognitiveServicesManagementClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); CognitiveServicesManagementClientImpl client = new CognitiveServicesManagementClientImpl(localPipeline, - localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CognitiveServicesManagementClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CognitiveServicesManagementClientImpl.java index 5cb03667a8b0..cdb25e0df05c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CognitiveServicesManagementClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CognitiveServicesManagementClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -29,18 +29,25 @@ import com.azure.resourcemanager.cognitiveservices.fluent.AccountCapabilityHostsClient; import com.azure.resourcemanager.cognitiveservices.fluent.AccountConnectionsClient; import com.azure.resourcemanager.cognitiveservices.fluent.AccountsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.AgentApplicationsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.AgentDeploymentsClient; import com.azure.resourcemanager.cognitiveservices.fluent.CognitiveServicesManagementClient; import com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient; import com.azure.resourcemanager.cognitiveservices.fluent.CommitmentTiersClient; +import com.azure.resourcemanager.cognitiveservices.fluent.ComputeOperationsClient; import com.azure.resourcemanager.cognitiveservices.fluent.DefenderForAISettingsClient; import com.azure.resourcemanager.cognitiveservices.fluent.DeletedAccountsClient; import com.azure.resourcemanager.cognitiveservices.fluent.DeploymentsClient; import com.azure.resourcemanager.cognitiveservices.fluent.EncryptionScopesClient; import com.azure.resourcemanager.cognitiveservices.fluent.LocationBasedModelCapacitiesClient; +import com.azure.resourcemanager.cognitiveservices.fluent.ManagedNetworkProvisionsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.ManagedNetworkSettingsOperationsClient; import com.azure.resourcemanager.cognitiveservices.fluent.ModelCapacitiesClient; import com.azure.resourcemanager.cognitiveservices.fluent.ModelsClient; import com.azure.resourcemanager.cognitiveservices.fluent.NetworkSecurityPerimeterConfigurationsClient; import com.azure.resourcemanager.cognitiveservices.fluent.OperationsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.OutboundRulesClient; +import com.azure.resourcemanager.cognitiveservices.fluent.OutboundRulesOperationsClient; import com.azure.resourcemanager.cognitiveservices.fluent.PrivateEndpointConnectionsClient; import com.azure.resourcemanager.cognitiveservices.fluent.PrivateLinkResourcesClient; import com.azure.resourcemanager.cognitiveservices.fluent.ProjectCapabilityHostsClient; @@ -50,10 +57,15 @@ import com.azure.resourcemanager.cognitiveservices.fluent.RaiBlocklistItemsClient; import com.azure.resourcemanager.cognitiveservices.fluent.RaiBlocklistsClient; import com.azure.resourcemanager.cognitiveservices.fluent.RaiContentFiltersClient; +import com.azure.resourcemanager.cognitiveservices.fluent.RaiExternalSafetyProvidersClient; +import com.azure.resourcemanager.cognitiveservices.fluent.RaiExternalSafetyProvidersOperationsClient; import com.azure.resourcemanager.cognitiveservices.fluent.RaiPoliciesClient; +import com.azure.resourcemanager.cognitiveservices.fluent.RaiToolLabelsClient; import com.azure.resourcemanager.cognitiveservices.fluent.RaiTopicsClient; import com.azure.resourcemanager.cognitiveservices.fluent.ResourceProvidersClient; import com.azure.resourcemanager.cognitiveservices.fluent.ResourceSkusClient; +import com.azure.resourcemanager.cognitiveservices.fluent.SubscriptionRaiPoliciesClient; +import com.azure.resourcemanager.cognitiveservices.fluent.TestRaiExternalSafetyProvidersClient; import com.azure.resourcemanager.cognitiveservices.fluent.UsagesClient; import java.io.IOException; import java.lang.reflect.Type; @@ -70,26 +82,12 @@ @ServiceClient(builder = CognitiveServicesManagementClientBuilder.class) public final class CognitiveServicesManagementClientImpl implements CognitiveServicesManagementClient { /** - * The ID of the target subscription. - */ - private final String subscriptionId; - - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** - * server parameter. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -98,12 +96,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -111,6 +109,20 @@ public String getApiVersion() { return this.apiVersion; } + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + /** * The HTTP pipeline to send requests through. */ @@ -153,76 +165,6 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } - /** - * The AccountsClient object to access its operations. - */ - private final AccountsClient accounts; - - /** - * Gets the AccountsClient object to access its operations. - * - * @return the AccountsClient object. - */ - public AccountsClient getAccounts() { - return this.accounts; - } - - /** - * The DeletedAccountsClient object to access its operations. - */ - private final DeletedAccountsClient deletedAccounts; - - /** - * Gets the DeletedAccountsClient object to access its operations. - * - * @return the DeletedAccountsClient object. - */ - public DeletedAccountsClient getDeletedAccounts() { - return this.deletedAccounts; - } - - /** - * The ResourceSkusClient object to access its operations. - */ - private final ResourceSkusClient resourceSkus; - - /** - * Gets the ResourceSkusClient object to access its operations. - * - * @return the ResourceSkusClient object. - */ - public ResourceSkusClient getResourceSkus() { - return this.resourceSkus; - } - - /** - * The UsagesClient object to access its operations. - */ - private final UsagesClient usages; - - /** - * Gets the UsagesClient object to access its operations. - * - * @return the UsagesClient object. - */ - public UsagesClient getUsages() { - return this.usages; - } - - /** - * The OperationsClient object to access its operations. - */ - private final OperationsClient operations; - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - public OperationsClient getOperations() { - return this.operations; - } - /** * The ResourceProvidersClient object to access its operations. */ @@ -238,59 +180,45 @@ public ResourceProvidersClient getResourceProviders() { } /** - * The CommitmentTiersClient object to access its operations. - */ - private final CommitmentTiersClient commitmentTiers; - - /** - * Gets the CommitmentTiersClient object to access its operations. - * - * @return the CommitmentTiersClient object. - */ - public CommitmentTiersClient getCommitmentTiers() { - return this.commitmentTiers; - } - - /** - * The ModelsClient object to access its operations. + * The OperationsClient object to access its operations. */ - private final ModelsClient models; + private final OperationsClient operations; /** - * Gets the ModelsClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the ModelsClient object. + * @return the OperationsClient object. */ - public ModelsClient getModels() { - return this.models; + public OperationsClient getOperations() { + return this.operations; } /** - * The LocationBasedModelCapacitiesClient object to access its operations. + * The AccountsClient object to access its operations. */ - private final LocationBasedModelCapacitiesClient locationBasedModelCapacities; + private final AccountsClient accounts; /** - * Gets the LocationBasedModelCapacitiesClient object to access its operations. + * Gets the AccountsClient object to access its operations. * - * @return the LocationBasedModelCapacitiesClient object. + * @return the AccountsClient object. */ - public LocationBasedModelCapacitiesClient getLocationBasedModelCapacities() { - return this.locationBasedModelCapacities; + public AccountsClient getAccounts() { + return this.accounts; } /** - * The ModelCapacitiesClient object to access its operations. + * The DeletedAccountsClient object to access its operations. */ - private final ModelCapacitiesClient modelCapacities; + private final DeletedAccountsClient deletedAccounts; /** - * Gets the ModelCapacitiesClient object to access its operations. + * Gets the DeletedAccountsClient object to access its operations. * - * @return the ModelCapacitiesClient object. + * @return the DeletedAccountsClient object. */ - public ModelCapacitiesClient getModelCapacities() { - return this.modelCapacities; + public DeletedAccountsClient getDeletedAccounts() { + return this.deletedAccounts; } /** @@ -307,20 +235,6 @@ public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { return this.privateEndpointConnections; } - /** - * The PrivateLinkResourcesClient object to access its operations. - */ - private final PrivateLinkResourcesClient privateLinkResources; - - /** - * Gets the PrivateLinkResourcesClient object to access its operations. - * - * @return the PrivateLinkResourcesClient object. - */ - public PrivateLinkResourcesClient getPrivateLinkResources() { - return this.privateLinkResources; - } - /** * The DeploymentsClient object to access its operations. */ @@ -378,17 +292,17 @@ public RaiPoliciesClient getRaiPolicies() { } /** - * The RaiBlocklistsClient object to access its operations. + * The SubscriptionRaiPoliciesClient object to access its operations. */ - private final RaiBlocklistsClient raiBlocklists; + private final SubscriptionRaiPoliciesClient subscriptionRaiPolicies; /** - * Gets the RaiBlocklistsClient object to access its operations. + * Gets the SubscriptionRaiPoliciesClient object to access its operations. * - * @return the RaiBlocklistsClient object. + * @return the SubscriptionRaiPoliciesClient object. */ - public RaiBlocklistsClient getRaiBlocklists() { - return this.raiBlocklists; + public SubscriptionRaiPoliciesClient getSubscriptionRaiPolicies() { + return this.subscriptionRaiPolicies; } /** @@ -405,6 +319,20 @@ public RaiBlocklistItemsClient getRaiBlocklistItems() { return this.raiBlocklistItems; } + /** + * The RaiBlocklistsClient object to access its operations. + */ + private final RaiBlocklistsClient raiBlocklists; + + /** + * Gets the RaiBlocklistsClient object to access its operations. + * + * @return the RaiBlocklistsClient object. + */ + public RaiBlocklistsClient getRaiBlocklists() { + return this.raiBlocklists; + } + /** * The RaiTopicsClient object to access its operations. */ @@ -419,6 +347,20 @@ public RaiTopicsClient getRaiTopics() { return this.raiTopics; } + /** + * The RaiToolLabelsClient object to access its operations. + */ + private final RaiToolLabelsClient raiToolLabels; + + /** + * Gets the RaiToolLabelsClient object to access its operations. + * + * @return the RaiToolLabelsClient object. + */ + public RaiToolLabelsClient getRaiToolLabels() { + return this.raiToolLabels; + } + /** * The RaiContentFiltersClient object to access its operations. */ @@ -476,31 +418,143 @@ public ProjectsClient getProjects() { } /** - * The AccountConnectionsClient object to access its operations. + * The ProjectConnectionsClient object to access its operations. */ - private final AccountConnectionsClient accountConnections; + private final ProjectConnectionsClient projectConnections; /** - * Gets the AccountConnectionsClient object to access its operations. + * Gets the ProjectConnectionsClient object to access its operations. * - * @return the AccountConnectionsClient object. + * @return the ProjectConnectionsClient object. */ - public AccountConnectionsClient getAccountConnections() { - return this.accountConnections; + public ProjectConnectionsClient getProjectConnections() { + return this.projectConnections; } /** - * The ProjectConnectionsClient object to access its operations. + * The ProjectCapabilityHostsClient object to access its operations. */ - private final ProjectConnectionsClient projectConnections; + private final ProjectCapabilityHostsClient projectCapabilityHosts; /** - * Gets the ProjectConnectionsClient object to access its operations. + * Gets the ProjectCapabilityHostsClient object to access its operations. * - * @return the ProjectConnectionsClient object. + * @return the ProjectCapabilityHostsClient object. */ - public ProjectConnectionsClient getProjectConnections() { - return this.projectConnections; + public ProjectCapabilityHostsClient getProjectCapabilityHosts() { + return this.projectCapabilityHosts; + } + + /** + * The QuotaTiersClient object to access its operations. + */ + private final QuotaTiersClient quotaTiers; + + /** + * Gets the QuotaTiersClient object to access its operations. + * + * @return the QuotaTiersClient object. + */ + public QuotaTiersClient getQuotaTiers() { + return this.quotaTiers; + } + + /** + * The AgentApplicationsClient object to access its operations. + */ + private final AgentApplicationsClient agentApplications; + + /** + * Gets the AgentApplicationsClient object to access its operations. + * + * @return the AgentApplicationsClient object. + */ + public AgentApplicationsClient getAgentApplications() { + return this.agentApplications; + } + + /** + * The ComputeOperationsClient object to access its operations. + */ + private final ComputeOperationsClient computeOperations; + + /** + * Gets the ComputeOperationsClient object to access its operations. + * + * @return the ComputeOperationsClient object. + */ + public ComputeOperationsClient getComputeOperations() { + return this.computeOperations; + } + + /** + * The PrivateLinkResourcesClient object to access its operations. + */ + private final PrivateLinkResourcesClient privateLinkResources; + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + public PrivateLinkResourcesClient getPrivateLinkResources() { + return this.privateLinkResources; + } + + /** + * The TestRaiExternalSafetyProvidersClient object to access its operations. + */ + private final TestRaiExternalSafetyProvidersClient testRaiExternalSafetyProviders; + + /** + * Gets the TestRaiExternalSafetyProvidersClient object to access its operations. + * + * @return the TestRaiExternalSafetyProvidersClient object. + */ + public TestRaiExternalSafetyProvidersClient getTestRaiExternalSafetyProviders() { + return this.testRaiExternalSafetyProviders; + } + + /** + * The RaiExternalSafetyProvidersClient object to access its operations. + */ + private final RaiExternalSafetyProvidersClient raiExternalSafetyProviders; + + /** + * Gets the RaiExternalSafetyProvidersClient object to access its operations. + * + * @return the RaiExternalSafetyProvidersClient object. + */ + public RaiExternalSafetyProvidersClient getRaiExternalSafetyProviders() { + return this.raiExternalSafetyProviders; + } + + /** + * The RaiExternalSafetyProvidersOperationsClient object to access its operations. + */ + private final RaiExternalSafetyProvidersOperationsClient raiExternalSafetyProvidersOperations; + + /** + * Gets the RaiExternalSafetyProvidersOperationsClient object to access its operations. + * + * @return the RaiExternalSafetyProvidersOperationsClient object. + */ + public RaiExternalSafetyProvidersOperationsClient getRaiExternalSafetyProvidersOperations() { + return this.raiExternalSafetyProvidersOperations; + } + + /** + * The AccountConnectionsClient object to access its operations. + */ + private final AccountConnectionsClient accountConnections; + + /** + * Gets the AccountConnectionsClient object to access its operations. + * + * @return the AccountConnectionsClient object. + */ + public AccountConnectionsClient getAccountConnections() { + return this.accountConnections; } /** @@ -518,31 +572,157 @@ public AccountCapabilityHostsClient getAccountCapabilityHosts() { } /** - * The ProjectCapabilityHostsClient object to access its operations. + * The OutboundRulesClient object to access its operations. */ - private final ProjectCapabilityHostsClient projectCapabilityHosts; + private final OutboundRulesClient outboundRules; /** - * Gets the ProjectCapabilityHostsClient object to access its operations. + * Gets the OutboundRulesClient object to access its operations. * - * @return the ProjectCapabilityHostsClient object. + * @return the OutboundRulesClient object. */ - public ProjectCapabilityHostsClient getProjectCapabilityHosts() { - return this.projectCapabilityHosts; + public OutboundRulesClient getOutboundRules() { + return this.outboundRules; } /** - * The QuotaTiersClient object to access its operations. + * The ManagedNetworkSettingsOperationsClient object to access its operations. */ - private final QuotaTiersClient quotaTiers; + private final ManagedNetworkSettingsOperationsClient managedNetworkSettingsOperations; /** - * Gets the QuotaTiersClient object to access its operations. + * Gets the ManagedNetworkSettingsOperationsClient object to access its operations. * - * @return the QuotaTiersClient object. + * @return the ManagedNetworkSettingsOperationsClient object. */ - public QuotaTiersClient getQuotaTiers() { - return this.quotaTiers; + public ManagedNetworkSettingsOperationsClient getManagedNetworkSettingsOperations() { + return this.managedNetworkSettingsOperations; + } + + /** + * The OutboundRulesOperationsClient object to access its operations. + */ + private final OutboundRulesOperationsClient outboundRulesOperations; + + /** + * Gets the OutboundRulesOperationsClient object to access its operations. + * + * @return the OutboundRulesOperationsClient object. + */ + public OutboundRulesOperationsClient getOutboundRulesOperations() { + return this.outboundRulesOperations; + } + + /** + * The ManagedNetworkProvisionsClient object to access its operations. + */ + private final ManagedNetworkProvisionsClient managedNetworkProvisions; + + /** + * Gets the ManagedNetworkProvisionsClient object to access its operations. + * + * @return the ManagedNetworkProvisionsClient object. + */ + public ManagedNetworkProvisionsClient getManagedNetworkProvisions() { + return this.managedNetworkProvisions; + } + + /** + * The AgentDeploymentsClient object to access its operations. + */ + private final AgentDeploymentsClient agentDeployments; + + /** + * Gets the AgentDeploymentsClient object to access its operations. + * + * @return the AgentDeploymentsClient object. + */ + public AgentDeploymentsClient getAgentDeployments() { + return this.agentDeployments; + } + + /** + * The ResourceSkusClient object to access its operations. + */ + private final ResourceSkusClient resourceSkus; + + /** + * Gets the ResourceSkusClient object to access its operations. + * + * @return the ResourceSkusClient object. + */ + public ResourceSkusClient getResourceSkus() { + return this.resourceSkus; + } + + /** + * The UsagesClient object to access its operations. + */ + private final UsagesClient usages; + + /** + * Gets the UsagesClient object to access its operations. + * + * @return the UsagesClient object. + */ + public UsagesClient getUsages() { + return this.usages; + } + + /** + * The CommitmentTiersClient object to access its operations. + */ + private final CommitmentTiersClient commitmentTiers; + + /** + * Gets the CommitmentTiersClient object to access its operations. + * + * @return the CommitmentTiersClient object. + */ + public CommitmentTiersClient getCommitmentTiers() { + return this.commitmentTiers; + } + + /** + * The ModelsClient object to access its operations. + */ + private final ModelsClient models; + + /** + * Gets the ModelsClient object to access its operations. + * + * @return the ModelsClient object. + */ + public ModelsClient getModels() { + return this.models; + } + + /** + * The LocationBasedModelCapacitiesClient object to access its operations. + */ + private final LocationBasedModelCapacitiesClient locationBasedModelCapacities; + + /** + * Gets the LocationBasedModelCapacitiesClient object to access its operations. + * + * @return the LocationBasedModelCapacitiesClient object. + */ + public LocationBasedModelCapacitiesClient getLocationBasedModelCapacities() { + return this.locationBasedModelCapacities; + } + + /** + * The ModelCapacitiesClient object to access its operations. + */ + private final ModelCapacitiesClient modelCapacities; + + /** + * Gets the ModelCapacitiesClient object to access its operations. + * + * @return the ModelCapacitiesClient object. + */ + public ModelCapacitiesClient getModelCapacities() { + return this.modelCapacities; } /** @@ -552,45 +732,57 @@ public QuotaTiersClient getQuotaTiers() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. - * @param endpoint server parameter. + * @param endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ CognitiveServicesManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2025-09-01"; + this.subscriptionId = subscriptionId; + this.apiVersion = "2026-01-15-preview"; + this.resourceProviders = new ResourceProvidersClientImpl(this); + this.operations = new OperationsClientImpl(this); this.accounts = new AccountsClientImpl(this); this.deletedAccounts = new DeletedAccountsClientImpl(this); - this.resourceSkus = new ResourceSkusClientImpl(this); - this.usages = new UsagesClientImpl(this); - this.operations = new OperationsClientImpl(this); - this.resourceProviders = new ResourceProvidersClientImpl(this); - this.commitmentTiers = new CommitmentTiersClientImpl(this); - this.models = new ModelsClientImpl(this); - this.locationBasedModelCapacities = new LocationBasedModelCapacitiesClientImpl(this); - this.modelCapacities = new ModelCapacitiesClientImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); - this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); this.deployments = new DeploymentsClientImpl(this); this.commitmentPlans = new CommitmentPlansClientImpl(this); this.encryptionScopes = new EncryptionScopesClientImpl(this); this.raiPolicies = new RaiPoliciesClientImpl(this); - this.raiBlocklists = new RaiBlocklistsClientImpl(this); + this.subscriptionRaiPolicies = new SubscriptionRaiPoliciesClientImpl(this); this.raiBlocklistItems = new RaiBlocklistItemsClientImpl(this); + this.raiBlocklists = new RaiBlocklistsClientImpl(this); this.raiTopics = new RaiTopicsClientImpl(this); + this.raiToolLabels = new RaiToolLabelsClientImpl(this); this.raiContentFilters = new RaiContentFiltersClientImpl(this); this.networkSecurityPerimeterConfigurations = new NetworkSecurityPerimeterConfigurationsClientImpl(this); this.defenderForAISettings = new DefenderForAISettingsClientImpl(this); this.projects = new ProjectsClientImpl(this); - this.accountConnections = new AccountConnectionsClientImpl(this); this.projectConnections = new ProjectConnectionsClientImpl(this); - this.accountCapabilityHosts = new AccountCapabilityHostsClientImpl(this); this.projectCapabilityHosts = new ProjectCapabilityHostsClientImpl(this); this.quotaTiers = new QuotaTiersClientImpl(this); + this.agentApplications = new AgentApplicationsClientImpl(this); + this.computeOperations = new ComputeOperationsClientImpl(this); + this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.testRaiExternalSafetyProviders = new TestRaiExternalSafetyProvidersClientImpl(this); + this.raiExternalSafetyProviders = new RaiExternalSafetyProvidersClientImpl(this); + this.raiExternalSafetyProvidersOperations = new RaiExternalSafetyProvidersOperationsClientImpl(this); + this.accountConnections = new AccountConnectionsClientImpl(this); + this.accountCapabilityHosts = new AccountCapabilityHostsClientImpl(this); + this.outboundRules = new OutboundRulesClientImpl(this); + this.managedNetworkSettingsOperations = new ManagedNetworkSettingsOperationsClientImpl(this); + this.outboundRulesOperations = new OutboundRulesOperationsClientImpl(this); + this.managedNetworkProvisions = new ManagedNetworkProvisionsClientImpl(this); + this.agentDeployments = new AgentDeploymentsClientImpl(this); + this.resourceSkus = new ResourceSkusClientImpl(this); + this.usages = new UsagesClientImpl(this); + this.commitmentTiers = new CommitmentTiersClientImpl(this); + this.models = new ModelsClientImpl(this); + this.locationBasedModelCapacities = new LocationBasedModelCapacitiesClientImpl(this); + this.modelCapacities = new ModelCapacitiesClientImpl(this); } /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlanAccountAssociationImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlanAccountAssociationImpl.java index a215ceb70fd7..bce660372f43 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlanAccountAssociationImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlanAccountAssociationImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlanImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlanImpl.java index e62acf7eaeee..24ac924cf6f6 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlanImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlanImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -32,16 +32,8 @@ public String type() { return this.innerModel().type(); } - public String etag() { - return this.innerModel().etag(); - } - - public String kind() { - return this.innerModel().kind(); - } - - public Sku sku() { - return this.innerModel().sku(); + public CommitmentPlanProperties properties() { + return this.innerModel().properties(); } public Map tags() { @@ -57,8 +49,16 @@ public String location() { return this.innerModel().location(); } - public CommitmentPlanProperties properties() { - return this.innerModel().properties(); + public String etag() { + return this.innerModel().etag(); + } + + public String kind() { + return this.innerModel().kind(); + } + + public Sku sku() { + return this.innerModel().sku(); } public SystemData systemData() { @@ -180,6 +180,11 @@ public CommitmentPlanImpl withTags(Map tags) { } } + public CommitmentPlanImpl withProperties(CommitmentPlanProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + public CommitmentPlanImpl withKind(String kind) { this.innerModel().withKind(kind); return this; @@ -195,11 +200,6 @@ public CommitmentPlanImpl withSku(Sku sku) { } } - public CommitmentPlanImpl withProperties(CommitmentPlanProperties properties) { - this.innerModel().withProperties(properties); - return this; - } - private boolean isInCreateMode() { return this.innerModel() == null || this.innerModel().id() == null; } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlansClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlansClientImpl.java index e14ce5cef894..c6b352c9e4c1 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlansClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlansClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -31,14 +31,13 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient; import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanAccountAssociationInner; import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanInner; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanAccountAssociationListResult; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanListResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.CommitmentPlanAccountAssociationListResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.CommitmentPlanListResult; import com.azure.resourcemanager.cognitiveservices.models.PatchResourceTagsAndSku; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -73,34 +72,16 @@ public final class CommitmentPlansClientImpl implements CommitmentPlansClient { * The interface defining all the services for CognitiveServicesManagementClientCommitmentPlans to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CognitiveServicesManagementClientCommitmentPlans") public interface CommitmentPlansService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("commitmentPlanName") String commitmentPlanName, @HeaderParam("Accept") String accept, Context context); @@ -108,157 +89,169 @@ Mono> get(@HostParam("$host") String endpoint, @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("commitmentPlanName") String commitmentPlanName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("commitmentPlanName") String commitmentPlanName, - @BodyParam("application/json") CommitmentPlanInner commitmentPlan, @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("commitmentPlanName") String commitmentPlanName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CommitmentPlanInner commitmentPlan, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("commitmentPlanName") String commitmentPlanName, - @BodyParam("application/json") CommitmentPlanInner commitmentPlan, @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("commitmentPlanName") String commitmentPlanName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CommitmentPlanInner commitmentPlan, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("commitmentPlanName") String commitmentPlanName, @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("commitmentPlanName") String commitmentPlanName, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("commitmentPlanName") String commitmentPlanName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("commitmentPlanName") String commitmentPlanName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("commitmentPlanName") String commitmentPlanName, @HeaderParam("Accept") String accept, + Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdatePlan(@HostParam("$host") String endpoint, + Mono>> createOrUpdatePlan(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("commitmentPlanName") String commitmentPlanName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") CommitmentPlanInner commitmentPlan, @HeaderParam("Accept") String accept, + @PathParam("commitmentPlanName") String commitmentPlanName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CommitmentPlanInner commitmentPlan, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdatePlanSync(@HostParam("$host") String endpoint, + Response createOrUpdatePlanSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("commitmentPlanName") String commitmentPlanName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") CommitmentPlanInner commitmentPlan, @HeaderParam("Accept") String accept, + @PathParam("commitmentPlanName") String commitmentPlanName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CommitmentPlanInner commitmentPlan, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updatePlan(@HostParam("$host") String endpoint, + Mono>> updatePlan(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("commitmentPlanName") String commitmentPlanName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") PatchResourceTagsAndSku commitmentPlan, @HeaderParam("Accept") String accept, + @PathParam("commitmentPlanName") String commitmentPlanName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") PatchResourceTagsAndSku commitmentPlan, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response updatePlanSync(@HostParam("$host") String endpoint, + Response updatePlanSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("commitmentPlanName") String commitmentPlanName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") PatchResourceTagsAndSku commitmentPlan, @HeaderParam("Accept") String accept, + @PathParam("commitmentPlanName") String commitmentPlanName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") PatchResourceTagsAndSku commitmentPlan, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deletePlan(@HostParam("$host") String endpoint, + Mono>> deletePlan(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("commitmentPlanName") String commitmentPlanName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @PathParam("commitmentPlanName") String commitmentPlanName, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response deletePlanSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("commitmentPlanName") String commitmentPlanName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("commitmentPlanName") String commitmentPlanName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getByResourceGroupSync(@HostParam("$host") String endpoint, + Response deletePlanSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("commitmentPlanName") String commitmentPlanName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @PathParam("commitmentPlanName") String commitmentPlanName, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listByResourceGroupSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/commitmentPlans") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listPlansBySubscription(@HostParam("$host") String endpoint, + Mono> listPlansBySubscription(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @@ -266,37 +259,17 @@ Mono> listPlansBySubscription(@HostParam("$ho @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/commitmentPlans") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listPlansBySubscriptionSync(@HostParam("$host") String endpoint, + Response listPlansBySubscriptionSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAssociations(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("commitmentPlanName") String commitmentPlanName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listAssociationsSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("commitmentPlanName") String commitmentPlanName, @HeaderParam("Accept") String accept, - Context context); - @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAssociation(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> getAssociation(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("commitmentPlanName") String commitmentPlanName, @PathParam("commitmentPlanAssociationName") String commitmentPlanAssociationName, @HeaderParam("Accept") String accept, Context context); @@ -305,65 +278,83 @@ Mono> getAssociation(@HostParam( @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response getAssociationSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Response getAssociationSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("commitmentPlanName") String commitmentPlanName, @PathParam("commitmentPlanAssociationName") String commitmentPlanAssociationName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdateAssociation(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdateAssociation(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("commitmentPlanName") String commitmentPlanName, @PathParam("commitmentPlanAssociationName") String commitmentPlanAssociationName, - @BodyParam("application/json") CommitmentPlanAccountAssociationInner association, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CommitmentPlanAccountAssociationInner association, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateAssociationSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Response createOrUpdateAssociationSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("commitmentPlanName") String commitmentPlanName, @PathParam("commitmentPlanAssociationName") String commitmentPlanAssociationName, - @BodyParam("application/json") CommitmentPlanAccountAssociationInner association, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CommitmentPlanAccountAssociationInner association, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteAssociation(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono>> deleteAssociation(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("commitmentPlanName") String commitmentPlanName, - @PathParam("commitmentPlanAssociationName") String commitmentPlanAssociationName, - @HeaderParam("Accept") String accept, Context context); + @PathParam("commitmentPlanAssociationName") String commitmentPlanAssociationName, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteAssociationSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Response deleteAssociationSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("commitmentPlanName") String commitmentPlanName, - @PathParam("commitmentPlanAssociationName") String commitmentPlanAssociationName, - @HeaderParam("Accept") String accept, Context context); + @PathParam("commitmentPlanAssociationName") String commitmentPlanAssociationName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAssociations( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("commitmentPlanName") String commitmentPlanName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listAssociationsSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("commitmentPlanName") String commitmentPlanName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -371,14 +362,14 @@ Mono> listNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listPlansByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -386,7 +377,7 @@ Mono> listPlansByResourceGroupNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listPlansByResourceGroupNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -394,7 +385,7 @@ Response listPlansByResourceGroupNextSync( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listPlansBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -402,7 +393,7 @@ Mono> listPlansBySubscriptionNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listPlansBySubscriptionNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -410,7 +401,7 @@ Response listPlansBySubscriptionNextSync( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listAssociationsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -418,218 +409,195 @@ Mono> listAssociationsNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listAssociationsNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Gets the commitmentPlans associated with the Cognitive Services account. + * Gets the specified commitmentPlans associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the commitmentPlans associated with the Cognitive Services account along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return the specified commitmentPlans associated with the Cognitive Services account along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String commitmentPlanName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, commitmentPlanName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the commitmentPlans associated with the Cognitive Services account. + * Gets the specified commitmentPlans associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the commitmentPlans associated with the Cognitive Services account as paginated response with - * {@link PagedFlux}. + * @return the specified commitmentPlans associated with the Cognitive Services account on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, + String commitmentPlanName) { + return getWithResponseAsync(resourceGroupName, accountName, commitmentPlanName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets the commitmentPlans associated with the Cognitive Services account. + * Gets the specified commitmentPlans associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the commitmentPlans associated with the Cognitive Services account along with {@link PagedResponse}. + * @return the specified commitmentPlans associated with the Cognitive Services account along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + public Response getWithResponse(String resourceGroupName, String accountName, + String commitmentPlanName, Context context) { final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), resourceGroupName, - accountName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, commitmentPlanName, accept, context); } /** - * Gets the commitmentPlans associated with the Cognitive Services account. + * Gets the specified commitmentPlans associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the commitmentPlans associated with the Cognitive Services account along with {@link PagedResponse}. + * @return the specified commitmentPlans associated with the Cognitive Services account. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, - Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + public CommitmentPlanInner get(String resourceGroupName, String accountName, String commitmentPlanName) { + return getWithResponse(resourceGroupName, accountName, commitmentPlanName, Context.NONE).getValue(); + } + + /** + * Update the state of specified commitmentPlans associated with the Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The commitmentPlan properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account commitment plan along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String accountName, String commitmentPlanName, CommitmentPlanInner commitmentPlan) { + final String contentType = "application/json"; final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), resourceGroupName, - accountName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, commitmentPlanName, contentType, + accept, commitmentPlan, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the commitmentPlans associated with the Cognitive Services account. + * Update the state of specified commitmentPlans associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The commitmentPlan properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the commitmentPlans associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. + * @return cognitive Services account commitment plan on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), - nextLink -> listNextSinglePage(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String accountName, + String commitmentPlanName, CommitmentPlanInner commitmentPlan) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, commitmentPlanName, commitmentPlan) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets the commitmentPlans associated with the Cognitive Services account. + * Update the state of specified commitmentPlans associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The commitmentPlan properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the commitmentPlans associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. + * @return cognitive Services account commitment plan along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, context), - nextLink -> listNextSinglePage(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String accountName, + String commitmentPlanName, CommitmentPlanInner commitmentPlan, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, commitmentPlanName, contentType, accept, + commitmentPlan, context); } /** - * Gets the specified commitmentPlans associated with the Cognitive Services account. + * Update the state of specified commitmentPlans associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param commitmentPlan The commitmentPlan properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified commitmentPlans associated with the Cognitive Services account along with {@link Response} - * on successful completion of {@link Mono}. + * @return cognitive Services account commitment plan. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + public CommitmentPlanInner createOrUpdate(String resourceGroupName, String accountName, String commitmentPlanName, + CommitmentPlanInner commitmentPlan) { + return createOrUpdateWithResponse(resourceGroupName, accountName, commitmentPlanName, commitmentPlan, + Context.NONE).getValue(); + } + + /** + * Deletes the specified commitmentPlan associated with the Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, String commitmentPlanName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (commitmentPlanName == null) { - return Mono - .error(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), commitmentPlanName, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, commitmentPlanName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the specified commitmentPlans associated with the Cognitive Services account. + * Deletes the specified commitmentPlan associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -637,18 +605,17 @@ private Mono> getWithResponseAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified commitmentPlans associated with the Cognitive Services account on successful completion of - * {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String accountName, + private Response deleteWithResponse(String resourceGroupName, String accountName, String commitmentPlanName) { - return getWithResponseAsync(resourceGroupName, accountName, commitmentPlanName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, commitmentPlanName, Context.NONE); } /** - * Gets the specified commitmentPlans associated with the Cognitive Services account. + * Deletes the specified commitmentPlan associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -657,40 +624,17 @@ private Mono getAsync(String resourceGroupName, String acco * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified commitmentPlans associated with the Cognitive Services account along with {@link Response}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String accountName, + private Response deleteWithResponse(String resourceGroupName, String accountName, String commitmentPlanName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (commitmentPlanName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), - this.client.getSubscriptionId(), commitmentPlanName, accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, commitmentPlanName, context); } /** - * Gets the specified commitmentPlans associated with the Cognitive Services account. + * Deletes the specified commitmentPlan associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -698,375 +642,287 @@ public Response getWithResponse(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified commitmentPlans associated with the Cognitive Services account. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CommitmentPlanInner get(String resourceGroupName, String accountName, String commitmentPlanName) { - return getWithResponse(resourceGroupName, accountName, commitmentPlanName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String accountName, + String commitmentPlanName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, accountName, commitmentPlanName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes the specified commitmentPlan associated with the Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String commitmentPlanName) { + Response response = deleteWithResponse(resourceGroupName, accountName, commitmentPlanName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified commitmentPlan associated with the Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String commitmentPlanName, Context context) { + Response response = deleteWithResponse(resourceGroupName, accountName, commitmentPlanName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** - * Update the state of specified commitmentPlans associated with the Cognitive Services account. + * Deletes the specified commitmentPlan associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The commitmentPlan properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account commitment plan along with {@link Response} on successful completion of - * {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String accountName, String commitmentPlanName, CommitmentPlanInner commitmentPlan) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (commitmentPlanName == null) { - return Mono - .error(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); - } - if (commitmentPlan == null) { - return Mono.error(new IllegalArgumentException("Parameter commitmentPlan is required and cannot be null.")); - } else { - commitmentPlan.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), commitmentPlanName, commitmentPlan, - accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Mono deleteAsync(String resourceGroupName, String accountName, String commitmentPlanName) { + return beginDeleteAsync(resourceGroupName, accountName, commitmentPlanName).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Update the state of specified commitmentPlans associated with the Cognitive Services account. + * Deletes the specified commitmentPlan associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The commitmentPlan properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account commitment plan on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String accountName, - String commitmentPlanName, CommitmentPlanInner commitmentPlan) { - return createOrUpdateWithResponseAsync(resourceGroupName, accountName, commitmentPlanName, commitmentPlan) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public void delete(String resourceGroupName, String accountName, String commitmentPlanName) { + beginDelete(resourceGroupName, accountName, commitmentPlanName).getFinalResult(); } /** - * Update the state of specified commitmentPlans associated with the Cognitive Services account. + * Deletes the specified commitmentPlan associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The commitmentPlan properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account commitment plan along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String commitmentPlanName, CommitmentPlanInner commitmentPlan, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (commitmentPlanName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); - } - if (commitmentPlan == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter commitmentPlan is required and cannot be null.")); - } else { - commitmentPlan.validate(); - } - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), commitmentPlanName, commitmentPlan, accept, - context); + public void delete(String resourceGroupName, String accountName, String commitmentPlanName, Context context) { + beginDelete(resourceGroupName, accountName, commitmentPlanName, context).getFinalResult(); } /** - * Update the state of specified commitmentPlans associated with the Cognitive Services account. + * Gets the commitmentPlans associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param commitmentPlan The commitmentPlan properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account commitment plan. + * @return the commitmentPlans associated with the Cognitive Services account along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CommitmentPlanInner createOrUpdate(String resourceGroupName, String accountName, String commitmentPlanName, - CommitmentPlanInner commitmentPlan) { - return createOrUpdateWithResponse(resourceGroupName, accountName, commitmentPlanName, commitmentPlan, - Context.NONE).getValue(); + private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes the specified commitmentPlan associated with the Cognitive Services account. + * Gets the commitmentPlans associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the commitmentPlans associated with the Cognitive Services account as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, - String commitmentPlanName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (commitmentPlanName == null) { - return Mono - .error(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), commitmentPlanName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Deletes the specified commitmentPlan associated with the Cognitive Services account. + * Gets the commitmentPlans associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. + * @return the commitmentPlans associated with the Cognitive Services account along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String accountName, - String commitmentPlanName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (commitmentPlanName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); - } + private PagedResponse listSinglePage(String resourceGroupName, String accountName) { final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), commitmentPlanName, accept, Context.NONE); + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Deletes the specified commitmentPlan associated with the Cognitive Services account. + * Gets the commitmentPlans associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. + * @return the commitmentPlans associated with the Cognitive Services account along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String accountName, - String commitmentPlanName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (commitmentPlanName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); - } + private PagedResponse listSinglePage(String resourceGroupName, String accountName, + Context context) { final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), commitmentPlanName, accept, context); + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Deletes the specified commitmentPlan associated with the Cognitive Services account. + * Gets the commitmentPlans associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the commitmentPlans associated with the Cognitive Services account as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String accountName, - String commitmentPlanName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, accountName, commitmentPlanName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), + nextLink -> listNextSinglePage(nextLink)); } /** - * Deletes the specified commitmentPlan associated with the Cognitive Services account. + * Gets the commitmentPlans associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the commitmentPlans associated with the Cognitive Services account as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, - String commitmentPlanName) { - Response response = deleteWithResponse(resourceGroupName, accountName, commitmentPlanName); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** - * Deletes the specified commitmentPlan associated with the Cognitive Services account. + * Returns a Cognitive Services commitment plan specified by the parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return cognitive Services account commitment plan along with {@link Response} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, - String commitmentPlanName, Context context) { - Response response = deleteWithResponse(resourceGroupName, accountName, commitmentPlanName, context); - return this.client.getLroResult(response, Void.class, Void.class, context); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String commitmentPlanName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes the specified commitmentPlan associated with the Cognitive Services account. + * Returns a Cognitive Services commitment plan specified by the parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return cognitive Services account commitment plan on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String accountName, String commitmentPlanName) { - return beginDeleteAsync(resourceGroupName, accountName, commitmentPlanName).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono getByResourceGroupAsync(String resourceGroupName, String commitmentPlanName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, commitmentPlanName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes the specified commitmentPlan associated with the Cognitive Services account. + * Returns a Cognitive Services commitment plan specified by the parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account commitment plan along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String commitmentPlanName) { - beginDelete(resourceGroupName, accountName, commitmentPlanName).getFinalResult(); + public Response getByResourceGroupWithResponse(String resourceGroupName, + String commitmentPlanName, Context context) { + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, accept, context); } /** - * Deletes the specified commitmentPlan associated with the Cognitive Services account. + * Returns a Cognitive Services commitment plan specified by the parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account commitment plan. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String commitmentPlanName, Context context) { - beginDelete(resourceGroupName, accountName, commitmentPlanName, context).getFinalResult(); + public CommitmentPlanInner getByResourceGroup(String resourceGroupName, String commitmentPlanName) { + return getByResourceGroupWithResponse(resourceGroupName, commitmentPlanName, Context.NONE).getValue(); } /** @@ -1084,32 +940,12 @@ public void delete(String resourceGroupName, String accountName, String commitme @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdatePlanWithResponseAsync(String resourceGroupName, String commitmentPlanName, CommitmentPlanInner commitmentPlan) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (commitmentPlanName == null) { - return Mono - .error(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (commitmentPlan == null) { - return Mono.error(new IllegalArgumentException("Parameter commitmentPlan is required and cannot be null.")); - } else { - commitmentPlan.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.createOrUpdatePlan(this.client.getEndpoint(), resourceGroupName, commitmentPlanName, - this.client.getApiVersion(), this.client.getSubscriptionId(), commitmentPlan, accept, context)) + .withContext(context -> service.createOrUpdatePlan(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, contentType, accept, + commitmentPlan, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1127,33 +963,11 @@ private Mono>> createOrUpdatePlanWithResponseAsync(Str @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdatePlanWithResponse(String resourceGroupName, String commitmentPlanName, CommitmentPlanInner commitmentPlan) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (commitmentPlanName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (commitmentPlan == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter commitmentPlan is required and cannot be null.")); - } else { - commitmentPlan.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdatePlanSync(this.client.getEndpoint(), resourceGroupName, commitmentPlanName, - this.client.getApiVersion(), this.client.getSubscriptionId(), commitmentPlan, accept, Context.NONE); + return service.createOrUpdatePlanSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, contentType, accept, commitmentPlan, + Context.NONE); } /** @@ -1171,33 +985,11 @@ private Response createOrUpdatePlanWithResponse(String resourceGroup @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdatePlanWithResponse(String resourceGroupName, String commitmentPlanName, CommitmentPlanInner commitmentPlan, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (commitmentPlanName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (commitmentPlan == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter commitmentPlan is required and cannot be null.")); - } else { - commitmentPlan.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdatePlanSync(this.client.getEndpoint(), resourceGroupName, commitmentPlanName, - this.client.getApiVersion(), this.client.getSubscriptionId(), commitmentPlan, accept, context); + return service.createOrUpdatePlanSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, contentType, accept, commitmentPlan, + context); } /** @@ -1329,31 +1121,12 @@ public CommitmentPlanInner createOrUpdatePlan(String resourceGroupName, String c @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updatePlanWithResponseAsync(String resourceGroupName, String commitmentPlanName, PatchResourceTagsAndSku commitmentPlan) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (commitmentPlanName == null) { - return Mono - .error(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (commitmentPlan == null) { - return Mono.error(new IllegalArgumentException("Parameter commitmentPlan is required and cannot be null.")); - } else { - commitmentPlan.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.updatePlan(this.client.getEndpoint(), resourceGroupName, commitmentPlanName, - this.client.getApiVersion(), this.client.getSubscriptionId(), commitmentPlan, accept, context)) + .withContext(context -> service.updatePlan(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, contentType, accept, + commitmentPlan, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1371,33 +1144,11 @@ private Mono>> updatePlanWithResponseAsync(String reso @ServiceMethod(returns = ReturnType.SINGLE) private Response updatePlanWithResponse(String resourceGroupName, String commitmentPlanName, PatchResourceTagsAndSku commitmentPlan) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (commitmentPlanName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (commitmentPlan == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter commitmentPlan is required and cannot be null.")); - } else { - commitmentPlan.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.updatePlanSync(this.client.getEndpoint(), resourceGroupName, commitmentPlanName, - this.client.getApiVersion(), this.client.getSubscriptionId(), commitmentPlan, accept, Context.NONE); + return service.updatePlanSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, contentType, accept, commitmentPlan, + Context.NONE); } /** @@ -1415,33 +1166,11 @@ private Response updatePlanWithResponse(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) private Response updatePlanWithResponse(String resourceGroupName, String commitmentPlanName, PatchResourceTagsAndSku commitmentPlan, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (commitmentPlanName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (commitmentPlan == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter commitmentPlan is required and cannot be null.")); - } else { - commitmentPlan.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.updatePlanSync(this.client.getEndpoint(), resourceGroupName, commitmentPlanName, - this.client.getApiVersion(), this.client.getSubscriptionId(), commitmentPlan, accept, context); + return service.updatePlanSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, contentType, accept, commitmentPlan, + context); } /** @@ -1570,26 +1299,9 @@ public CommitmentPlanInner updatePlan(String resourceGroupName, String commitmen @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deletePlanWithResponseAsync(String resourceGroupName, String commitmentPlanName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (commitmentPlanName == null) { - return Mono - .error(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.deletePlan(this.client.getEndpoint(), resourceGroupName, commitmentPlanName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.deletePlan(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1605,27 +1317,8 @@ private Mono>> deletePlanWithResponseAsync(String reso */ @ServiceMethod(returns = ReturnType.SINGLE) private Response deletePlanWithResponse(String resourceGroupName, String commitmentPlanName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (commitmentPlanName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deletePlanSync(this.client.getEndpoint(), resourceGroupName, commitmentPlanName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return service.deletePlanSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, Context.NONE); } /** @@ -1642,27 +1335,8 @@ private Response deletePlanWithResponse(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) private Response deletePlanWithResponse(String resourceGroupName, String commitmentPlanName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (commitmentPlanName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deletePlanSync(this.client.getEndpoint(), resourceGroupName, commitmentPlanName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service.deletePlanSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, context); } /** @@ -1728,143 +1402,38 @@ public SyncPoller, Void> beginDeletePlan(String resourceGroupNa * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deletePlanAsync(String resourceGroupName, String commitmentPlanName) { - return beginDeletePlanAsync(resourceGroupName, commitmentPlanName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a Cognitive Services commitment plan from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deletePlan(String resourceGroupName, String commitmentPlanName) { - beginDeletePlan(resourceGroupName, commitmentPlanName).getFinalResult(); - } - - /** - * Deletes a Cognitive Services commitment plan from the resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deletePlan(String resourceGroupName, String commitmentPlanName, Context context) { - beginDeletePlan(resourceGroupName, commitmentPlanName, context).getFinalResult(); - } - - /** - * Returns a Cognitive Services commitment plan specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account commitment plan along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String commitmentPlanName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (commitmentPlanName == null) { - return Mono - .error(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, - commitmentPlanName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a Cognitive Services commitment plan specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account commitment plan on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String commitmentPlanName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, commitmentPlanName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono deletePlanAsync(String resourceGroupName, String commitmentPlanName) { + return beginDeletePlanAsync(resourceGroupName, commitmentPlanName).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Returns a Cognitive Services commitment plan specified by the parameters. + * Deletes a Cognitive Services commitment plan from the resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account commitment plan along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, - String commitmentPlanName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (commitmentPlanName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return service.getByResourceGroupSync(this.client.getEndpoint(), resourceGroupName, commitmentPlanName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + public void deletePlan(String resourceGroupName, String commitmentPlanName) { + beginDeletePlan(resourceGroupName, commitmentPlanName).getFinalResult(); } /** - * Returns a Cognitive Services commitment plan specified by the parameters. + * Deletes a Cognitive Services commitment plan from the resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account commitment plan. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CommitmentPlanInner getByResourceGroup(String resourceGroupName, String commitmentPlanName) { - return getByResourceGroupWithResponse(resourceGroupName, commitmentPlanName, Context.NONE).getValue(); + public void deletePlan(String resourceGroupName, String commitmentPlanName, Context context) { + beginDeletePlan(resourceGroupName, commitmentPlanName, context).getFinalResult(); } /** @@ -1879,22 +1448,10 @@ public CommitmentPlanInner getByResourceGroup(String resourceGroupName, String c */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1926,23 +1483,9 @@ private PagedFlux listByResourceGroupAsync(String resourceG */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listByResourceGroupSync(this.client.getEndpoint(), - resourceGroupName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, Context.NONE); + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -1960,23 +1503,9 @@ private PagedResponse listByResourceGroupSinglePage(String @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listByResourceGroupSync(this.client.getEndpoint(), - resourceGroupName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -2024,14 +1553,6 @@ public PagedIterable listByResourceGroup(String resourceGro */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listPlansBySubscriptionSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listPlansBySubscription(this.client.getEndpoint(), @@ -2063,16 +1584,6 @@ private PagedFlux listPlansBySubscriptionAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listPlansBySubscriptionSinglePage() { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listPlansBySubscriptionSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); @@ -2091,16 +1602,6 @@ private PagedResponse listPlansBySubscriptionSinglePage() { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listPlansBySubscriptionSinglePage(Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listPlansBySubscriptionSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); @@ -2138,178 +1639,6 @@ public PagedIterable listPlansBySubscription(Context contex nextLink -> listPlansBySubscriptionNextSinglePage(nextLink, context)); } - /** - * Gets the associations of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the associations of the Cognitive Services commitment plan along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listAssociationsSinglePageAsync(String resourceGroupName, String commitmentPlanName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (commitmentPlanName == null) { - return Mono - .error(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAssociations(this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), this.client.getSubscriptionId(), commitmentPlanName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the associations of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the associations of the Cognitive Services commitment plan as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAssociationsAsync(String resourceGroupName, - String commitmentPlanName) { - return new PagedFlux<>(() -> listAssociationsSinglePageAsync(resourceGroupName, commitmentPlanName), - nextLink -> listAssociationsNextSinglePageAsync(nextLink)); - } - - /** - * Gets the associations of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the associations of the Cognitive Services commitment plan along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listAssociationsSinglePage(String resourceGroupName, - String commitmentPlanName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (commitmentPlanName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); - } - final String accept = "application/json"; - Response res - = service.listAssociationsSync(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), - this.client.getSubscriptionId(), commitmentPlanName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the associations of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the associations of the Cognitive Services commitment plan along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listAssociationsSinglePage(String resourceGroupName, - String commitmentPlanName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (commitmentPlanName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); - } - final String accept = "application/json"; - Response res - = service.listAssociationsSync(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), - this.client.getSubscriptionId(), commitmentPlanName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the associations of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the associations of the Cognitive Services commitment plan as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAssociations(String resourceGroupName, - String commitmentPlanName) { - return new PagedIterable<>(() -> listAssociationsSinglePage(resourceGroupName, commitmentPlanName), - nextLink -> listAssociationsNextSinglePage(nextLink)); - } - - /** - * Gets the associations of the Cognitive Services commitment plan. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the associations of the Cognitive Services commitment plan as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAssociations(String resourceGroupName, - String commitmentPlanName, Context context) { - return new PagedIterable<>(() -> listAssociationsSinglePage(resourceGroupName, commitmentPlanName, context), - nextLink -> listAssociationsNextSinglePage(nextLink, context)); - } - /** * Gets the association of the Cognitive Services commitment plan. * @@ -2326,31 +1655,11 @@ public PagedIterable listAssociations(Str @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getAssociationWithResponseAsync( String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (commitmentPlanName == null) { - return Mono - .error(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); - } - if (commitmentPlanAssociationName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter commitmentPlanAssociationName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getAssociation(this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), this.client.getSubscriptionId(), commitmentPlanName, - commitmentPlanAssociationName, accept, context)) + .withContext(context -> service.getAssociation(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2389,32 +1698,10 @@ private Mono getAssociationAsync(String r @ServiceMethod(returns = ReturnType.SINGLE) public Response getAssociationWithResponse(String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (commitmentPlanName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); - } - if (commitmentPlanAssociationName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter commitmentPlanAssociationName is required and cannot be null.")); - } final String accept = "application/json"; - return service.getAssociationSync(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), - this.client.getSubscriptionId(), commitmentPlanName, commitmentPlanAssociationName, accept, context); + return service.getAssociationSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, + accept, context); } /** @@ -2453,36 +1740,12 @@ public CommitmentPlanAccountAssociationInner getAssociation(String resourceGroup private Mono>> createOrUpdateAssociationWithResponseAsync(String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName, CommitmentPlanAccountAssociationInner association) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (commitmentPlanName == null) { - return Mono - .error(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); - } - if (commitmentPlanAssociationName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter commitmentPlanAssociationName is required and cannot be null.")); - } - if (association == null) { - return Mono.error(new IllegalArgumentException("Parameter association is required and cannot be null.")); - } else { - association.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdateAssociation(this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), this.client.getSubscriptionId(), commitmentPlanName, - commitmentPlanAssociationName, association, accept, context)) + .withContext(context -> service.createOrUpdateAssociation(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, + commitmentPlanAssociationName, contentType, accept, association, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2503,39 +1766,11 @@ private Mono>> createOrUpdateAssociationWithResponseAs private Response createOrUpdateAssociationWithResponse(String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName, CommitmentPlanAccountAssociationInner association) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (commitmentPlanName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); - } - if (commitmentPlanAssociationName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter commitmentPlanAssociationName is required and cannot be null.")); - } - if (association == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter association is required and cannot be null.")); - } else { - association.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateAssociationSync(this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), this.client.getSubscriptionId(), commitmentPlanName, - commitmentPlanAssociationName, association, accept, Context.NONE); + return service.createOrUpdateAssociationSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, + contentType, accept, association, Context.NONE); } /** @@ -2556,39 +1791,11 @@ private Response createOrUpdateAssociationWithResponse(String resour private Response createOrUpdateAssociationWithResponse(String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName, CommitmentPlanAccountAssociationInner association, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (commitmentPlanName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); - } - if (commitmentPlanAssociationName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter commitmentPlanAssociationName is required and cannot be null.")); - } - if (association == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter association is required and cannot be null.")); - } else { - association.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateAssociationSync(this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), this.client.getSubscriptionId(), commitmentPlanName, - commitmentPlanAssociationName, association, accept, context); + return service.createOrUpdateAssociationSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, + contentType, accept, association, context); } /** @@ -2743,31 +1950,10 @@ public CommitmentPlanAccountAssociationInner createOrUpdateAssociation(String re @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteAssociationWithResponseAsync(String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (commitmentPlanName == null) { - return Mono - .error(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); - } - if (commitmentPlanAssociationName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter commitmentPlanAssociationName is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.deleteAssociation(this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), this.client.getSubscriptionId(), commitmentPlanName, - commitmentPlanAssociationName, accept, context)) + .withContext(context -> service.deleteAssociation(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2786,32 +1972,9 @@ private Mono>> deleteAssociationWithResponseAsync(Stri @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteAssociationWithResponse(String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (commitmentPlanName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); - } - if (commitmentPlanAssociationName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter commitmentPlanAssociationName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteAssociationSync(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), - this.client.getSubscriptionId(), commitmentPlanName, commitmentPlanAssociationName, accept, Context.NONE); + return service.deleteAssociationSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, + Context.NONE); } /** @@ -2830,32 +1993,9 @@ private Response deleteAssociationWithResponse(String resourceGroupN @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteAssociationWithResponse(String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (commitmentPlanName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter commitmentPlanName is required and cannot be null.")); - } - if (commitmentPlanAssociationName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter commitmentPlanAssociationName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteAssociationSync(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), - this.client.getSubscriptionId(), commitmentPlanName, commitmentPlanAssociationName, accept, context); + return service.deleteAssociationSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, + context); } /** @@ -2975,6 +2115,126 @@ public void deleteAssociation(String resourceGroupName, String commitmentPlanNam .getFinalResult(); } + /** + * Gets the associations of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the associations of the Cognitive Services commitment plan along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listAssociationsSinglePageAsync(String resourceGroupName, String commitmentPlanName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listAssociations(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the associations of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the associations of the Cognitive Services commitment plan as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAssociationsAsync(String resourceGroupName, + String commitmentPlanName) { + return new PagedFlux<>(() -> listAssociationsSinglePageAsync(resourceGroupName, commitmentPlanName), + nextLink -> listAssociationsNextSinglePageAsync(nextLink)); + } + + /** + * Gets the associations of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the associations of the Cognitive Services commitment plan along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listAssociationsSinglePage(String resourceGroupName, + String commitmentPlanName) { + final String accept = "application/json"; + Response res + = service.listAssociationsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets the associations of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the associations of the Cognitive Services commitment plan along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listAssociationsSinglePage(String resourceGroupName, + String commitmentPlanName, Context context) { + final String accept = "application/json"; + Response res + = service.listAssociationsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, commitmentPlanName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets the associations of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the associations of the Cognitive Services commitment plan as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAssociations(String resourceGroupName, + String commitmentPlanName) { + return new PagedIterable<>(() -> listAssociationsSinglePage(resourceGroupName, commitmentPlanName), + nextLink -> listAssociationsNextSinglePage(nextLink)); + } + + /** + * Gets the associations of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the associations of the Cognitive Services commitment plan as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAssociations(String resourceGroupName, + String commitmentPlanName, Context context) { + return new PagedIterable<>(() -> listAssociationsSinglePage(resourceGroupName, commitmentPlanName, context), + nextLink -> listAssociationsNextSinglePage(nextLink, context)); + } + /** * Get the next page of items. * @@ -2987,13 +2247,6 @@ public void deleteAssociation(String resourceGroupName, String commitmentPlanNam */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -3012,15 +2265,6 @@ private Mono> listNextSinglePageAsync(String */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -3040,15 +2284,6 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); @@ -3068,13 +2303,6 @@ private PagedResponse listNextSinglePage(String nextLink, C */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listPlansByResourceGroupNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -3095,15 +2323,6 @@ private Mono> listPlansByResourceGroupNextSin */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listPlansByResourceGroupNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listPlansByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -3124,15 +2343,6 @@ private PagedResponse listPlansByResourceGroupNextSinglePag @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listPlansByResourceGroupNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listPlansByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); @@ -3152,13 +2362,6 @@ private PagedResponse listPlansByResourceGroupNextSinglePag */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listPlansBySubscriptionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -3179,15 +2382,6 @@ private Mono> listPlansBySubscriptionNextSing */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listPlansBySubscriptionNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listPlansBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -3207,15 +2401,6 @@ private PagedResponse listPlansBySubscriptionNextSinglePage */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listPlansBySubscriptionNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listPlansBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); @@ -3236,13 +2421,6 @@ private PagedResponse listPlansBySubscriptionNextSinglePage @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAssociationsNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listAssociationsNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -3262,15 +2440,6 @@ private PagedResponse listPlansBySubscriptionNextSinglePage */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listAssociationsNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listAssociationsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -3291,21 +2460,10 @@ private PagedResponse listAssociationsNex @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listAssociationsNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listAssociationsNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(CommitmentPlansClientImpl.class); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlansImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlansImpl.java index cefefcfc429b..e962b77ee0ae 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlansImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlansImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -29,26 +29,12 @@ public CommitmentPlansImpl(CommitmentPlansClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String accountName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CommitmentPlanImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CommitmentPlanImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String accountName, String commitmentPlanName, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, accountName, commitmentPlanName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CommitmentPlanImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CommitmentPlanImpl(inner.getValue(), this.manager())); } public CommitmentPlan get(String resourceGroupName, String accountName, String commitmentPlanName) { @@ -64,12 +50,8 @@ public Response createOrUpdateWithResponse(String resourceGroupN String commitmentPlanName, CommitmentPlanInner commitmentPlan, Context context) { Response inner = this.serviceClient() .createOrUpdateWithResponse(resourceGroupName, accountName, commitmentPlanName, commitmentPlan, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CommitmentPlanImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CommitmentPlanImpl(inner.getValue(), this.manager())); } public CommitmentPlan createOrUpdate(String resourceGroupName, String accountName, String commitmentPlanName, @@ -91,24 +73,22 @@ public void delete(String resourceGroupName, String accountName, String commitme this.serviceClient().delete(resourceGroupName, accountName, commitmentPlanName, context); } - public void deletePlan(String resourceGroupName, String commitmentPlanName) { - this.serviceClient().deletePlan(resourceGroupName, commitmentPlanName); + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CommitmentPlanImpl(inner1, this.manager())); } - public void deletePlan(String resourceGroupName, String commitmentPlanName, Context context) { - this.serviceClient().deletePlan(resourceGroupName, commitmentPlanName, context); + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CommitmentPlanImpl(inner1, this.manager())); } public Response getByResourceGroupWithResponse(String resourceGroupName, String commitmentPlanName, Context context) { Response inner = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, commitmentPlanName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CommitmentPlanImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CommitmentPlanImpl(inner.getValue(), this.manager())); } public CommitmentPlan getByResourceGroup(String resourceGroupName, String commitmentPlanName) { @@ -120,6 +100,14 @@ public CommitmentPlan getByResourceGroup(String resourceGroupName, String commit } } + public void deletePlan(String resourceGroupName, String commitmentPlanName) { + this.serviceClient().deletePlan(resourceGroupName, commitmentPlanName); + } + + public void deletePlan(String resourceGroupName, String commitmentPlanName, Context context) { + this.serviceClient().deletePlan(resourceGroupName, commitmentPlanName, context); + } + public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); return ResourceManagerUtils.mapPage(inner, inner1 -> new CommitmentPlanImpl(inner1, this.manager())); @@ -140,32 +128,12 @@ public PagedIterable listPlansBySubscription(Context context) { return ResourceManagerUtils.mapPage(inner, inner1 -> new CommitmentPlanImpl(inner1, this.manager())); } - public PagedIterable listAssociations(String resourceGroupName, - String commitmentPlanName) { - PagedIterable inner - = this.serviceClient().listAssociations(resourceGroupName, commitmentPlanName); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new CommitmentPlanAccountAssociationImpl(inner1, this.manager())); - } - - public PagedIterable listAssociations(String resourceGroupName, - String commitmentPlanName, Context context) { - PagedIterable inner - = this.serviceClient().listAssociations(resourceGroupName, commitmentPlanName, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new CommitmentPlanAccountAssociationImpl(inner1, this.manager())); - } - public Response getAssociationWithResponse(String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName, Context context) { Response inner = this.serviceClient() .getAssociationWithResponse(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CommitmentPlanAccountAssociationImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CommitmentPlanAccountAssociationImpl(inner.getValue(), this.manager())); } public CommitmentPlanAccountAssociation getAssociation(String resourceGroupName, String commitmentPlanName, @@ -190,6 +158,22 @@ public void deleteAssociation(String resourceGroupName, String commitmentPlanNam .deleteAssociation(resourceGroupName, commitmentPlanName, commitmentPlanAssociationName, context); } + public PagedIterable listAssociations(String resourceGroupName, + String commitmentPlanName) { + PagedIterable inner + = this.serviceClient().listAssociations(resourceGroupName, commitmentPlanName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new CommitmentPlanAccountAssociationImpl(inner1, this.manager())); + } + + public PagedIterable listAssociations(String resourceGroupName, + String commitmentPlanName, Context context) { + PagedIterable inner + = this.serviceClient().listAssociations(resourceGroupName, commitmentPlanName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new CommitmentPlanAccountAssociationImpl(inner1, this.manager())); + } + public CommitmentPlan getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTierImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTierImpl.java index cc65d92d5e6b..5268797cded1 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTierImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTierImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTiersClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTiersClientImpl.java index d9c5bc676593..6cff370a257f 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTiersClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTiersClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -25,10 +25,9 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.cognitiveservices.fluent.CommitmentTiersClient; import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentTierInner; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentTierListResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.CommitmentTierListResult; import reactor.core.publisher.Mono; /** @@ -60,23 +59,23 @@ public final class CommitmentTiersClientImpl implements CommitmentTiersClient { * The interface defining all the services for CognitiveServicesManagementClientCommitmentTiers to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CognitiveServicesManagementClientCommitmentTiers") public interface CommitmentTiersService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/commitmentTiers") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/commitmentTiers") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -84,7 +83,7 @@ Response listSync(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -92,13 +91,13 @@ Mono> listNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * List Commitment Tiers. * - * @param location Resource location. + * @param location The location name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -107,21 +106,10 @@ Response listNextSync(@PathParam(value = "nextLink", e */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String location) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), location, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -130,7 +118,7 @@ private Mono> listSinglePageAsync(String loca /** * List Commitment Tiers. * - * @param location Resource location. + * @param location The location name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -144,7 +132,7 @@ private PagedFlux listAsync(String location) { /** * List Commitment Tiers. * - * @param location Resource location. + * @param location The location name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -152,23 +140,9 @@ private PagedFlux listAsync(String location) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String location) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), - this.client.getSubscriptionId(), this.client.getApiVersion(), location, accept, Context.NONE); + this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -176,7 +150,7 @@ private PagedResponse listSinglePage(String location) { /** * List Commitment Tiers. * - * @param location Resource location. + * @param location The location name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -185,23 +159,9 @@ private PagedResponse listSinglePage(String location) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String location, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), - this.client.getSubscriptionId(), this.client.getApiVersion(), location, accept, context); + this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -209,7 +169,7 @@ private PagedResponse listSinglePage(String location, Conte /** * List Commitment Tiers. * - * @param location Resource location. + * @param location The location name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -224,7 +184,7 @@ public PagedIterable list(String location) { /** * List Commitment Tiers. * - * @param location Resource location. + * @param location The location name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -250,13 +210,6 @@ public PagedIterable list(String location, Context context) */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -275,15 +228,6 @@ private Mono> listNextSinglePageAsync(String */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -303,21 +247,10 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(CommitmentTiersClientImpl.class); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTiersImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTiersImpl.java index 3798a4f837a4..b249bb1dadaf 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTiersImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTiersImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeOperationStatusImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeOperationStatusImpl.java new file mode 100644 index 000000000000..55cabf001380 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeOperationStatusImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ComputeOperationStatusInner; +import com.azure.resourcemanager.cognitiveservices.models.ComputeOperationStatus; +import com.azure.resourcemanager.cognitiveservices.models.ComputeOperationStatusProperties; + +public final class ComputeOperationStatusImpl implements ComputeOperationStatus { + private ComputeOperationStatusInner innerObject; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + ComputeOperationStatusImpl(ComputeOperationStatusInner innerObject, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ComputeOperationStatusProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ComputeOperationStatusInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeOperationsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeOperationsClientImpl.java new file mode 100644 index 000000000000..c388974c8207 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeOperationsClientImpl.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.cognitiveservices.fluent.ComputeOperationsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ComputeOperationStatusInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ComputeOperationsClient. + */ +public final class ComputeOperationsClientImpl implements ComputeOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ComputeOperationsService service; + + /** + * The service client containing this operation class. + */ + private final CognitiveServicesManagementClientImpl client; + + /** + * Initializes an instance of ComputeOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ComputeOperationsClientImpl(CognitiveServicesManagementClientImpl client) { + this.service + = RestProxy.create(ComputeOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CognitiveServicesManagementClientComputeOperations to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CognitiveServicesManagementClientComputeOperations") + public interface ComputeOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/computeOperations/{operationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/computeOperations/{operationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the status of a compute operation. + * + * @param location The name of the Azure region. + * @param operationId The ID of the compute operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a compute operation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String location, String operationId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, operationId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the status of a compute operation. + * + * @param location The name of the Azure region. + * @param operationId The ID of the compute operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a compute operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String location, String operationId) { + return getWithResponseAsync(location, operationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the status of a compute operation. + * + * @param location The name of the Azure region. + * @param operationId The ID of the compute operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a compute operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String location, String operationId, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + location, operationId, accept, context); + } + + /** + * Gets the status of a compute operation. + * + * @param location The name of the Azure region. + * @param operationId The ID of the compute operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a compute operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ComputeOperationStatusInner get(String location, String operationId) { + return getWithResponse(location, operationId, Context.NONE).getValue(); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeOperationsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeOperationsImpl.java new file mode 100644 index 000000000000..8904257ecda3 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeOperationsImpl.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cognitiveservices.fluent.ComputeOperationsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ComputeOperationStatusInner; +import com.azure.resourcemanager.cognitiveservices.models.ComputeOperationStatus; +import com.azure.resourcemanager.cognitiveservices.models.ComputeOperations; + +public final class ComputeOperationsImpl implements ComputeOperations { + private static final ClientLogger LOGGER = new ClientLogger(ComputeOperationsImpl.class); + + private final ComputeOperationsClient innerClient; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + public ComputeOperationsImpl(ComputeOperationsClient innerClient, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String location, String operationId, Context context) { + Response inner + = this.serviceClient().getWithResponse(location, operationId, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ComputeOperationStatusImpl(inner.getValue(), this.manager())); + } + + public ComputeOperationStatus get(String location, String operationId) { + ComputeOperationStatusInner inner = this.serviceClient().get(location, operationId); + if (inner != null) { + return new ComputeOperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + private ComputeOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ConnectionPropertiesV2BasicResourceImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ConnectionPropertiesV2BasicResourceImpl.java index c679214a1435..36a4ebeea258 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ConnectionPropertiesV2BasicResourceImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ConnectionPropertiesV2BasicResourceImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -53,28 +53,33 @@ private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager man private String accountName; + private String projectName; + private String connectionName; private ConnectionUpdateContent updateConnection; - public ConnectionPropertiesV2BasicResourceImpl withExistingAccount(String resourceGroupName, String accountName) { + public ConnectionPropertiesV2BasicResourceImpl withExistingProject(String resourceGroupName, String accountName, + String projectName) { this.resourceGroupName = resourceGroupName; this.accountName = accountName; + this.projectName = projectName; return this; } public ConnectionPropertiesV2BasicResource create() { this.innerObject = serviceManager.serviceClient() - .getAccountConnections() - .createWithResponse(resourceGroupName, accountName, connectionName, this.innerModel(), Context.NONE) + .getProjectConnections() + .createWithResponse(resourceGroupName, accountName, projectName, connectionName, this.innerModel(), + Context.NONE) .getValue(); return this; } public ConnectionPropertiesV2BasicResource create(Context context) { this.innerObject = serviceManager.serviceClient() - .getAccountConnections() - .createWithResponse(resourceGroupName, accountName, connectionName, this.innerModel(), context) + .getProjectConnections() + .createWithResponse(resourceGroupName, accountName, projectName, connectionName, this.innerModel(), context) .getValue(); return this; } @@ -93,16 +98,17 @@ public ConnectionPropertiesV2BasicResourceImpl update() { public ConnectionPropertiesV2BasicResource apply() { this.innerObject = serviceManager.serviceClient() - .getAccountConnections() - .updateWithResponse(resourceGroupName, accountName, connectionName, updateConnection, Context.NONE) + .getProjectConnections() + .updateWithResponse(resourceGroupName, accountName, projectName, connectionName, updateConnection, + Context.NONE) .getValue(); return this; } public ConnectionPropertiesV2BasicResource apply(Context context) { this.innerObject = serviceManager.serviceClient() - .getAccountConnections() - .updateWithResponse(resourceGroupName, accountName, connectionName, updateConnection, context) + .getProjectConnections() + .updateWithResponse(resourceGroupName, accountName, projectName, connectionName, updateConnection, context) .getValue(); return this; } @@ -113,21 +119,22 @@ public ConnectionPropertiesV2BasicResource apply(Context context) { this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); + this.projectName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "projects"); this.connectionName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "connections"); } public ConnectionPropertiesV2BasicResource refresh() { this.innerObject = serviceManager.serviceClient() - .getAccountConnections() - .getWithResponse(resourceGroupName, accountName, connectionName, Context.NONE) + .getProjectConnections() + .getWithResponse(resourceGroupName, accountName, projectName, connectionName, Context.NONE) .getValue(); return this; } public ConnectionPropertiesV2BasicResource refresh(Context context) { this.innerObject = serviceManager.serviceClient() - .getAccountConnections() - .getWithResponse(resourceGroupName, accountName, connectionName, context) + .getProjectConnections() + .getWithResponse(resourceGroupName, accountName, projectName, connectionName, context) .getValue(); return this; } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DefenderForAISettingImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DefenderForAISettingImpl.java index eabde08372cb..6387bba7a4ca 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DefenderForAISettingImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DefenderForAISettingImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DefenderForAISettingsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DefenderForAISettingsClientImpl.java index a5e1079e0e5d..9a5ad5a0f76d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DefenderForAISettingsClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DefenderForAISettingsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -28,10 +28,9 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.cognitiveservices.fluent.DefenderForAISettingsClient; import com.azure.resourcemanager.cognitiveservices.fluent.models.DefenderForAISettingInner; -import com.azure.resourcemanager.cognitiveservices.models.DefenderForAISettingResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.DefenderForAISettingResult; import reactor.core.publisher.Mono; /** @@ -63,34 +62,16 @@ public final class DefenderForAISettingsClientImpl implements DefenderForAISetti * The interface defining all the services for CognitiveServicesManagementClientDefenderForAISettings to be used by * the proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CognitiveServicesManagementClientDefenderForAISettings") public interface DefenderForAISettingsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/defenderForAISettings") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/defenderForAISettings") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/defenderForAISettings/{defenderForAISettingName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("defenderForAISettingName") String defenderForAISettingName, @HeaderParam("Accept") String accept, Context context); @@ -98,54 +79,68 @@ Mono> get(@HostParam("$host") String endpoin @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/defenderForAISettings/{defenderForAISettingName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("defenderForAISettingName") String defenderForAISettingName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/defenderForAISettings/{defenderForAISettingName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("defenderForAISettingName") String defenderForAISettingName, - @BodyParam("application/json") DefenderForAISettingInner defenderForAISettings, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DefenderForAISettingInner defenderForAISettings, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/defenderForAISettings/{defenderForAISettingName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("defenderForAISettingName") String defenderForAISettingName, - @BodyParam("application/json") DefenderForAISettingInner defenderForAISettings, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DefenderForAISettingInner defenderForAISettings, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/defenderForAISettings/{defenderForAISettingName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("defenderForAISettingName") String defenderForAISettingName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DefenderForAISettingInner defenderForAISettings, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/defenderForAISettings/{defenderForAISettingName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("defenderForAISettingName") String defenderForAISettingName, - @BodyParam("application/json") DefenderForAISettingInner defenderForAISettings, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DefenderForAISettingInner defenderForAISettings, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/defenderForAISettings/{defenderForAISettingName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/defenderForAISettings") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/defenderForAISettings") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("defenderForAISettingName") String defenderForAISettingName, - @BodyParam("application/json") DefenderForAISettingInner defenderForAISettings, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -153,7 +148,7 @@ Response updateSync(@HostParam("$host") String endpoi @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -161,174 +156,10 @@ Mono> listNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } - /** - * Lists the Defender for AI settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services Defender for AI Settings along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String accountName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the Defender for AI settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services Defender for AI Settings as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists the Defender for AI settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services Defender for AI Settings along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), resourceGroupName, - accountName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists the Defender for AI settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services Defender for AI Settings along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, - Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), resourceGroupName, - accountName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Lists the Defender for AI settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services Defender for AI Settings as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Lists the Defender for AI settings. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services Defender for AI Settings as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, - Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - /** * Gets the specified Defender for AI setting by name. * @@ -344,28 +175,9 @@ public PagedIterable list(String resourceGroupName, S @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String accountName, String defenderForAISettingName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (defenderForAISettingName == null) { - return Mono.error( - new IllegalArgumentException("Parameter defenderForAISettingName is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), defenderForAISettingName, accept, context)) + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, defenderForAISettingName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -402,32 +214,9 @@ private Mono getAsync(String resourceGroupName, Strin @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String accountName, String defenderForAISettingName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (defenderForAISettingName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter defenderForAISettingName is required and cannot be null.")); - } final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), - this.client.getSubscriptionId(), defenderForAISettingName, accept, context); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, defenderForAISettingName, accept, context); } /** @@ -462,36 +251,12 @@ public DefenderForAISettingInner get(String resourceGroupName, String accountNam @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String accountName, String defenderForAISettingName, DefenderForAISettingInner defenderForAISettings) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (defenderForAISettingName == null) { - return Mono.error( - new IllegalArgumentException("Parameter defenderForAISettingName is required and cannot be null.")); - } - if (defenderForAISettings == null) { - return Mono - .error(new IllegalArgumentException("Parameter defenderForAISettings is required and cannot be null.")); - } else { - defenderForAISettings.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), defenderForAISettingName, - defenderForAISettings, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, defenderForAISettingName, contentType, + accept, defenderForAISettings, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -530,39 +295,11 @@ private Mono createOrUpdateAsync(String resourceGroup @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String accountName, String defenderForAISettingName, DefenderForAISettingInner defenderForAISettings, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (defenderForAISettingName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter defenderForAISettingName is required and cannot be null.")); - } - if (defenderForAISettings == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter defenderForAISettings is required and cannot be null.")); - } else { - defenderForAISettings.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), defenderForAISettingName, - defenderForAISettings, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, defenderForAISettingName, contentType, + accept, defenderForAISettings, context); } /** @@ -599,36 +336,12 @@ public DefenderForAISettingInner createOrUpdate(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String accountName, String defenderForAISettingName, DefenderForAISettingInner defenderForAISettings) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (defenderForAISettingName == null) { - return Mono.error( - new IllegalArgumentException("Parameter defenderForAISettingName is required and cannot be null.")); - } - if (defenderForAISettings == null) { - return Mono - .error(new IllegalArgumentException("Parameter defenderForAISettings is required and cannot be null.")); - } else { - defenderForAISettings.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), defenderForAISettingName, - defenderForAISettings, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, defenderForAISettingName, contentType, + accept, defenderForAISettings, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -667,39 +380,11 @@ private Mono updateAsync(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse(String resourceGroupName, String accountName, String defenderForAISettingName, DefenderForAISettingInner defenderForAISettings, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (defenderForAISettingName == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Parameter defenderForAISettingName is required and cannot be null.")); - } - if (defenderForAISettings == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter defenderForAISettings is required and cannot be null.")); - } else { - defenderForAISettings.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), defenderForAISettingName, - defenderForAISettings, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, defenderForAISettingName, contentType, + accept, defenderForAISettings, context); } /** @@ -721,6 +406,121 @@ public DefenderForAISettingInner update(String resourceGroupName, String account Context.NONE).getValue(); } + /** + * Lists the Defender for AI settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cognitive services Defender for AI Settings along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String accountName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the Defender for AI settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cognitive services Defender for AI Settings as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the Defender for AI settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cognitive services Defender for AI Settings along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String accountName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists the Defender for AI settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cognitive services Defender for AI Settings along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String accountName, + Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists the Defender for AI settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cognitive services Defender for AI Settings as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Lists the Defender for AI settings. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of cognitive services Defender for AI Settings as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + /** * Get the next page of items. * @@ -733,13 +533,6 @@ public DefenderForAISettingInner update(String resourceGroupName, String account */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -758,15 +551,6 @@ private Mono> listNextSinglePageAsync(S */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -786,21 +570,10 @@ private PagedResponse listNextSinglePage(String nextL */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(DefenderForAISettingsClientImpl.class); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DefenderForAISettingsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DefenderForAISettingsImpl.java index 004494a4b7c7..378f70301c7b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DefenderForAISettingsImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DefenderForAISettingsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -27,27 +27,12 @@ public DefenderForAISettingsImpl(DefenderForAISettingsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String accountName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DefenderForAISettingImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, accountName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DefenderForAISettingImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String accountName, String defenderForAISettingName, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, accountName, defenderForAISettingName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DefenderForAISettingImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DefenderForAISettingImpl(inner.getValue(), this.manager())); } public DefenderForAISetting get(String resourceGroupName, String accountName, String defenderForAISettingName) { @@ -60,6 +45,17 @@ public DefenderForAISetting get(String resourceGroupName, String accountName, St } } + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DefenderForAISettingImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, accountName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DefenderForAISettingImpl(inner1, this.manager())); + } + public DefenderForAISetting getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeletedAccountsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeletedAccountsClientImpl.java index 98e01f733d96..459515dc9a61 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeletedAccountsClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeletedAccountsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -28,12 +28,11 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.cognitiveservices.fluent.DeletedAccountsClient; import com.azure.resourcemanager.cognitiveservices.fluent.models.AccountInner; -import com.azure.resourcemanager.cognitiveservices.models.AccountListResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.AccountListResult; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -67,50 +66,50 @@ public final class DeletedAccountsClientImpl implements DeletedAccountsClient { * The interface defining all the services for CognitiveServicesManagementClientDeletedAccounts to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CognitiveServicesManagementClientDeletedAccounts") public interface DeletedAccountsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/resourceGroups/{resourceGroupName}/deletedAccounts/{accountName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, @PathParam("location") String location, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("location") String location, @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/resourceGroups/{resourceGroupName}/deletedAccounts/{accountName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("$host") String endpoint, @PathParam("location") String location, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("location") String location, @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/resourceGroups/{resourceGroupName}/deletedAccounts/{accountName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> purge(@HostParam("$host") String endpoint, + Mono>> purge(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("accountName") String accountName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @PathParam("accountName") String accountName, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/resourceGroups/{resourceGroupName}/deletedAccounts/{accountName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response purgeSync(@HostParam("$host") String endpoint, @PathParam("location") String location, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response purgeSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("location") String location, @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("accountName") String accountName, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/deletedAccounts") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @@ -118,7 +117,7 @@ Mono> list(@HostParam("$host") String endpoint, @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/deletedAccounts") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @@ -127,20 +126,20 @@ Response listSync(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Returns a Cognitive Services account specified by the parameters. * - * @param location Resource location. + * @param location The location name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -152,35 +151,17 @@ Response listNextSync(@PathParam(value = "nextLink", encoded @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String location, String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), location, resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, resourceGroupName, accountName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Returns a Cognitive Services account specified by the parameters. * - * @param location Resource location. + * @param location The location name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -198,7 +179,7 @@ private Mono getAsync(String location, String resourceGroupName, S /** * Returns a Cognitive Services account specified by the parameters. * - * @param location Resource location. + * @param location The location name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param context The context to associate with this operation. @@ -211,37 +192,15 @@ private Mono getAsync(String location, String resourceGroupName, S @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String location, String resourceGroupName, String accountName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), location, resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + location, resourceGroupName, accountName, accept, context); } /** * Returns a Cognitive Services account specified by the parameters. * - * @param location Resource location. + * @param location The location name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -258,7 +217,7 @@ public AccountInner get(String location, String resourceGroupName, String accoun /** * Deletes a Cognitive Services account from the resource group. * - * @param location Resource location. + * @param location The location name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -269,35 +228,16 @@ public AccountInner get(String location, String resourceGroupName, String accoun @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> purgeWithResponseAsync(String location, String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.purge(this.client.getEndpoint(), location, resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.purge(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, resourceGroupName, accountName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes a Cognitive Services account from the resource group. * - * @param location Resource location. + * @param location The location name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -307,37 +247,14 @@ private Mono>> purgeWithResponseAsync(String location, */ @ServiceMethod(returns = ReturnType.SINGLE) private Response purgeWithResponse(String location, String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return service.purgeSync(this.client.getEndpoint(), location, resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return service.purgeSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, resourceGroupName, accountName, Context.NONE); } /** * Deletes a Cognitive Services account from the resource group. * - * @param location Resource location. + * @param location The location name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param context The context to associate with this operation. @@ -349,37 +266,14 @@ private Response purgeWithResponse(String location, String resourceG @ServiceMethod(returns = ReturnType.SINGLE) private Response purgeWithResponse(String location, String resourceGroupName, String accountName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return service.purgeSync(this.client.getEndpoint(), location, resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service.purgeSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, resourceGroupName, accountName, context); } /** * Deletes a Cognitive Services account from the resource group. * - * @param location Resource location. + * @param location The location name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -398,7 +292,7 @@ private PollerFlux, Void> beginPurgeAsync(String location, Stri /** * Deletes a Cognitive Services account from the resource group. * - * @param location Resource location. + * @param location The location name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -416,7 +310,7 @@ public SyncPoller, Void> beginPurge(String location, String res /** * Deletes a Cognitive Services account from the resource group. * - * @param location Resource location. + * @param location The location name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param context The context to associate with this operation. @@ -435,7 +329,7 @@ public SyncPoller, Void> beginPurge(String location, String res /** * Deletes a Cognitive Services account from the resource group. * - * @param location Resource location. + * @param location The location name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -452,7 +346,7 @@ private Mono purgeAsync(String location, String resourceGroupName, String /** * Deletes a Cognitive Services account from the resource group. * - * @param location Resource location. + * @param location The location name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -467,7 +361,7 @@ public void purge(String location, String resourceGroupName, String accountName) /** * Deletes a Cognitive Services account from the resource group. * - * @param location Resource location. + * @param location The location name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param context The context to associate with this operation. @@ -490,14 +384,6 @@ public void purge(String location, String resourceGroupName, String accountName, */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), @@ -528,16 +414,6 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage() { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); @@ -556,16 +432,6 @@ private PagedResponse listSinglePage() { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); @@ -613,13 +479,6 @@ public PagedIterable list(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), @@ -638,15 +497,6 @@ private Mono> listNextSinglePageAsync(String nextLin */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -666,20 +516,9 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(DeletedAccountsClientImpl.class); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeletedAccountsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeletedAccountsImpl.java index 484932d8c1ba..c83a8e792b81 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeletedAccountsImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeletedAccountsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -31,12 +31,8 @@ public Response getWithResponse(String location, String resourceGroupNa Context context) { Response inner = this.serviceClient().getWithResponse(location, resourceGroupName, accountName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new AccountImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AccountImpl(inner.getValue(), this.manager())); } public Account get(String location, String resourceGroupName, String accountName) { diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentImpl.java index a46c682e3b65..931f0b169710 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentImpl.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; +import com.azure.core.http.rest.Response; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.cognitiveservices.fluent.models.DeploymentInner; @@ -31,6 +32,10 @@ public String type() { return this.innerModel().type(); } + public DeploymentProperties properties() { + return this.innerModel().properties(); + } + public Sku sku() { return this.innerModel().sku(); } @@ -48,10 +53,6 @@ public Map tags() { } } - public DeploymentProperties properties() { - return this.innerModel().properties(); - } - public SystemData systemData() { return this.innerModel().systemData(); } @@ -146,6 +147,22 @@ public Deployment refresh(Context context) { return this; } + public Response pauseWithResponse(Context context) { + return serviceManager.deployments().pauseWithResponse(resourceGroupName, accountName, deploymentName, context); + } + + public Deployment pause() { + return serviceManager.deployments().pause(resourceGroupName, accountName, deploymentName); + } + + public Response resumeWithResponse(Context context) { + return serviceManager.deployments().resumeWithResponse(resourceGroupName, accountName, deploymentName, context); + } + + public Deployment resume() { + return serviceManager.deployments().resume(resourceGroupName, accountName, deploymentName); + } + public DeploymentImpl withTags(Map tags) { if (isInCreateMode()) { this.innerModel().withTags(tags); @@ -156,6 +173,11 @@ public DeploymentImpl withTags(Map tags) { } } + public DeploymentImpl withProperties(DeploymentProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + public DeploymentImpl withSku(Sku sku) { if (isInCreateMode()) { this.innerModel().withSku(sku); @@ -166,11 +188,6 @@ public DeploymentImpl withSku(Sku sku) { } } - public DeploymentImpl withProperties(DeploymentProperties properties) { - this.innerModel().withProperties(properties); - return this; - } - private boolean isInCreateMode() { return this.innerModel() == null || this.innerModel().id() == null; } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentsClientImpl.java index 1d2be31a1115..e6b6349eebaf 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentsClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -14,6 +14,7 @@ import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -31,14 +32,13 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.cognitiveservices.fluent.DeploymentsClient; import com.azure.resourcemanager.cognitiveservices.fluent.models.DeploymentInner; import com.azure.resourcemanager.cognitiveservices.fluent.models.SkuResourceInner; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentListResult; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentSkuListResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.DeploymentListResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.DeploymentSkuListResult; import com.azure.resourcemanager.cognitiveservices.models.PatchResourceTagsAndSku; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -73,123 +73,155 @@ public final class DeploymentsClientImpl implements DeploymentsClient { * The interface defining all the services for CognitiveServicesManagementClientDeployments to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CognitiveServicesManagementClientDeployments") public interface DeploymentsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("deploymentName") String deploymentName, - @BodyParam("application/json") DeploymentInner deployment, @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DeploymentInner deployment, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("deploymentName") String deploymentName, - @BodyParam("application/json") DeploymentInner deployment, @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DeploymentInner deployment, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono>> update(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("deploymentName") String deploymentName, - @BodyParam("application/json") PatchResourceTagsAndSku deployment, @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") PatchResourceTagsAndSku deployment, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response updateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("deploymentName") String deploymentName, - @BodyParam("application/json") PatchResourceTagsAndSku deployment, @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") PatchResourceTagsAndSku deployment, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("deploymentName") String deploymentName, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("deploymentName") String deploymentName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}/skus") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSkus(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}/skus") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSkus(@HostParam("$host") String endpoint, + Response listSkusSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}/pause") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> pause(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}/skus") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}/pause") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listSkusSync(@HostParam("$host") String endpoint, + Response pauseSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}/resume") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> resume(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/deployments/{deploymentName}/resume") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response resumeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -197,21 +229,21 @@ Response listSkusSync(@HostParam("$host") String endpoi @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listSkusNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -219,175 +251,10 @@ Mono> listSkusNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listSkusNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } - /** - * Gets the deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployments associated with the Cognitive Services account along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployments associated with the Cognitive Services account as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployments associated with the Cognitive Services account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployments associated with the Cognitive Services account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, - Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployments associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Gets the deployments associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployments associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, context), - nextLink -> listNextSinglePage(nextLink, context)); - } - /** * Gets the specified deployments associated with the Cognitive Services account. * @@ -403,28 +270,10 @@ public PagedIterable list(String resourceGroupName, String acco @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String accountName, String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), deploymentName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -461,31 +310,9 @@ private Mono getAsync(String resourceGroupName, String accountN @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String accountName, String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (deploymentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), - this.client.getSubscriptionId(), deploymentName, accept, context); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, deploymentName, accept, context); } /** @@ -520,34 +347,12 @@ public DeploymentInner get(String resourceGroupName, String accountName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String accountName, String deploymentName, DeploymentInner deployment) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (deployment == null) { - return Mono.error(new IllegalArgumentException("Parameter deployment is required and cannot be null.")); - } else { - deployment.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), deploymentName, deployment, accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, contentType, accept, + deployment, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -566,38 +371,11 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, String deploymentName, DeploymentInner deployment) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (deploymentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (deployment == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter deployment is required and cannot be null.")); - } else { - deployment.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), deploymentName, deployment, accept, - Context.NONE); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, contentType, accept, + deployment, Context.NONE); } /** @@ -616,37 +394,11 @@ private Response createOrUpdateWithResponse(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, String deploymentName, DeploymentInner deployment, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (deploymentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (deployment == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter deployment is required and cannot be null.")); - } else { - deployment.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), deploymentName, deployment, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, contentType, accept, + deployment, context); } /** @@ -786,32 +538,12 @@ public DeploymentInner createOrUpdate(String resourceGroupName, String accountNa @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String accountName, String deploymentName, PatchResourceTagsAndSku deployment) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (deployment == null) { - return Mono.error(new IllegalArgumentException("Parameter deployment is required and cannot be null.")); - } else { - deployment.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), deploymentName, deployment, accept, context)) + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, contentType, accept, + deployment, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -830,38 +562,11 @@ private Mono>> updateWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response updateWithResponse(String resourceGroupName, String accountName, String deploymentName, PatchResourceTagsAndSku deployment) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (deploymentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (deployment == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter deployment is required and cannot be null.")); - } else { - deployment.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), deploymentName, deployment, accept, - Context.NONE); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, contentType, accept, + deployment, Context.NONE); } /** @@ -880,37 +585,11 @@ private Response updateWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response updateWithResponse(String resourceGroupName, String accountName, String deploymentName, PatchResourceTagsAndSku deployment, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (deploymentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (deployment == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter deployment is required and cannot be null.")); - } else { - deployment.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), deploymentName, deployment, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, contentType, accept, + deployment, context); } /** @@ -1046,28 +725,9 @@ public DeploymentInner update(String resourceGroupName, String accountName, Stri @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), deploymentName, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1085,31 +745,8 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String accountName, String deploymentName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (deploymentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), deploymentName, accept, Context.NONE); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, Context.NONE); } /** @@ -1127,31 +764,8 @@ private Response deleteWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String accountName, String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (deploymentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), deploymentName, accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, context); } /** @@ -1258,6 +872,120 @@ public void delete(String resourceGroupName, String accountName, String deployme beginDelete(resourceGroupName, accountName, deploymentName, context).getFinalResult(); } + /** + * Gets the deployments associated with the Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployments associated with the Cognitive Services account along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the deployments associated with the Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployments associated with the Cognitive Services account as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the deployments associated with the Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployments associated with the Cognitive Services account along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String accountName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets the deployments associated with the Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployments associated with the Cognitive Services account along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String accountName, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets the deployments associated with the Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployments associated with the Cognitive Services account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets the deployments associated with the Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployments associated with the Cognitive Services account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + /** * Lists the specified deployments skus associated with the Cognitive Services account. * @@ -1273,28 +1001,10 @@ public void delete(String resourceGroupName, String accountName, String deployme @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSkusSinglePageAsync(String resourceGroupName, String accountName, String deploymentName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listSkus(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), deploymentName, accept, context)) + .withContext(context -> service.listSkus(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1332,32 +1042,10 @@ private PagedFlux listSkusAsync(String resourceGroupName, Stri @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSkusSinglePage(String resourceGroupName, String accountName, String deploymentName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (deploymentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } final String accept = "application/json"; Response res - = service.listSkusSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), deploymentName, accept, Context.NONE); + = service.listSkusSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -1377,31 +1065,10 @@ private PagedResponse listSkusSinglePage(String resourceGroupN @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSkusSinglePage(String resourceGroupName, String accountName, String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (deploymentName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } final String accept = "application/json"; - Response res = service.listSkusSync(this.client.getEndpoint(), resourceGroupName, - accountName, this.client.getApiVersion(), this.client.getSubscriptionId(), deploymentName, accept, context); + Response res + = service.listSkusSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -1445,6 +1112,192 @@ public PagedIterable listSkus(String resourceGroupName, String nextLink -> listSkusNextSinglePage(nextLink, context)); } + /** + * Pause a deployment + * + * Pauses inferencing on a deployment by setting the deploymentState to 'Paused' (see + * #/definitions/DeploymentProperties/properties/deploymentState). Only Standard, DataZoneStandard, and + * GlobalStandard SKUs support this operation. Inference requests to the paused deployment endpoint will receive + * HTTP 423 (Locked). This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account deployment along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> pauseWithResponseAsync(String resourceGroupName, String accountName, + String deploymentName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.pause(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Pause a deployment + * + * Pauses inferencing on a deployment by setting the deploymentState to 'Paused' (see + * #/definitions/DeploymentProperties/properties/deploymentState). Only Standard, DataZoneStandard, and + * GlobalStandard SKUs support this operation. Inference requests to the paused deployment endpoint will receive + * HTTP 423 (Locked). This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account deployment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono pauseAsync(String resourceGroupName, String accountName, String deploymentName) { + return pauseWithResponseAsync(resourceGroupName, accountName, deploymentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Pause a deployment + * + * Pauses inferencing on a deployment by setting the deploymentState to 'Paused' (see + * #/definitions/DeploymentProperties/properties/deploymentState). Only Standard, DataZoneStandard, and + * GlobalStandard SKUs support this operation. Inference requests to the paused deployment endpoint will receive + * HTTP 423 (Locked). This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account deployment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response pauseWithResponse(String resourceGroupName, String accountName, + String deploymentName, Context context) { + final String accept = "application/json"; + return service.pauseSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, accept, context); + } + + /** + * Pause a deployment + * + * Pauses inferencing on a deployment by setting the deploymentState to 'Paused' (see + * #/definitions/DeploymentProperties/properties/deploymentState). Only Standard, DataZoneStandard, and + * GlobalStandard SKUs support this operation. Inference requests to the paused deployment endpoint will receive + * HTTP 423 (Locked). This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account deployment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentInner pause(String resourceGroupName, String accountName, String deploymentName) { + return pauseWithResponse(resourceGroupName, accountName, deploymentName, Context.NONE).getValue(); + } + + /** + * Resume a deployment + * + * Resumes inferencing on a previously paused deployment by setting the deploymentState to 'Running' (see + * #/definitions/DeploymentProperties/properties/deploymentState). This operation is idempotent and can be safely + * called on already running deployments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account deployment along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> resumeWithResponseAsync(String resourceGroupName, String accountName, + String deploymentName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.resume(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Resume a deployment + * + * Resumes inferencing on a previously paused deployment by setting the deploymentState to 'Running' (see + * #/definitions/DeploymentProperties/properties/deploymentState). This operation is idempotent and can be safely + * called on already running deployments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account deployment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono resumeAsync(String resourceGroupName, String accountName, String deploymentName) { + return resumeWithResponseAsync(resourceGroupName, accountName, deploymentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Resume a deployment + * + * Resumes inferencing on a previously paused deployment by setting the deploymentState to 'Running' (see + * #/definitions/DeploymentProperties/properties/deploymentState). This operation is idempotent and can be safely + * called on already running deployments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account deployment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response resumeWithResponse(String resourceGroupName, String accountName, + String deploymentName, Context context) { + final String accept = "application/json"; + return service.resumeSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, deploymentName, accept, context); + } + + /** + * Resume a deployment + * + * Resumes inferencing on a previously paused deployment by setting the deploymentState to 'Running' (see + * #/definitions/DeploymentProperties/properties/deploymentState). This operation is idempotent and can be safely + * called on already running deployments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account deployment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentInner resume(String resourceGroupName, String accountName, String deploymentName) { + return resumeWithResponse(resourceGroupName, accountName, deploymentName, Context.NONE).getValue(); + } + /** * Get the next page of items. * @@ -1457,13 +1310,6 @@ public PagedIterable listSkus(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), @@ -1482,15 +1328,6 @@ private Mono> listNextSinglePageAsync(String next */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -1510,15 +1347,6 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), @@ -1537,13 +1365,6 @@ private PagedResponse listNextSinglePage(String nextLink, Conte */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSkusNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listSkusNext(nextLink, this.client.getEndpoint(), accept, context)) @@ -1563,15 +1384,6 @@ private Mono> listSkusNextSinglePageAsync(String */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSkusNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listSkusNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -1591,21 +1403,10 @@ private PagedResponse listSkusNextSinglePage(String nextLink) */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSkusNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listSkusNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(DeploymentsClientImpl.class); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentsImpl.java index 833e31a44a50..37796cdad1da 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentsImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -29,26 +29,12 @@ public DeploymentsImpl(DeploymentsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String accountName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DeploymentImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new DeploymentImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String accountName, String deploymentName, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, accountName, deploymentName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DeploymentImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DeploymentImpl(inner.getValue(), this.manager())); } public Deployment get(String resourceGroupName, String accountName, String deploymentName) { @@ -68,6 +54,16 @@ public void delete(String resourceGroupName, String accountName, String deployme this.serviceClient().delete(resourceGroupName, accountName, deploymentName, context); } + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeploymentImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeploymentImpl(inner1, this.manager())); + } + public PagedIterable listSkus(String resourceGroupName, String accountName, String deploymentName) { PagedIterable inner = this.serviceClient().listSkus(resourceGroupName, accountName, deploymentName); @@ -81,6 +77,40 @@ public PagedIterable listSkus(String resourceGroupName, String acco return ResourceManagerUtils.mapPage(inner, inner1 -> new SkuResourceImpl(inner1, this.manager())); } + public Response pauseWithResponse(String resourceGroupName, String accountName, String deploymentName, + Context context) { + Response inner + = this.serviceClient().pauseWithResponse(resourceGroupName, accountName, deploymentName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DeploymentImpl(inner.getValue(), this.manager())); + } + + public Deployment pause(String resourceGroupName, String accountName, String deploymentName) { + DeploymentInner inner = this.serviceClient().pause(resourceGroupName, accountName, deploymentName); + if (inner != null) { + return new DeploymentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response resumeWithResponse(String resourceGroupName, String accountName, String deploymentName, + Context context) { + Response inner + = this.serviceClient().resumeWithResponse(resourceGroupName, accountName, deploymentName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DeploymentImpl(inner.getValue(), this.manager())); + } + + public Deployment resume(String resourceGroupName, String accountName, String deploymentName) { + DeploymentInner inner = this.serviceClient().resume(resourceGroupName, accountName, deploymentName); + if (inner != null) { + return new DeploymentImpl(inner, this.manager()); + } else { + return null; + } + } + public Deployment getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DomainAvailabilityImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DomainAvailabilityImpl.java index 3276dfe5391a..68f36850c095 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DomainAvailabilityImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DomainAvailabilityImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EncryptionScopeImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EncryptionScopeImpl.java index 4f185b6a6d90..34268e74ddac 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EncryptionScopeImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EncryptionScopeImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -29,6 +29,10 @@ public String type() { return this.innerModel().type(); } + public EncryptionScopeProperties properties() { + return this.innerModel().properties(); + } + public String etag() { return this.innerModel().etag(); } @@ -42,10 +46,6 @@ public Map tags() { } } - public EncryptionScopeProperties properties() { - return this.innerModel().properties(); - } - public SystemData systemData() { return this.innerModel().systemData(); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EncryptionScopesClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EncryptionScopesClientImpl.java index 220369a3045f..dcb8494ef6c6 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EncryptionScopesClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EncryptionScopesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -30,12 +30,11 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.cognitiveservices.fluent.EncryptionScopesClient; import com.azure.resourcemanager.cognitiveservices.fluent.models.EncryptionScopeInner; -import com.azure.resourcemanager.cognitiveservices.models.EncryptionScopeListResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.EncryptionScopeListResult; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -69,34 +68,16 @@ public final class EncryptionScopesClientImpl implements EncryptionScopesClient * The interface defining all the services for CognitiveServicesManagementClientEncryptionScopes to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CognitiveServicesManagementClientEncryptionScopes") public interface EncryptionScopesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/encryptionScopes") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/encryptionScopes") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/encryptionScopes/{encryptionScopeName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("encryptionScopeName") String encryptionScopeName, @HeaderParam("Accept") String accept, Context context); @@ -104,60 +85,74 @@ Mono> get(@HostParam("$host") String endpoint, @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/encryptionScopes/{encryptionScopeName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("encryptionScopeName") String encryptionScopeName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/encryptionScopes/{encryptionScopeName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("encryptionScopeName") String encryptionScopeName, - @BodyParam("application/json") EncryptionScopeInner encryptionScope, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") EncryptionScopeInner encryptionScope, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/encryptionScopes/{encryptionScopeName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("encryptionScopeName") String encryptionScopeName, - @BodyParam("application/json") EncryptionScopeInner encryptionScope, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") EncryptionScopeInner encryptionScope, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/encryptionScopes/{encryptionScopeName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("encryptionScopeName") String encryptionScopeName, @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("encryptionScopeName") String encryptionScopeName, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/encryptionScopes/{encryptionScopeName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("encryptionScopeName") String encryptionScopeName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/encryptionScopes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("encryptionScopeName") String encryptionScopeName, @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/encryptionScopes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -165,173 +160,7 @@ Mono> listNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String accountName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), resourceGroupName, - accountName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, - Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), resourceGroupName, - accountName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, context), - nextLink -> listNextSinglePage(nextLink, context)); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -349,29 +178,10 @@ public PagedIterable list(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String accountName, String encryptionScopeName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (encryptionScopeName == null) { - return Mono - .error(new IllegalArgumentException("Parameter encryptionScopeName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), encryptionScopeName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, encryptionScopeName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -409,31 +219,9 @@ private Mono getAsync(String resourceGroupName, String acc @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String accountName, String encryptionScopeName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (encryptionScopeName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter encryptionScopeName is required and cannot be null.")); - } final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), - this.client.getSubscriptionId(), encryptionScopeName, accept, context); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, encryptionScopeName, accept, context); } /** @@ -467,36 +255,12 @@ public EncryptionScopeInner get(String resourceGroupName, String accountName, St @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String accountName, String encryptionScopeName, EncryptionScopeInner encryptionScope) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (encryptionScopeName == null) { - return Mono - .error(new IllegalArgumentException("Parameter encryptionScopeName is required and cannot be null.")); - } - if (encryptionScope == null) { - return Mono - .error(new IllegalArgumentException("Parameter encryptionScope is required and cannot be null.")); - } else { - encryptionScope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), encryptionScopeName, encryptionScope, - accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, encryptionScopeName, contentType, + accept, encryptionScope, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -535,38 +299,11 @@ private Mono createOrUpdateAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String accountName, String encryptionScopeName, EncryptionScopeInner encryptionScope, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (encryptionScopeName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter encryptionScopeName is required and cannot be null.")); - } - if (encryptionScope == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter encryptionScope is required and cannot be null.")); - } else { - encryptionScope.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), encryptionScopeName, encryptionScope, accept, - context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, encryptionScopeName, contentType, accept, + encryptionScope, context); } /** @@ -602,29 +339,9 @@ public EncryptionScopeInner createOrUpdate(String resourceGroupName, String acco @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, String encryptionScopeName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (encryptionScopeName == null) { - return Mono - .error(new IllegalArgumentException("Parameter encryptionScopeName is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), encryptionScopeName, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, encryptionScopeName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -642,31 +359,8 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String accountName, String encryptionScopeName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (encryptionScopeName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter encryptionScopeName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), encryptionScopeName, accept, Context.NONE); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, encryptionScopeName, Context.NONE); } /** @@ -684,31 +378,8 @@ private Response deleteWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String accountName, String encryptionScopeName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (encryptionScopeName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter encryptionScopeName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), encryptionScopeName, accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, encryptionScopeName, context); } /** @@ -817,6 +488,123 @@ public void delete(String resourceGroupName, String accountName, String encrypti beginDelete(resourceGroupName, accountName, encryptionScopeName, context).getFinalResult(); } + /** + * Gets the content filters associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the content filters associated with the Azure OpenAI account along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String accountName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the content filters associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the content filters associated with the Azure OpenAI account as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the content filters associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the content filters associated with the Azure OpenAI account along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String accountName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets the content filters associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the content filters associated with the Azure OpenAI account along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String accountName, + Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets the content filters associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the content filters associated with the Azure OpenAI account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets the content filters associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the content filters associated with the Azure OpenAI account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + /** * Get the next page of items. * @@ -829,13 +617,6 @@ public void delete(String resourceGroupName, String accountName, String encrypti */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -854,15 +635,6 @@ private Mono> listNextSinglePageAsync(String */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -882,21 +654,10 @@ private PagedResponse listNextSinglePage(String nextLink) */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(EncryptionScopesClientImpl.class); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EncryptionScopesImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EncryptionScopesImpl.java index 729f902487af..5ce31381d037 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EncryptionScopesImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EncryptionScopesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -27,26 +27,12 @@ public EncryptionScopesImpl(EncryptionScopesClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String accountName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new EncryptionScopeImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new EncryptionScopeImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String accountName, String encryptionScopeName, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, accountName, encryptionScopeName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new EncryptionScopeImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EncryptionScopeImpl(inner.getValue(), this.manager())); } public EncryptionScope get(String resourceGroupName, String accountName, String encryptionScopeName) { @@ -66,6 +52,16 @@ public void delete(String resourceGroupName, String accountName, String encrypti this.serviceClient().delete(resourceGroupName, accountName, encryptionScopeName, context); } + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EncryptionScopeImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EncryptionScopeImpl(inner1, this.manager())); + } + public EncryptionScope getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/LocationBasedModelCapacitiesClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/LocationBasedModelCapacitiesClientImpl.java index 7a040c3a77c3..e60b2ecb3d74 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/LocationBasedModelCapacitiesClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/LocationBasedModelCapacitiesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -25,10 +25,9 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.cognitiveservices.fluent.LocationBasedModelCapacitiesClient; import com.azure.resourcemanager.cognitiveservices.fluent.models.ModelCapacityListResultValueItemInner; -import com.azure.resourcemanager.cognitiveservices.models.ModelCapacityListResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.ModelCapacityListResult; import reactor.core.publisher.Mono; /** @@ -60,15 +59,15 @@ public final class LocationBasedModelCapacitiesClientImpl implements LocationBas * The interface defining all the services for CognitiveServicesManagementClientLocationBasedModelCapacities to be * used by the proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CognitiveServicesManagementClientLocationBasedModelCapacities") public interface LocationBasedModelCapacitiesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/modelCapacities") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @QueryParam("modelFormat") String modelFormat, @QueryParam("modelName") String modelName, @QueryParam("modelVersion") String modelVersion, @HeaderParam("Accept") String accept, Context context); @@ -77,8 +76,8 @@ Mono> list(@HostParam("$host") String endpoint @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/modelCapacities") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @QueryParam("modelFormat") String modelFormat, @QueryParam("modelName") String modelName, @QueryParam("modelVersion") String modelVersion, @HeaderParam("Accept") String accept, Context context); @@ -88,20 +87,20 @@ Response listSync(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * List Location Based ModelCapacities. * - * @param location Resource location. + * @param location The location name. * @param modelFormat The format of the Model. * @param modelName The name of the Model. * @param modelVersion The version of the Model. @@ -114,30 +113,10 @@ Response listNextSync(@PathParam(value = "nextLink", en @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String location, String modelFormat, String modelName, String modelVersion) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (modelFormat == null) { - return Mono.error(new IllegalArgumentException("Parameter modelFormat is required and cannot be null.")); - } - if (modelName == null) { - return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); - } - if (modelVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter modelVersion is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), location, modelFormat, modelName, modelVersion, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, modelFormat, modelName, modelVersion, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -146,7 +125,7 @@ private Mono> listSinglePag /** * List Location Based ModelCapacities. * - * @param location Resource location. + * @param location The location name. * @param modelFormat The format of the Model. * @param modelName The name of the Model. * @param modelVersion The version of the Model. @@ -165,7 +144,7 @@ private PagedFlux listAsync(String locati /** * List Location Based ModelCapacities. * - * @param location Resource location. + * @param location The location name. * @param modelFormat The format of the Model. * @param modelName The name of the Model. * @param modelVersion The version of the Model. @@ -177,36 +156,9 @@ private PagedFlux listAsync(String locati @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String location, String modelFormat, String modelName, String modelVersion) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (modelFormat == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter modelFormat is required and cannot be null.")); - } - if (modelName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); - } - if (modelVersion == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter modelVersion is required and cannot be null.")); - } final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), - location, modelFormat, modelName, modelVersion, accept, Context.NONE); + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, modelFormat, modelName, modelVersion, accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -214,7 +166,7 @@ private PagedResponse listSinglePage(Stri /** * List Location Based ModelCapacities. * - * @param location Resource location. + * @param location The location name. * @param modelFormat The format of the Model. * @param modelName The name of the Model. * @param modelVersion The version of the Model. @@ -227,36 +179,9 @@ private PagedResponse listSinglePage(Stri @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String location, String modelFormat, String modelName, String modelVersion, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (modelFormat == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter modelFormat is required and cannot be null.")); - } - if (modelName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); - } - if (modelVersion == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter modelVersion is required and cannot be null.")); - } final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), - location, modelFormat, modelName, modelVersion, accept, context); + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, modelFormat, modelName, modelVersion, accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -264,7 +189,7 @@ private PagedResponse listSinglePage(Stri /** * List Location Based ModelCapacities. * - * @param location Resource location. + * @param location The location name. * @param modelFormat The format of the Model. * @param modelName The name of the Model. * @param modelVersion The version of the Model. @@ -284,7 +209,7 @@ public PagedIterable list(String location /** * List Location Based ModelCapacities. * - * @param location Resource location. + * @param location The location name. * @param modelFormat The format of the Model. * @param modelName The name of the Model. * @param modelVersion The version of the Model. @@ -314,13 +239,6 @@ public PagedIterable list(String location */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -339,15 +257,6 @@ private Mono> listNextSingl */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -367,21 +276,10 @@ private PagedResponse listNextSinglePage( */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(LocationBasedModelCapacitiesClientImpl.class); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/LocationBasedModelCapacitiesImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/LocationBasedModelCapacitiesImpl.java index 5711184721e8..51722dae4d82 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/LocationBasedModelCapacitiesImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/LocationBasedModelCapacitiesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkProvisionStatusImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkProvisionStatusImpl.java new file mode 100644 index 000000000000..fb2da22bf3e6 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkProvisionStatusImpl.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkProvisionStatusInner; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkProvisionStatus; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkStatus; + +public final class ManagedNetworkProvisionStatusImpl implements ManagedNetworkProvisionStatus { + private ManagedNetworkProvisionStatusInner innerObject; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + ManagedNetworkProvisionStatusImpl(ManagedNetworkProvisionStatusInner innerObject, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public ManagedNetworkStatus status() { + return this.innerModel().status(); + } + + public ManagedNetworkProvisionStatusInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkProvisionsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkProvisionsClientImpl.java new file mode 100644 index 000000000000..430d3c3154cb --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkProvisionsClientImpl.java @@ -0,0 +1,352 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cognitiveservices.fluent.ManagedNetworkProvisionsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkProvisionStatusInner; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkProvisionOptions; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ManagedNetworkProvisionsClient. + */ +public final class ManagedNetworkProvisionsClientImpl implements ManagedNetworkProvisionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ManagedNetworkProvisionsService service; + + /** + * The service client containing this operation class. + */ + private final CognitiveServicesManagementClientImpl client; + + /** + * Initializes an instance of ManagedNetworkProvisionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedNetworkProvisionsClientImpl(CognitiveServicesManagementClientImpl client) { + this.service = RestProxy.create(ManagedNetworkProvisionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CognitiveServicesManagementClientManagedNetworkProvisions to be used + * by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CognitiveServicesManagementClientManagedNetworkProvisions") + public interface ManagedNetworkProvisionsService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/provision") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> provisionManagedNetwork(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("managedNetworkName") String managedNetworkName, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ManagedNetworkProvisionOptions body, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/provision") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response provisionManagedNetworkSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("managedNetworkName") String managedNetworkName, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ManagedNetworkProvisionOptions body, Context context); + } + + /** + * Provisions the managed network of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body Managed Network Provisioning Options for a cognitive services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> provisionManagedNetworkWithResponseAsync(String resourceGroupName, + String accountName, String managedNetworkName, ManagedNetworkProvisionOptions body) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.provisionManagedNetwork(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + managedNetworkName, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Provisions the managed network of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body Managed Network Provisioning Options for a cognitive services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response provisionManagedNetworkWithResponse(String resourceGroupName, String accountName, + String managedNetworkName, ManagedNetworkProvisionOptions body) { + final String accept = "application/json"; + return service.provisionManagedNetworkSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, accept, body, + Context.NONE); + } + + /** + * Provisions the managed network of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body Managed Network Provisioning Options for a cognitive services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response provisionManagedNetworkWithResponse(String resourceGroupName, String accountName, + String managedNetworkName, ManagedNetworkProvisionOptions body, Context context) { + final String accept = "application/json"; + return service.provisionManagedNetworkSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, accept, body, context); + } + + /** + * Provisions the managed network of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body Managed Network Provisioning Options for a cognitive services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedNetworkProvisionStatusInner> + beginProvisionManagedNetworkAsync(String resourceGroupName, String accountName, String managedNetworkName, + ManagedNetworkProvisionOptions body) { + Mono>> mono + = provisionManagedNetworkWithResponseAsync(resourceGroupName, accountName, managedNetworkName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ManagedNetworkProvisionStatusInner.class, + ManagedNetworkProvisionStatusInner.class, this.client.getContext()); + } + + /** + * Provisions the managed network of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedNetworkProvisionStatusInner> + beginProvisionManagedNetworkAsync(String resourceGroupName, String accountName, String managedNetworkName) { + final ManagedNetworkProvisionOptions body = null; + Mono>> mono + = provisionManagedNetworkWithResponseAsync(resourceGroupName, accountName, managedNetworkName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ManagedNetworkProvisionStatusInner.class, + ManagedNetworkProvisionStatusInner.class, this.client.getContext()); + } + + /** + * Provisions the managed network of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body Managed Network Provisioning Options for a cognitive services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedNetworkProvisionStatusInner> + beginProvisionManagedNetwork(String resourceGroupName, String accountName, String managedNetworkName, + ManagedNetworkProvisionOptions body) { + Response response + = provisionManagedNetworkWithResponse(resourceGroupName, accountName, managedNetworkName, body); + return this.client.getLroResult( + response, ManagedNetworkProvisionStatusInner.class, ManagedNetworkProvisionStatusInner.class, Context.NONE); + } + + /** + * Provisions the managed network of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedNetworkProvisionStatusInner> + beginProvisionManagedNetwork(String resourceGroupName, String accountName, String managedNetworkName) { + final ManagedNetworkProvisionOptions body = null; + Response response + = provisionManagedNetworkWithResponse(resourceGroupName, accountName, managedNetworkName, body); + return this.client.getLroResult( + response, ManagedNetworkProvisionStatusInner.class, ManagedNetworkProvisionStatusInner.class, Context.NONE); + } + + /** + * Provisions the managed network of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body Managed Network Provisioning Options for a cognitive services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedNetworkProvisionStatusInner> + beginProvisionManagedNetwork(String resourceGroupName, String accountName, String managedNetworkName, + ManagedNetworkProvisionOptions body, Context context) { + Response response + = provisionManagedNetworkWithResponse(resourceGroupName, accountName, managedNetworkName, body, context); + return this.client.getLroResult( + response, ManagedNetworkProvisionStatusInner.class, ManagedNetworkProvisionStatusInner.class, context); + } + + /** + * Provisions the managed network of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body Managed Network Provisioning Options for a cognitive services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono provisionManagedNetworkAsync(String resourceGroupName, + String accountName, String managedNetworkName, ManagedNetworkProvisionOptions body) { + return beginProvisionManagedNetworkAsync(resourceGroupName, accountName, managedNetworkName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Provisions the managed network of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono provisionManagedNetworkAsync(String resourceGroupName, + String accountName, String managedNetworkName) { + final ManagedNetworkProvisionOptions body = null; + return beginProvisionManagedNetworkAsync(resourceGroupName, accountName, managedNetworkName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Provisions the managed network of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedNetworkProvisionStatusInner provisionManagedNetwork(String resourceGroupName, String accountName, + String managedNetworkName) { + final ManagedNetworkProvisionOptions body = null; + return beginProvisionManagedNetwork(resourceGroupName, accountName, managedNetworkName, body).getFinalResult(); + } + + /** + * Provisions the managed network of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body Managed Network Provisioning Options for a cognitive services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedNetworkProvisionStatusInner provisionManagedNetwork(String resourceGroupName, String accountName, + String managedNetworkName, ManagedNetworkProvisionOptions body, Context context) { + return beginProvisionManagedNetwork(resourceGroupName, accountName, managedNetworkName, body, context) + .getFinalResult(); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkProvisionsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkProvisionsImpl.java new file mode 100644 index 000000000000..201f5483579b --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkProvisionsImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cognitiveservices.fluent.ManagedNetworkProvisionsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkProvisionStatusInner; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkProvisionOptions; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkProvisionStatus; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkProvisions; + +public final class ManagedNetworkProvisionsImpl implements ManagedNetworkProvisions { + private static final ClientLogger LOGGER = new ClientLogger(ManagedNetworkProvisionsImpl.class); + + private final ManagedNetworkProvisionsClient innerClient; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + public ManagedNetworkProvisionsImpl(ManagedNetworkProvisionsClient innerClient, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ManagedNetworkProvisionStatus provisionManagedNetwork(String resourceGroupName, String accountName, + String managedNetworkName) { + ManagedNetworkProvisionStatusInner inner + = this.serviceClient().provisionManagedNetwork(resourceGroupName, accountName, managedNetworkName); + if (inner != null) { + return new ManagedNetworkProvisionStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public ManagedNetworkProvisionStatus provisionManagedNetwork(String resourceGroupName, String accountName, + String managedNetworkName, ManagedNetworkProvisionOptions body, Context context) { + ManagedNetworkProvisionStatusInner inner = this.serviceClient() + .provisionManagedNetwork(resourceGroupName, accountName, managedNetworkName, body, context); + if (inner != null) { + return new ManagedNetworkProvisionStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + private ManagedNetworkProvisionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsBasicResourceImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsBasicResourceImpl.java new file mode 100644 index 000000000000..17d13e943228 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsBasicResourceImpl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsBasicResourceInner; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsInner; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettings; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsBasicResource; + +public final class ManagedNetworkSettingsBasicResourceImpl implements ManagedNetworkSettingsBasicResource { + private ManagedNetworkSettingsBasicResourceInner innerObject; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + ManagedNetworkSettingsBasicResourceImpl(ManagedNetworkSettingsBasicResourceInner innerObject, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ManagedNetworkSettings properties() { + ManagedNetworkSettingsInner inner = this.innerModel().properties(); + if (inner != null) { + return new ManagedNetworkSettingsImpl(inner, this.manager()); + } else { + return null; + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ManagedNetworkSettingsBasicResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsImpl.java new file mode 100644 index 000000000000..58675f5f1f30 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsImpl.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkProvisionStatusInner; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsInner; +import com.azure.resourcemanager.cognitiveservices.models.FirewallSku; +import com.azure.resourcemanager.cognitiveservices.models.IsolationMode; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkKind; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkProvisionStatus; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkProvisioningState; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettings; +import com.azure.resourcemanager.cognitiveservices.models.OutboundRule; +import java.util.Collections; +import java.util.Map; + +public final class ManagedNetworkSettingsImpl implements ManagedNetworkSettings { + private ManagedNetworkSettingsInner innerObject; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + ManagedNetworkSettingsImpl(ManagedNetworkSettingsInner innerObject, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public IsolationMode isolationMode() { + return this.innerModel().isolationMode(); + } + + public String networkId() { + return this.innerModel().networkId(); + } + + public Map outboundRules() { + Map inner = this.innerModel().outboundRules(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ManagedNetworkProvisionStatus status() { + ManagedNetworkProvisionStatusInner inner = this.innerModel().status(); + if (inner != null) { + return new ManagedNetworkProvisionStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public FirewallSku firewallSku() { + return this.innerModel().firewallSku(); + } + + public ManagedNetworkKind managedNetworkKind() { + return this.innerModel().managedNetworkKind(); + } + + public String firewallPublicIpAddress() { + return this.innerModel().firewallPublicIpAddress(); + } + + public ManagedNetworkProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public ManagedNetworkSettingsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsOperationsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsOperationsClientImpl.java new file mode 100644 index 000000000000..efc7a6f4e984 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsOperationsClientImpl.java @@ -0,0 +1,1121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cognitiveservices.fluent.ManagedNetworkSettingsOperationsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsPropertiesBasicResourceInner; +import com.azure.resourcemanager.cognitiveservices.implementation.models.ManagedNetworkListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ManagedNetworkSettingsOperationsClient. + */ +public final class ManagedNetworkSettingsOperationsClientImpl implements ManagedNetworkSettingsOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ManagedNetworkSettingsOperationsService service; + + /** + * The service client containing this operation class. + */ + private final CognitiveServicesManagementClientImpl client; + + /** + * Initializes an instance of ManagedNetworkSettingsOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedNetworkSettingsOperationsClientImpl(CognitiveServicesManagementClientImpl client) { + this.service = RestProxy.create(ManagedNetworkSettingsOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CognitiveServicesManagementClientManagedNetworkSettingsOperations to + * be used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CognitiveServicesManagementClientManagedNetworkSettingsOperations") + public interface ManagedNetworkSettingsOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("managedNetworkName") String managedNetworkName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("managedNetworkName") String managedNetworkName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> put(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("managedNetworkName") String managedNetworkName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ManagedNetworkSettingsPropertiesBasicResourceInner body, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response putSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("managedNetworkName") String managedNetworkName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ManagedNetworkSettingsPropertiesBasicResourceInner body, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> patch(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("managedNetworkName") String managedNetworkName, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ManagedNetworkSettingsPropertiesBasicResourceInner body, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response patchSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("managedNetworkName") String managedNetworkName, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ManagedNetworkSettingsPropertiesBasicResourceInner body, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("managedNetworkName") String managedNetworkName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("managedNetworkName") String managedNetworkName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI for managed network settings of a cognitive services account along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getWithResponseAsync(String resourceGroupName, String accountName, String managedNetworkName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI for managed network settings of a cognitive services account on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, + String accountName, String managedNetworkName) { + return getWithResponseAsync(resourceGroupName, accountName, managedNetworkName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI for managed network settings of a cognitive services account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String accountName, String managedNetworkName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, managedNetworkName, accept, context); + } + + /** + * Get API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI for managed network settings of a cognitive services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedNetworkSettingsPropertiesBasicResourceInner get(String resourceGroupName, String accountName, + String managedNetworkName) { + return getWithResponse(resourceGroupName, accountName, managedNetworkName, Context.NONE).getValue(); + } + + /** + * PUT API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> putWithResponseAsync(String resourceGroupName, String accountName, + String managedNetworkName, ManagedNetworkSettingsPropertiesBasicResourceInner body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.put(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, contentType, + accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * PUT API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response putWithResponse(String resourceGroupName, String accountName, + String managedNetworkName, ManagedNetworkSettingsPropertiesBasicResourceInner body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.putSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, managedNetworkName, contentType, accept, body, Context.NONE); + } + + /** + * PUT API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response putWithResponse(String resourceGroupName, String accountName, + String managedNetworkName, ManagedNetworkSettingsPropertiesBasicResourceInner body, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.putSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, managedNetworkName, contentType, accept, body, context); + } + + /** + * PUT API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of concrete proxy resource types can be created by aliasing this type + * using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, ManagedNetworkSettingsPropertiesBasicResourceInner> + beginPutAsync(String resourceGroupName, String accountName, String managedNetworkName, + ManagedNetworkSettingsPropertiesBasicResourceInner body) { + Mono>> mono + = putWithResponseAsync(resourceGroupName, accountName, managedNetworkName, body); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), ManagedNetworkSettingsPropertiesBasicResourceInner.class, + ManagedNetworkSettingsPropertiesBasicResourceInner.class, this.client.getContext()); + } + + /** + * PUT API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete proxy resource types can be created by aliasing this type + * using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ManagedNetworkSettingsPropertiesBasicResourceInner> + beginPut(String resourceGroupName, String accountName, String managedNetworkName, + ManagedNetworkSettingsPropertiesBasicResourceInner body) { + Response response = putWithResponse(resourceGroupName, accountName, managedNetworkName, body); + return this.client + .getLroResult( + response, ManagedNetworkSettingsPropertiesBasicResourceInner.class, + ManagedNetworkSettingsPropertiesBasicResourceInner.class, Context.NONE); + } + + /** + * PUT API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete proxy resource types can be created by aliasing this type + * using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ManagedNetworkSettingsPropertiesBasicResourceInner> + beginPut(String resourceGroupName, String accountName, String managedNetworkName, + ManagedNetworkSettingsPropertiesBasicResourceInner body, Context context) { + Response response + = putWithResponse(resourceGroupName, accountName, managedNetworkName, body, context); + return this.client + .getLroResult( + response, ManagedNetworkSettingsPropertiesBasicResourceInner.class, + ManagedNetworkSettingsPropertiesBasicResourceInner.class, context); + } + + /** + * PUT API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono putAsync(String resourceGroupName, + String accountName, String managedNetworkName, ManagedNetworkSettingsPropertiesBasicResourceInner body) { + return beginPutAsync(resourceGroupName, accountName, managedNetworkName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * PUT API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedNetworkSettingsPropertiesBasicResourceInner put(String resourceGroupName, String accountName, + String managedNetworkName, ManagedNetworkSettingsPropertiesBasicResourceInner body) { + return beginPut(resourceGroupName, accountName, managedNetworkName, body).getFinalResult(); + } + + /** + * PUT API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedNetworkSettingsPropertiesBasicResourceInner put(String resourceGroupName, String accountName, + String managedNetworkName, ManagedNetworkSettingsPropertiesBasicResourceInner body, Context context) { + return beginPut(resourceGroupName, accountName, managedNetworkName, body, context).getFinalResult(); + } + + /** + * Patch API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> patchWithResponseAsync(String resourceGroupName, String accountName, + String managedNetworkName, ManagedNetworkSettingsPropertiesBasicResourceInner body) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.patch(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patch API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response patchWithResponse(String resourceGroupName, String accountName, + String managedNetworkName, ManagedNetworkSettingsPropertiesBasicResourceInner body) { + final String accept = "application/json"; + return service.patchSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, accept, body, + Context.NONE); + } + + /** + * Patch API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response patchWithResponse(String resourceGroupName, String accountName, + String managedNetworkName, ManagedNetworkSettingsPropertiesBasicResourceInner body, Context context) { + final String accept = "application/json"; + return service.patchSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, accept, body, context); + } + + /** + * Patch API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of concrete proxy resource types can be created by aliasing this type + * using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, ManagedNetworkSettingsPropertiesBasicResourceInner> + beginPatchAsync(String resourceGroupName, String accountName, String managedNetworkName, + ManagedNetworkSettingsPropertiesBasicResourceInner body) { + Mono>> mono + = patchWithResponseAsync(resourceGroupName, accountName, managedNetworkName, body); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), ManagedNetworkSettingsPropertiesBasicResourceInner.class, + ManagedNetworkSettingsPropertiesBasicResourceInner.class, this.client.getContext()); + } + + /** + * Patch API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of concrete proxy resource types can be created by aliasing this type + * using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, ManagedNetworkSettingsPropertiesBasicResourceInner> + beginPatchAsync(String resourceGroupName, String accountName, String managedNetworkName) { + final ManagedNetworkSettingsPropertiesBasicResourceInner body = null; + Mono>> mono + = patchWithResponseAsync(resourceGroupName, accountName, managedNetworkName, body); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), ManagedNetworkSettingsPropertiesBasicResourceInner.class, + ManagedNetworkSettingsPropertiesBasicResourceInner.class, this.client.getContext()); + } + + /** + * Patch API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete proxy resource types can be created by aliasing this type + * using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ManagedNetworkSettingsPropertiesBasicResourceInner> + beginPatch(String resourceGroupName, String accountName, String managedNetworkName, + ManagedNetworkSettingsPropertiesBasicResourceInner body) { + Response response = patchWithResponse(resourceGroupName, accountName, managedNetworkName, body); + return this.client + .getLroResult( + response, ManagedNetworkSettingsPropertiesBasicResourceInner.class, + ManagedNetworkSettingsPropertiesBasicResourceInner.class, Context.NONE); + } + + /** + * Patch API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete proxy resource types can be created by aliasing this type + * using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ManagedNetworkSettingsPropertiesBasicResourceInner> + beginPatch(String resourceGroupName, String accountName, String managedNetworkName) { + final ManagedNetworkSettingsPropertiesBasicResourceInner body = null; + Response response = patchWithResponse(resourceGroupName, accountName, managedNetworkName, body); + return this.client + .getLroResult( + response, ManagedNetworkSettingsPropertiesBasicResourceInner.class, + ManagedNetworkSettingsPropertiesBasicResourceInner.class, Context.NONE); + } + + /** + * Patch API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete proxy resource types can be created by aliasing this type + * using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, ManagedNetworkSettingsPropertiesBasicResourceInner> + beginPatch(String resourceGroupName, String accountName, String managedNetworkName, + ManagedNetworkSettingsPropertiesBasicResourceInner body, Context context) { + Response response + = patchWithResponse(resourceGroupName, accountName, managedNetworkName, body, context); + return this.client + .getLroResult( + response, ManagedNetworkSettingsPropertiesBasicResourceInner.class, + ManagedNetworkSettingsPropertiesBasicResourceInner.class, context); + } + + /** + * Patch API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono patchAsync(String resourceGroupName, + String accountName, String managedNetworkName, ManagedNetworkSettingsPropertiesBasicResourceInner body) { + return beginPatchAsync(resourceGroupName, accountName, managedNetworkName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono patchAsync(String resourceGroupName, + String accountName, String managedNetworkName) { + final ManagedNetworkSettingsPropertiesBasicResourceInner body = null; + return beginPatchAsync(resourceGroupName, accountName, managedNetworkName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Patch API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedNetworkSettingsPropertiesBasicResourceInner patch(String resourceGroupName, String accountName, + String managedNetworkName) { + final ManagedNetworkSettingsPropertiesBasicResourceInner body = null; + return beginPatch(resourceGroupName, accountName, managedNetworkName, body).getFinalResult(); + } + + /** + * Patch API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedNetworkSettingsPropertiesBasicResourceInner patch(String resourceGroupName, String accountName, + String managedNetworkName, ManagedNetworkSettingsPropertiesBasicResourceInner body, Context context) { + return beginPatch(resourceGroupName, accountName, managedNetworkName, body, context).getFinalResult(); + } + + /** + * Delete API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, + String managedNetworkName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String accountName, + String managedNetworkName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, Context.NONE); + } + + /** + * Delete API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String accountName, + String managedNetworkName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, context); + } + + /** + * Delete API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String accountName, + String managedNetworkName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, accountName, managedNetworkName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String managedNetworkName) { + Response response = deleteWithResponse(resourceGroupName, accountName, managedNetworkName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String managedNetworkName, Context context) { + Response response = deleteWithResponse(resourceGroupName, accountName, managedNetworkName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String managedNetworkName) { + return beginDeleteAsync(resourceGroupName, accountName, managedNetworkName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String managedNetworkName) { + beginDelete(resourceGroupName, accountName, managedNetworkName).getFinalResult(); + } + + /** + * Delete API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String managedNetworkName, Context context) { + beginDelete(resourceGroupName, accountName, managedNetworkName, context).getFinalResult(); + } + + /** + * List API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed networks of a cognitive services account along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listSinglePageAsync(String resourceGroupName, String accountName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed networks of a cognitive services account as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, + String accountName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed networks of a cognitive services account along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String accountName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed networks of a cognitive services account along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String accountName, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed networks of a cognitive services account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, + String accountName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed networks of a cognitive services account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, + String accountName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * List API for managed network settings of a cognitive services account. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed networks of a cognitive services account along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List API for managed network settings of a cognitive services account. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed networks of a cognitive services account along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List API for managed network settings of a cognitive services account. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed networks of a cognitive services account along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, + Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsOperationsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsOperationsImpl.java new file mode 100644 index 000000000000..fe0e5b047e73 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsOperationsImpl.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cognitiveservices.fluent.ManagedNetworkSettingsOperationsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsPropertiesBasicResourceInner; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsOperations; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsPropertiesBasicResource; + +public final class ManagedNetworkSettingsOperationsImpl implements ManagedNetworkSettingsOperations { + private static final ClientLogger LOGGER = new ClientLogger(ManagedNetworkSettingsOperationsImpl.class); + + private final ManagedNetworkSettingsOperationsClient innerClient; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + public ManagedNetworkSettingsOperationsImpl(ManagedNetworkSettingsOperationsClient innerClient, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, + String accountName, String managedNetworkName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, accountName, managedNetworkName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ManagedNetworkSettingsPropertiesBasicResourceImpl(inner.getValue(), this.manager())); + } + + public ManagedNetworkSettingsPropertiesBasicResource get(String resourceGroupName, String accountName, + String managedNetworkName) { + ManagedNetworkSettingsPropertiesBasicResourceInner inner + = this.serviceClient().get(resourceGroupName, accountName, managedNetworkName); + if (inner != null) { + return new ManagedNetworkSettingsPropertiesBasicResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String managedNetworkName) { + this.serviceClient().delete(resourceGroupName, accountName, managedNetworkName); + } + + public void delete(String resourceGroupName, String accountName, String managedNetworkName, Context context) { + this.serviceClient().delete(resourceGroupName, accountName, managedNetworkName, context); + } + + public PagedIterable list(String resourceGroupName, + String accountName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, accountName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ManagedNetworkSettingsPropertiesBasicResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, + String accountName, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, accountName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ManagedNetworkSettingsPropertiesBasicResourceImpl(inner1, this.manager())); + } + + public ManagedNetworkSettingsPropertiesBasicResource getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String managedNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "managedNetworks"); + if (managedNetworkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedNetworks'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, managedNetworkName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String managedNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "managedNetworks"); + if (managedNetworkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedNetworks'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, managedNetworkName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String managedNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "managedNetworks"); + if (managedNetworkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedNetworks'.", id))); + } + this.delete(resourceGroupName, accountName, managedNetworkName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String managedNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "managedNetworks"); + if (managedNetworkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedNetworks'.", id))); + } + this.delete(resourceGroupName, accountName, managedNetworkName, context); + } + + private ManagedNetworkSettingsOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } + + public ManagedNetworkSettingsPropertiesBasicResourceImpl define(String name) { + return new ManagedNetworkSettingsPropertiesBasicResourceImpl(name, this.manager()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsPropertiesBasicResourceImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsPropertiesBasicResourceImpl.java new file mode 100644 index 000000000000..7996ac363589 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsPropertiesBasicResourceImpl.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsPropertiesBasicResourceInner; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsProperties; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsPropertiesBasicResource; + +public final class ManagedNetworkSettingsPropertiesBasicResourceImpl + implements ManagedNetworkSettingsPropertiesBasicResource, ManagedNetworkSettingsPropertiesBasicResource.Definition, + ManagedNetworkSettingsPropertiesBasicResource.Update { + private ManagedNetworkSettingsPropertiesBasicResourceInner innerObject; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ManagedNetworkSettingsProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ManagedNetworkSettingsPropertiesBasicResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String managedNetworkName; + + public ManagedNetworkSettingsPropertiesBasicResourceImpl withExistingAccount(String resourceGroupName, + String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public ManagedNetworkSettingsPropertiesBasicResource create() { + this.innerObject = serviceManager.serviceClient() + .getManagedNetworkSettingsOperations() + .put(resourceGroupName, accountName, managedNetworkName, this.innerModel(), Context.NONE); + return this; + } + + public ManagedNetworkSettingsPropertiesBasicResource create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getManagedNetworkSettingsOperations() + .put(resourceGroupName, accountName, managedNetworkName, this.innerModel(), context); + return this; + } + + ManagedNetworkSettingsPropertiesBasicResourceImpl(String name, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = new ManagedNetworkSettingsPropertiesBasicResourceInner(); + this.serviceManager = serviceManager; + this.managedNetworkName = name; + } + + public ManagedNetworkSettingsPropertiesBasicResourceImpl update() { + return this; + } + + public ManagedNetworkSettingsPropertiesBasicResource apply() { + this.innerObject = serviceManager.serviceClient() + .getManagedNetworkSettingsOperations() + .patch(resourceGroupName, accountName, managedNetworkName, this.innerModel(), Context.NONE); + return this; + } + + public ManagedNetworkSettingsPropertiesBasicResource apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getManagedNetworkSettingsOperations() + .patch(resourceGroupName, accountName, managedNetworkName, this.innerModel(), context); + return this; + } + + ManagedNetworkSettingsPropertiesBasicResourceImpl(ManagedNetworkSettingsPropertiesBasicResourceInner innerObject, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); + this.managedNetworkName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "managedNetworks"); + } + + public ManagedNetworkSettingsPropertiesBasicResource refresh() { + this.innerObject = serviceManager.serviceClient() + .getManagedNetworkSettingsOperations() + .getWithResponse(resourceGroupName, accountName, managedNetworkName, Context.NONE) + .getValue(); + return this; + } + + public ManagedNetworkSettingsPropertiesBasicResource refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getManagedNetworkSettingsOperations() + .getWithResponse(resourceGroupName, accountName, managedNetworkName, context) + .getValue(); + return this; + } + + public ManagedNetworkSettingsPropertiesBasicResourceImpl + withProperties(ManagedNetworkSettingsProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelCapacitiesClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelCapacitiesClientImpl.java index 49fa7cff3aa4..1cfc0c8a702a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelCapacitiesClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelCapacitiesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -25,10 +25,9 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.cognitiveservices.fluent.ModelCapacitiesClient; import com.azure.resourcemanager.cognitiveservices.fluent.models.ModelCapacityListResultValueItemInner; -import com.azure.resourcemanager.cognitiveservices.models.ModelCapacityListResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.ModelCapacityListResult; import reactor.core.publisher.Mono; /** @@ -60,15 +59,15 @@ public final class ModelCapacitiesClientImpl implements ModelCapacitiesClient { * The interface defining all the services for CognitiveServicesManagementClientModelCapacities to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CognitiveServicesManagementClientModelCapacities") public interface ModelCapacitiesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/modelCapacities") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @QueryParam("modelFormat") String modelFormat, @QueryParam("modelName") String modelName, @QueryParam("modelVersion") String modelVersion, @HeaderParam("Accept") String accept, Context context); @@ -76,8 +75,8 @@ Mono> list(@HostParam("$host") String endpoint @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/modelCapacities") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @QueryParam("modelFormat") String modelFormat, @QueryParam("modelName") String modelName, @QueryParam("modelVersion") String modelVersion, @HeaderParam("Accept") String accept, Context context); @@ -86,14 +85,14 @@ Response listSync(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -111,27 +110,10 @@ Response listNextSync(@PathParam(value = "nextLink", en @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String modelFormat, String modelName, String modelVersion) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (modelFormat == null) { - return Mono.error(new IllegalArgumentException("Parameter modelFormat is required and cannot be null.")); - } - if (modelName == null) { - return Mono.error(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); - } - if (modelVersion == null) { - return Mono.error(new IllegalArgumentException("Parameter modelVersion is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), modelFormat, modelName, modelVersion, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), modelFormat, modelName, modelVersion, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -169,32 +151,9 @@ private PagedFlux listAsync(String modelF @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String modelFormat, String modelName, String modelVersion) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (modelFormat == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter modelFormat is required and cannot be null.")); - } - if (modelName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); - } - if (modelVersion == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter modelVersion is required and cannot be null.")); - } final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), - modelFormat, modelName, modelVersion, accept, Context.NONE); + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), modelFormat, modelName, modelVersion, accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -214,32 +173,9 @@ private PagedResponse listSinglePage(Stri @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String modelFormat, String modelName, String modelVersion, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (modelFormat == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter modelFormat is required and cannot be null.")); - } - if (modelName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter modelName is required and cannot be null.")); - } - if (modelVersion == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter modelVersion is required and cannot be null.")); - } final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), - modelFormat, modelName, modelVersion, accept, context); + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), modelFormat, modelName, modelVersion, accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -295,13 +231,6 @@ public PagedIterable list(String modelFor */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -320,15 +249,6 @@ private Mono> listNextSingl */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -348,21 +268,10 @@ private PagedResponse listNextSinglePage( */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(ModelCapacitiesClientImpl.class); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelCapacitiesImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelCapacitiesImpl.java index 3d84e77f8da5..80e5388399df 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelCapacitiesImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelCapacitiesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelCapacityListResultValueItemImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelCapacityListResultValueItemImpl.java index 48da2bfa48bb..ba5d2a3f5cd6 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelCapacityListResultValueItemImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelCapacityListResultValueItemImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelImpl.java index 99191a38ca18..2d950954b86b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelsClientImpl.java index 0bfd1cba6c31..2066e626f528 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelsClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -25,10 +25,9 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.cognitiveservices.fluent.ModelsClient; import com.azure.resourcemanager.cognitiveservices.fluent.models.ModelInner; -import com.azure.resourcemanager.cognitiveservices.models.ModelListResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.ModelListResult; import reactor.core.publisher.Mono; /** @@ -59,23 +58,23 @@ public final class ModelsClientImpl implements ModelsClient { * The interface defining all the services for CognitiveServicesManagementClientModels to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CognitiveServicesManagementClientModels") public interface ModelsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/models") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/models") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -83,20 +82,20 @@ Response listSync(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * List Models. * - * @param location Resource location. + * @param location The location name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -105,21 +104,10 @@ Response listNextSync(@PathParam(value = "nextLink", encoded = */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String location) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), location, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -128,7 +116,7 @@ private Mono> listSinglePageAsync(String location) { /** * List Models. * - * @param location Resource location. + * @param location The location name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -142,7 +130,7 @@ private PagedFlux listAsync(String location) { /** * List Models. * - * @param location Resource location. + * @param location The location name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -150,23 +138,9 @@ private PagedFlux listAsync(String location) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String location) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), location, accept, Context.NONE); + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -174,7 +148,7 @@ private PagedResponse listSinglePage(String location) { /** * List Models. * - * @param location Resource location. + * @param location The location name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -183,23 +157,9 @@ private PagedResponse listSinglePage(String location) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String location, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), location, accept, context); + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -207,7 +167,7 @@ private PagedResponse listSinglePage(String location, Context contex /** * List Models. * - * @param location Resource location. + * @param location The location name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -221,7 +181,7 @@ public PagedIterable list(String location) { /** * List Models. * - * @param location Resource location. + * @param location The location name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -246,13 +206,6 @@ public PagedIterable list(String location, Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), @@ -271,15 +224,6 @@ private Mono> listNextSinglePageAsync(String nextLink) */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), @@ -298,20 +242,9 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(ModelsClientImpl.class); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelsImpl.java index 1c4f04f2c6a2..1a7268ae782a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelsImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/NetworkSecurityPerimeterConfigurationImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/NetworkSecurityPerimeterConfigurationImpl.java index 3e0b5e1e7914..98847a63c14c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/NetworkSecurityPerimeterConfigurationImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/NetworkSecurityPerimeterConfigurationImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/NetworkSecurityPerimeterConfigurationsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/NetworkSecurityPerimeterConfigurationsClientImpl.java index 499fc0da9fbb..d7285b767149 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/NetworkSecurityPerimeterConfigurationsClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/NetworkSecurityPerimeterConfigurationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -28,12 +28,11 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.cognitiveservices.fluent.NetworkSecurityPerimeterConfigurationsClient; import com.azure.resourcemanager.cognitiveservices.fluent.models.NetworkSecurityPerimeterConfigurationInner; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterConfigurationList; +import com.azure.resourcemanager.cognitiveservices.implementation.models.NetworkSecurityPerimeterConfigurationList; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -70,54 +69,54 @@ public final class NetworkSecurityPerimeterConfigurationsClientImpl * CognitiveServicesManagementClientNetworkSecurityPerimeterConfigurations to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CognitiveServicesManagementClientNetworkSecurityPerimeterConfigurations") public interface NetworkSecurityPerimeterConfigurationsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/networkSecurityPerimeterConfigurations") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/networkSecurityPerimeterConfigurations/{nspConfigurationName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/networkSecurityPerimeterConfigurations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("nspConfigurationName") String nspConfigurationName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/networkSecurityPerimeterConfigurations/{nspConfigurationName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("nspConfigurationName") String nspConfigurationName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/networkSecurityPerimeterConfigurations/{nspConfigurationName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/networkSecurityPerimeterConfigurations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/networkSecurityPerimeterConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("nspConfigurationName") String nspConfigurationName, @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/networkSecurityPerimeterConfigurations/{nspConfigurationName}/reconcile") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> reconcile(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono>> reconcile(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("nspConfigurationName") String nspConfigurationName, @HeaderParam("Accept") String accept, Context context); @@ -125,9 +124,9 @@ Mono>> reconcile(@HostParam("$host") String endpoint, @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/networkSecurityPerimeterConfigurations/{nspConfigurationName}/reconcile") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response reconcileSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response reconcileSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("nspConfigurationName") String nspConfigurationName, @HeaderParam("Accept") String accept, Context context); @@ -136,7 +135,7 @@ Response reconcileSync(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -144,143 +143,85 @@ Mono> listNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Gets a list of NSP configurations for an account. + * Gets the specified NSP configurations for an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. + * @param nspConfigurationName The name of the NSP Configuration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of NSP configurations for an account along with {@link PagedResponse} on successful completion of + * @return the specified NSP configurations for an account along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listSinglePageAsync(String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, + String accountName, String nspConfigurationName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .>map( - res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, nspConfigurationName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets a list of NSP configurations for an account. + * Gets the specified NSP configurations for an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. + * @param nspConfigurationName The name of the NSP Configuration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of NSP configurations for an account as paginated response with {@link PagedFlux}. + * @return the specified NSP configurations for an account on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, - String accountName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, + String nspConfigurationName) { + return getWithResponseAsync(resourceGroupName, accountName, nspConfigurationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets a list of NSP configurations for an account. + * Gets the specified NSP configurations for an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. + * @param nspConfigurationName The name of the NSP Configuration. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of NSP configurations for an account along with {@link PagedResponse}. + * @return the specified NSP configurations for an account along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, - String accountName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + public Response getWithResponse(String resourceGroupName, + String accountName, String nspConfigurationName, Context context) { final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, nspConfigurationName, accept, context); } /** - * Gets a list of NSP configurations for an account. + * Gets the specified NSP configurations for an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. + * @param nspConfigurationName The name of the NSP Configuration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of NSP configurations for an account along with {@link PagedResponse}. + * @return the specified NSP configurations for an account. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, - String accountName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); + public NetworkSecurityPerimeterConfigurationInner get(String resourceGroupName, String accountName, + String nspConfigurationName) { + return getWithResponse(resourceGroupName, accountName, nspConfigurationName, Context.NONE).getValue(); } /** @@ -291,13 +232,20 @@ private PagedResponse listSinglePage * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of NSP configurations for an account as paginated response with {@link PagedIterable}. + * @return a list of NSP configurations for an account along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, - String accountName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), - nextLink -> listNextSinglePage(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listSinglePageAsync(String resourceGroupName, String accountName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -305,135 +253,94 @@ public PagedIterable list(String res * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of NSP configurations for an account as paginated response with {@link PagedIterable}. + * @return a list of NSP configurations for an account as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, - Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, context), - nextLink -> listNextSinglePage(nextLink, context)); + private PagedFlux listAsync(String resourceGroupName, + String accountName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Gets the specified NSP configurations for an account. + * Gets a list of NSP configurations for an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP Configuration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified NSP configurations for an account along with {@link Response} on successful completion of - * {@link Mono}. + * @return a list of NSP configurations for an account along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String accountName, String nspConfigurationName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (nspConfigurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter nspConfigurationName is required and cannot be null.")); - } + private PagedResponse listSinglePage(String resourceGroupName, + String accountName) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), nspConfigurationName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Gets the specified NSP configurations for an account. + * Gets a list of NSP configurations for an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP Configuration. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified NSP configurations for an account on successful completion of {@link Mono}. + * @return a list of NSP configurations for an account along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String accountName, - String nspConfigurationName) { - return getWithResponseAsync(resourceGroupName, accountName, nspConfigurationName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listSinglePage(String resourceGroupName, + String accountName, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Gets the specified NSP configurations for an account. + * Gets a list of NSP configurations for an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP Configuration. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified NSP configurations for an account along with {@link Response}. + * @return a list of NSP configurations for an account as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, - String accountName, String nspConfigurationName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (nspConfigurationName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nspConfigurationName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), - this.client.getSubscriptionId(), nspConfigurationName, accept, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, + String accountName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), + nextLink -> listNextSinglePage(nextLink)); } /** - * Gets the specified NSP configurations for an account. + * Gets a list of NSP configurations for an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP Configuration. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified NSP configurations for an account. + * @return a list of NSP configurations for an account as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public NetworkSecurityPerimeterConfigurationInner get(String resourceGroupName, String accountName, - String nspConfigurationName) { - return getWithResponse(resourceGroupName, accountName, nspConfigurationName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -445,35 +352,15 @@ public NetworkSecurityPerimeterConfigurationInner get(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSP Configuration for an Cognitive Services account along with {@link Response} on successful completion - * of {@link Mono}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> reconcileWithResponseAsync(String resourceGroupName, String accountName, String nspConfigurationName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (nspConfigurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter nspConfigurationName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.reconcile(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), nspConfigurationName, accept, context)) + .withContext(context -> service.reconcile(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, nspConfigurationName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -486,36 +373,15 @@ private Mono>> reconcileWithResponseAsync(String resou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSP Configuration for an Cognitive Services account along with {@link Response}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Response reconcileWithResponse(String resourceGroupName, String accountName, String nspConfigurationName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (nspConfigurationName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nspConfigurationName is required and cannot be null.")); - } final String accept = "application/json"; - return service.reconcileSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), nspConfigurationName, accept, Context.NONE); + return service.reconcileSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, nspConfigurationName, accept, + Context.NONE); } /** @@ -528,36 +394,14 @@ private Response reconcileWithResponse(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSP Configuration for an Cognitive Services account along with {@link Response}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Response reconcileWithResponse(String resourceGroupName, String accountName, String nspConfigurationName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (nspConfigurationName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nspConfigurationName is required and cannot be null.")); - } final String accept = "application/json"; - return service.reconcileSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), nspConfigurationName, accept, context); + return service.reconcileSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, nspConfigurationName, accept, context); } /** @@ -569,7 +413,7 @@ private Response reconcileWithResponse(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of nSP Configuration for an Cognitive Services account. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private @@ -592,7 +436,7 @@ private Response reconcileWithResponse(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of nSP Configuration for an Cognitive Services account. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public @@ -615,7 +459,7 @@ private Response reconcileWithResponse(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of nSP Configuration for an Cognitive Services account. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public @@ -638,7 +482,7 @@ private Response reconcileWithResponse(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSP Configuration for an Cognitive Services account on successful completion of {@link Mono}. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono reconcileAsync(String resourceGroupName, @@ -656,7 +500,7 @@ private Mono reconcileAsync(String r * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSP Configuration for an Cognitive Services account. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) public NetworkSecurityPerimeterConfigurationInner reconcile(String resourceGroupName, String accountName, @@ -674,7 +518,7 @@ public NetworkSecurityPerimeterConfigurationInner reconcile(String resourceGroup * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSP Configuration for an Cognitive Services account. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) public NetworkSecurityPerimeterConfigurationInner reconcile(String resourceGroupName, String accountName, @@ -694,13 +538,6 @@ public NetworkSecurityPerimeterConfigurationInner reconcile(String resourceGroup */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( @@ -720,15 +557,6 @@ private Mono> listNext */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -749,21 +577,10 @@ private PagedResponse listNextSingle @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(NetworkSecurityPerimeterConfigurationsClientImpl.class); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/NetworkSecurityPerimeterConfigurationsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/NetworkSecurityPerimeterConfigurationsImpl.java index da69ed25eb7f..5f0783275caa 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/NetworkSecurityPerimeterConfigurationsImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/NetworkSecurityPerimeterConfigurationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -27,31 +27,12 @@ public NetworkSecurityPerimeterConfigurationsImpl(NetworkSecurityPerimeterConfig this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String accountName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, accountName); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new NetworkSecurityPerimeterConfigurationImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String accountName, - Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, accountName, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new NetworkSecurityPerimeterConfigurationImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String accountName, String nspConfigurationName, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, accountName, nspConfigurationName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new NetworkSecurityPerimeterConfigurationImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new NetworkSecurityPerimeterConfigurationImpl(inner.getValue(), this.manager())); } public NetworkSecurityPerimeterConfiguration get(String resourceGroupName, String accountName, @@ -65,6 +46,21 @@ public NetworkSecurityPerimeterConfiguration get(String resourceGroupName, Strin } } + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, accountName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new NetworkSecurityPerimeterConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, accountName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new NetworkSecurityPerimeterConfigurationImpl(inner1, this.manager())); + } + public NetworkSecurityPerimeterConfiguration reconcile(String resourceGroupName, String accountName, String nspConfigurationName) { NetworkSecurityPerimeterConfigurationInner inner diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OperationImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OperationImpl.java index 8b18aca53f75..7abc5b4e76a4 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OperationImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OperationImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OperationsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OperationsClientImpl.java index 57e0dc419446..28ed42b4e2fa 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OperationsClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OperationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -25,10 +25,9 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.cognitiveservices.fluent.OperationsClient; import com.azure.resourcemanager.cognitiveservices.fluent.models.OperationInner; -import com.azure.resourcemanager.cognitiveservices.models.OperationListResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.OperationListResult; import reactor.core.publisher.Mono; /** @@ -60,21 +59,21 @@ public final class OperationsClientImpl implements OperationsClient { * The interface defining all the services for CognitiveServicesManagementClientOperations to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CognitiveServicesManagementClientOperations") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.CognitiveServices/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.CognitiveServices/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -82,14 +81,14 @@ Response listSync(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -102,10 +101,6 @@ Response listNextSync(@PathParam(value = "nextLink", encode */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -137,11 +132,6 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage() { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); @@ -160,11 +150,6 @@ private PagedResponse listSinglePage() { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); @@ -212,13 +197,6 @@ public PagedIterable list(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), @@ -237,15 +215,6 @@ private Mono> listNextSinglePageAsync(String nextL */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -265,20 +234,9 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(OperationsClientImpl.class); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OperationsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OperationsImpl.java index 9a79657d672e..3c77b71ea853 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OperationsImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OperationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRuleBasicResourceImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRuleBasicResourceImpl.java new file mode 100644 index 000000000000..ffd97a5cf909 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRuleBasicResourceImpl.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.OutboundRuleBasicResourceInner; +import com.azure.resourcemanager.cognitiveservices.models.OutboundRule; +import com.azure.resourcemanager.cognitiveservices.models.OutboundRuleBasicResource; + +public final class OutboundRuleBasicResourceImpl + implements OutboundRuleBasicResource, OutboundRuleBasicResource.Definition, OutboundRuleBasicResource.Update { + private OutboundRuleBasicResourceInner innerObject; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public OutboundRule properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public OutboundRuleBasicResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String managedNetworkName; + + private String ruleName; + + public OutboundRuleBasicResourceImpl withExistingManagedNetwork(String resourceGroupName, String accountName, + String managedNetworkName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.managedNetworkName = managedNetworkName; + return this; + } + + public OutboundRuleBasicResource create() { + this.innerObject = serviceManager.serviceClient() + .getOutboundRules() + .createOrUpdate(resourceGroupName, accountName, managedNetworkName, ruleName, this.innerModel(), + Context.NONE); + return this; + } + + public OutboundRuleBasicResource create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getOutboundRules() + .createOrUpdate(resourceGroupName, accountName, managedNetworkName, ruleName, this.innerModel(), context); + return this; + } + + OutboundRuleBasicResourceImpl(String name, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = new OutboundRuleBasicResourceInner(); + this.serviceManager = serviceManager; + this.ruleName = name; + } + + public OutboundRuleBasicResourceImpl update() { + return this; + } + + public OutboundRuleBasicResource apply() { + this.innerObject = serviceManager.serviceClient() + .getOutboundRules() + .createOrUpdate(resourceGroupName, accountName, managedNetworkName, ruleName, this.innerModel(), + Context.NONE); + return this; + } + + public OutboundRuleBasicResource apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getOutboundRules() + .createOrUpdate(resourceGroupName, accountName, managedNetworkName, ruleName, this.innerModel(), context); + return this; + } + + OutboundRuleBasicResourceImpl(OutboundRuleBasicResourceInner innerObject, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); + this.managedNetworkName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "managedNetworks"); + this.ruleName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "outboundRules"); + } + + public OutboundRuleBasicResource refresh() { + this.innerObject = serviceManager.serviceClient() + .getOutboundRules() + .getWithResponse(resourceGroupName, accountName, managedNetworkName, ruleName, Context.NONE) + .getValue(); + return this; + } + + public OutboundRuleBasicResource refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getOutboundRules() + .getWithResponse(resourceGroupName, accountName, managedNetworkName, ruleName, context) + .getValue(); + return this; + } + + public OutboundRuleBasicResourceImpl withProperties(OutboundRule properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRuleListResultImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRuleListResultImpl.java new file mode 100644 index 000000000000..03a2e526f95e --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRuleListResultImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.resourcemanager.cognitiveservices.fluent.models.OutboundRuleBasicResourceInner; +import com.azure.resourcemanager.cognitiveservices.fluent.models.OutboundRuleListResultInner; +import com.azure.resourcemanager.cognitiveservices.models.OutboundRuleBasicResource; +import com.azure.resourcemanager.cognitiveservices.models.OutboundRuleListResult; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class OutboundRuleListResultImpl implements OutboundRuleListResult { + private OutboundRuleListResultInner innerObject; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + OutboundRuleListResultImpl(OutboundRuleListResultInner innerObject, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new OutboundRuleBasicResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public OutboundRuleListResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesClientImpl.java new file mode 100644 index 000000000000..afd38b3e23d8 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesClientImpl.java @@ -0,0 +1,892 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cognitiveservices.fluent.OutboundRulesClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.OutboundRuleBasicResourceInner; +import com.azure.resourcemanager.cognitiveservices.fluent.models.OutboundRuleListResultInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OutboundRulesClient. + */ +public final class OutboundRulesClientImpl implements OutboundRulesClient { + /** + * The proxy service used to perform REST calls. + */ + private final OutboundRulesService service; + + /** + * The service client containing this operation class. + */ + private final CognitiveServicesManagementClientImpl client; + + /** + * Initializes an instance of OutboundRulesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OutboundRulesClientImpl(CognitiveServicesManagementClientImpl client) { + this.service + = RestProxy.create(OutboundRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CognitiveServicesManagementClientOutboundRules to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CognitiveServicesManagementClientOutboundRules") + public interface OutboundRulesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/outboundRules/{ruleName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("managedNetworkName") String managedNetworkName, @PathParam("ruleName") String ruleName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/outboundRules/{ruleName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("managedNetworkName") String managedNetworkName, @PathParam("ruleName") String ruleName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/outboundRules/{ruleName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("managedNetworkName") String managedNetworkName, @PathParam("ruleName") String ruleName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") OutboundRuleBasicResourceInner body, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/outboundRules/{ruleName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("managedNetworkName") String managedNetworkName, @PathParam("ruleName") String ruleName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") OutboundRuleBasicResourceInner body, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/outboundRules/{ruleName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("managedNetworkName") String managedNetworkName, @PathParam("ruleName") String ruleName, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/outboundRules/{ruleName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("managedNetworkName") String managedNetworkName, @PathParam("ruleName") String ruleName, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/outboundRules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("managedNetworkName") String managedNetworkName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/outboundRules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("managedNetworkName") String managedNetworkName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * The GET API for retrieving a single outbound rule of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String accountName, String managedNetworkName, String ruleName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, ruleName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The GET API for retrieving a single outbound rule of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, + String managedNetworkName, String ruleName) { + return getWithResponseAsync(resourceGroupName, accountName, managedNetworkName, ruleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * The GET API for retrieving a single outbound rule of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, + String managedNetworkName, String ruleName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, managedNetworkName, ruleName, accept, context); + } + + /** + * The GET API for retrieving a single outbound rule of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OutboundRuleBasicResourceInner get(String resourceGroupName, String accountName, String managedNetworkName, + String ruleName) { + return getWithResponse(resourceGroupName, accountName, managedNetworkName, ruleName, Context.NONE).getValue(); + } + + /** + * The PUT API for creating or updating a single outbound rule of the managed network associated with the cognitive + * services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String accountName, String managedNetworkName, String ruleName, OutboundRuleBasicResourceInner body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, ruleName, + contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The PUT API for creating or updating a single outbound rule of the managed network associated with the cognitive + * services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, + String managedNetworkName, String ruleName, OutboundRuleBasicResourceInner body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, ruleName, contentType, + accept, body, Context.NONE); + } + + /** + * The PUT API for creating or updating a single outbound rule of the managed network associated with the cognitive + * services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @param body The body parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, + String managedNetworkName, String ruleName, OutboundRuleBasicResourceInner body, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, ruleName, contentType, + accept, body, context); + } + + /** + * The PUT API for creating or updating a single outbound rule of the managed network associated with the cognitive + * services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of concrete proxy resource types can be created by aliasing this type + * using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OutboundRuleBasicResourceInner> + beginCreateOrUpdateAsync(String resourceGroupName, String accountName, String managedNetworkName, + String ruleName, OutboundRuleBasicResourceInner body) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, accountName, managedNetworkName, ruleName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OutboundRuleBasicResourceInner.class, OutboundRuleBasicResourceInner.class, + this.client.getContext()); + } + + /** + * The PUT API for creating or updating a single outbound rule of the managed network associated with the cognitive + * services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete proxy resource types can be created by aliasing this type + * using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OutboundRuleBasicResourceInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, String managedNetworkName, String ruleName, + OutboundRuleBasicResourceInner body) { + Response response + = createOrUpdateWithResponse(resourceGroupName, accountName, managedNetworkName, ruleName, body); + return this.client.getLroResult(response, + OutboundRuleBasicResourceInner.class, OutboundRuleBasicResourceInner.class, Context.NONE); + } + + /** + * The PUT API for creating or updating a single outbound rule of the managed network associated with the cognitive + * services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @param body The body parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete proxy resource types can be created by aliasing this type + * using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OutboundRuleBasicResourceInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, String managedNetworkName, String ruleName, + OutboundRuleBasicResourceInner body, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, accountName, managedNetworkName, ruleName, body, context); + return this.client.getLroResult(response, + OutboundRuleBasicResourceInner.class, OutboundRuleBasicResourceInner.class, context); + } + + /** + * The PUT API for creating or updating a single outbound rule of the managed network associated with the cognitive + * services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String accountName, + String managedNetworkName, String ruleName, OutboundRuleBasicResourceInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, accountName, managedNetworkName, ruleName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The PUT API for creating or updating a single outbound rule of the managed network associated with the cognitive + * services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @param body The body parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OutboundRuleBasicResourceInner createOrUpdate(String resourceGroupName, String accountName, + String managedNetworkName, String ruleName, OutboundRuleBasicResourceInner body) { + return beginCreateOrUpdate(resourceGroupName, accountName, managedNetworkName, ruleName, body).getFinalResult(); + } + + /** + * The PUT API for creating or updating a single outbound rule of the managed network associated with the cognitive + * services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @param body The body parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OutboundRuleBasicResourceInner createOrUpdate(String resourceGroupName, String accountName, + String managedNetworkName, String ruleName, OutboundRuleBasicResourceInner body, Context context) { + return beginCreateOrUpdate(resourceGroupName, accountName, managedNetworkName, ruleName, body, context) + .getFinalResult(); + } + + /** + * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, + String managedNetworkName, String ruleName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, ruleName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String accountName, + String managedNetworkName, String ruleName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, ruleName, + Context.NONE); + } + + /** + * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String accountName, + String managedNetworkName, String ruleName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, ruleName, context); + } + + /** + * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String accountName, + String managedNetworkName, String ruleName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, accountName, managedNetworkName, ruleName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String managedNetworkName, String ruleName) { + Response response + = deleteWithResponse(resourceGroupName, accountName, managedNetworkName, ruleName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String managedNetworkName, String ruleName, Context context) { + Response response + = deleteWithResponse(resourceGroupName, accountName, managedNetworkName, ruleName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String managedNetworkName, + String ruleName) { + return beginDeleteAsync(resourceGroupName, accountName, managedNetworkName, ruleName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String managedNetworkName, String ruleName) { + beginDelete(resourceGroupName, accountName, managedNetworkName, ruleName).getFinalResult(); + } + + /** + * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String managedNetworkName, String ruleName, + Context context) { + beginDelete(resourceGroupName, accountName, managedNetworkName, ruleName, context).getFinalResult(); + } + + /** + * The GET API for retrieving the list of outbound rules of the managed network associated with the cognitive + * services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a cognitive services account along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String accountName, String managedNetworkName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The GET API for retrieving the list of outbound rules of the managed network associated with the cognitive + * services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a cognitive services account as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, + String managedNetworkName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, managedNetworkName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * The GET API for retrieving the list of outbound rules of the managed network associated with the cognitive + * services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a cognitive services account along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String accountName, + String managedNetworkName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, managedNetworkName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * The GET API for retrieving the list of outbound rules of the managed network associated with the cognitive + * services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a cognitive services account along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String accountName, + String managedNetworkName, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, managedNetworkName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * The GET API for retrieving the list of outbound rules of the managed network associated with the cognitive + * services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a cognitive services account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, + String managedNetworkName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, managedNetworkName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * The GET API for retrieving the list of outbound rules of the managed network associated with the cognitive + * services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a cognitive services account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, + String managedNetworkName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, managedNetworkName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * The GET API for retrieving the list of outbound rules of the managed network associated with the cognitive + * services account. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a cognitive services account along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The GET API for retrieving the list of outbound rules of the managed network associated with the cognitive + * services account. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a cognitive services account along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * The GET API for retrieving the list of outbound rules of the managed network associated with the cognitive + * services account. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a cognitive services account along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesImpl.java new file mode 100644 index 000000000000..93aa90cf6aa8 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesImpl.java @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cognitiveservices.fluent.OutboundRulesClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.OutboundRuleBasicResourceInner; +import com.azure.resourcemanager.cognitiveservices.models.OutboundRuleBasicResource; +import com.azure.resourcemanager.cognitiveservices.models.OutboundRules; + +public final class OutboundRulesImpl implements OutboundRules { + private static final ClientLogger LOGGER = new ClientLogger(OutboundRulesImpl.class); + + private final OutboundRulesClient innerClient; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + public OutboundRulesImpl(OutboundRulesClient innerClient, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String accountName, + String managedNetworkName, String ruleName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, accountName, managedNetworkName, ruleName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OutboundRuleBasicResourceImpl(inner.getValue(), this.manager())); + } + + public OutboundRuleBasicResource get(String resourceGroupName, String accountName, String managedNetworkName, + String ruleName) { + OutboundRuleBasicResourceInner inner + = this.serviceClient().get(resourceGroupName, accountName, managedNetworkName, ruleName); + if (inner != null) { + return new OutboundRuleBasicResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String managedNetworkName, String ruleName) { + this.serviceClient().delete(resourceGroupName, accountName, managedNetworkName, ruleName); + } + + public void delete(String resourceGroupName, String accountName, String managedNetworkName, String ruleName, + Context context) { + this.serviceClient().delete(resourceGroupName, accountName, managedNetworkName, ruleName, context); + } + + public PagedIterable list(String resourceGroupName, String accountName, + String managedNetworkName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, accountName, managedNetworkName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OutboundRuleBasicResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, + String managedNetworkName, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, accountName, managedNetworkName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OutboundRuleBasicResourceImpl(inner1, this.manager())); + } + + public OutboundRuleBasicResource getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String managedNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "managedNetworks"); + if (managedNetworkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedNetworks'.", id))); + } + String ruleName = ResourceManagerUtils.getValueFromIdByName(id, "outboundRules"); + if (ruleName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'outboundRules'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, managedNetworkName, ruleName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String managedNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "managedNetworks"); + if (managedNetworkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedNetworks'.", id))); + } + String ruleName = ResourceManagerUtils.getValueFromIdByName(id, "outboundRules"); + if (ruleName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'outboundRules'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, managedNetworkName, ruleName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String managedNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "managedNetworks"); + if (managedNetworkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedNetworks'.", id))); + } + String ruleName = ResourceManagerUtils.getValueFromIdByName(id, "outboundRules"); + if (ruleName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'outboundRules'.", id))); + } + this.delete(resourceGroupName, accountName, managedNetworkName, ruleName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String managedNetworkName = ResourceManagerUtils.getValueFromIdByName(id, "managedNetworks"); + if (managedNetworkName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'managedNetworks'.", id))); + } + String ruleName = ResourceManagerUtils.getValueFromIdByName(id, "outboundRules"); + if (ruleName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'outboundRules'.", id))); + } + this.delete(resourceGroupName, accountName, managedNetworkName, ruleName, context); + } + + private OutboundRulesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } + + public OutboundRuleBasicResourceImpl define(String name) { + return new OutboundRuleBasicResourceImpl(name, this.manager()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesOperationsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesOperationsClientImpl.java new file mode 100644 index 000000000000..fe5ca66ee637 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesOperationsClientImpl.java @@ -0,0 +1,295 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cognitiveservices.fluent.OutboundRulesOperationsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsBasicResourceInner; +import com.azure.resourcemanager.cognitiveservices.fluent.models.OutboundRuleListResultInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OutboundRulesOperationsClient. + */ +public final class OutboundRulesOperationsClientImpl implements OutboundRulesOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final OutboundRulesOperationsService service; + + /** + * The service client containing this operation class. + */ + private final CognitiveServicesManagementClientImpl client; + + /** + * Initializes an instance of OutboundRulesOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OutboundRulesOperationsClientImpl(CognitiveServicesManagementClientImpl client) { + this.service = RestProxy.create(OutboundRulesOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CognitiveServicesManagementClientOutboundRulesOperations to be used + * by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CognitiveServicesManagementClientOutboundRulesOperations") + public interface OutboundRulesOperationsService { + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/batchOutboundRules") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> post(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("managedNetworkName") String managedNetworkName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ManagedNetworkSettingsBasicResourceInner body, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/managedNetworks/{managedNetworkName}/batchOutboundRules") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response postSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("managedNetworkName") String managedNetworkName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ManagedNetworkSettingsBasicResourceInner body, Context context); + } + + /** + * The POST API for updating the outbound rules of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> postWithResponseAsync(String resourceGroupName, String accountName, + String managedNetworkName, ManagedNetworkSettingsBasicResourceInner body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.post(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, managedNetworkName, contentType, + accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * The POST API for updating the outbound rules of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response postWithResponse(String resourceGroupName, String accountName, + String managedNetworkName, ManagedNetworkSettingsBasicResourceInner body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.postSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, managedNetworkName, contentType, accept, body, Context.NONE); + } + + /** + * The POST API for updating the outbound rules of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response postWithResponse(String resourceGroupName, String accountName, + String managedNetworkName, ManagedNetworkSettingsBasicResourceInner body, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.postSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, managedNetworkName, contentType, accept, body, context); + } + + /** + * The POST API for updating the outbound rules of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OutboundRuleListResultInner> beginPostAsync( + String resourceGroupName, String accountName, String managedNetworkName, + ManagedNetworkSettingsBasicResourceInner body) { + Mono>> mono + = postWithResponseAsync(resourceGroupName, accountName, managedNetworkName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OutboundRuleListResultInner.class, OutboundRuleListResultInner.class, + this.client.getContext()); + } + + /** + * The POST API for updating the outbound rules of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OutboundRuleListResultInner> beginPost( + String resourceGroupName, String accountName, String managedNetworkName, + ManagedNetworkSettingsBasicResourceInner body) { + Response response = postWithResponse(resourceGroupName, accountName, managedNetworkName, body); + return this.client.getLroResult(response, + OutboundRuleListResultInner.class, OutboundRuleListResultInner.class, Context.NONE); + } + + /** + * The POST API for updating the outbound rules of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OutboundRuleListResultInner> beginPost( + String resourceGroupName, String accountName, String managedNetworkName, + ManagedNetworkSettingsBasicResourceInner body, Context context) { + Response response + = postWithResponse(resourceGroupName, accountName, managedNetworkName, body, context); + return this.client.getLroResult(response, + OutboundRuleListResultInner.class, OutboundRuleListResultInner.class, context); + } + + /** + * The POST API for updating the outbound rules of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono postAsync(String resourceGroupName, String accountName, + String managedNetworkName, ManagedNetworkSettingsBasicResourceInner body) { + return beginPostAsync(resourceGroupName, accountName, managedNetworkName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * The POST API for updating the outbound rules of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OutboundRuleListResultInner post(String resourceGroupName, String accountName, String managedNetworkName, + ManagedNetworkSettingsBasicResourceInner body) { + return beginPost(resourceGroupName, accountName, managedNetworkName, body).getFinalResult(); + } + + /** + * The POST API for updating the outbound rules of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OutboundRuleListResultInner post(String resourceGroupName, String accountName, String managedNetworkName, + ManagedNetworkSettingsBasicResourceInner body, Context context) { + return beginPost(resourceGroupName, accountName, managedNetworkName, body, context).getFinalResult(); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesOperationsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesOperationsImpl.java new file mode 100644 index 000000000000..9a5540f42864 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesOperationsImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cognitiveservices.fluent.OutboundRulesOperationsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsBasicResourceInner; +import com.azure.resourcemanager.cognitiveservices.fluent.models.OutboundRuleListResultInner; +import com.azure.resourcemanager.cognitiveservices.models.OutboundRuleListResult; +import com.azure.resourcemanager.cognitiveservices.models.OutboundRulesOperations; + +public final class OutboundRulesOperationsImpl implements OutboundRulesOperations { + private static final ClientLogger LOGGER = new ClientLogger(OutboundRulesOperationsImpl.class); + + private final OutboundRulesOperationsClient innerClient; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + public OutboundRulesOperationsImpl(OutboundRulesOperationsClient innerClient, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public OutboundRuleListResult post(String resourceGroupName, String accountName, String managedNetworkName, + ManagedNetworkSettingsBasicResourceInner body) { + OutboundRuleListResultInner inner + = this.serviceClient().post(resourceGroupName, accountName, managedNetworkName, body); + if (inner != null) { + return new OutboundRuleListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OutboundRuleListResult post(String resourceGroupName, String accountName, String managedNetworkName, + ManagedNetworkSettingsBasicResourceInner body, Context context) { + OutboundRuleListResultInner inner + = this.serviceClient().post(resourceGroupName, accountName, managedNetworkName, body, context); + if (inner != null) { + return new OutboundRuleListResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private OutboundRulesOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionImpl.java index 50b9bab9251c..43259508565d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -29,22 +29,22 @@ public String type() { return this.innerModel().type(); } - public String etag() { - return this.innerModel().etag(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - public PrivateEndpointConnectionProperties properties() { return this.innerModel().properties(); } + public String etag() { + return this.innerModel().etag(); + } + public String location() { return this.innerModel().location(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public Region region() { return Region.fromName(this.regionName()); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionListResultImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionListResultImpl.java index 03a48187e0e4..4da6492dd1db 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionListResultImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionListResultImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionsClientImpl.java index a9f2e644ba54..07ad54f76ce1 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -26,7 +26,6 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.cognitiveservices.fluent.PrivateEndpointConnectionsClient; @@ -65,34 +64,16 @@ public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpoi * The interface defining all the services for CognitiveServicesManagementClientPrivateEndpointConnections to be * used by the proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CognitiveServicesManagementClientPrivateEndpointConnections") public interface PrivateEndpointConnectionsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, @HeaderParam("Accept") String accept, Context context); @@ -100,158 +81,67 @@ Mono> get(@HostParam("$host") String en @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @BodyParam("application/json") PrivateEndpointConnectionInner properties, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PrivateEndpointConnectionInner properties, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @BodyParam("application/json") PrivateEndpointConnectionInner properties, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PrivateEndpointConnectionInner properties, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the private endpoint connections associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connections associated with the Cognitive Services account along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String resourceGroupName, - String accountName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the private endpoint connections associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connections associated with the Cognitive Services account on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync(String resourceGroupName, String accountName) { - return listWithResponseAsync(resourceGroupName, accountName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the private endpoint connections associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connections associated with the Cognitive Services account along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(String resourceGroupName, - String accountName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return service.listSync(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context); - } - /** - * Gets the private endpoint connections associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connections associated with the Cognitive Services account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionListResultInner list(String resourceGroupName, String accountName) { - return listWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); } /** @@ -270,29 +160,10 @@ public PrivateEndpointConnectionListResultInner list(String resourceGroupName, S @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), privateEndpointConnectionName, accept, + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, privateEndpointConnectionName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -334,32 +205,9 @@ private Mono getAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), - this.client.getSubscriptionId(), privateEndpointConnectionName, accept, context); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, privateEndpointConnectionName, accept, context); } /** @@ -397,35 +245,12 @@ public PrivateEndpointConnectionInner get(String resourceGroupName, String accou @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (properties == null) { - return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), privateEndpointConnectionName, properties, - accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, privateEndpointConnectionName, + contentType, accept, properties, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -445,39 +270,11 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, String privateEndpointConnectionName, PrivateEndpointConnectionInner properties) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (properties == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), privateEndpointConnectionName, properties, - accept, Context.NONE); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, privateEndpointConnectionName, contentType, + accept, properties, Context.NONE); } /** @@ -497,39 +294,11 @@ private Response createOrUpdateWithResponse(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, String privateEndpointConnectionName, PrivateEndpointConnectionInner properties, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - if (properties == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter properties is required and cannot be null.")); - } else { - properties.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), privateEndpointConnectionName, properties, - accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, privateEndpointConnectionName, contentType, + accept, properties, context); } /** @@ -680,30 +449,8 @@ public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, S @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono.error(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), privateEndpointConnectionName, accept, - context)) + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, privateEndpointConnectionName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -722,32 +469,8 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String accountName, String privateEndpointConnectionName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), privateEndpointConnectionName, accept, + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, privateEndpointConnectionName, Context.NONE); } @@ -767,33 +490,8 @@ private Response deleteWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter privateEndpointConnectionName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), privateEndpointConnectionName, accept, - context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, privateEndpointConnectionName, context); } /** @@ -910,5 +608,75 @@ public void delete(String resourceGroupName, String accountName, String privateE beginDelete(resourceGroupName, accountName, privateEndpointConnectionName, context).getFinalResult(); } - private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionsClientImpl.class); + /** + * Gets the private endpoint connections associated with the Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connections associated with the Cognitive Services account along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(String resourceGroupName, + String accountName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the private endpoint connections associated with the Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connections associated with the Cognitive Services account on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String accountName) { + return listWithResponseAsync(resourceGroupName, accountName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the private endpoint connections associated with the Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connections associated with the Cognitive Services account along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String resourceGroupName, + String accountName, Context context) { + final String accept = "application/json"; + return service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, accept, context); + } + + /** + * Gets the private endpoint connections associated with the Cognitive Services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connections associated with the Cognitive Services account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionListResultInner list(String resourceGroupName, String accountName) { + return listWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); + } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionsImpl.java index 68f0897eeb72..c141f110c4fa 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionsImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -28,37 +28,12 @@ public PrivateEndpointConnectionsImpl(PrivateEndpointConnectionsClient innerClie this.serviceManager = serviceManager; } - public Response listWithResponse(String resourceGroupName, String accountName, - Context context) { - Response inner - = this.serviceClient().listWithResponse(resourceGroupName, accountName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new PrivateEndpointConnectionListResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public PrivateEndpointConnectionListResult list(String resourceGroupName, String accountName) { - PrivateEndpointConnectionListResultInner inner = this.serviceClient().list(resourceGroupName, accountName); - if (inner != null) { - return new PrivateEndpointConnectionListResultImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse(String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context) { Response inner = this.serviceClient() .getWithResponse(resourceGroupName, accountName, privateEndpointConnectionName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); } public PrivateEndpointConnection get(String resourceGroupName, String accountName, @@ -81,6 +56,23 @@ public void delete(String resourceGroupName, String accountName, String privateE this.serviceClient().delete(resourceGroupName, accountName, privateEndpointConnectionName, context); } + public Response listWithResponse(String resourceGroupName, String accountName, + Context context) { + Response inner + = this.serviceClient().listWithResponse(resourceGroupName, accountName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateEndpointConnectionListResultImpl(inner.getValue(), this.manager())); + } + + public PrivateEndpointConnectionListResult list(String resourceGroupName, String accountName) { + PrivateEndpointConnectionListResultInner inner = this.serviceClient().list(resourceGroupName, accountName); + if (inner != null) { + return new PrivateEndpointConnectionListResultImpl(inner, this.manager()); + } else { + return null; + } + } + public PrivateEndpointConnection getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourceListResultImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourceListResultImpl.java index 0b57234b065f..516eaf7a79fa 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourceListResultImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourceListResultImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourcesClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourcesClientImpl.java index 1f2c585d6522..cb4c5d16ebb8 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourcesClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourcesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -21,7 +21,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.cognitiveservices.fluent.PrivateLinkResourcesClient; import com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateLinkResourceListResultInner; import reactor.core.publisher.Mono; @@ -55,25 +54,25 @@ public final class PrivateLinkResourcesClientImpl implements PrivateLinkResource * The interface defining all the services for CognitiveServicesManagementClientPrivateLinkResources to be used by * the proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CognitiveServicesManagementClientPrivateLinkResources") public interface PrivateLinkResourcesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateLinkResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateLinkResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @HeaderParam("Accept") String accept, Context context); } @@ -91,25 +90,10 @@ Response listSync(@HostParam("$host") String @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync(String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -144,27 +128,9 @@ private Mono listAsync(String resourceGroupN @ServiceMethod(returns = ReturnType.SINGLE) public Response listWithResponse(String resourceGroupName, String accountName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; - return service.listSync(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context); + return service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, accept, context); } /** @@ -181,6 +147,4 @@ public Response listWithResponse(String reso public PrivateLinkResourceListResultInner list(String resourceGroupName, String accountName) { return listWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); } - - private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkResourcesClientImpl.class); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourcesImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourcesImpl.java index 1ad506586413..36bd7470b0b0 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourcesImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourcesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -30,12 +30,8 @@ public Response listWithResponse(String resourceG Context context) { Response inner = this.serviceClient().listWithResponse(resourceGroupName, accountName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new PrivateLinkResourceListResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PrivateLinkResourceListResultImpl(inner.getValue(), this.manager())); } public PrivateLinkResourceListResult list(String resourceGroupName, String accountName) { diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostImpl.java new file mode 100644 index 000000000000..d4047ec032f2 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostImpl.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ProjectCapabilityHostInner; +import com.azure.resourcemanager.cognitiveservices.models.ProjectCapabilityHost; +import com.azure.resourcemanager.cognitiveservices.models.ProjectCapabilityHostProperties; + +public final class ProjectCapabilityHostImpl + implements ProjectCapabilityHost, ProjectCapabilityHost.Definition, ProjectCapabilityHost.Update { + private ProjectCapabilityHostInner innerObject; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ProjectCapabilityHostProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ProjectCapabilityHostInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String projectName; + + private String capabilityHostName; + + public ProjectCapabilityHostImpl withExistingProject(String resourceGroupName, String accountName, + String projectName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + this.projectName = projectName; + return this; + } + + public ProjectCapabilityHost create() { + this.innerObject = serviceManager.serviceClient() + .getProjectCapabilityHosts() + .createOrUpdate(resourceGroupName, accountName, projectName, capabilityHostName, this.innerModel(), + Context.NONE); + return this; + } + + public ProjectCapabilityHost create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getProjectCapabilityHosts() + .createOrUpdate(resourceGroupName, accountName, projectName, capabilityHostName, this.innerModel(), + context); + return this; + } + + ProjectCapabilityHostImpl(String name, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = new ProjectCapabilityHostInner(); + this.serviceManager = serviceManager; + this.capabilityHostName = name; + } + + public ProjectCapabilityHostImpl update() { + return this; + } + + public ProjectCapabilityHost apply() { + this.innerObject = serviceManager.serviceClient() + .getProjectCapabilityHosts() + .createOrUpdate(resourceGroupName, accountName, projectName, capabilityHostName, this.innerModel(), + Context.NONE); + return this; + } + + public ProjectCapabilityHost apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getProjectCapabilityHosts() + .createOrUpdate(resourceGroupName, accountName, projectName, capabilityHostName, this.innerModel(), + context); + return this; + } + + ProjectCapabilityHostImpl(ProjectCapabilityHostInner innerObject, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); + this.projectName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "projects"); + this.capabilityHostName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "capabilityHosts"); + } + + public ProjectCapabilityHost refresh() { + this.innerObject = serviceManager.serviceClient() + .getProjectCapabilityHosts() + .getWithResponse(resourceGroupName, accountName, projectName, capabilityHostName, Context.NONE) + .getValue(); + return this; + } + + public ProjectCapabilityHost refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getProjectCapabilityHosts() + .getWithResponse(resourceGroupName, accountName, projectName, capabilityHostName, context) + .getValue(); + return this; + } + + public ProjectCapabilityHostImpl withProperties(ProjectCapabilityHostProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostsClientImpl.java index 166764cf7246..904e2c86148c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostsClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -19,6 +19,10 @@ import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; @@ -26,11 +30,11 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.cognitiveservices.fluent.ProjectCapabilityHostsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CapabilityHostInner; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ProjectCapabilityHostInner; +import com.azure.resourcemanager.cognitiveservices.implementation.models.ProjectCapabilityHostResourceArmPaginatedResult; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -64,748 +68,754 @@ public final class ProjectCapabilityHostsClientImpl implements ProjectCapability * The interface defining all the services for CognitiveServicesManagementClientProjectCapabilityHosts to be used by * the proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CognitiveServicesManagementClientProjectCapabilityHosts") public interface ProjectCapabilityHostsService { @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("capabilityHostName") String capabilityHostName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("capabilityHostName") String capabilityHostName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("capabilityHostName") String capabilityHostName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ProjectCapabilityHostInner capabilityHost, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @PathParam("capabilityHostName") String capabilityHostName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ProjectCapabilityHostInner capabilityHost, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("capabilityHostName") String capabilityHostname, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("projectName") String projectName, @PathParam("capabilityHostName") String capabilityHostName, + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("capabilityHostName") String capabilityHostname, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("projectName") String projectName, @PathParam("capabilityHostName") String capabilityHostName, + Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("capabilityHostName") String capabilityHostname, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("projectName") String projectName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("capabilityHostName") String capabilityHostname, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("projectName") String projectName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName}") - @ExpectedResponses({ 200, 201 }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("capabilityHostName") String capabilityHostname, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CapabilityHostInner capabilityHost, @HeaderParam("Accept") String accept, - Context context); + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/capabilityHosts/{capabilityHostName}") - @ExpectedResponses({ 200, 201 }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @PathParam("capabilityHostName") String capabilityHostname, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CapabilityHostInner capabilityHost, @HeaderParam("Accept") String accept, - Context context); + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** - * Delete project capabilityHost. + * Get project capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return project capabilityHost along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, - String projectName, String capabilityHostname) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (capabilityHostname == null) { - return Mono - .error(new IllegalArgumentException("Parameter capabilityHostname is required and cannot be null.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, + String accountName, String projectName, String capabilityHostName) { final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, projectName, capabilityHostname, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, capabilityHostName, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete project capabilityHost. + * Get project capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. + * @return project capabilityHost on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String accountName, String projectName, - String capabilityHostname) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (projectName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (capabilityHostname == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter capabilityHostname is required and cannot be null.")); - } + private Mono getAsync(String resourceGroupName, String accountName, String projectName, + String capabilityHostName) { + return getWithResponseAsync(resourceGroupName, accountName, projectName, capabilityHostName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return project capabilityHost along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, + String projectName, String capabilityHostName, Context context) { final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, projectName, capabilityHostname, this.client.getApiVersion(), accept, Context.NONE); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, projectName, capabilityHostName, accept, context); } /** - * Delete project capabilityHost. + * Get project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return project capabilityHost. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectCapabilityHostInner get(String resourceGroupName, String accountName, String projectName, + String capabilityHostName) { + return getWithResponse(resourceGroupName, accountName, projectName, capabilityHostName, Context.NONE) + .getValue(); + } + + /** + * Create or update project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHost CapabilityHost definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope for Project CapabilityHost along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String accountName, String projectName, String capabilityHostName, ProjectCapabilityHostInner capabilityHost) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, capabilityHostName, + contentType, accept, capabilityHost, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update project capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHost CapabilityHost definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope for Project CapabilityHost along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, + String projectName, String capabilityHostName, ProjectCapabilityHostInner capabilityHost) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, capabilityHostName, + contentType, accept, capabilityHost, Context.NONE); + } + + /** + * Create or update project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHost CapabilityHost definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. + * @return azure Resource Manager resource envelope for Project CapabilityHost along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response deleteWithResponse(String resourceGroupName, String accountName, String projectName, - String capabilityHostname, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (projectName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (capabilityHostname == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter capabilityHostname is required and cannot be null.")); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, + String projectName, String capabilityHostName, ProjectCapabilityHostInner capabilityHost, Context context) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, projectName, capabilityHostname, this.client.getApiVersion(), accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, capabilityHostName, + contentType, accept, capabilityHost, context); } /** - * Delete project capabilityHost. + * Create or update project capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHost CapabilityHost definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope for Project + * CapabilityHost. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String accountName, - String projectName, String capabilityHostname) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, accountName, projectName, capabilityHostname); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + private PollerFlux, ProjectCapabilityHostInner> beginCreateOrUpdateAsync( + String resourceGroupName, String accountName, String projectName, String capabilityHostName, + ProjectCapabilityHostInner capabilityHost) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, accountName, + projectName, capabilityHostName, capabilityHost); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ProjectCapabilityHostInner.class, ProjectCapabilityHostInner.class, this.client.getContext()); } /** - * Delete project capabilityHost. + * Create or update project capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHost CapabilityHost definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope for Project + * CapabilityHost. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, - String projectName, String capabilityHostname) { - Response response - = deleteWithResponse(resourceGroupName, accountName, projectName, capabilityHostname); - return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + public SyncPoller, ProjectCapabilityHostInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, String projectName, String capabilityHostName, + ProjectCapabilityHostInner capabilityHost) { + Response response = createOrUpdateWithResponse(resourceGroupName, accountName, projectName, + capabilityHostName, capabilityHost); + return this.client.getLroResult(response, + ProjectCapabilityHostInner.class, ProjectCapabilityHostInner.class, Context.NONE); } /** - * Delete project capabilityHost. + * Create or update project capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHost CapabilityHost definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope for Project + * CapabilityHost. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, - String projectName, String capabilityHostname, Context context) { - Response response - = deleteWithResponse(resourceGroupName, accountName, projectName, capabilityHostname, context); - return this.client.getLroResult(response, Void.class, Void.class, context); + public SyncPoller, ProjectCapabilityHostInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, String projectName, String capabilityHostName, + ProjectCapabilityHostInner capabilityHost, Context context) { + Response response = createOrUpdateWithResponse(resourceGroupName, accountName, projectName, + capabilityHostName, capabilityHost, context); + return this.client.getLroResult(response, + ProjectCapabilityHostInner.class, ProjectCapabilityHostInner.class, context); } /** - * Delete project capabilityHost. + * Create or update project capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHost CapabilityHost definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return azure Resource Manager resource envelope for Project CapabilityHost on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String accountName, String projectName, - String capabilityHostname) { - return beginDeleteAsync(resourceGroupName, accountName, projectName, capabilityHostname).last() + private Mono createOrUpdateAsync(String resourceGroupName, String accountName, + String projectName, String capabilityHostName, ProjectCapabilityHostInner capabilityHost) { + return beginCreateOrUpdateAsync(resourceGroupName, accountName, projectName, capabilityHostName, capabilityHost) + .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Delete project capabilityHost. + * Create or update project capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHost CapabilityHost definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope for Project CapabilityHost. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostname) { - beginDelete(resourceGroupName, accountName, projectName, capabilityHostname).getFinalResult(); + public ProjectCapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String projectName, + String capabilityHostName, ProjectCapabilityHostInner capabilityHost) { + return beginCreateOrUpdate(resourceGroupName, accountName, projectName, capabilityHostName, capabilityHost) + .getFinalResult(); } /** - * Delete project capabilityHost. + * Create or update project capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHost CapabilityHost definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return azure Resource Manager resource envelope for Project CapabilityHost. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostname, - Context context) { - beginDelete(resourceGroupName, accountName, projectName, capabilityHostname, context).getFinalResult(); + public ProjectCapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String projectName, + String capabilityHostName, ProjectCapabilityHostInner capabilityHost, Context context) { + return beginCreateOrUpdate(resourceGroupName, accountName, projectName, capabilityHostName, capabilityHost, + context).getFinalResult(); } /** - * Get project capabilityHost. + * Delete project capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return project capabilityHost along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String accountName, - String projectName, String capabilityHostname) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (capabilityHostname == null) { - return Mono - .error(new IllegalArgumentException("Parameter capabilityHostname is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, projectName, capabilityHostname, this.client.getApiVersion(), accept, context)) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, + String projectName, String capabilityHostName) { + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, capabilityHostName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get project capabilityHost. + * Delete project capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return project capabilityHost on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String accountName, String projectName, - String capabilityHostname) { - return getWithResponseAsync(resourceGroupName, accountName, projectName, capabilityHostname) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Response deleteWithResponse(String resourceGroupName, String accountName, String projectName, + String capabilityHostName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, capabilityHostName, + Context.NONE); } /** - * Get project capabilityHost. + * Delete project capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return project capabilityHost along with {@link Response}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String accountName, - String projectName, String capabilityHostname, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (projectName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (capabilityHostname == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter capabilityHostname is required and cannot be null.")); - } - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, projectName, capabilityHostname, this.client.getApiVersion(), accept, context); + private Response deleteWithResponse(String resourceGroupName, String accountName, String projectName, + String capabilityHostName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, capabilityHostName, context); } /** - * Get project capabilityHost. + * Delete project capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return project capabilityHost. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CapabilityHostInner get(String resourceGroupName, String accountName, String projectName, - String capabilityHostname) { - return getWithResponse(resourceGroupName, accountName, projectName, capabilityHostname, Context.NONE) - .getValue(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String accountName, + String projectName, String capabilityHostName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, accountName, projectName, capabilityHostName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * Create or update project capabilityHost. + * Delete project capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response} on successful completion of - * {@link Mono}. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String projectName, String capabilityHostName) { + Response response + = deleteWithResponse(resourceGroupName, accountName, projectName, capabilityHostName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String projectName, String capabilityHostName, Context context) { + Response response + = deleteWithResponse(resourceGroupName, accountName, projectName, capabilityHostName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete project capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String accountName, String projectName, String capabilityHostname, CapabilityHostInner capabilityHost) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (capabilityHostname == null) { - return Mono - .error(new IllegalArgumentException("Parameter capabilityHostname is required and cannot be null.")); - } - if (capabilityHost == null) { - return Mono.error(new IllegalArgumentException("Parameter capabilityHost is required and cannot be null.")); - } else { - capabilityHost.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, projectName, capabilityHostname, this.client.getApiVersion(), - capabilityHost, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Mono deleteAsync(String resourceGroupName, String accountName, String projectName, + String capabilityHostName) { + return beginDeleteAsync(resourceGroupName, accountName, projectName, capabilityHostName).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Create or update project capabilityHost. + * Delete project capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String projectName, String capabilityHostname, CapabilityHostInner capabilityHost) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (projectName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (capabilityHostname == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter capabilityHostname is required and cannot be null.")); - } - if (capabilityHost == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter capabilityHost is required and cannot be null.")); - } else { - capabilityHost.validate(); - } - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, projectName, capabilityHostname, this.client.getApiVersion(), capabilityHost, accept, - Context.NONE); + public void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostName) { + beginDelete(resourceGroupName, accountName, projectName, capabilityHostName).getFinalResult(); } /** - * Create or update project capabilityHost. + * Delete project capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response createOrUpdateWithResponse(String resourceGroupName, String accountName, - String projectName, String capabilityHostname, CapabilityHostInner capabilityHost, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (projectName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (capabilityHostname == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter capabilityHostname is required and cannot be null.")); - } - if (capabilityHost == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter capabilityHost is required and cannot be null.")); - } else { - capabilityHost.validate(); - } - final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, projectName, capabilityHostname, this.client.getApiVersion(), capabilityHost, accept, context); + public void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostName, + Context context) { + beginDelete(resourceGroupName, accountName, projectName, capabilityHostName, context).getFinalResult(); } /** - * Create or update project capabilityHost. + * List capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of azure Resource Manager resource envelope. + * @return a paginated list of Project Capability Host entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CapabilityHostInner> beginCreateOrUpdateAsync( - String resourceGroupName, String accountName, String projectName, String capabilityHostname, - CapabilityHostInner capabilityHost) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, accountName, - projectName, capabilityHostname, capabilityHost); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - CapabilityHostInner.class, CapabilityHostInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String accountName, String projectName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or update project capabilityHost. + * List capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + * @return a paginated list of Project Capability Host entities as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CapabilityHostInner> beginCreateOrUpdate( - String resourceGroupName, String accountName, String projectName, String capabilityHostname, - CapabilityHostInner capabilityHost) { - Response response = createOrUpdateWithResponse(resourceGroupName, accountName, projectName, - capabilityHostname, capabilityHost); - return this.client.getLroResult(response, CapabilityHostInner.class, - CapabilityHostInner.class, Context.NONE); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, + String projectName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, projectName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Create or update project capabilityHost. + * List capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of azure Resource Manager resource envelope. + * @return a paginated list of Project Capability Host entities along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CapabilityHostInner> beginCreateOrUpdate( - String resourceGroupName, String accountName, String projectName, String capabilityHostname, - CapabilityHostInner capabilityHost, Context context) { - Response response = createOrUpdateWithResponse(resourceGroupName, accountName, projectName, - capabilityHostname, capabilityHost, context); - return this.client.getLroResult(response, CapabilityHostInner.class, - CapabilityHostInner.class, context); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String accountName, + String projectName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, projectName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Create or update project capabilityHost. + * List capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope on successful completion of {@link Mono}. + * @return a paginated list of Project Capability Host entities along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String accountName, - String projectName, String capabilityHostname, CapabilityHostInner capabilityHost) { - return beginCreateOrUpdateAsync(resourceGroupName, accountName, projectName, capabilityHostname, capabilityHost) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private PagedResponse listSinglePage(String resourceGroupName, String accountName, + String projectName, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, projectName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Create or update project capabilityHost. + * List capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope. + * @return a paginated list of Project Capability Host entities as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String projectName, - String capabilityHostname, CapabilityHostInner capabilityHost) { - return beginCreateOrUpdate(resourceGroupName, accountName, projectName, capabilityHostname, capabilityHost) - .getFinalResult(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, + String projectName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, projectName), + nextLink -> listNextSinglePage(nextLink)); } /** - * Create or update project capabilityHost. + * List capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope. + * @return a paginated list of Project Capability Host entities as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, + String projectName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, projectName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * List capabilityHost. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Project Capability Host entities along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CapabilityHostInner createOrUpdate(String resourceGroupName, String accountName, String projectName, - String capabilityHostname, CapabilityHostInner capabilityHost, Context context) { - return beginCreateOrUpdate(resourceGroupName, accountName, projectName, capabilityHostname, capabilityHost, - context).getFinalResult(); + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List capabilityHost. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Project Capability Host entities along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } - private static final ClientLogger LOGGER = new ClientLogger(ProjectCapabilityHostsClientImpl.class); + /** + * List capabilityHost. + * + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Project Capability Host entities along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostsImpl.java index d934b82293a9..eff88a7668a4 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostsImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostsImpl.java @@ -1,16 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.cognitiveservices.fluent.ProjectCapabilityHostsClient; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CapabilityHostInner; -import com.azure.resourcemanager.cognitiveservices.models.CapabilityHost; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ProjectCapabilityHostInner; +import com.azure.resourcemanager.cognitiveservices.models.ProjectCapabilityHost; import com.azure.resourcemanager.cognitiveservices.models.ProjectCapabilityHosts; public final class ProjectCapabilityHostsImpl implements ProjectCapabilityHosts { @@ -26,58 +27,142 @@ public ProjectCapabilityHostsImpl(ProjectCapabilityHostsClient innerClient, this.serviceManager = serviceManager; } - public void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostname) { - this.serviceClient().delete(resourceGroupName, accountName, projectName, capabilityHostname); + public Response getWithResponse(String resourceGroupName, String accountName, + String projectName, String capabilityHostName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, accountName, projectName, capabilityHostName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ProjectCapabilityHostImpl(inner.getValue(), this.manager())); } - public void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostname, - Context context) { - this.serviceClient().delete(resourceGroupName, accountName, projectName, capabilityHostname, context); - } - - public Response getWithResponse(String resourceGroupName, String accountName, String projectName, - String capabilityHostname, Context context) { - Response inner = this.serviceClient() - .getWithResponse(resourceGroupName, accountName, projectName, capabilityHostname, context); + public ProjectCapabilityHost get(String resourceGroupName, String accountName, String projectName, + String capabilityHostName) { + ProjectCapabilityHostInner inner + = this.serviceClient().get(resourceGroupName, accountName, projectName, capabilityHostName); if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CapabilityHostImpl(inner.getValue(), this.manager())); + return new ProjectCapabilityHostImpl(inner, this.manager()); } else { return null; } } - public CapabilityHost get(String resourceGroupName, String accountName, String projectName, - String capabilityHostname) { - CapabilityHostInner inner - = this.serviceClient().get(resourceGroupName, accountName, projectName, capabilityHostname); - if (inner != null) { - return new CapabilityHostImpl(inner, this.manager()); - } else { - return null; + public void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostName) { + this.serviceClient().delete(resourceGroupName, accountName, projectName, capabilityHostName); + } + + public void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostName, + Context context) { + this.serviceClient().delete(resourceGroupName, accountName, projectName, capabilityHostName, context); + } + + public PagedIterable list(String resourceGroupName, String accountName, String projectName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, accountName, projectName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ProjectCapabilityHostImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, String projectName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, accountName, projectName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ProjectCapabilityHostImpl(inner1, this.manager())); + } + + public ProjectCapabilityHost getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); } + String capabilityHostName = ResourceManagerUtils.getValueFromIdByName(id, "capabilityHosts"); + if (capabilityHostName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'capabilityHosts'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, projectName, capabilityHostName, Context.NONE) + .getValue(); } - public CapabilityHost createOrUpdate(String resourceGroupName, String accountName, String projectName, - String capabilityHostname, CapabilityHostInner capabilityHost) { - CapabilityHostInner inner = this.serviceClient() - .createOrUpdate(resourceGroupName, accountName, projectName, capabilityHostname, capabilityHost); - if (inner != null) { - return new CapabilityHostImpl(inner, this.manager()); - } else { - return null; + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String capabilityHostName = ResourceManagerUtils.getValueFromIdByName(id, "capabilityHosts"); + if (capabilityHostName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'capabilityHosts'.", id))); } + return this.getWithResponse(resourceGroupName, accountName, projectName, capabilityHostName, context); } - public CapabilityHost createOrUpdate(String resourceGroupName, String accountName, String projectName, - String capabilityHostname, CapabilityHostInner capabilityHost, Context context) { - CapabilityHostInner inner = this.serviceClient() - .createOrUpdate(resourceGroupName, accountName, projectName, capabilityHostname, capabilityHost, context); - if (inner != null) { - return new CapabilityHostImpl(inner, this.manager()); - } else { - return null; + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); } + String capabilityHostName = ResourceManagerUtils.getValueFromIdByName(id, "capabilityHosts"); + if (capabilityHostName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'capabilityHosts'.", id))); + } + this.delete(resourceGroupName, accountName, projectName, capabilityHostName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String capabilityHostName = ResourceManagerUtils.getValueFromIdByName(id, "capabilityHosts"); + if (capabilityHostName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'capabilityHosts'.", id))); + } + this.delete(resourceGroupName, accountName, projectName, capabilityHostName, context); } private ProjectCapabilityHostsClient serviceClient() { @@ -87,4 +172,8 @@ private ProjectCapabilityHostsClient serviceClient() { private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { return this.serviceManager; } + + public ProjectCapabilityHostImpl define(String name) { + return new ProjectCapabilityHostImpl(name, this.manager()); + } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectConnectionsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectConnectionsClientImpl.java index 3a771f65260d..62452d95bdb3 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectConnectionsClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectConnectionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -29,10 +29,9 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.cognitiveservices.fluent.ProjectConnectionsClient; import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; -import com.azure.resourcemanager.cognitiveservices.models.ConnectionPropertiesV2BasicResourceArmPaginatedResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.ConnectionPropertiesV2BasicResourceArmPaginatedResult; import com.azure.resourcemanager.cognitiveservices.models.ConnectionUpdateContent; import reactor.core.publisher.Mono; @@ -65,125 +64,122 @@ public final class ProjectConnectionsClientImpl implements ProjectConnectionsCli * The interface defining all the services for CognitiveServicesManagementClientProjectConnections to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CognitiveServicesManagementClientProjectConnections") public interface ProjectConnectionsService { @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName}") - @ExpectedResponses({ 200, 204 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("projectName") String projectName, @PathParam("connectionName") String connectionName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName}") - @ExpectedResponses({ 200, 204 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("projectName") String projectName, @PathParam("connectionName") String connectionName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName}") + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("projectName") String projectName, @PathParam("connectionName") String connectionName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConnectionPropertiesV2BasicResourceInner connection, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName}") + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("projectName") String projectName, @PathParam("connectionName") String connectionName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ConnectionPropertiesV2BasicResourceInner connection, Context context); @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("projectName") String projectName, @PathParam("connectionName") String connectionName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ConnectionUpdateContent connection, @HeaderParam("Accept") String accept, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ConnectionUpdateContent connection, Context context); @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("projectName") String projectName, @PathParam("connectionName") String connectionName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ConnectionUpdateContent connection, @HeaderParam("Accept") String accept, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ConnectionUpdateContent connection, Context context); - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName}") - @ExpectedResponses({ 200 }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("projectName") String projectName, @PathParam("connectionName") String connectionName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ConnectionPropertiesV2BasicResourceInner connection, - @HeaderParam("Accept") String accept, Context context); + Context context); - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName}") - @ExpectedResponses({ 200 }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections/{connectionName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response createSync(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("projectName") String projectName, @PathParam("connectionName") String connectionName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ConnectionPropertiesV2BasicResourceInner connection, - @HeaderParam("Accept") String accept, Context context); + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("projectName") String projectName, @QueryParam("target") String target, - @QueryParam("category") String category, @QueryParam("api-version") String apiVersion, - @QueryParam("includeAll") Boolean includeAll, @HeaderParam("Accept") String accept, Context context); + @QueryParam("category") String category, @QueryParam("includeAll") Boolean includeAll, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}/connections") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("projectName") String projectName, @QueryParam("target") String target, - @QueryParam("category") String category, @QueryParam("api-version") String apiVersion, - @QueryParam("includeAll") Boolean includeAll, @HeaderParam("Accept") String accept, Context context); + @QueryParam("category") String category, @QueryParam("includeAll") Boolean includeAll, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -191,12 +187,12 @@ Mono> listNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Delete Cognitive Services project connection by name. + * Lists Cognitive Services project connection by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -205,42 +201,21 @@ Response listNextSync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return connection base resource schema along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String accountName, - String projectName, String connectionName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (connectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } + private Mono> getWithResponseAsync(String resourceGroupName, + String accountName, String projectName, String connectionName) { final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, projectName, connectionName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, connectionName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete Cognitive Services project connection by name. + * Lists Cognitive Services project connection by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -249,17 +224,17 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return connection base resource schema on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String accountName, String projectName, - String connectionName) { - return deleteWithResponseAsync(resourceGroupName, accountName, projectName, connectionName) - .flatMap(ignored -> Mono.empty()); + private Mono getAsync(String resourceGroupName, String accountName, + String projectName, String connectionName) { + return getWithResponseAsync(resourceGroupName, accountName, projectName, connectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Delete Cognitive Services project connection by name. + * Lists Cognitive Services project connection by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -269,44 +244,18 @@ private Mono deleteAsync(String resourceGroupName, String accountName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return connection base resource schema along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String accountName, String projectName, - String connectionName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (projectName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (connectionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } + public Response getWithResponse(String resourceGroupName, + String accountName, String projectName, String connectionName, Context context) { final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, projectName, connectionName, this.client.getApiVersion(), accept, context); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, projectName, connectionName, accept, context); } /** - * Delete Cognitive Services project connection by name. + * Lists Cognitive Services project connection by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -315,58 +264,41 @@ public Response deleteWithResponse(String resourceGroupName, String accoun * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String projectName, String connectionName) { - deleteWithResponse(resourceGroupName, accountName, projectName, connectionName, Context.NONE); + public ConnectionPropertiesV2BasicResourceInner get(String resourceGroupName, String accountName, + String projectName, String connectionName) { + return getWithResponse(resourceGroupName, accountName, projectName, connectionName, Context.NONE).getValue(); } /** - * Lists Cognitive Services project connection by name. + * Create or update Cognitive Services project connection under the specified project. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. * @param connectionName Friendly name of the connection. + * @param connection The object for creating or updating a new account connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return connection base resource schema along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String accountName, String projectName, String connectionName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (connectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } + private Mono> createWithResponseAsync(String resourceGroupName, + String accountName, String projectName, String connectionName, + ConnectionPropertiesV2BasicResourceInner connection) { final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, projectName, connectionName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, connectionName, accept, + connection, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists Cognitive Services project connection by name. + * Create or update Cognitive Services project connection under the specified project. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -378,19 +310,21 @@ private Mono> getWithResponse * @return connection base resource schema on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String accountName, + private Mono createAsync(String resourceGroupName, String accountName, String projectName, String connectionName) { - return getWithResponseAsync(resourceGroupName, accountName, projectName, connectionName) + final ConnectionPropertiesV2BasicResourceInner connection = null; + return createWithResponseAsync(resourceGroupName, accountName, projectName, connectionName, connection) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Lists Cognitive Services project connection by name. + * Create or update Cognitive Services project connection under the specified project. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. * @param connectionName Friendly name of the connection. + * @param connection The object for creating or updating a new account connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -398,41 +332,17 @@ private Mono getAsync(String resourceG * @return connection base resource schema along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, - String accountName, String projectName, String connectionName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (projectName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (connectionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } + public Response createWithResponse(String resourceGroupName, + String accountName, String projectName, String connectionName, + ConnectionPropertiesV2BasicResourceInner connection, Context context) { final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, projectName, connectionName, this.client.getApiVersion(), accept, context); + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, connectionName, accept, + connection, context); } /** - * Lists Cognitive Services project connection by name. + * Create or update Cognitive Services project connection under the specified project. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -444,9 +354,11 @@ public Response getWithResponse(String * @return connection base resource schema. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectionPropertiesV2BasicResourceInner get(String resourceGroupName, String accountName, + public ConnectionPropertiesV2BasicResourceInner create(String resourceGroupName, String accountName, String projectName, String connectionName) { - return getWithResponse(resourceGroupName, accountName, projectName, connectionName, Context.NONE).getValue(); + final ConnectionPropertiesV2BasicResourceInner connection = null; + return createWithResponse(resourceGroupName, accountName, projectName, connectionName, connection, Context.NONE) + .getValue(); } /** @@ -465,35 +377,11 @@ public ConnectionPropertiesV2BasicResourceInner get(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String resourceGroupName, String accountName, String projectName, String connectionName, ConnectionUpdateContent connection) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (connectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } - if (connection != null) { - connection.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, projectName, connectionName, this.client.getApiVersion(), connection, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, connectionName, accept, + connection, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -535,38 +423,10 @@ private Mono updateAsync(String resour public Response updateWithResponse(String resourceGroupName, String accountName, String projectName, String connectionName, ConnectionUpdateContent connection, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (projectName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (connectionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } - if (connection != null) { - connection.validate(); - } final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, projectName, connectionName, this.client.getApiVersion(), connection, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, connectionName, accept, + connection, context); } /** @@ -590,56 +450,28 @@ public ConnectionPropertiesV2BasicResourceInner update(String resourceGroupName, } /** - * Create or update Cognitive Services project connection under the specified project. + * Delete Cognitive Services project connection by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. * @param connectionName Friendly name of the connection. - * @param connection The object for creating or updating a new account connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String resourceGroupName, - String accountName, String projectName, String connectionName, - ConnectionPropertiesV2BasicResourceInner connection) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (connectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } - if (connection != null) { - connection.validate(); - } - final String accept = "application/json"; + private Mono> deleteWithResponseAsync(String resourceGroupName, String accountName, + String projectName, String connectionName) { return FluxUtil - .withContext( - context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, projectName, connectionName, this.client.getApiVersion(), connection, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, connectionName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or update Cognitive Services project connection under the specified project. + * Delete Cognitive Services project connection by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -648,70 +480,37 @@ private Mono> createWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String accountName, - String projectName, String connectionName) { - final ConnectionPropertiesV2BasicResourceInner connection = null; - return createWithResponseAsync(resourceGroupName, accountName, projectName, connectionName, connection) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono deleteAsync(String resourceGroupName, String accountName, String projectName, + String connectionName) { + return deleteWithResponseAsync(resourceGroupName, accountName, projectName, connectionName) + .flatMap(ignored -> Mono.empty()); } /** - * Create or update Cognitive Services project connection under the specified project. + * Delete Cognitive Services project connection by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. * @param connectionName Friendly name of the connection. - * @param connection The object for creating or updating a new account connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse(String resourceGroupName, - String accountName, String projectName, String connectionName, - ConnectionPropertiesV2BasicResourceInner connection, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (projectName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (connectionName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); - } - if (connection != null) { - connection.validate(); - } - final String accept = "application/json"; - return service.createSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, projectName, connectionName, this.client.getApiVersion(), connection, accept, context); + public Response deleteWithResponse(String resourceGroupName, String accountName, String projectName, + String connectionName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, connectionName, context); } /** - * Create or update Cognitive Services project connection under the specified project. + * Delete Cognitive Services project connection by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -720,14 +519,10 @@ public Response createWithResponse(Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectionPropertiesV2BasicResourceInner create(String resourceGroupName, String accountName, - String projectName, String connectionName) { - final ConnectionPropertiesV2BasicResourceInner connection = null; - return createWithResponse(resourceGroupName, accountName, projectName, connectionName, connection, Context.NONE) - .getValue(); + public void delete(String resourceGroupName, String accountName, String projectName, String connectionName) { + deleteWithResponse(resourceGroupName, accountName, projectName, connectionName, Context.NONE); } /** @@ -748,29 +543,11 @@ public ConnectionPropertiesV2BasicResourceInner create(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String accountName, String projectName, String target, String category, Boolean includeAll) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, projectName, target, category, this.client.getApiVersion(), includeAll, - accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, target, category, + includeAll, accept, context)) .>map( res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -840,32 +617,10 @@ private PagedFlux listAsync(String res @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String accountName, String projectName, String target, String category, Boolean includeAll) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (projectName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } final String accept = "application/json"; - Response res = service.listSync( - this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, - target, category, this.client.getApiVersion(), includeAll, accept, Context.NONE); + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, projectName, target, category, includeAll, accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -889,32 +644,10 @@ private PagedResponse listSinglePage(S @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String accountName, String projectName, String target, String category, Boolean includeAll, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (projectName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } final String accept = "application/json"; Response res - = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, projectName, target, category, this.client.getApiVersion(), includeAll, accept, context); + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, projectName, target, category, includeAll, accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -978,13 +711,6 @@ public PagedIterable list(String resou */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map( @@ -1006,15 +732,6 @@ private Mono> listNextSi */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -1037,21 +754,10 @@ private PagedResponse listNextSinglePa @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(ProjectConnectionsClientImpl.class); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectConnectionsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectConnectionsImpl.java index 7b960f65b515..f86d10aa2c49 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectConnectionsImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectConnectionsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -12,7 +12,6 @@ import com.azure.resourcemanager.cognitiveservices.fluent.ProjectConnectionsClient; import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; import com.azure.resourcemanager.cognitiveservices.models.ConnectionPropertiesV2BasicResource; -import com.azure.resourcemanager.cognitiveservices.models.ConnectionUpdateContent; import com.azure.resourcemanager.cognitiveservices.models.ProjectConnections; public final class ProjectConnectionsImpl implements ProjectConnections { @@ -28,26 +27,12 @@ public ProjectConnectionsImpl(ProjectConnectionsClient innerClient, this.serviceManager = serviceManager; } - public Response deleteWithResponse(String resourceGroupName, String accountName, String projectName, - String connectionName, Context context) { - return this.serviceClient() - .deleteWithResponse(resourceGroupName, accountName, projectName, connectionName, context); - } - - public void delete(String resourceGroupName, String accountName, String projectName, String connectionName) { - this.serviceClient().delete(resourceGroupName, accountName, projectName, connectionName); - } - public Response getWithResponse(String resourceGroupName, String accountName, String projectName, String connectionName, Context context) { Response inner = this.serviceClient() .getWithResponse(resourceGroupName, accountName, projectName, connectionName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ConnectionPropertiesV2BasicResourceImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ConnectionPropertiesV2BasicResourceImpl(inner.getValue(), this.manager())); } public ConnectionPropertiesV2BasicResource get(String resourceGroupName, String accountName, String projectName, @@ -61,52 +46,14 @@ public ConnectionPropertiesV2BasicResource get(String resourceGroupName, String } } - public Response updateWithResponse(String resourceGroupName, - String accountName, String projectName, String connectionName, ConnectionUpdateContent connection, - Context context) { - Response inner = this.serviceClient() - .updateWithResponse(resourceGroupName, accountName, projectName, connectionName, connection, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ConnectionPropertiesV2BasicResourceImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ConnectionPropertiesV2BasicResource update(String resourceGroupName, String accountName, String projectName, - String connectionName) { - ConnectionPropertiesV2BasicResourceInner inner - = this.serviceClient().update(resourceGroupName, accountName, projectName, connectionName); - if (inner != null) { - return new ConnectionPropertiesV2BasicResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response createWithResponse(String resourceGroupName, - String accountName, String projectName, String connectionName, - ConnectionPropertiesV2BasicResourceInner connection, Context context) { - Response inner = this.serviceClient() - .createWithResponse(resourceGroupName, accountName, projectName, connectionName, connection, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ConnectionPropertiesV2BasicResourceImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public Response deleteWithResponse(String resourceGroupName, String accountName, String projectName, + String connectionName, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, accountName, projectName, connectionName, context); } - public ConnectionPropertiesV2BasicResource create(String resourceGroupName, String accountName, String projectName, - String connectionName) { - ConnectionPropertiesV2BasicResourceInner inner - = this.serviceClient().create(resourceGroupName, accountName, projectName, connectionName); - if (inner != null) { - return new ConnectionPropertiesV2BasicResourceImpl(inner, this.manager()); - } else { - return null; - } + public void delete(String resourceGroupName, String accountName, String projectName, String connectionName) { + this.serviceClient().delete(resourceGroupName, accountName, projectName, connectionName); } public PagedIterable list(String resourceGroupName, String accountName, @@ -125,6 +72,103 @@ public PagedIterable list(String resourceGr inner1 -> new ConnectionPropertiesV2BasicResourceImpl(inner1, this.manager())); } + public ConnectionPropertiesV2BasicResource getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String connectionName = ResourceManagerUtils.getValueFromIdByName(id, "connections"); + if (connectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, projectName, connectionName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String connectionName = ResourceManagerUtils.getValueFromIdByName(id, "connections"); + if (connectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, projectName, connectionName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String connectionName = ResourceManagerUtils.getValueFromIdByName(id, "connections"); + if (connectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + this.deleteWithResponse(resourceGroupName, accountName, projectName, connectionName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String projectName = ResourceManagerUtils.getValueFromIdByName(id, "projects"); + if (projectName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'projects'.", id))); + } + String connectionName = ResourceManagerUtils.getValueFromIdByName(id, "connections"); + if (connectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'connections'.", id))); + } + return this.deleteWithResponse(resourceGroupName, accountName, projectName, connectionName, context); + } + private ProjectConnectionsClient serviceClient() { return this.innerClient; } @@ -132,4 +176,8 @@ private ProjectConnectionsClient serviceClient() { private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { return this.serviceManager; } + + public ConnectionPropertiesV2BasicResourceImpl define(String name) { + return new ConnectionPropertiesV2BasicResourceImpl(name, this.manager()); + } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectImpl.java index 648dfd2f7049..73a4261def04 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -31,16 +31,8 @@ public String type() { return this.innerModel().type(); } - public String etag() { - return this.innerModel().etag(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public Identity identity() { - return this.innerModel().identity(); + public ProjectProperties properties() { + return this.innerModel().properties(); } public Map tags() { @@ -56,8 +48,16 @@ public String location() { return this.innerModel().location(); } - public ProjectProperties properties() { - return this.innerModel().properties(); + public String etag() { + return this.innerModel().etag(); + } + + public Identity identity() { + return this.innerModel().identity(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); } public Region region() { @@ -170,13 +170,13 @@ public ProjectImpl withTags(Map tags) { return this; } - public ProjectImpl withIdentity(Identity identity) { - this.innerModel().withIdentity(identity); + public ProjectImpl withProperties(ProjectProperties properties) { + this.innerModel().withProperties(properties); return this; } - public ProjectImpl withProperties(ProjectProperties properties) { - this.innerModel().withProperties(properties); + public ProjectImpl withIdentity(Identity identity) { + this.innerModel().withIdentity(identity); return this; } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectsClientImpl.java index 7bff139a5fe8..3cafcebda605 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectsClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -31,12 +31,11 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.cognitiveservices.fluent.ProjectsClient; import com.azure.resourcemanager.cognitiveservices.fluent.models.ProjectInner; -import com.azure.resourcemanager.cognitiveservices.models.ProjectListResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.ProjectListResult; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -69,101 +68,97 @@ public final class ProjectsClientImpl implements ProjectsClient { * The interface defining all the services for CognitiveServicesManagementClientProjects to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CognitiveServicesManagementClientProjects") public interface ProjectsService { @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("projectName") String projectName, @HeaderParam("Accept") String accept, Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}") @ExpectedResponses({ 200, 201, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@HostParam("$host") String endpoint, + Mono>> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") ProjectInner project, - @HeaderParam("Accept") String accept, Context context); + @PathParam("projectName") String projectName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ProjectInner project, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}") @ExpectedResponses({ 200, 201, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response createSync(@HostParam("$host") String endpoint, + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") ProjectInner project, - @HeaderParam("Accept") String accept, Context context); + @PathParam("projectName") String projectName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ProjectInner project, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") ProjectInner project, - @HeaderParam("Accept") String accept, Context context); + @PathParam("projectName") String projectName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ProjectInner project, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("$host") String endpoint, + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") ProjectInner project, - @HeaderParam("Accept") String accept, Context context); + @PathParam("projectName") String projectName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ProjectInner project, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}") - @ExpectedResponses({ 200, 202, 204 }) + @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @PathParam("projectName") String projectName, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}") - @ExpectedResponses({ 200, 202, 204 }) + @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects/{projectName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("projectName") String projectName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @PathParam("projectName") String projectName, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/projects") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -171,14 +166,92 @@ Response listSync(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Returns a Cognitive Services project specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String projectName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns a Cognitive Services project specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, String projectName) { + return getWithResponseAsync(resourceGroupName, accountName, projectName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns a Cognitive Services project specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, String projectName, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, projectName, accept, context); + } + + /** + * Returns a Cognitive Services project specified by the parameters. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProjectInner get(String resourceGroupName, String accountName, String projectName) { + return getWithResponse(resourceGroupName, accountName, projectName, Context.NONE).getValue(); } /** @@ -198,33 +271,12 @@ Response listNextSync(@PathParam(value = "nextLink", encoded @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync(String resourceGroupName, String accountName, String projectName, ProjectInner project) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (project == null) { - return Mono.error(new IllegalArgumentException("Parameter project is required and cannot be null.")); - } else { - project.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), resourceGroupName, accountName, - projectName, this.client.getApiVersion(), this.client.getSubscriptionId(), project, accept, context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, contentType, accept, + project, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -245,37 +297,11 @@ private Mono>> createWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response createWithResponse(String resourceGroupName, String accountName, String projectName, ProjectInner project) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (projectName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (project == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter project is required and cannot be null.")); - } else { - project.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createSync(this.client.getEndpoint(), resourceGroupName, accountName, projectName, - this.client.getApiVersion(), this.client.getSubscriptionId(), project, accept, Context.NONE); + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, contentType, accept, project, + Context.NONE); } /** @@ -296,37 +322,11 @@ private Response createWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response createWithResponse(String resourceGroupName, String accountName, String projectName, ProjectInner project, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (projectName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (project == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter project is required and cannot be null.")); - } else { - project.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createSync(this.client.getEndpoint(), resourceGroupName, accountName, projectName, - this.client.getApiVersion(), this.client.getSubscriptionId(), project, accept, context); + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, contentType, accept, project, + context); } /** @@ -475,33 +475,12 @@ public ProjectInner create(String resourceGroupName, String accountName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String accountName, String projectName, ProjectInner project) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (project == null) { - return Mono.error(new IllegalArgumentException("Parameter project is required and cannot be null.")); - } else { - project.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, accountName, - projectName, this.client.getApiVersion(), this.client.getSubscriptionId(), project, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, contentType, accept, + project, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -521,37 +500,11 @@ private Mono>> updateWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response updateWithResponse(String resourceGroupName, String accountName, String projectName, ProjectInner project) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (projectName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (project == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter project is required and cannot be null.")); - } else { - project.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), resourceGroupName, accountName, projectName, - this.client.getApiVersion(), this.client.getSubscriptionId(), project, accept, Context.NONE); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, contentType, accept, project, + Context.NONE); } /** @@ -571,37 +524,11 @@ private Response updateWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response updateWithResponse(String resourceGroupName, String accountName, String projectName, ProjectInner project, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (projectName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (project == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter project is required and cannot be null.")); - } else { - project.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), resourceGroupName, accountName, projectName, - this.client.getApiVersion(), this.client.getSubscriptionId(), project, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, contentType, accept, project, + context); } /** @@ -742,28 +669,9 @@ public ProjectInner update(String resourceGroupName, String accountName, String @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, String projectName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, accountName, - projectName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -780,31 +688,8 @@ private Mono>> deleteWithResponseAsync(String resource */ @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String accountName, String projectName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (projectName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), resourceGroupName, accountName, projectName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, Context.NONE); } /** @@ -822,31 +707,8 @@ private Response deleteWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String accountName, String projectName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (projectName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), resourceGroupName, accountName, projectName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, projectName, context); } /** @@ -953,124 +815,6 @@ public void delete(String resourceGroupName, String accountName, String projectN beginDelete(resourceGroupName, accountName, projectName, context).getFinalResult(); } - /** - * Returns a Cognitive Services project specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String accountName, - String projectName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (projectName == null) { - return Mono.error(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, accountName, projectName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns a Cognitive Services project specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String accountName, String projectName) { - return getWithResponseAsync(resourceGroupName, accountName, projectName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns a Cognitive Services project specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String accountName, String projectName, - Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (projectName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter projectName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), resourceGroupName, accountName, projectName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); - } - - /** - * Returns a Cognitive Services project specified by the parameters. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProjectInner get(String resourceGroupName, String accountName, String projectName) { - return getWithResponse(resourceGroupName, accountName, projectName, Context.NONE).getValue(); - } - /** * Returns all the projects in a Cognitive Services account. * @@ -1084,25 +828,10 @@ public ProjectInner get(String resourceGroupName, String accountName, String pro */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1136,27 +865,9 @@ private PagedFlux listAsync(String resourceGroupName, String accou */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -1174,27 +885,9 @@ private PagedResponse listSinglePage(String resourceGroupName, Str */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String accountName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -1246,13 +939,6 @@ public PagedIterable list(String resourceGroupName, String account */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), @@ -1271,15 +957,6 @@ private Mono> listNextSinglePageAsync(String nextLin */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -1299,20 +976,9 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(ProjectsClientImpl.class); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectsImpl.java index a29699c999ba..2ac60b86f85b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectsImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -27,24 +27,12 @@ public ProjectsImpl(ProjectsClient innerClient, this.serviceManager = serviceManager; } - public void delete(String resourceGroupName, String accountName, String projectName) { - this.serviceClient().delete(resourceGroupName, accountName, projectName); - } - - public void delete(String resourceGroupName, String accountName, String projectName, Context context) { - this.serviceClient().delete(resourceGroupName, accountName, projectName, context); - } - public Response getWithResponse(String resourceGroupName, String accountName, String projectName, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, accountName, projectName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ProjectImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ProjectImpl(inner.getValue(), this.manager())); } public Project get(String resourceGroupName, String accountName, String projectName) { @@ -56,6 +44,14 @@ public Project get(String resourceGroupName, String accountName, String projectN } } + public void delete(String resourceGroupName, String accountName, String projectName) { + this.serviceClient().delete(resourceGroupName, accountName, projectName); + } + + public void delete(String resourceGroupName, String accountName, String projectName, Context context) { + this.serviceClient().delete(resourceGroupName, accountName, projectName, context); + } + public PagedIterable list(String resourceGroupName, String accountName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); return ResourceManagerUtils.mapPage(inner, inner1 -> new ProjectImpl(inner1, this.manager())); diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/QuotaTierImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/QuotaTierImpl.java index bf95f3dfbf8d..08065d5eee23 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/QuotaTierImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/QuotaTierImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/QuotaTiersClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/QuotaTiersClientImpl.java index aa69592833ee..65bf8084a262 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/QuotaTiersClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/QuotaTiersClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -28,10 +28,9 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.cognitiveservices.fluent.QuotaTiersClient; import com.azure.resourcemanager.cognitiveservices.fluent.models.QuotaTierInner; -import com.azure.resourcemanager.cognitiveservices.models.QuotaTierListResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.QuotaTierListResult; import reactor.core.publisher.Mono; /** @@ -63,75 +62,71 @@ public final class QuotaTiersClientImpl implements QuotaTiersClient { * The interface defining all the services for CognitiveServicesManagementClientQuotaTiers to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CognitiveServicesManagementClientQuotaTiers") public interface QuotaTiersService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/quotaTiers") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/quotaTiers/{default}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("default") String defaultParameter, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/quotaTiers") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/quotaTiers/{default}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("default") String defaultParameter, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/quotaTiers/{default}") - @ExpectedResponses({ 200 }) + @Put("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/quotaTiers/{default}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @PathParam("default") String defaultParameter, @HeaderParam("Accept") String accept, Context context); + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("default") String defaultParameter, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") QuotaTierInner tier, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/quotaTiers/{default}") - @ExpectedResponses({ 200 }) + @Put("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/quotaTiers/{default}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @PathParam("default") String defaultParameter, @HeaderParam("Accept") String accept, Context context); + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("default") String defaultParameter, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") QuotaTierInner tier, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/quotaTiers/{default}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @PathParam("default") String defaultParameter, @BodyParam("application/json") QuotaTierInner tier, - @HeaderParam("Accept") String accept, Context context); + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("default") String defaultParameter, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") QuotaTierInner tier, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/quotaTiers/{default}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @PathParam("default") String defaultParameter, @BodyParam("application/json") QuotaTierInner tier, - @HeaderParam("Accept") String accept, Context context); + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("default") String defaultParameter, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") QuotaTierInner tier, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/quotaTiers/{default}") - @ExpectedResponses({ 200, 201 }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/quotaTiers") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @PathParam("default") String defaultParameter, @BodyParam("application/json") QuotaTierInner tier, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/quotaTiers/{default}") - @ExpectedResponses({ 200, 201 }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/quotaTiers") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @PathParam("default") String defaultParameter, @BodyParam("application/json") QuotaTierInner tier, + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -139,7 +134,7 @@ Response createOrUpdateSync(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -147,231 +142,176 @@ Mono> listBySubscriptionNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listBySubscriptionNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Returns all the resources of a particular type belonging to a subscription. + * Gets the Quota Tier for a subscription + * + * Gets the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It + * holds current tier information. * + * @param defaultParameter Default parameter. Leave the value as default. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Quota Tiers response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the Quota Tier for a subscription + * + * Gets the Quota Tier information for the given subscription along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + private Mono> getWithResponseAsync(String defaultParameter) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), defaultParameter, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Returns all the resources of a particular type belonging to a subscription. + * Gets the Quota Tier for a subscription * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Quota Tiers response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Returns all the resources of a particular type belonging to a subscription. + * Gets the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It + * holds current tier information. * + * @param defaultParameter Default parameter. Leave the value as default. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Quota Tiers response along with {@link PagedResponse}. + * @return the Quota Tier for a subscription + * + * Gets the Quota Tier information for the given subscription on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage() { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); + private Mono getAsync(String defaultParameter) { + return getWithResponseAsync(defaultParameter).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Returns all the resources of a particular type belonging to a subscription. + * Gets the Quota Tier for a subscription * + * Gets the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It + * holds current tier information. + * + * @param defaultParameter Default parameter. Leave the value as default. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Quota Tiers response along with {@link PagedResponse}. + * @return the Quota Tier for a subscription + * + * Gets the Quota Tier information for the given subscription along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + public Response getWithResponse(String defaultParameter, Context context) { final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + defaultParameter, accept, context); } /** - * Returns all the resources of a particular type belonging to a subscription. + * Gets the Quota Tier for a subscription * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Quota Tiers response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(nextLink)); - } - - /** - * Returns all the resources of a particular type belonging to a subscription. + * Gets the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It + * holds current tier information. * - * @param context The context to associate with this operation. + * @param defaultParameter Default parameter. Leave the value as default. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Quota Tiers response as paginated response with {@link PagedIterable}. + * @return the Quota Tier for a subscription + * + * Gets the Quota Tier information for the given subscription. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(() -> listSinglePage(context), - nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public QuotaTierInner get(String defaultParameter) { + return getWithResponse(defaultParameter, Context.NONE).getValue(); } /** - * Gets the Quota Tier for a subscription + * Updates the Quota Tier resource for a subscription. * - * Gets the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It + * Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It * holds current tier information. * - * @param defaultParameter Default parameter. Leave the value as "default". + * @param defaultParameter Default parameter. Leave the value as default. + * @param tier The parameters to provide for the quota tier resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Quota Tier information for the given subscription along with {@link Response} on successful - * completion of {@link Mono}. + * @return the quota tier information for the subscription along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String defaultParameter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (defaultParameter == null) { - return Mono - .error(new IllegalArgumentException("Parameter defaultParameter is required and cannot be null.")); - } + private Mono> createOrUpdateWithResponseAsync(String defaultParameter, + QuotaTierInner tier) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), defaultParameter, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), defaultParameter, contentType, accept, tier, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the Quota Tier for a subscription + * Updates the Quota Tier resource for a subscription. * - * Gets the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It + * Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It * holds current tier information. * - * @param defaultParameter Default parameter. Leave the value as "default". + * @param defaultParameter Default parameter. Leave the value as default. + * @param tier The parameters to provide for the quota tier resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Quota Tier information for the given subscription on successful completion of {@link Mono}. + * @return the quota tier information for the subscription on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String defaultParameter) { - return getWithResponseAsync(defaultParameter).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono createOrUpdateAsync(String defaultParameter, QuotaTierInner tier) { + return createOrUpdateWithResponseAsync(defaultParameter, tier).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets the Quota Tier for a subscription + * Updates the Quota Tier resource for a subscription. * - * Gets the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It + * Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It * holds current tier information. * - * @param defaultParameter Default parameter. Leave the value as "default". + * @param defaultParameter Default parameter. Leave the value as default. + * @param tier The parameters to provide for the quota tier resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Quota Tier information for the given subscription along with {@link Response}. + * @return the quota tier information for the subscription along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String defaultParameter, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (defaultParameter == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter defaultParameter is required and cannot be null.")); - } + public Response createOrUpdateWithResponse(String defaultParameter, QuotaTierInner tier, + Context context) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), - defaultParameter, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), defaultParameter, contentType, accept, tier, context); } /** - * Gets the Quota Tier for a subscription + * Updates the Quota Tier resource for a subscription. * - * Gets the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It + * Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It * holds current tier information. * - * @param defaultParameter Default parameter. Leave the value as "default". + * @param defaultParameter Default parameter. Leave the value as default. + * @param tier The parameters to provide for the quota tier resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Quota Tier information for the given subscription. + * @return the quota tier information for the subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public QuotaTierInner get(String defaultParameter) { - return getWithResponse(defaultParameter, Context.NONE).getValue(); + public QuotaTierInner createOrUpdate(String defaultParameter, QuotaTierInner tier) { + return createOrUpdateWithResponse(defaultParameter, tier, Context.NONE).getValue(); } /** @@ -381,7 +321,7 @@ public QuotaTierInner get(String defaultParameter) { * Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It * holds current tier information. * - * @param defaultParameter Default parameter. Leave the value as "default". + * @param defaultParameter Default parameter. Leave the value as default. * @param tier The parameters to provide for the quota tier resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -391,27 +331,11 @@ public QuotaTierInner get(String defaultParameter) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String defaultParameter, QuotaTierInner tier) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (defaultParameter == null) { - return Mono - .error(new IllegalArgumentException("Parameter defaultParameter is required and cannot be null.")); - } - if (tier == null) { - return Mono.error(new IllegalArgumentException("Parameter tier is required and cannot be null.")); - } else { - tier.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), defaultParameter, tier, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), defaultParameter, contentType, accept, tier, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -422,7 +346,7 @@ private Mono> updateWithResponseAsync(String defaultPar * Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It * holds current tier information. * - * @param defaultParameter Default parameter. Leave the value as "default". + * @param defaultParameter Default parameter. Leave the value as default. * @param tier The parameters to provide for the quota tier resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -441,7 +365,7 @@ private Mono updateAsync(String defaultParameter, QuotaTierInner * Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It * holds current tier information. * - * @param defaultParameter Default parameter. Leave the value as "default". + * @param defaultParameter Default parameter. Leave the value as default. * @param tier The parameters to provide for the quota tier resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -451,28 +375,10 @@ private Mono updateAsync(String defaultParameter, QuotaTierInner */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse(String defaultParameter, QuotaTierInner tier, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (defaultParameter == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter defaultParameter is required and cannot be null.")); - } - if (tier == null) { - throw LOGGER.atError().log(new IllegalArgumentException("Parameter tier is required and cannot be null.")); - } else { - tier.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), defaultParameter, tier, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), defaultParameter, contentType, accept, tier, context); } /** @@ -482,7 +388,7 @@ public Response updateWithResponse(String defaultParameter, Quot * Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It * holds current tier information. * - * @param defaultParameter Default parameter. Leave the value as "default". + * @param defaultParameter Default parameter. Leave the value as default. * @param tier The parameters to provide for the quota tier resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -495,121 +401,96 @@ public QuotaTierInner update(String defaultParameter, QuotaTierInner tier) { } /** - * Updates the Quota Tier resource for a subscription. - * - * Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It - * holds current tier information. + * Returns all the resources of a particular type belonging to a subscription. * - * @param defaultParameter Default parameter. Leave the value as "default". - * @param tier The parameters to provide for the quota tier resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota tier information for the subscription along with {@link Response} on successful completion of + * @return the list of Quota Tiers response along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String defaultParameter, - QuotaTierInner tier) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (defaultParameter == null) { - return Mono - .error(new IllegalArgumentException("Parameter defaultParameter is required and cannot be null.")); - } - if (tier == null) { - return Mono.error(new IllegalArgumentException("Parameter tier is required and cannot be null.")); - } else { - tier.validate(); - } + private Mono> listSinglePageAsync() { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), defaultParameter, tier, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Updates the Quota Tier resource for a subscription. + * Returns all the resources of a particular type belonging to a subscription. * - * Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It - * holds current tier information. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Quota Tiers response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Returns all the resources of a particular type belonging to a subscription. * - * @param defaultParameter Default parameter. Leave the value as "default". - * @param tier The parameters to provide for the quota tier resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota tier information for the subscription on successful completion of {@link Mono}. + * @return the list of Quota Tiers response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String defaultParameter, QuotaTierInner tier) { - return createOrUpdateWithResponseAsync(defaultParameter, tier).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Updates the Quota Tier resource for a subscription. - * - * Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It - * holds current tier information. + * Returns all the resources of a particular type belonging to a subscription. * - * @param defaultParameter Default parameter. Leave the value as "default". - * @param tier The parameters to provide for the quota tier resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota tier information for the subscription along with {@link Response}. + * @return the list of Quota Tiers response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String defaultParameter, QuotaTierInner tier, - Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (defaultParameter == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter defaultParameter is required and cannot be null.")); - } - if (tier == null) { - throw LOGGER.atError().log(new IllegalArgumentException("Parameter tier is required and cannot be null.")); - } else { - tier.validate(); - } + private PagedResponse listSinglePage(Context context) { final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), defaultParameter, tier, accept, context); + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Updates the Quota Tier resource for a subscription. + * Returns all the resources of a particular type belonging to a subscription. * - * Update the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It - * holds current tier information. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Quota Tiers response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(nextLink)); + } + + /** + * Returns all the resources of a particular type belonging to a subscription. * - * @param defaultParameter Default parameter. Leave the value as "default". - * @param tier The parameters to provide for the quota tier resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota tier information for the subscription. + * @return the list of Quota Tiers response as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public QuotaTierInner createOrUpdate(String defaultParameter, QuotaTierInner tier) { - return createOrUpdateWithResponse(defaultParameter, tier, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); } /** @@ -624,13 +505,6 @@ public QuotaTierInner createOrUpdate(String defaultParameter, QuotaTierInner tie */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -651,15 +525,6 @@ private Mono> listBySubscriptionNextSinglePageAsyn */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -679,21 +544,10 @@ private PagedResponse listBySubscriptionNextSinglePage(String ne */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(QuotaTiersClientImpl.class); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/QuotaTiersImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/QuotaTiersImpl.java index 5b832460fc9d..1a2b2ddc30bf 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/QuotaTiersImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/QuotaTiersImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -27,24 +27,10 @@ public QuotaTiersImpl(QuotaTiersClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new QuotaTierImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new QuotaTierImpl(inner1, this.manager())); - } - public Response getWithResponse(String defaultParameter, Context context) { Response inner = this.serviceClient().getWithResponse(defaultParameter, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new QuotaTierImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new QuotaTierImpl(inner.getValue(), this.manager())); } public QuotaTier get(String defaultParameter) { @@ -56,6 +42,16 @@ public QuotaTier get(String defaultParameter) { } } + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new QuotaTierImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new QuotaTierImpl(inner1, this.manager())); + } + public QuotaTier getById(String id) { String defaultParameter = ResourceManagerUtils.getValueFromIdByName(id, "quotaTiers"); if (defaultParameter == null) { diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistImpl.java index 89f368a5763c..7a74ba5142de 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -29,6 +29,10 @@ public String type() { return this.innerModel().type(); } + public RaiBlocklistProperties properties() { + return this.innerModel().properties(); + } + public String etag() { return this.innerModel().etag(); } @@ -42,10 +46,6 @@ public Map tags() { } } - public RaiBlocklistProperties properties() { - return this.innerModel().properties(); - } - public SystemData systemData() { return this.innerModel().systemData(); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistItemImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistItemImpl.java index dcbdb6519fe6..28b9be1990d5 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistItemImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistItemImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -30,6 +30,10 @@ public String type() { return this.innerModel().type(); } + public RaiBlocklistItemProperties properties() { + return this.innerModel().properties(); + } + public String etag() { return this.innerModel().etag(); } @@ -43,10 +47,6 @@ public Map tags() { } } - public RaiBlocklistItemProperties properties() { - return this.innerModel().properties(); - } - public SystemData systemData() { return this.innerModel().systemData(); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistItemsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistItemsClientImpl.java index e16d06b487a6..b24c692a733d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistItemsClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistItemsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -31,13 +31,12 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.cognitiveservices.fluent.RaiBlocklistItemsClient; import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiBlocklistInner; import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiBlocklistItemInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlockListItemsResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.RaiBlockListItemsResult; import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItemBulkRequest; import java.nio.ByteBuffer; import java.util.List; @@ -73,36 +72,16 @@ public final class RaiBlocklistItemsClientImpl implements RaiBlocklistItemsClien * The interface defining all the services for CognitiveServicesManagementClientRaiBlocklistItems to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CognitiveServicesManagementClientRaiBlocklistItems") public interface RaiBlocklistItemsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("raiBlocklistName") String raiBlocklistName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("raiBlocklistName") String raiBlocklistName, @HeaderParam("Accept") String accept, - Context context); - @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("raiBlocklistName") String raiBlocklistName, @PathParam("raiBlocklistItemName") String raiBlocklistItemName, @HeaderParam("Accept") String accept, Context context); @@ -111,305 +90,128 @@ Mono> get(@HostParam("$host") String endpoint, @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("raiBlocklistName") String raiBlocklistName, @PathParam("raiBlocklistItemName") String raiBlocklistItemName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("raiBlocklistName") String raiBlocklistName, @PathParam("raiBlocklistItemName") String raiBlocklistItemName, - @BodyParam("application/json") RaiBlocklistItemInner raiBlocklistItem, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RaiBlocklistItemInner raiBlocklistItem, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("raiBlocklistName") String raiBlocklistName, @PathParam("raiBlocklistItemName") String raiBlocklistItemName, - @BodyParam("application/json") RaiBlocklistItemInner raiBlocklistItem, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RaiBlocklistItemInner raiBlocklistItem, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("raiBlocklistName") String raiBlocklistName, - @PathParam("raiBlocklistItemName") String raiBlocklistItemName, @HeaderParam("Accept") String accept, - Context context); + @PathParam("raiBlocklistItemName") String raiBlocklistItemName, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("raiBlocklistName") String raiBlocklistName, - @PathParam("raiBlocklistItemName") String raiBlocklistItemName, @HeaderParam("Accept") String accept, - Context context); + @PathParam("raiBlocklistItemName") String raiBlocklistItemName, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/addRaiBlocklistItems") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> batchAdd(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("raiBlocklistName") String raiBlocklistName, - @BodyParam("application/json") List raiBlocklistItems, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("raiBlocklistName") String raiBlocklistName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("raiBlocklistName") String raiBlocklistName, @HeaderParam("Accept") String accept, + Context context); + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/addRaiBlocklistItems") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response batchAddSync(@HostParam("$host") String endpoint, + Mono> batchAdd(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("raiBlocklistName") String raiBlocklistName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") List raiBlocklistItems, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/addRaiBlocklistItems") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response batchAddSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("raiBlocklistName") String raiBlocklistName, - @BodyParam("application/json") List raiBlocklistItems, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("raiBlocklistName") String raiBlocklistName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") List raiBlocklistItems, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/deleteRaiBlocklistItems") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> batchDelete(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono> batchDelete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("raiBlocklistName") String raiBlocklistName, - @BodyParam("application/json") Object raiBlocklistItemsNames, @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("raiBlocklistName") String raiBlocklistName, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") List raiBlocklistItemsNames, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}/deleteRaiBlocklistItems") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response batchDeleteSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response batchDeleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("raiBlocklistName") String raiBlocklistName, - @BodyParam("application/json") Object raiBlocklistItemsNames, @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("raiBlocklistName") String raiBlocklistName, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") List raiBlocklistItemsNames, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the blocklist items associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blocklist items associated with the custom blocklist along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String accountName, - String raiBlocklistName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiBlocklistName == null) { - return Mono - .error(new IllegalArgumentException("Parameter raiBlocklistName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), raiBlocklistName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the blocklist items associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blocklist items associated with the custom blocklist as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName, - String raiBlocklistName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, raiBlocklistName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the blocklist items associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blocklist items associated with the custom blocklist along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, - String raiBlocklistName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiBlocklistName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter raiBlocklistName is required and cannot be null.")); - } - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), - this.client.getSubscriptionId(), raiBlocklistName, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the blocklist items associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blocklist items associated with the custom blocklist along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, - String raiBlocklistName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiBlocklistName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter raiBlocklistName is required and cannot be null.")); - } - final String accept = "application/json"; - Response res - = service.listSync(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), - this.client.getSubscriptionId(), raiBlocklistName, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the blocklist items associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blocklist items associated with the custom blocklist as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, - String raiBlocklistName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, raiBlocklistName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Gets the blocklist items associated with the custom blocklist. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blocklist items associated with the custom blocklist as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, - String raiBlocklistName, Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, raiBlocklistName, context), - nextLink -> listNextSinglePage(nextLink, context)); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -428,33 +230,10 @@ public PagedIterable list(String resourceGroupName, Strin @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String accountName, String raiBlocklistName, String raiBlocklistItemName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiBlocklistName == null) { - return Mono - .error(new IllegalArgumentException("Parameter raiBlocklistName is required and cannot be null.")); - } - if (raiBlocklistItemName == null) { - return Mono - .error(new IllegalArgumentException("Parameter raiBlocklistItemName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), raiBlocklistName, raiBlocklistItemName, + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -495,35 +274,9 @@ private Mono getAsync(String resourceGroupName, String ac @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String accountName, String raiBlocklistName, String raiBlocklistItemName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiBlocklistName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter raiBlocklistName is required and cannot be null.")); - } - if (raiBlocklistItemName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter raiBlocklistItemName is required and cannot be null.")); - } final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), - this.client.getSubscriptionId(), raiBlocklistName, raiBlocklistItemName, accept, context); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, accept, context); } /** @@ -563,40 +316,12 @@ public RaiBlocklistItemInner get(String resourceGroupName, String accountName, S private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String accountName, String raiBlocklistName, String raiBlocklistItemName, RaiBlocklistItemInner raiBlocklistItem) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiBlocklistName == null) { - return Mono - .error(new IllegalArgumentException("Parameter raiBlocklistName is required and cannot be null.")); - } - if (raiBlocklistItemName == null) { - return Mono - .error(new IllegalArgumentException("Parameter raiBlocklistItemName is required and cannot be null.")); - } - if (raiBlocklistItem == null) { - return Mono - .error(new IllegalArgumentException("Parameter raiBlocklistItem is required and cannot be null.")); - } else { - raiBlocklistItem.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), raiBlocklistName, raiBlocklistItemName, - raiBlocklistItem, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, + contentType, accept, raiBlocklistItem, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -637,42 +362,11 @@ private Mono createOrUpdateAsync(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String accountName, String raiBlocklistName, String raiBlocklistItemName, RaiBlocklistItemInner raiBlocklistItem, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiBlocklistName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter raiBlocklistName is required and cannot be null.")); - } - if (raiBlocklistItemName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter raiBlocklistItemName is required and cannot be null.")); - } - if (raiBlocklistItem == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter raiBlocklistItem is required and cannot be null.")); - } else { - raiBlocklistItem.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), raiBlocklistName, raiBlocklistItemName, - raiBlocklistItem, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, + contentType, accept, raiBlocklistItem, context); } /** @@ -710,34 +404,10 @@ public RaiBlocklistItemInner createOrUpdate(String resourceGroupName, String acc @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, String raiBlocklistName, String raiBlocklistItemName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiBlocklistName == null) { - return Mono - .error(new IllegalArgumentException("Parameter raiBlocklistName is required and cannot be null.")); - } - if (raiBlocklistItemName == null) { - return Mono - .error(new IllegalArgumentException("Parameter raiBlocklistItemName is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), raiBlocklistName, raiBlocklistItemName, - accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -756,36 +426,9 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String accountName, String raiBlocklistName, String raiBlocklistItemName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiBlocklistName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter raiBlocklistName is required and cannot be null.")); - } - if (raiBlocklistItemName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter raiBlocklistItemName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), raiBlocklistName, raiBlocklistItemName, - accept, Context.NONE); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, + Context.NONE); } /** @@ -804,36 +447,9 @@ private Response deleteWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String accountName, String raiBlocklistName, String raiBlocklistItemName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiBlocklistName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter raiBlocklistName is required and cannot be null.")); - } - if (raiBlocklistItemName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter raiBlocklistItemName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), raiBlocklistName, raiBlocklistItemName, - accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, + context); } /** @@ -952,6 +568,130 @@ public void delete(String resourceGroupName, String accountName, String raiBlock beginDelete(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, context).getFinalResult(); } + /** + * Gets the blocklist items associated with the custom blocklist. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blocklist items associated with the custom blocklist along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String accountName, + String raiBlocklistName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the blocklist items associated with the custom blocklist. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blocklist items associated with the custom blocklist as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, + String raiBlocklistName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, raiBlocklistName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the blocklist items associated with the custom blocklist. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blocklist items associated with the custom blocklist along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String accountName, + String raiBlocklistName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets the blocklist items associated with the custom blocklist. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blocklist items associated with the custom blocklist along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String accountName, + String raiBlocklistName, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets the blocklist items associated with the custom blocklist. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blocklist items associated with the custom blocklist as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, + String raiBlocklistName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, raiBlocklistName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets the blocklist items associated with the custom blocklist. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blocklist items associated with the custom blocklist as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, + String raiBlocklistName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, raiBlocklistName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + /** * Batch operation to add blocklist items. * @@ -967,36 +707,12 @@ public void delete(String resourceGroupName, String accountName, String raiBlock @ServiceMethod(returns = ReturnType.SINGLE) private Mono> batchAddWithResponseAsync(String resourceGroupName, String accountName, String raiBlocklistName, List raiBlocklistItems) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiBlocklistName == null) { - return Mono - .error(new IllegalArgumentException("Parameter raiBlocklistName is required and cannot be null.")); - } - if (raiBlocklistItems == null) { - return Mono - .error(new IllegalArgumentException("Parameter raiBlocklistItems is required and cannot be null.")); - } else { - raiBlocklistItems.forEach(e -> e.validate()); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.batchAdd(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), raiBlocklistName, raiBlocklistItems, - accept, context)) + .withContext(context -> service.batchAdd(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, contentType, accept, + raiBlocklistItems, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1035,38 +751,11 @@ private Mono batchAddAsync(String resourceGroupName, String a @ServiceMethod(returns = ReturnType.SINGLE) public Response batchAddWithResponse(String resourceGroupName, String accountName, String raiBlocklistName, List raiBlocklistItems, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiBlocklistName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter raiBlocklistName is required and cannot be null.")); - } - if (raiBlocklistItems == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter raiBlocklistItems is required and cannot be null.")); - } else { - raiBlocklistItems.forEach(e -> e.validate()); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.batchAddSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), raiBlocklistName, raiBlocklistItems, accept, - context); + return service.batchAddSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, contentType, accept, + raiBlocklistItems, context); } /** @@ -1102,35 +791,12 @@ public RaiBlocklistInner batchAdd(String resourceGroupName, String accountName, */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> batchDeleteWithResponseAsync(String resourceGroupName, String accountName, - String raiBlocklistName, Object raiBlocklistItemsNames) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiBlocklistName == null) { - return Mono - .error(new IllegalArgumentException("Parameter raiBlocklistName is required and cannot be null.")); - } - if (raiBlocklistItemsNames == null) { - return Mono.error( - new IllegalArgumentException("Parameter raiBlocklistItemsNames is required and cannot be null.")); - } - final String accept = "application/json"; + String raiBlocklistName, List raiBlocklistItemsNames) { + final String contentType = "application/json"; return FluxUtil - .withContext(context -> service.batchDelete(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), raiBlocklistName, raiBlocklistItemsNames, - accept, context)) + .withContext(context -> service.batchDelete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, contentType, + raiBlocklistItemsNames, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1148,7 +814,7 @@ private Mono> batchDeleteWithResponseAsync(String resourceGroupNa */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono batchDeleteAsync(String resourceGroupName, String accountName, String raiBlocklistName, - Object raiBlocklistItemsNames) { + List raiBlocklistItemsNames) { return batchDeleteWithResponseAsync(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemsNames) .flatMap(ignored -> Mono.empty()); } @@ -1168,37 +834,11 @@ private Mono batchDeleteAsync(String resourceGroupName, String accountName */ @ServiceMethod(returns = ReturnType.SINGLE) public Response batchDeleteWithResponse(String resourceGroupName, String accountName, String raiBlocklistName, - Object raiBlocklistItemsNames, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiBlocklistName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter raiBlocklistName is required and cannot be null.")); - } - if (raiBlocklistItemsNames == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter raiBlocklistItemsNames is required and cannot be null.")); - } - final String accept = "application/json"; - return service.batchDeleteSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), raiBlocklistName, raiBlocklistItemsNames, - accept, context); + List raiBlocklistItemsNames, Context context) { + final String contentType = "application/json"; + return service.batchDeleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, contentType, + raiBlocklistItemsNames, context); } /** @@ -1214,7 +854,7 @@ public Response batchDeleteWithResponse(String resourceGroupName, String a */ @ServiceMethod(returns = ReturnType.SINGLE) public void batchDelete(String resourceGroupName, String accountName, String raiBlocklistName, - Object raiBlocklistItemsNames) { + List raiBlocklistItemsNames) { batchDeleteWithResponse(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemsNames, Context.NONE); } @@ -1230,13 +870,6 @@ public void batchDelete(String resourceGroupName, String accountName, String rai */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -1255,15 +888,6 @@ private Mono> listNextSinglePageAsync(Strin */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -1283,21 +907,10 @@ private PagedResponse listNextSinglePage(String nextLink) */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(RaiBlocklistItemsClientImpl.class); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistItemsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistItemsImpl.java index b075323336c4..c2c9ef0aa5c8 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistItemsImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistItemsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -31,29 +31,12 @@ public RaiBlocklistItemsImpl(RaiBlocklistItemsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String accountName, String raiBlocklistName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, accountName, raiBlocklistName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RaiBlocklistItemImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String accountName, String raiBlocklistName, - Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, accountName, raiBlocklistName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RaiBlocklistItemImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String accountName, String raiBlocklistName, String raiBlocklistItemName, Context context) { Response inner = this.serviceClient() .getWithResponse(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RaiBlocklistItemImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RaiBlocklistItemImpl(inner.getValue(), this.manager())); } public RaiBlocklistItem get(String resourceGroupName, String accountName, String raiBlocklistName, @@ -77,16 +60,25 @@ public void delete(String resourceGroupName, String accountName, String raiBlock this.serviceClient().delete(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemName, context); } + public PagedIterable list(String resourceGroupName, String accountName, String raiBlocklistName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, accountName, raiBlocklistName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RaiBlocklistItemImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, String raiBlocklistName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, accountName, raiBlocklistName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RaiBlocklistItemImpl(inner1, this.manager())); + } + public Response batchAddWithResponse(String resourceGroupName, String accountName, String raiBlocklistName, List raiBlocklistItems, Context context) { Response inner = this.serviceClient() .batchAddWithResponse(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItems, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RaiBlocklistImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RaiBlocklistImpl(inner.getValue(), this.manager())); } public RaiBlocklist batchAdd(String resourceGroupName, String accountName, String raiBlocklistName, @@ -101,13 +93,13 @@ public RaiBlocklist batchAdd(String resourceGroupName, String accountName, Strin } public Response batchDeleteWithResponse(String resourceGroupName, String accountName, String raiBlocklistName, - Object raiBlocklistItemsNames, Context context) { + List raiBlocklistItemsNames, Context context) { return this.serviceClient() .batchDeleteWithResponse(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemsNames, context); } public void batchDelete(String resourceGroupName, String accountName, String raiBlocklistName, - Object raiBlocklistItemsNames) { + List raiBlocklistItemsNames) { this.serviceClient().batchDelete(resourceGroupName, accountName, raiBlocklistName, raiBlocklistItemsNames); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistsClientImpl.java index 07d18c84adad..6e2b6d9aac8a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistsClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -30,12 +30,11 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.cognitiveservices.fluent.RaiBlocklistsClient; import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiBlocklistInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlockListResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.RaiBlockListResult; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -69,34 +68,16 @@ public final class RaiBlocklistsClientImpl implements RaiBlocklistsClient { * The interface defining all the services for CognitiveServicesManagementClientRaiBlocklists to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CognitiveServicesManagementClientRaiBlocklists") public interface RaiBlocklistsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("raiBlocklistName") String raiBlocklistName, @HeaderParam("Accept") String accept, Context context); @@ -104,232 +85,81 @@ Mono> get(@HostParam("$host") String endpoint, @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("raiBlocklistName") String raiBlocklistName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("raiBlocklistName") String raiBlocklistName, - @BodyParam("application/json") RaiBlocklistInner raiBlocklist, @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("raiBlocklistName") String raiBlocklistName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") RaiBlocklistInner raiBlocklist, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("raiBlocklistName") String raiBlocklistName, - @BodyParam("application/json") RaiBlocklistInner raiBlocklist, @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("raiBlocklistName") String raiBlocklistName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") RaiBlocklistInner raiBlocklist, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("raiBlocklistName") String raiBlocklistName, @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("raiBlocklistName") String raiBlocklistName, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists/{raiBlocklistName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("raiBlocklistName") String raiBlocklistName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiBlocklists") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("raiBlocklistName") String raiBlocklistName, @HeaderParam("Accept") String accept, - Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the custom blocklists associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the custom blocklists associated with the Azure OpenAI account along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the custom blocklists associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the custom blocklists associated with the Azure OpenAI account as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the custom blocklists associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the custom blocklists associated with the Azure OpenAI account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the custom blocklists associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the custom blocklists associated with the Azure OpenAI account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, - Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the custom blocklists associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the custom blocklists associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Gets the custom blocklists associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the custom blocklists associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, context), - nextLink -> listNextSinglePage(nextLink, context)); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -347,29 +177,10 @@ public PagedIterable list(String resourceGroupName, String ac @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String accountName, String raiBlocklistName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiBlocklistName == null) { - return Mono - .error(new IllegalArgumentException("Parameter raiBlocklistName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), raiBlocklistName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -406,31 +217,9 @@ private Mono getAsync(String resourceGroupName, String accoun @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String accountName, String raiBlocklistName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiBlocklistName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter raiBlocklistName is required and cannot be null.")); - } final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), - this.client.getSubscriptionId(), raiBlocklistName, accept, context); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, raiBlocklistName, accept, context); } /** @@ -464,35 +253,12 @@ public RaiBlocklistInner get(String resourceGroupName, String accountName, Strin @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String accountName, String raiBlocklistName, RaiBlocklistInner raiBlocklist) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiBlocklistName == null) { - return Mono - .error(new IllegalArgumentException("Parameter raiBlocklistName is required and cannot be null.")); - } - if (raiBlocklist == null) { - return Mono.error(new IllegalArgumentException("Parameter raiBlocklist is required and cannot be null.")); - } else { - raiBlocklist.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), raiBlocklistName, raiBlocklist, accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, contentType, accept, + raiBlocklist, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -531,38 +297,11 @@ private Mono createOrUpdateAsync(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String accountName, String raiBlocklistName, RaiBlocklistInner raiBlocklist, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiBlocklistName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter raiBlocklistName is required and cannot be null.")); - } - if (raiBlocklist == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter raiBlocklist is required and cannot be null.")); - } else { - raiBlocklist.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), raiBlocklistName, raiBlocklist, accept, - context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, contentType, accept, + raiBlocklist, context); } /** @@ -598,29 +337,9 @@ public RaiBlocklistInner createOrUpdate(String resourceGroupName, String account @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, String raiBlocklistName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiBlocklistName == null) { - return Mono - .error(new IllegalArgumentException("Parameter raiBlocklistName is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), raiBlocklistName, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -638,31 +357,8 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String accountName, String raiBlocklistName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiBlocklistName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter raiBlocklistName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), raiBlocklistName, accept, Context.NONE); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, Context.NONE); } /** @@ -680,31 +376,8 @@ private Response deleteWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String accountName, String raiBlocklistName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiBlocklistName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter raiBlocklistName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), raiBlocklistName, accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiBlocklistName, context); } /** @@ -812,6 +485,120 @@ public void delete(String resourceGroupName, String accountName, String raiBlock beginDelete(resourceGroupName, accountName, raiBlocklistName, context).getFinalResult(); } + /** + * Gets the custom blocklists associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom blocklists associated with the Azure OpenAI account along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the custom blocklists associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom blocklists associated with the Azure OpenAI account as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the custom blocklists associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom blocklists associated with the Azure OpenAI account along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String accountName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets the custom blocklists associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom blocklists associated with the Azure OpenAI account along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String accountName, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets the custom blocklists associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom blocklists associated with the Azure OpenAI account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets the custom blocklists associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom blocklists associated with the Azure OpenAI account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + /** * Get the next page of items. * @@ -824,13 +611,6 @@ public void delete(String resourceGroupName, String accountName, String raiBlock */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), @@ -849,15 +629,6 @@ private Mono> listNextSinglePageAsync(String ne */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -877,20 +648,9 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(RaiBlocklistsClientImpl.class); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistsImpl.java index e6f6a77bdc97..082fd7247c82 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistsImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -27,26 +27,12 @@ public RaiBlocklistsImpl(RaiBlocklistsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String accountName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RaiBlocklistImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RaiBlocklistImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String accountName, String raiBlocklistName, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, accountName, raiBlocklistName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RaiBlocklistImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RaiBlocklistImpl(inner.getValue(), this.manager())); } public RaiBlocklist get(String resourceGroupName, String accountName, String raiBlocklistName) { @@ -66,6 +52,16 @@ public void delete(String resourceGroupName, String accountName, String raiBlock this.serviceClient().delete(resourceGroupName, accountName, raiBlocklistName, context); } + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RaiBlocklistImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RaiBlocklistImpl(inner1, this.manager())); + } + public RaiBlocklist getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiContentFilterImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiContentFilterImpl.java index 797b342f324d..59cac3c032fc 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiContentFilterImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiContentFilterImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiContentFiltersClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiContentFiltersClientImpl.java index 85f0ee11d0f6..12cb6c4d4727 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiContentFiltersClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiContentFiltersClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -25,10 +25,9 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.cognitiveservices.fluent.RaiContentFiltersClient; import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiContentFilterInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiContentFilterListResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.RaiContentFilterListResult; import reactor.core.publisher.Mono; /** @@ -60,49 +59,49 @@ public final class RaiContentFiltersClientImpl implements RaiContentFiltersClien * The interface defining all the services for CognitiveServicesManagementClientRaiContentFilters to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CognitiveServicesManagementClientRaiContentFilters") public interface RaiContentFiltersService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/raiContentFilters") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/raiContentFilters/{filterName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("filterName") String filterName, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/raiContentFilters") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/raiContentFilters/{filterName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("filterName") String filterName, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/raiContentFilters/{filterName}") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/raiContentFilters") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @PathParam("location") String location, @PathParam("filterName") String filterName, - @HeaderParam("Accept") String accept, Context context); + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/raiContentFilters/{filterName}") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/raiContentFilters") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @PathParam("location") String location, @PathParam("filterName") String filterName, - @HeaderParam("Accept") String accept, Context context); + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -110,247 +109,176 @@ Mono> listNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * List Content Filters types. + * Get Content Filters by Name. * - * @param location Resource location. + * @param location The name of the Azure region. + * @param filterName The name of the RAI Content Filter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Content Filters along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return content Filters by Name along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String location) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } + private Mono> getWithResponseAsync(String location, String filterName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), location, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, filterName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List Content Filters types. + * Get Content Filters by Name. * - * @param location Resource location. + * @param location The name of the Azure region. + * @param filterName The name of the RAI Content Filter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Content Filters as paginated response with {@link PagedFlux}. + * @return content Filters by Name on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String location) { - return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String location, String filterName) { + return getWithResponseAsync(location, filterName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * List Content Filters types. + * Get Content Filters by Name. * - * @param location Resource location. + * @param location The name of the Azure region. + * @param filterName The name of the RAI Content Filter. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Content Filters along with {@link PagedResponse}. + * @return content Filters by Name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String location) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } + public Response getWithResponse(String location, String filterName, Context context) { final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), - this.client.getSubscriptionId(), this.client.getApiVersion(), location, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + location, filterName, accept, context); } /** - * List Content Filters types. + * Get Content Filters by Name. * - * @param location Resource location. - * @param context The context to associate with this operation. + * @param location The name of the Azure region. + * @param filterName The name of the RAI Content Filter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Content Filters along with {@link PagedResponse}. + * @return content Filters by Name. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String location, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), - this.client.getSubscriptionId(), this.client.getApiVersion(), location, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); + public RaiContentFilterInner get(String location, String filterName) { + return getWithResponse(location, filterName, Context.NONE).getValue(); } /** * List Content Filters types. * - * @param location Resource location. + * @param location The name of the Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Content Filters as paginated response with {@link PagedIterable}. + * @return the list of Content Filters along with {@link PagedResponse} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location) { - return new PagedIterable<>(() -> listSinglePage(location), nextLink -> listNextSinglePage(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List Content Filters types. * - * @param location Resource location. - * @param context The context to associate with this operation. + * @param location The name of the Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Content Filters as paginated response with {@link PagedIterable}. + * @return the list of Content Filters as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location, Context context) { - return new PagedIterable<>(() -> listSinglePage(location, context), - nextLink -> listNextSinglePage(nextLink, context)); + private PagedFlux listAsync(String location) { + return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Get Content Filters by Name. + * List Content Filters types. * - * @param location Resource location. - * @param filterName The name of the RAI Content Filter. + * @param location The name of the Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return content Filters by Name along with {@link Response} on successful completion of {@link Mono}. + * @return the list of Content Filters along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String location, String filterName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (filterName == null) { - return Mono.error(new IllegalArgumentException("Parameter filterName is required and cannot be null.")); - } + private PagedResponse listSinglePage(String location) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), location, filterName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Get Content Filters by Name. + * List Content Filters types. * - * @param location Resource location. - * @param filterName The name of the RAI Content Filter. + * @param location The name of the Azure region. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return content Filters by Name on successful completion of {@link Mono}. + * @return the list of Content Filters along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String location, String filterName) { - return getWithResponseAsync(location, filterName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listSinglePage(String location, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Get Content Filters by Name. + * List Content Filters types. * - * @param location Resource location. - * @param filterName The name of the RAI Content Filter. - * @param context The context to associate with this operation. + * @param location The name of the Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return content Filters by Name along with {@link Response}. + * @return the list of Content Filters as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String location, String filterName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (filterName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter filterName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), - location, filterName, accept, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location) { + return new PagedIterable<>(() -> listSinglePage(location), nextLink -> listNextSinglePage(nextLink)); } /** - * Get Content Filters by Name. + * List Content Filters types. * - * @param location Resource location. - * @param filterName The name of the RAI Content Filter. + * @param location The name of the Azure region. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return content Filters by Name. + * @return the list of Content Filters as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RaiContentFilterInner get(String location, String filterName) { - return getWithResponse(location, filterName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, Context context) { + return new PagedIterable<>(() -> listSinglePage(location, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -364,13 +292,6 @@ public RaiContentFilterInner get(String location, String filterName) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -389,15 +310,6 @@ private Mono> listNextSinglePageAsync(Strin */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -417,21 +329,10 @@ private PagedResponse listNextSinglePage(String nextLink) */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(RaiContentFiltersClientImpl.class); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiContentFiltersImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiContentFiltersImpl.java index 0241c56daf66..f810818d8633 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiContentFiltersImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiContentFiltersImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -27,24 +27,10 @@ public RaiContentFiltersImpl(RaiContentFiltersClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String location) { - PagedIterable inner = this.serviceClient().list(location); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RaiContentFilterImpl(inner1, this.manager())); - } - - public PagedIterable list(String location, Context context) { - PagedIterable inner = this.serviceClient().list(location, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RaiContentFilterImpl(inner1, this.manager())); - } - public Response getWithResponse(String location, String filterName, Context context) { Response inner = this.serviceClient().getWithResponse(location, filterName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RaiContentFilterImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RaiContentFilterImpl(inner.getValue(), this.manager())); } public RaiContentFilter get(String location, String filterName) { @@ -56,6 +42,16 @@ public RaiContentFilter get(String location, String filterName) { } } + public PagedIterable list(String location) { + PagedIterable inner = this.serviceClient().list(location); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RaiContentFilterImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RaiContentFilterImpl(inner1, this.manager())); + } + private RaiContentFiltersClient serviceClient() { return this.innerClient; } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProviderImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProviderImpl.java new file mode 100644 index 000000000000..9a4c12d8ea80 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProviderImpl.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderInner; +import com.azure.resourcemanager.cognitiveservices.models.RaiExternalSafetyProvider; +import com.azure.resourcemanager.cognitiveservices.models.RaiExternalSafetyProviderProperties; +import java.util.Collections; +import java.util.Map; + +public final class RaiExternalSafetyProviderImpl implements RaiExternalSafetyProvider { + private RaiExternalSafetyProviderInner innerObject; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + RaiExternalSafetyProviderImpl(RaiExternalSafetyProviderInner innerObject, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public RaiExternalSafetyProviderProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public RaiExternalSafetyProviderInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProviderSchemaImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProviderSchemaImpl.java new file mode 100644 index 000000000000..14303c3cbe47 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProviderSchemaImpl.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderSchemaInner; +import com.azure.resourcemanager.cognitiveservices.models.RaiExternalSafetyProviderSchema; +import com.azure.resourcemanager.cognitiveservices.models.RaiExternalSafetyProviderSchemaProperties; +import java.util.Collections; +import java.util.Map; + +public final class RaiExternalSafetyProviderSchemaImpl implements RaiExternalSafetyProviderSchema, + RaiExternalSafetyProviderSchema.Definition, RaiExternalSafetyProviderSchema.Update { + private RaiExternalSafetyProviderSchemaInner innerObject; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public RaiExternalSafetyProviderSchemaProperties properties() { + return this.innerModel().properties(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public RaiExternalSafetyProviderSchemaInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String safetyProviderName; + + public RaiExternalSafetyProviderSchemaImpl withExistingAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public RaiExternalSafetyProviderSchema create() { + this.innerObject = serviceManager.serviceClient() + .getTestRaiExternalSafetyProviders() + .createOrUpdateWithResponse(resourceGroupName, accountName, safetyProviderName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public RaiExternalSafetyProviderSchema create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getTestRaiExternalSafetyProviders() + .createOrUpdateWithResponse(resourceGroupName, accountName, safetyProviderName, this.innerModel(), context) + .getValue(); + return this; + } + + RaiExternalSafetyProviderSchemaImpl(String name, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = new RaiExternalSafetyProviderSchemaInner(); + this.serviceManager = serviceManager; + this.safetyProviderName = name; + } + + public RaiExternalSafetyProviderSchemaImpl update() { + return this; + } + + public RaiExternalSafetyProviderSchema apply() { + this.innerObject = serviceManager.serviceClient() + .getTestRaiExternalSafetyProviders() + .createOrUpdateWithResponse(resourceGroupName, accountName, safetyProviderName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public RaiExternalSafetyProviderSchema apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getTestRaiExternalSafetyProviders() + .createOrUpdateWithResponse(resourceGroupName, accountName, safetyProviderName, this.innerModel(), context) + .getValue(); + return this; + } + + RaiExternalSafetyProviderSchemaImpl(RaiExternalSafetyProviderSchemaInner innerObject, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); + this.safetyProviderName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "testRaiExternalSafetyProvider"); + } + + public RaiExternalSafetyProviderSchemaImpl withProperties(RaiExternalSafetyProviderSchemaProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersClientImpl.java new file mode 100644 index 000000000000..8a5e53114592 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersClientImpl.java @@ -0,0 +1,415 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cognitiveservices.fluent.RaiExternalSafetyProvidersClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderSchemaInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RaiExternalSafetyProvidersClient. + */ +public final class RaiExternalSafetyProvidersClientImpl implements RaiExternalSafetyProvidersClient { + /** + * The proxy service used to perform REST calls. + */ + private final RaiExternalSafetyProvidersService service; + + /** + * The service client containing this operation class. + */ + private final CognitiveServicesManagementClientImpl client; + + /** + * Initializes an instance of RaiExternalSafetyProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RaiExternalSafetyProvidersClientImpl(CognitiveServicesManagementClientImpl client) { + this.service = RestProxy.create(RaiExternalSafetyProvidersService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CognitiveServicesManagementClientRaiExternalSafetyProviders to be + * used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CognitiveServicesManagementClientRaiExternalSafetyProviders") + public interface RaiExternalSafetyProvidersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiExternalSafetyProviders/{safetyProviderName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("safetyProviderName") String safetyProviderName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiExternalSafetyProviders/{safetyProviderName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("safetyProviderName") String safetyProviderName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiExternalSafetyProviders/{safetyProviderName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("safetyProviderName") String safetyProviderName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") RaiExternalSafetyProviderSchemaInner safetyProvider, Context context); + + @Put("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiExternalSafetyProviders/{safetyProviderName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("safetyProviderName") String safetyProviderName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") RaiExternalSafetyProviderSchemaInner safetyProvider, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiExternalSafetyProviders/{safetyProviderName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("safetyProviderName") String safetyProviderName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiExternalSafetyProviders/{safetyProviderName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("safetyProviderName") String safetyProviderName, Context context); + } + + /** + * Gets the specified external safety provider associated with the Subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified external safety provider associated with the Subscription along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String safetyProviderName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), safetyProviderName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified external safety provider associated with the Subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified external safety provider associated with the Subscription on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String safetyProviderName) { + return getWithResponseAsync(safetyProviderName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the specified external safety provider associated with the Subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified external safety provider associated with the Subscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String safetyProviderName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + safetyProviderName, accept, context); + } + + /** + * Gets the specified external safety provider associated with the Subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified external safety provider associated with the Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RaiExternalSafetyProviderSchemaInner get(String safetyProviderName) { + return getWithResponse(safetyProviderName, Context.NONE).getValue(); + } + + /** + * Create the rai safety provider associated with the subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @param safetyProvider Properties describing the rai external safety provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services Rai External Safety provider Schema along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String safetyProviderName, + RaiExternalSafetyProviderSchemaInner safetyProvider) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), safetyProviderName, contentType, accept, safetyProvider, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create the rai safety provider associated with the subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @param safetyProvider Properties describing the rai external safety provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services Rai External Safety provider Schema on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String safetyProviderName, + RaiExternalSafetyProviderSchemaInner safetyProvider) { + return createOrUpdateWithResponseAsync(safetyProviderName, safetyProvider) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create the rai safety provider associated with the subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @param safetyProvider Properties describing the rai external safety provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services Rai External Safety provider Schema along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String safetyProviderName, + RaiExternalSafetyProviderSchemaInner safetyProvider, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), safetyProviderName, contentType, accept, safetyProvider, context); + } + + /** + * Create the rai safety provider associated with the subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @param safetyProvider Properties describing the rai external safety provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services Rai External Safety provider Schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProxyResource createOrUpdate(String safetyProviderName, + RaiExternalSafetyProviderSchemaInner safetyProvider) { + return createOrUpdateWithResponse(safetyProviderName, safetyProvider, Context.NONE).getValue(); + } + + /** + * Deletes the specified custom topic associated with the subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String safetyProviderName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), safetyProviderName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified custom topic associated with the subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String safetyProviderName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), safetyProviderName, Context.NONE); + } + + /** + * Deletes the specified custom topic associated with the subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String safetyProviderName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), safetyProviderName, context); + } + + /** + * Deletes the specified custom topic associated with the subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String safetyProviderName) { + Mono>> mono = deleteWithResponseAsync(safetyProviderName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes the specified custom topic associated with the subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String safetyProviderName) { + Response response = deleteWithResponse(safetyProviderName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified custom topic associated with the subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String safetyProviderName, Context context) { + Response response = deleteWithResponse(safetyProviderName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Deletes the specified custom topic associated with the subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String safetyProviderName) { + return beginDeleteAsync(safetyProviderName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified custom topic associated with the subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String safetyProviderName) { + beginDelete(safetyProviderName).getFinalResult(); + } + + /** + * Deletes the specified custom topic associated with the subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String safetyProviderName, Context context) { + beginDelete(safetyProviderName, context).getFinalResult(); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersImpl.java new file mode 100644 index 000000000000..c7ce563844c6 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersImpl.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cognitiveservices.fluent.RaiExternalSafetyProvidersClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderSchemaInner; +import com.azure.resourcemanager.cognitiveservices.models.RaiExternalSafetyProviderSchema; +import com.azure.resourcemanager.cognitiveservices.models.RaiExternalSafetyProviders; + +public final class RaiExternalSafetyProvidersImpl implements RaiExternalSafetyProviders { + private static final ClientLogger LOGGER = new ClientLogger(RaiExternalSafetyProvidersImpl.class); + + private final RaiExternalSafetyProvidersClient innerClient; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + public RaiExternalSafetyProvidersImpl(RaiExternalSafetyProvidersClient innerClient, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String safetyProviderName, Context context) { + Response inner + = this.serviceClient().getWithResponse(safetyProviderName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RaiExternalSafetyProviderSchemaImpl(inner.getValue(), this.manager())); + } + + public RaiExternalSafetyProviderSchema get(String safetyProviderName) { + RaiExternalSafetyProviderSchemaInner inner = this.serviceClient().get(safetyProviderName); + if (inner != null) { + return new RaiExternalSafetyProviderSchemaImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse(String safetyProviderName, + RaiExternalSafetyProviderSchemaInner safetyProvider, Context context) { + return this.serviceClient().createOrUpdateWithResponse(safetyProviderName, safetyProvider, context); + } + + public ProxyResource createOrUpdate(String safetyProviderName, + RaiExternalSafetyProviderSchemaInner safetyProvider) { + return this.serviceClient().createOrUpdate(safetyProviderName, safetyProvider); + } + + public void delete(String safetyProviderName) { + this.serviceClient().delete(safetyProviderName); + } + + public void delete(String safetyProviderName, Context context) { + this.serviceClient().delete(safetyProviderName, context); + } + + private RaiExternalSafetyProvidersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersOperationsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersOperationsClientImpl.java new file mode 100644 index 000000000000..e4d4461efd16 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersOperationsClientImpl.java @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.cognitiveservices.fluent.RaiExternalSafetyProvidersOperationsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderSchemaInner; +import com.azure.resourcemanager.cognitiveservices.implementation.models.RaiExternalSafetyProviderResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * RaiExternalSafetyProvidersOperationsClient. + */ +public final class RaiExternalSafetyProvidersOperationsClientImpl + implements RaiExternalSafetyProvidersOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final RaiExternalSafetyProvidersOperationsService service; + + /** + * The service client containing this operation class. + */ + private final CognitiveServicesManagementClientImpl client; + + /** + * Initializes an instance of RaiExternalSafetyProvidersOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RaiExternalSafetyProvidersOperationsClientImpl(CognitiveServicesManagementClientImpl client) { + this.service = RestProxy.create(RaiExternalSafetyProvidersOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CognitiveServicesManagementClientRaiExternalSafetyProvidersOperations + * to be used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CognitiveServicesManagementClientRaiExternalSafetyProvidersOperations") + public interface RaiExternalSafetyProvidersOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiExternalSafetyProviders") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiExternalSafetyProviders") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the safety providers associated with the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the safety providers associated with the subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the safety providers associated with the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the safety providers associated with the subscription as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the safety providers associated with the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the safety providers associated with the subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets the safety providers associated with the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the safety providers associated with the subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets the safety providers associated with the subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the safety providers associated with the subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets the safety providers associated with the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the safety providers associated with the subscription as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the safety providers associated with the subscription along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the safety providers associated with the subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the safety providers associated with the subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersOperationsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersOperationsImpl.java new file mode 100644 index 000000000000..cc1ec85b92c7 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersOperationsImpl.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cognitiveservices.fluent.RaiExternalSafetyProvidersOperationsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderSchemaInner; +import com.azure.resourcemanager.cognitiveservices.models.RaiExternalSafetyProviderSchema; +import com.azure.resourcemanager.cognitiveservices.models.RaiExternalSafetyProvidersOperations; + +public final class RaiExternalSafetyProvidersOperationsImpl implements RaiExternalSafetyProvidersOperations { + private static final ClientLogger LOGGER = new ClientLogger(RaiExternalSafetyProvidersOperationsImpl.class); + + private final RaiExternalSafetyProvidersOperationsClient innerClient; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + public RaiExternalSafetyProvidersOperationsImpl(RaiExternalSafetyProvidersOperationsClient innerClient, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new RaiExternalSafetyProviderSchemaImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new RaiExternalSafetyProviderSchemaImpl(inner1, this.manager())); + } + + private RaiExternalSafetyProvidersOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiPoliciesClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiPoliciesClientImpl.java index d5d52bd439dc..18707212ee39 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiPoliciesClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiPoliciesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -30,12 +30,11 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.cognitiveservices.fluent.RaiPoliciesClient; import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiPolicyInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyListResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.RaiPolicyListResult; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -69,261 +68,96 @@ public final class RaiPoliciesClientImpl implements RaiPoliciesClient { * The interface defining all the services for CognitiveServicesManagementClientRaiPolicies to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CognitiveServicesManagementClientRaiPolicies") public interface RaiPoliciesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiPolicies") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiPolicies") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiPolicies/{raiPolicyName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("raiPolicyName") String raiPolicyName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiPolicies/{raiPolicyName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("raiPolicyName") String raiPolicyName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiPolicies/{raiPolicyName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("raiPolicyName") String raiPolicyName, @BodyParam("application/json") RaiPolicyInner raiPolicy, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("raiPolicyName") String raiPolicyName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") RaiPolicyInner raiPolicy, + Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiPolicies/{raiPolicyName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("raiPolicyName") String raiPolicyName, @BodyParam("application/json") RaiPolicyInner raiPolicy, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("raiPolicyName") String raiPolicyName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") RaiPolicyInner raiPolicy, + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiPolicies/{raiPolicyName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("raiPolicyName") String raiPolicyName, @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("raiPolicyName") String raiPolicyName, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiPolicies/{raiPolicyName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("raiPolicyName") String raiPolicyName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiPolicies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiPolicies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("raiPolicyName") String raiPolicyName, @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String resourceGroupName, String accountName, - Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); - } - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), - nextLink -> listNextSinglePage(nextLink)); - } - - /** - * Gets the content filters associated with the Azure OpenAI account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, context), - nextLink -> listNextSinglePage(nextLink, context)); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -341,28 +175,10 @@ public PagedIterable list(String resourceGroupName, String accou @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String accountName, String raiPolicyName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiPolicyName == null) { - return Mono.error(new IllegalArgumentException("Parameter raiPolicyName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), raiPolicyName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiPolicyName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -399,31 +215,9 @@ private Mono getAsync(String resourceGroupName, String accountNa @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String accountName, String raiPolicyName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiPolicyName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter raiPolicyName is required and cannot be null.")); - } final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), - this.client.getSubscriptionId(), raiPolicyName, accept, context); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, raiPolicyName, accept, context); } /** @@ -457,34 +251,12 @@ public RaiPolicyInner get(String resourceGroupName, String accountName, String r @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String accountName, String raiPolicyName, RaiPolicyInner raiPolicy) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiPolicyName == null) { - return Mono.error(new IllegalArgumentException("Parameter raiPolicyName is required and cannot be null.")); - } - if (raiPolicy == null) { - return Mono.error(new IllegalArgumentException("Parameter raiPolicy is required and cannot be null.")); - } else { - raiPolicy.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), raiPolicyName, raiPolicy, accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiPolicyName, contentType, accept, + raiPolicy, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -523,37 +295,11 @@ private Mono createOrUpdateAsync(String resourceGroupName, Strin @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String accountName, String raiPolicyName, RaiPolicyInner raiPolicy, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiPolicyName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter raiPolicyName is required and cannot be null.")); - } - if (raiPolicy == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter raiPolicy is required and cannot be null.")); - } else { - raiPolicy.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), raiPolicyName, raiPolicy, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiPolicyName, contentType, accept, + raiPolicy, context); } /** @@ -589,28 +335,9 @@ public RaiPolicyInner createOrUpdate(String resourceGroupName, String accountNam @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, String raiPolicyName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiPolicyName == null) { - return Mono.error(new IllegalArgumentException("Parameter raiPolicyName is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), raiPolicyName, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiPolicyName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -628,31 +355,8 @@ private Mono>> deleteWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String accountName, String raiPolicyName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiPolicyName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter raiPolicyName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), raiPolicyName, accept, Context.NONE); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiPolicyName, Context.NONE); } /** @@ -670,31 +374,8 @@ private Response deleteWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String accountName, String raiPolicyName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiPolicyName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter raiPolicyName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), raiPolicyName, accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiPolicyName, context); } /** @@ -801,6 +482,120 @@ public void delete(String resourceGroupName, String accountName, String raiPolic beginDelete(resourceGroupName, accountName, raiPolicyName, context).getFinalResult(); } + /** + * Gets the content filters associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the content filters associated with the Azure OpenAI account along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the content filters associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the content filters associated with the Azure OpenAI account as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets the content filters associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the content filters associated with the Azure OpenAI account along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String accountName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets the content filters associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the content filters associated with the Azure OpenAI account along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String accountName, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets the content filters associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the content filters associated with the Azure OpenAI account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Gets the content filters associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the content filters associated with the Azure OpenAI account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + /** * Get the next page of items. * @@ -813,13 +608,6 @@ public void delete(String resourceGroupName, String accountName, String raiPolic */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), @@ -838,15 +626,6 @@ private Mono> listNextSinglePageAsync(String nextL */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -866,20 +645,9 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(RaiPoliciesClientImpl.class); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiPoliciesImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiPoliciesImpl.java index d5a00e059528..4dc60d07cbe5 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiPoliciesImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiPoliciesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -27,26 +27,12 @@ public RaiPoliciesImpl(RaiPoliciesClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceGroupName, String accountName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RaiPolicyImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new RaiPolicyImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceGroupName, String accountName, String raiPolicyName, Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, accountName, raiPolicyName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RaiPolicyImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RaiPolicyImpl(inner.getValue(), this.manager())); } public RaiPolicy get(String resourceGroupName, String accountName, String raiPolicyName) { @@ -66,6 +52,16 @@ public void delete(String resourceGroupName, String accountName, String raiPolic this.serviceClient().delete(resourceGroupName, accountName, raiPolicyName, context); } + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RaiPolicyImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RaiPolicyImpl(inner1, this.manager())); + } + public RaiPolicy getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiPolicyImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiPolicyImpl.java index c22ba8b43151..c25bc5dc0472 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiPolicyImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiPolicyImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -29,6 +29,10 @@ public String type() { return this.innerModel().type(); } + public RaiPolicyProperties properties() { + return this.innerModel().properties(); + } + public String etag() { return this.innerModel().etag(); } @@ -42,10 +46,6 @@ public Map tags() { } } - public RaiPolicyProperties properties() { - return this.innerModel().properties(); - } - public SystemData systemData() { return this.innerModel().systemData(); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiToolLabelImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiToolLabelImpl.java new file mode 100644 index 000000000000..6dd847083356 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiToolLabelImpl.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiToolLabelInner; +import com.azure.resourcemanager.cognitiveservices.models.RaiToolLabel; +import com.azure.resourcemanager.cognitiveservices.models.RaiToolLabelProperties; +import java.util.Collections; +import java.util.Map; + +public final class RaiToolLabelImpl implements RaiToolLabel, RaiToolLabel.Definition, RaiToolLabel.Update { + private RaiToolLabelInner innerObject; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public RaiToolLabelProperties properties() { + return this.innerModel().properties(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public RaiToolLabelInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String accountName; + + private String raiToolConnectionName; + + public RaiToolLabelImpl withExistingAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + public RaiToolLabel create() { + this.innerObject = serviceManager.serviceClient() + .getRaiToolLabels() + .createOrUpdateWithResponse(resourceGroupName, accountName, raiToolConnectionName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public RaiToolLabel create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRaiToolLabels() + .createOrUpdateWithResponse(resourceGroupName, accountName, raiToolConnectionName, this.innerModel(), + context) + .getValue(); + return this; + } + + RaiToolLabelImpl(String name, com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = new RaiToolLabelInner(); + this.serviceManager = serviceManager; + this.raiToolConnectionName = name; + } + + public RaiToolLabelImpl update() { + return this; + } + + public RaiToolLabel apply() { + this.innerObject = serviceManager.serviceClient() + .getRaiToolLabels() + .createOrUpdateWithResponse(resourceGroupName, accountName, raiToolConnectionName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public RaiToolLabel apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRaiToolLabels() + .createOrUpdateWithResponse(resourceGroupName, accountName, raiToolConnectionName, this.innerModel(), + context) + .getValue(); + return this; + } + + RaiToolLabelImpl(RaiToolLabelInner innerObject, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); + this.raiToolConnectionName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "raiToolLabels"); + } + + public RaiToolLabel refresh() { + this.innerObject = serviceManager.serviceClient() + .getRaiToolLabels() + .getWithResponse(resourceGroupName, accountName, raiToolConnectionName, Context.NONE) + .getValue(); + return this; + } + + public RaiToolLabel refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getRaiToolLabels() + .getWithResponse(resourceGroupName, accountName, raiToolConnectionName, context) + .getValue(); + return this; + } + + public RaiToolLabelImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public RaiToolLabelImpl withProperties(RaiToolLabelProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiToolLabelsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiToolLabelsClientImpl.java new file mode 100644 index 000000000000..95b7fbc69d4d --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiToolLabelsClientImpl.java @@ -0,0 +1,655 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cognitiveservices.fluent.RaiToolLabelsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiToolLabelInner; +import com.azure.resourcemanager.cognitiveservices.implementation.models.RaiToolLabelResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RaiToolLabelsClient. + */ +public final class RaiToolLabelsClientImpl implements RaiToolLabelsClient { + /** + * The proxy service used to perform REST calls. + */ + private final RaiToolLabelsService service; + + /** + * The service client containing this operation class. + */ + private final CognitiveServicesManagementClientImpl client; + + /** + * Initializes an instance of RaiToolLabelsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RaiToolLabelsClientImpl(CognitiveServicesManagementClientImpl client) { + this.service + = RestProxy.create(RaiToolLabelsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CognitiveServicesManagementClientRaiToolLabels to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CognitiveServicesManagementClientRaiToolLabels") + public interface RaiToolLabelsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiToolLabels/{raiToolConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("raiToolConnectionName") String raiToolConnectionName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiToolLabels/{raiToolConnectionName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("raiToolConnectionName") String raiToolConnectionName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiToolLabels/{raiToolConnectionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("raiToolConnectionName") String raiToolConnectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RaiToolLabelInner raiToolLabel, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiToolLabels/{raiToolConnectionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("raiToolConnectionName") String raiToolConnectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RaiToolLabelInner raiToolLabel, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiToolLabels/{raiToolConnectionName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("raiToolConnectionName") String raiToolConnectionName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiToolLabels/{raiToolConnectionName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("raiToolConnectionName") String raiToolConnectionName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiToolLabels") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raiToolLabels") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the specified RAI Tool Label associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiToolConnectionName The name of the Rai Tool Label. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified RAI Tool Label associated with the Azure OpenAI account along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String raiToolConnectionName) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiToolConnectionName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified RAI Tool Label associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiToolConnectionName The name of the Rai Tool Label. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified RAI Tool Label associated with the Azure OpenAI account on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, + String raiToolConnectionName) { + return getWithResponseAsync(resourceGroupName, accountName, raiToolConnectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the specified RAI Tool Label associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiToolConnectionName The name of the Rai Tool Label. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified RAI Tool Label associated with the Azure OpenAI account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, + String raiToolConnectionName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, raiToolConnectionName, accept, context); + } + + /** + * Gets the specified RAI Tool Label associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiToolConnectionName The name of the Rai Tool Label. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified RAI Tool Label associated with the Azure OpenAI account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RaiToolLabelInner get(String resourceGroupName, String accountName, String raiToolConnectionName) { + return getWithResponse(resourceGroupName, accountName, raiToolConnectionName, Context.NONE).getValue(); + } + + /** + * Creates the RAI Tool Label associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiToolConnectionName The name of the Rai Tool Label. + * @param raiToolLabel Properties describing the RAI Tool Label. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services RAI Tool Label resource along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String accountName, String raiToolConnectionName, RaiToolLabelInner raiToolLabel) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiToolConnectionName, contentType, + accept, raiToolLabel, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates the RAI Tool Label associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiToolConnectionName The name of the Rai Tool Label. + * @param raiToolLabel Properties describing the RAI Tool Label. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services RAI Tool Label resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String accountName, + String raiToolConnectionName, RaiToolLabelInner raiToolLabel) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, raiToolConnectionName, raiToolLabel) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates the RAI Tool Label associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiToolConnectionName The name of the Rai Tool Label. + * @param raiToolLabel Properties describing the RAI Tool Label. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services RAI Tool Label resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String accountName, + String raiToolConnectionName, RaiToolLabelInner raiToolLabel, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiToolConnectionName, contentType, accept, + raiToolLabel, context); + } + + /** + * Creates the RAI Tool Label associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiToolConnectionName The name of the Rai Tool Label. + * @param raiToolLabel Properties describing the RAI Tool Label. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services RAI Tool Label resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RaiToolLabelInner createOrUpdate(String resourceGroupName, String accountName, String raiToolConnectionName, + RaiToolLabelInner raiToolLabel) { + return createOrUpdateWithResponse(resourceGroupName, accountName, raiToolConnectionName, raiToolLabel, + Context.NONE).getValue(); + } + + /** + * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiToolConnectionName The name of the Rai Tool Label. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, + String raiToolConnectionName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiToolConnectionName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiToolConnectionName The name of the Rai Tool Label. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String accountName, + String raiToolConnectionName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiToolConnectionName, Context.NONE); + } + + /** + * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiToolConnectionName The name of the Rai Tool Label. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String accountName, + String raiToolConnectionName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiToolConnectionName, context); + } + + /** + * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiToolConnectionName The name of the Rai Tool Label. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String accountName, + String raiToolConnectionName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, accountName, raiToolConnectionName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiToolConnectionName The name of the Rai Tool Label. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String raiToolConnectionName) { + Response response = deleteWithResponse(resourceGroupName, accountName, raiToolConnectionName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiToolConnectionName The name of the Rai Tool Label. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + String raiToolConnectionName, Context context) { + Response response + = deleteWithResponse(resourceGroupName, accountName, raiToolConnectionName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiToolConnectionName The name of the Rai Tool Label. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String accountName, String raiToolConnectionName) { + return beginDeleteAsync(resourceGroupName, accountName, raiToolConnectionName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiToolConnectionName The name of the Rai Tool Label. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String raiToolConnectionName) { + beginDelete(resourceGroupName, accountName, raiToolConnectionName).getFinalResult(); + } + + /** + * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiToolConnectionName The name of the Rai Tool Label. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String accountName, String raiToolConnectionName, Context context) { + beginDelete(resourceGroupName, accountName, raiToolConnectionName, context).getFinalResult(); + } + + /** + * Lists all RAI Tool Labels associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Cognitive Services RAI Tool Labels along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all RAI Tool Labels associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Cognitive Services RAI Tool Labels as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all RAI Tool Labels associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Cognitive Services RAI Tool Labels along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String accountName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all RAI Tool Labels associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Cognitive Services RAI Tool Labels along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String accountName, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all RAI Tool Labels associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Cognitive Services RAI Tool Labels as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Lists all RAI Tool Labels associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Cognitive Services RAI Tool Labels as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, accountName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Cognitive Services RAI Tool Labels along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Cognitive Services RAI Tool Labels along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Cognitive Services RAI Tool Labels along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiToolLabelsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiToolLabelsImpl.java new file mode 100644 index 000000000000..ca64c4366790 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiToolLabelsImpl.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cognitiveservices.fluent.RaiToolLabelsClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiToolLabelInner; +import com.azure.resourcemanager.cognitiveservices.models.RaiToolLabel; +import com.azure.resourcemanager.cognitiveservices.models.RaiToolLabels; + +public final class RaiToolLabelsImpl implements RaiToolLabels { + private static final ClientLogger LOGGER = new ClientLogger(RaiToolLabelsImpl.class); + + private final RaiToolLabelsClient innerClient; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + public RaiToolLabelsImpl(RaiToolLabelsClient innerClient, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String accountName, + String raiToolConnectionName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, accountName, raiToolConnectionName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RaiToolLabelImpl(inner.getValue(), this.manager())); + } + + public RaiToolLabel get(String resourceGroupName, String accountName, String raiToolConnectionName) { + RaiToolLabelInner inner = this.serviceClient().get(resourceGroupName, accountName, raiToolConnectionName); + if (inner != null) { + return new RaiToolLabelImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String accountName, String raiToolConnectionName) { + this.serviceClient().delete(resourceGroupName, accountName, raiToolConnectionName); + } + + public void delete(String resourceGroupName, String accountName, String raiToolConnectionName, Context context) { + this.serviceClient().delete(resourceGroupName, accountName, raiToolConnectionName, context); + } + + public PagedIterable list(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RaiToolLabelImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RaiToolLabelImpl(inner1, this.manager())); + } + + public RaiToolLabel getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String raiToolConnectionName = ResourceManagerUtils.getValueFromIdByName(id, "raiToolLabels"); + if (raiToolConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'raiToolLabels'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, raiToolConnectionName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String raiToolConnectionName = ResourceManagerUtils.getValueFromIdByName(id, "raiToolLabels"); + if (raiToolConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'raiToolLabels'.", id))); + } + return this.getWithResponse(resourceGroupName, accountName, raiToolConnectionName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String raiToolConnectionName = ResourceManagerUtils.getValueFromIdByName(id, "raiToolLabels"); + if (raiToolConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'raiToolLabels'.", id))); + } + this.delete(resourceGroupName, accountName, raiToolConnectionName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + } + String raiToolConnectionName = ResourceManagerUtils.getValueFromIdByName(id, "raiToolLabels"); + if (raiToolConnectionName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'raiToolLabels'.", id))); + } + this.delete(resourceGroupName, accountName, raiToolConnectionName, context); + } + + private RaiToolLabelsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } + + public RaiToolLabelImpl define(String name) { + return new RaiToolLabelImpl(name, this.manager()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiTopicImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiTopicImpl.java index 86196839369c..7edc4492b49d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiTopicImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiTopicImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -29,6 +29,10 @@ public String type() { return this.innerModel().type(); } + public RaiTopicProperties properties() { + return this.innerModel().properties(); + } + public String etag() { return this.innerModel().etag(); } @@ -42,10 +46,6 @@ public Map tags() { } } - public RaiTopicProperties properties() { - return this.innerModel().properties(); - } - public SystemData systemData() { return this.innerModel().systemData(); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiTopicsClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiTopicsClientImpl.java index 609b5d35b930..4d6e4fb3f5fa 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiTopicsClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiTopicsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -30,12 +30,11 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.cognitiveservices.fluent.RaiTopicsClient; import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiTopicInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiTopicResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.RaiTopicResult; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -69,81 +68,81 @@ public final class RaiTopicsClientImpl implements RaiTopicsClient { * The interface defining all the services for CognitiveServicesManagementClientRaiTopics to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CognitiveServicesManagementClientRaiTopics") public interface RaiTopicsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raitopics/{raiTopicName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("raiTopicName") String raiTopicName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raitopics/{raiTopicName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response getSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response getSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("raiTopicName") String raiTopicName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raitopics/{raiTopicName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("raiTopicName") String raiTopicName, @BodyParam("application/json") RaiTopicInner raiTopic, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("raiTopicName") String raiTopicName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") RaiTopicInner raiTopic, + Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raitopics/{raiTopicName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response createOrUpdateSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("raiTopicName") String raiTopicName, @BodyParam("application/json") RaiTopicInner raiTopic, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("raiTopicName") String raiTopicName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") RaiTopicInner raiTopic, + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raitopics/{raiTopicName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono>> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("raiTopicName") String raiTopicName, @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("raiTopicName") String raiTopicName, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raitopics/{raiTopicName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("raiTopicName") String raiTopicName, @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("raiTopicName") String raiTopicName, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raitopics") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/raitopics") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -151,14 +150,14 @@ Response listSync(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -176,28 +175,10 @@ Response listNextSync(@PathParam(value = "nextLink", encoded = t @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String resourceGroupName, String accountName, String raiTopicName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiTopicName == null) { - return Mono.error(new IllegalArgumentException("Parameter raiTopicName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), raiTopicName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiTopicName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -234,31 +215,9 @@ private Mono getAsync(String resourceGroupName, String accountNam @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String accountName, String raiTopicName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiTopicName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter raiTopicName is required and cannot be null.")); - } final String accept = "application/json"; - return service.getSync(this.client.getEndpoint(), resourceGroupName, accountName, this.client.getApiVersion(), - this.client.getSubscriptionId(), raiTopicName, accept, context); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, raiTopicName, accept, context); } /** @@ -292,33 +251,12 @@ public RaiTopicInner get(String resourceGroupName, String accountName, String ra @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, String accountName, String raiTopicName, RaiTopicInner raiTopic) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiTopicName == null) { - return Mono.error(new IllegalArgumentException("Parameter raiTopicName is required and cannot be null.")); - } - if (raiTopic == null) { - return Mono.error(new IllegalArgumentException("Parameter raiTopic is required and cannot be null.")); - } else { - raiTopic.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), raiTopicName, raiTopic, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiTopicName, contentType, accept, + raiTopic, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -357,37 +295,11 @@ private Mono createOrUpdateAsync(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String accountName, String raiTopicName, RaiTopicInner raiTopic, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiTopicName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter raiTopicName is required and cannot be null.")); - } - if (raiTopic == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter raiTopic is required and cannot be null.")); - } else { - raiTopic.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), raiTopicName, raiTopic, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiTopicName, contentType, accept, + raiTopic, context); } /** @@ -423,28 +335,9 @@ public RaiTopicInner createOrUpdate(String resourceGroupName, String accountName @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, String raiTopicName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiTopicName == null) { - return Mono.error(new IllegalArgumentException("Parameter raiTopicName is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), raiTopicName, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiTopicName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -461,31 +354,8 @@ private Mono>> deleteWithResponseAsync(String resource */ @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String accountName, String raiTopicName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiTopicName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter raiTopicName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), raiTopicName, accept, Context.NONE); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiTopicName, Context.NONE); } /** @@ -503,31 +373,8 @@ private Response deleteWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String accountName, String raiTopicName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (raiTopicName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter raiTopicName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), raiTopicName, accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, raiTopicName, context); } /** @@ -647,25 +494,10 @@ public void delete(String resourceGroupName, String accountName, String raiTopic */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -699,27 +531,9 @@ private PagedFlux listAsync(String resourceGroupName, String acco */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String accountName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -737,27 +551,9 @@ private PagedResponse listSinglePage(String resourceGroupName, St */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(String resourceGroupName, String accountName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (accountName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), resourceGroupName, accountName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -809,13 +605,6 @@ public PagedIterable list(String resourceGroupName, String accoun */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), @@ -834,15 +623,6 @@ private Mono> listNextSinglePageAsync(String nextLi */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), @@ -861,20 +641,9 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(RaiTopicsClientImpl.class); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiTopicsImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiTopicsImpl.java index 3cdf53d63aaf..d364798a5675 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiTopicsImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiTopicsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -31,12 +31,8 @@ public Response getWithResponse(String resourceGroupName, String accou Context context) { Response inner = this.serviceClient().getWithResponse(resourceGroupName, accountName, raiTopicName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RaiTopicImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RaiTopicImpl(inner.getValue(), this.manager())); } public RaiTopic get(String resourceGroupName, String accountName, String raiTopicName) { diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceManagerUtils.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceManagerUtils.java index 9d6173eb2142..0cb33dfe025e 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceManagerUtils.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceManagerUtils.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceProvidersClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceProvidersClientImpl.java index 77e0380d4709..9f2b60d0aabe 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceProvidersClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceProvidersClientImpl.java @@ -1,13 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; @@ -22,7 +21,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.cognitiveservices.fluent.ResourceProvidersClient; import com.azure.resourcemanager.cognitiveservices.fluent.models.CalculateModelCapacityResultInner; import com.azure.resourcemanager.cognitiveservices.fluent.models.DomainAvailabilityInner; @@ -61,71 +59,65 @@ public final class ResourceProvidersClientImpl implements ResourceProvidersClien * The interface defining all the services for CognitiveServicesManagementClientResourceProviders to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CognitiveServicesManagementClientResourceProviders") public interface ResourceProvidersService { - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/checkSkuAvailability") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkSkuAvailability(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @PathParam("location") String location, - @BodyParam("application/json") CheckSkuAvailabilityParameter parameters, - @HeaderParam("Accept") String accept, Context context); + Mono> checkSkuAvailability(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") CheckSkuAvailabilityParameter parameters, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/checkSkuAvailability") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response checkSkuAvailabilitySync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @PathParam("location") String location, - @BodyParam("application/json") CheckSkuAvailabilityParameter parameters, - @HeaderParam("Accept") String accept, Context context); + Response checkSkuAvailabilitySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") CheckSkuAvailabilityParameter parameters, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/checkDomainAvailability") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkDomainAvailability(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CheckDomainAvailabilityParameter parameters, - @HeaderParam("Accept") String accept, Context context); + Mono> checkDomainAvailability(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CheckDomainAvailabilityParameter parameters, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/checkDomainAvailability") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response checkDomainAvailabilitySync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CheckDomainAvailabilityParameter parameters, - @HeaderParam("Accept") String accept, Context context); + Response checkDomainAvailabilitySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CheckDomainAvailabilityParameter parameters, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/calculateModelCapacity") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> calculateModelCapacity(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CalculateModelCapacityParameter parameters, - @HeaderParam("Accept") String accept, Context context); + Mono> calculateModelCapacity(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CalculateModelCapacityParameter parameters, Context context); - @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/calculateModelCapacity") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response calculateModelCapacitySync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CalculateModelCapacityParameter parameters, - @HeaderParam("Accept") String accept, Context context); + Response calculateModelCapacitySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CalculateModelCapacityParameter parameters, Context context); } /** * Check available SKUs. * - * @param location Resource location. - * @param parameters Check SKU Availability POST body. + * @param location The location name. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -134,34 +126,19 @@ Response calculateModelCapacitySync(@HostPara @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkSkuAvailabilityWithResponseAsync(String location, CheckSkuAvailabilityParameter parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.checkSkuAvailability(this.client.getEndpoint(), - this.client.getSubscriptionId(), this.client.getApiVersion(), location, parameters, accept, context)) + .withContext(context -> service.checkSkuAvailability(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Check available SKUs. * - * @param location Resource location. - * @param parameters Check SKU Availability POST body. + * @param location The location name. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -177,8 +154,8 @@ private Mono checkSkuAvailabilityAsync(String lo /** * Check available SKUs. * - * @param location Resource location. - * @param parameters Check SKU Availability POST body. + * @param location The location name. + * @param parameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -188,36 +165,17 @@ private Mono checkSkuAvailabilityAsync(String lo @ServiceMethod(returns = ReturnType.SINGLE) public Response checkSkuAvailabilityWithResponse(String location, CheckSkuAvailabilityParameter parameters, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (parameters == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.checkSkuAvailabilitySync(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), location, parameters, accept, context); + return service.checkSkuAvailabilitySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, contentType, accept, parameters, context); } /** * Check available SKUs. * - * @param location Resource location. - * @param parameters Check SKU Availability POST body. + * @param location The location name. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -232,7 +190,7 @@ public SkuAvailabilityListResultInner checkSkuAvailability(String location, /** * Check whether a domain is available. * - * @param parameters Check Domain Availability parameter. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -241,30 +199,18 @@ public SkuAvailabilityListResultInner checkSkuAvailability(String location, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkDomainAvailabilityWithResponseAsync(CheckDomainAvailabilityParameter parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.checkDomainAvailability(this.client.getEndpoint(), - this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Check whether a domain is available. * - * @param parameters Check Domain Availability parameter. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -278,7 +224,7 @@ private Mono checkDomainAvailabilityAsync(CheckDomainAv /** * Check whether a domain is available. * - * @param parameters Check Domain Availability parameter. + * @param parameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -288,31 +234,16 @@ private Mono checkDomainAvailabilityAsync(CheckDomainAv @ServiceMethod(returns = ReturnType.SINGLE) public Response checkDomainAvailabilityWithResponse(CheckDomainAvailabilityParameter parameters, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.checkDomainAvailabilitySync(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), parameters, accept, context); + return service.checkDomainAvailabilitySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), contentType, accept, parameters, context); } /** * Check whether a domain is available. * - * @param parameters Check Domain Availability parameter. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -326,7 +257,7 @@ public DomainAvailabilityInner checkDomainAvailability(CheckDomainAvailabilityPa /** * Model capacity calculator. * - * @param parameters Check Domain Availability parameter. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -335,30 +266,18 @@ public DomainAvailabilityInner checkDomainAvailability(CheckDomainAvailabilityPa @ServiceMethod(returns = ReturnType.SINGLE) private Mono> calculateModelCapacityWithResponseAsync(CalculateModelCapacityParameter parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.calculateModelCapacity(this.client.getEndpoint(), - this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Model capacity calculator. * - * @param parameters Check Domain Availability parameter. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -373,7 +292,7 @@ public DomainAvailabilityInner checkDomainAvailability(CheckDomainAvailabilityPa /** * Model capacity calculator. * - * @param parameters Check Domain Availability parameter. + * @param parameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -383,31 +302,16 @@ public DomainAvailabilityInner checkDomainAvailability(CheckDomainAvailabilityPa @ServiceMethod(returns = ReturnType.SINGLE) public Response calculateModelCapacityWithResponse(CalculateModelCapacityParameter parameters, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.calculateModelCapacitySync(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), parameters, accept, context); + return service.calculateModelCapacitySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), contentType, accept, parameters, context); } /** * Model capacity calculator. * - * @param parameters Check Domain Availability parameter. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -417,6 +321,4 @@ public DomainAvailabilityInner checkDomainAvailability(CheckDomainAvailabilityPa public CalculateModelCapacityResultInner calculateModelCapacity(CalculateModelCapacityParameter parameters) { return calculateModelCapacityWithResponse(parameters, Context.NONE).getValue(); } - - private static final ClientLogger LOGGER = new ClientLogger(ResourceProvidersClientImpl.class); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceProvidersImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceProvidersImpl.java index ab6f664036d2..d065c2050af4 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceProvidersImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceProvidersImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -37,12 +37,8 @@ public Response checkSkuAvailabilityWithResponse(Stri CheckSkuAvailabilityParameter parameters, Context context) { Response inner = this.serviceClient().checkSkuAvailabilityWithResponse(location, parameters, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SkuAvailabilityListResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SkuAvailabilityListResultImpl(inner.getValue(), this.manager())); } public SkuAvailabilityListResult checkSkuAvailability(String location, CheckSkuAvailabilityParameter parameters) { @@ -58,12 +54,8 @@ public Response checkDomainAvailabilityWithResponse(CheckDom Context context) { Response inner = this.serviceClient().checkDomainAvailabilityWithResponse(parameters, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new DomainAvailabilityImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new DomainAvailabilityImpl(inner.getValue(), this.manager())); } public DomainAvailability checkDomainAvailability(CheckDomainAvailabilityParameter parameters) { @@ -79,12 +71,8 @@ public DomainAvailability checkDomainAvailability(CheckDomainAvailabilityParamet calculateModelCapacityWithResponse(CalculateModelCapacityParameter parameters, Context context) { Response inner = this.serviceClient().calculateModelCapacityWithResponse(parameters, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CalculateModelCapacityResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CalculateModelCapacityResultImpl(inner.getValue(), this.manager())); } public CalculateModelCapacityResult calculateModelCapacity(CalculateModelCapacityParameter parameters) { diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceSkuImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceSkuImpl.java index 3ad29457ebe3..bb46ee9da354 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceSkuImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceSkuImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceSkusClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceSkusClientImpl.java index 50ae42427e47..daacb385389d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceSkusClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceSkusClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -25,10 +25,9 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.cognitiveservices.fluent.ResourceSkusClient; import com.azure.resourcemanager.cognitiveservices.fluent.models.ResourceSkuInner; -import com.azure.resourcemanager.cognitiveservices.models.ResourceSkuListResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.ResourceSkuListResult; import reactor.core.publisher.Mono; /** @@ -60,14 +59,14 @@ public final class ResourceSkusClientImpl implements ResourceSkusClient { * The interface defining all the services for CognitiveServicesManagementClientResourceSkus to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CognitiveServicesManagementClientResourceSkus") public interface ResourceSkusService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/skus") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @@ -75,7 +74,7 @@ Mono> list(@HostParam("$host") String endpoint, @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/skus") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @@ -84,14 +83,14 @@ Response listSync(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -104,14 +103,6 @@ Response listNextSync(@PathParam(value = "nextLink", enco */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), @@ -144,16 +135,6 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage() { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); @@ -173,16 +154,6 @@ private PagedResponse listSinglePage() { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); @@ -230,13 +201,6 @@ public PagedIterable list(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), @@ -256,15 +220,6 @@ private Mono> listNextSinglePageAsync(String nex */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -285,21 +240,10 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(ResourceSkusClientImpl.class); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceSkusImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceSkusImpl.java index 1b2199303a95..74758bcb90e6 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceSkusImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceSkusImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SkuAvailabilityListResultImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SkuAvailabilityListResultImpl.java index 9755b0f7c874..0514e9c825b3 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SkuAvailabilityListResultImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SkuAvailabilityListResultImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SkuResourceImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SkuResourceImpl.java index 8f1f0ea0e5f7..0ed50f6d0b94 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SkuResourceImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SkuResourceImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SubscriptionRaiPoliciesClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SubscriptionRaiPoliciesClientImpl.java new file mode 100644 index 000000000000..5f4f8f46f350 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SubscriptionRaiPoliciesClientImpl.java @@ -0,0 +1,391 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cognitiveservices.fluent.SubscriptionRaiPoliciesClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiPolicyInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SubscriptionRaiPoliciesClient. + */ +public final class SubscriptionRaiPoliciesClientImpl implements SubscriptionRaiPoliciesClient { + /** + * The proxy service used to perform REST calls. + */ + private final SubscriptionRaiPoliciesService service; + + /** + * The service client containing this operation class. + */ + private final CognitiveServicesManagementClientImpl client; + + /** + * Initializes an instance of SubscriptionRaiPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SubscriptionRaiPoliciesClientImpl(CognitiveServicesManagementClientImpl client) { + this.service = RestProxy.create(SubscriptionRaiPoliciesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CognitiveServicesManagementClientSubscriptionRaiPolicies to be used + * by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CognitiveServicesManagementClientSubscriptionRaiPolicies") + public interface SubscriptionRaiPoliciesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiPolicy/{raiPolicyName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("raiPolicyName") String raiPolicyName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiPolicy/{raiPolicyName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("raiPolicyName") String raiPolicyName, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiPolicy/{raiPolicyName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("raiPolicyName") String raiPolicyName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") RaiPolicyInner raiPolicy, + Context context); + + @Put("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiPolicy/{raiPolicyName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("raiPolicyName") String raiPolicyName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") RaiPolicyInner raiPolicy, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiPolicy/{raiPolicyName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("raiPolicyName") String raiPolicyName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/raiPolicy/{raiPolicyName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("raiPolicyName") String raiPolicyName, Context context); + } + + /** + * Gets the specified Content Filters associated with the Subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Content Filters associated with the Subscription along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String raiPolicyName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), raiPolicyName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the specified Content Filters associated with the Subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Content Filters associated with the Subscription on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String raiPolicyName) { + return getWithResponseAsync(raiPolicyName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the specified Content Filters associated with the Subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Content Filters associated with the Subscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String raiPolicyName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + raiPolicyName, accept, context); + } + + /** + * Gets the specified Content Filters associated with the Subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Content Filters associated with the Subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RaiPolicyInner get(String raiPolicyName) { + return getWithResponse(raiPolicyName, Context.NONE).getValue(); + } + + /** + * Update the state of specified Content Filters associated with the subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @param raiPolicy Properties describing the Content Filters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services RaiPolicy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String raiPolicyName, + RaiPolicyInner raiPolicy) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), raiPolicyName, contentType, accept, raiPolicy, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update the state of specified Content Filters associated with the subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @param raiPolicy Properties describing the Content Filters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services RaiPolicy on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String raiPolicyName, RaiPolicyInner raiPolicy) { + return createOrUpdateWithResponseAsync(raiPolicyName, raiPolicy) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update the state of specified Content Filters associated with the subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @param raiPolicy Properties describing the Content Filters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services RaiPolicy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String raiPolicyName, RaiPolicyInner raiPolicy, + Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), raiPolicyName, contentType, accept, raiPolicy, context); + } + + /** + * Update the state of specified Content Filters associated with the subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @param raiPolicy Properties describing the Content Filters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services RaiPolicy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RaiPolicyInner createOrUpdate(String raiPolicyName, RaiPolicyInner raiPolicy) { + return createOrUpdateWithResponse(raiPolicyName, raiPolicy, Context.NONE).getValue(); + } + + /** + * Deletes the specified Content Filters associated with the subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String raiPolicyName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), raiPolicyName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes the specified Content Filters associated with the subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String raiPolicyName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), raiPolicyName, Context.NONE); + } + + /** + * Deletes the specified Content Filters associated with the subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String raiPolicyName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), raiPolicyName, context); + } + + /** + * Deletes the specified Content Filters associated with the subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String raiPolicyName) { + Mono>> mono = deleteWithResponseAsync(raiPolicyName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes the specified Content Filters associated with the subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String raiPolicyName) { + Response response = deleteWithResponse(raiPolicyName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Deletes the specified Content Filters associated with the subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String raiPolicyName, Context context) { + Response response = deleteWithResponse(raiPolicyName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Deletes the specified Content Filters associated with the subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String raiPolicyName) { + return beginDeleteAsync(raiPolicyName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes the specified Content Filters associated with the subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String raiPolicyName) { + beginDelete(raiPolicyName).getFinalResult(); + } + + /** + * Deletes the specified Content Filters associated with the subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String raiPolicyName, Context context) { + beginDelete(raiPolicyName, context).getFinalResult(); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SubscriptionRaiPoliciesImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SubscriptionRaiPoliciesImpl.java new file mode 100644 index 000000000000..22d3047be865 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SubscriptionRaiPoliciesImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cognitiveservices.fluent.SubscriptionRaiPoliciesClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiPolicyInner; +import com.azure.resourcemanager.cognitiveservices.models.RaiPolicy; +import com.azure.resourcemanager.cognitiveservices.models.SubscriptionRaiPolicies; + +public final class SubscriptionRaiPoliciesImpl implements SubscriptionRaiPolicies { + private static final ClientLogger LOGGER = new ClientLogger(SubscriptionRaiPoliciesImpl.class); + + private final SubscriptionRaiPoliciesClient innerClient; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + public SubscriptionRaiPoliciesImpl(SubscriptionRaiPoliciesClient innerClient, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String raiPolicyName, Context context) { + Response inner = this.serviceClient().getWithResponse(raiPolicyName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RaiPolicyImpl(inner.getValue(), this.manager())); + } + + public RaiPolicy get(String raiPolicyName) { + RaiPolicyInner inner = this.serviceClient().get(raiPolicyName); + if (inner != null) { + return new RaiPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response createOrUpdateWithResponse(String raiPolicyName, RaiPolicyInner raiPolicy, + Context context) { + Response inner + = this.serviceClient().createOrUpdateWithResponse(raiPolicyName, raiPolicy, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RaiPolicyImpl(inner.getValue(), this.manager())); + } + + public RaiPolicy createOrUpdate(String raiPolicyName, RaiPolicyInner raiPolicy) { + RaiPolicyInner inner = this.serviceClient().createOrUpdate(raiPolicyName, raiPolicy); + if (inner != null) { + return new RaiPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String raiPolicyName) { + this.serviceClient().delete(raiPolicyName); + } + + public void delete(String raiPolicyName, Context context) { + this.serviceClient().delete(raiPolicyName, context); + } + + private SubscriptionRaiPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/TestRaiExternalSafetyProvidersClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/TestRaiExternalSafetyProvidersClientImpl.java new file mode 100644 index 000000000000..817d3551fadf --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/TestRaiExternalSafetyProvidersClientImpl.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.cognitiveservices.fluent.TestRaiExternalSafetyProvidersClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderSchemaInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in TestRaiExternalSafetyProvidersClient. + */ +public final class TestRaiExternalSafetyProvidersClientImpl implements TestRaiExternalSafetyProvidersClient { + /** + * The proxy service used to perform REST calls. + */ + private final TestRaiExternalSafetyProvidersService service; + + /** + * The service client containing this operation class. + */ + private final CognitiveServicesManagementClientImpl client; + + /** + * Initializes an instance of TestRaiExternalSafetyProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TestRaiExternalSafetyProvidersClientImpl(CognitiveServicesManagementClientImpl client) { + this.service = RestProxy.create(TestRaiExternalSafetyProvidersService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CognitiveServicesManagementClientTestRaiExternalSafetyProviders to be + * used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CognitiveServicesManagementClientTestRaiExternalSafetyProviders") + public interface TestRaiExternalSafetyProvidersService { + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/testRaiExternalSafetyProvider/{safetyProviderName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("safetyProviderName") String safetyProviderName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") RaiExternalSafetyProviderSchemaInner safetyProvider, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/testRaiExternalSafetyProvider/{safetyProviderName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("safetyProviderName") String safetyProviderName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") RaiExternalSafetyProviderSchemaInner safetyProvider, Context context); + } + + /** + * Test the rai safety provider associated with the subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @param safetyProvider Properties describing the rai external safety provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services Rai External Safety provider Schema along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String accountName, String safetyProviderName, + RaiExternalSafetyProviderSchemaInner safetyProvider) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, safetyProviderName, contentType, + accept, safetyProvider, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Test the rai safety provider associated with the subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @param safetyProvider Properties describing the rai external safety provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services Rai External Safety provider Schema on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String accountName, + String safetyProviderName, RaiExternalSafetyProviderSchemaInner safetyProvider) { + return createOrUpdateWithResponseAsync(resourceGroupName, accountName, safetyProviderName, safetyProvider) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Test the rai safety provider associated with the subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @param safetyProvider Properties describing the rai external safety provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services Rai External Safety provider Schema along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, + String accountName, String safetyProviderName, RaiExternalSafetyProviderSchemaInner safetyProvider, + Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, safetyProviderName, contentType, accept, + safetyProvider, context); + } + + /** + * Test the rai safety provider associated with the subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @param safetyProvider Properties describing the rai external safety provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services Rai External Safety provider Schema. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RaiExternalSafetyProviderSchemaInner createOrUpdate(String resourceGroupName, String accountName, + String safetyProviderName, RaiExternalSafetyProviderSchemaInner safetyProvider) { + return createOrUpdateWithResponse(resourceGroupName, accountName, safetyProviderName, safetyProvider, + Context.NONE).getValue(); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/TestRaiExternalSafetyProvidersImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/TestRaiExternalSafetyProvidersImpl.java new file mode 100644 index 000000000000..ea551e3cf9f1 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/TestRaiExternalSafetyProvidersImpl.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.cognitiveservices.fluent.TestRaiExternalSafetyProvidersClient; +import com.azure.resourcemanager.cognitiveservices.models.TestRaiExternalSafetyProviders; + +public final class TestRaiExternalSafetyProvidersImpl implements TestRaiExternalSafetyProviders { + private static final ClientLogger LOGGER = new ClientLogger(TestRaiExternalSafetyProvidersImpl.class); + + private final TestRaiExternalSafetyProvidersClient innerClient; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + public TestRaiExternalSafetyProvidersImpl(TestRaiExternalSafetyProvidersClient innerClient, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + private TestRaiExternalSafetyProvidersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } + + public RaiExternalSafetyProviderSchemaImpl define(String name) { + return new RaiExternalSafetyProviderSchemaImpl(name, this.manager()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsageImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsageImpl.java new file mode 100644 index 000000000000..02b9771cb138 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsageImpl.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation; + +import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageInner; +import com.azure.resourcemanager.cognitiveservices.models.MetricName; +import com.azure.resourcemanager.cognitiveservices.models.QuotaScopeType; +import com.azure.resourcemanager.cognitiveservices.models.QuotaUsageStatus; +import com.azure.resourcemanager.cognitiveservices.models.UnitType; +import com.azure.resourcemanager.cognitiveservices.models.Usage; + +public final class UsageImpl implements Usage { + private UsageInner innerObject; + + private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager; + + UsageImpl(UsageInner innerObject, + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public UnitType unit() { + return this.innerModel().unit(); + } + + public MetricName name() { + return this.innerModel().name(); + } + + public String quotaPeriod() { + return this.innerModel().quotaPeriod(); + } + + public Double limit() { + return this.innerModel().limit(); + } + + public Double currentValue() { + return this.innerModel().currentValue(); + } + + public String nextResetTime() { + return this.innerModel().nextResetTime(); + } + + public QuotaUsageStatus status() { + return this.innerModel().status(); + } + + public QuotaScopeType scopeType() { + return this.innerModel().scopeType(); + } + + public String scopeId() { + return this.innerModel().scopeId(); + } + + public UsageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsageListResultImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsageListResultImpl.java index 1ffcbfaed4da..9a654d9cbb77 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsageListResultImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsageListResultImpl.java @@ -1,14 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; +import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageInner; import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageListResultInner; import com.azure.resourcemanager.cognitiveservices.models.Usage; import com.azure.resourcemanager.cognitiveservices.models.UsageListResult; import java.util.Collections; import java.util.List; +import java.util.stream.Collectors; public final class UsageListResultImpl implements UsageListResult { private UsageListResultInner innerObject; @@ -26,9 +28,10 @@ public String nextLink() { } public List value() { - List inner = this.innerModel().value(); + List inner = this.innerModel().value(); if (inner != null) { - return Collections.unmodifiableList(inner); + return Collections.unmodifiableList( + inner.stream().map(inner1 -> new UsageImpl(inner1, this.manager())).collect(Collectors.toList())); } else { return Collections.emptyList(); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsagesClientImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsagesClientImpl.java index 7e431a758d4a..e7ea4716e18d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsagesClientImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsagesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -25,10 +25,9 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.cognitiveservices.fluent.UsagesClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageInner; import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageListResultInner; -import com.azure.resourcemanager.cognitiveservices.models.Usage; import reactor.core.publisher.Mono; /** @@ -59,15 +58,15 @@ public final class UsagesClientImpl implements UsagesClient { * The interface defining all the services for CognitiveServicesManagementClientUsages to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CognitiveServicesManagementClientUsages") public interface UsagesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/usages") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); @@ -75,8 +74,8 @@ Mono> list(@HostParam("$host") String endpoint, @Get("/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/usages") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); @@ -85,20 +84,20 @@ Response listSync(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Get usages for the requested subscription. * - * @param location Resource location. + * @param location The location name. * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is * name.value (name of the metric, can have an or of multiple names). * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -108,23 +107,12 @@ Response listNextSync(@PathParam(value = "nextLink", encod * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String location, String filter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } + private Mono> listSinglePageAsync(String location, String filter) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), location, filter, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, filter, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -132,7 +120,7 @@ private Mono> listSinglePageAsync(String location, String f /** * Get usages for the requested subscription. * - * @param location Resource location. + * @param location The location name. * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is * name.value (name of the metric, can have an or of multiple names). * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -141,7 +129,7 @@ private Mono> listSinglePageAsync(String location, String f * @return usages for the requested subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String location, String filter) { + private PagedFlux listAsync(String location, String filter) { return new PagedFlux<>(() -> listSinglePageAsync(location, filter), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -149,14 +137,14 @@ private PagedFlux listAsync(String location, String filter) { /** * Get usages for the requested subscription. * - * @param location Resource location. + * @param location The location name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return usages for the requested subscription as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String location) { + private PagedFlux listAsync(String location) { final String filter = null; return new PagedFlux<>(() -> listSinglePageAsync(location, filter), nextLink -> listNextSinglePageAsync(nextLink)); @@ -165,7 +153,7 @@ private PagedFlux listAsync(String location) { /** * Get usages for the requested subscription. * - * @param location Resource location. + * @param location The location name. * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is * name.value (name of the metric, can have an or of multiple names). * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -174,24 +162,10 @@ private PagedFlux listAsync(String location) { * @return usages for the requested subscription along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String location, String filter) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } + private PagedResponse listSinglePage(String location, String filter) { final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), - this.client.getSubscriptionId(), this.client.getApiVersion(), location, filter, accept, Context.NONE); + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, filter, accept, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -199,7 +173,7 @@ private PagedResponse listSinglePage(String location, String filter) { /** * Get usages for the requested subscription. * - * @param location Resource location. + * @param location The location name. * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is * name.value (name of the metric, can have an or of multiple names). * @param context The context to associate with this operation. @@ -209,24 +183,10 @@ private PagedResponse listSinglePage(String location, String filter) { * @return usages for the requested subscription along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(String location, String filter, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } + private PagedResponse listSinglePage(String location, String filter, Context context) { final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), - this.client.getSubscriptionId(), this.client.getApiVersion(), location, filter, accept, context); + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, filter, accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } @@ -234,14 +194,14 @@ private PagedResponse listSinglePage(String location, String filter, Cont /** * Get usages for the requested subscription. * - * @param location Resource location. + * @param location The location name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return usages for the requested subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location) { + public PagedIterable list(String location) { final String filter = null; return new PagedIterable<>(() -> listSinglePage(location, filter), nextLink -> listNextSinglePage(nextLink)); } @@ -249,7 +209,7 @@ public PagedIterable list(String location) { /** * Get usages for the requested subscription. * - * @param location Resource location. + * @param location The location name. * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is * name.value (name of the metric, can have an or of multiple names). * @param context The context to associate with this operation. @@ -259,7 +219,7 @@ public PagedIterable list(String location) { * @return usages for the requested subscription as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String location, String filter, Context context) { + public PagedIterable list(String location, String filter, Context context) { return new PagedIterable<>(() -> listSinglePage(location, filter, context), nextLink -> listNextSinglePage(nextLink, context)); } @@ -275,17 +235,10 @@ public PagedIterable list(String location, String filter, Context context * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private Mono> listNextSinglePageAsync(String nextLink) { final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -300,16 +253,7 @@ private Mono> listNextSinglePageAsync(String nextLink) { * @return usages for the requested subscription along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink) { final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -328,21 +272,10 @@ private PagedResponse listNextSinglePage(String nextLink) { * @return usages for the requested subscription along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null); } - - private static final ClientLogger LOGGER = new ClientLogger(UsagesClientImpl.class); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsagesImpl.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsagesImpl.java index 13adef61650c..39f8f45aebe9 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsagesImpl.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsagesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.implementation; @@ -8,6 +8,7 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.cognitiveservices.fluent.UsagesClient; +import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageInner; import com.azure.resourcemanager.cognitiveservices.models.Usage; import com.azure.resourcemanager.cognitiveservices.models.Usages; @@ -25,11 +26,13 @@ public UsagesImpl(UsagesClient innerClient, } public PagedIterable list(String location) { - return this.serviceClient().list(location); + PagedIterable inner = this.serviceClient().list(location); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); } public PagedIterable list(String location, String filter, Context context) { - return this.serviceClient().list(location, filter, context); + PagedIterable inner = this.serviceClient().list(location, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UsageImpl(inner1, this.manager())); } private UsagesClient serviceClient() { diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AccountListResult.java similarity index 78% rename from sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountListResult.java rename to sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AccountListResult.java index a735cb5cc3b4..41db2ed3901b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountListResult.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AccountListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cognitiveservices.models; +package com.azure.resourcemanager.cognitiveservices.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The list of cognitive services accounts operation response. */ -@Fluent +@Immutable public final class AccountListResult implements JsonSerializable { /* * The link used to get the next page of accounts. @@ -31,7 +31,7 @@ public final class AccountListResult implements JsonSerializable value() { return this.value; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountModelListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AccountModelListResult.java similarity index 72% rename from sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountModelListResult.java rename to sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AccountModelListResult.java index 3a84416c2774..cc521dd4c996 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountModelListResult.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AccountModelListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cognitiveservices.models; +package com.azure.resourcemanager.cognitiveservices.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The list of cognitive services accounts operation response. */ -@Fluent +@Immutable public final class AccountModelListResult implements JsonSerializable { /* * The link used to get the next page of Model. @@ -31,7 +31,7 @@ public final class AccountModelListResult implements JsonSerializable value() { return this.value; } - /** - * Set the value property: Gets the list of Cognitive Services accounts Model and their properties. - * - * @param value the value value to set. - * @return the AccountModelListResult object itself. - */ - public AccountModelListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AgentApplicationResourceArmPaginatedResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AgentApplicationResourceArmPaginatedResult.java new file mode 100644 index 000000000000..503281bcbecb --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AgentApplicationResourceArmPaginatedResult.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentApplicationInner; +import java.io.IOException; +import java.util.List; + +/** + * A paginated list of Agent Application entities. + */ +@Immutable +public final class AgentApplicationResourceArmPaginatedResult + implements JsonSerializable { + /* + * The link to the next page of Agent Application objects. If null, there are no additional pages. + */ + private String nextLink; + + /* + * An array of objects of type Agent Application. + */ + private List value; + + /** + * Creates an instance of AgentApplicationResourceArmPaginatedResult class. + */ + private AgentApplicationResourceArmPaginatedResult() { + } + + /** + * Get the nextLink property: The link to the next page of Agent Application objects. If null, there are no + * additional pages. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: An array of objects of type Agent Application. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentApplicationResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentApplicationResourceArmPaginatedResult if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AgentApplicationResourceArmPaginatedResult. + */ + public static AgentApplicationResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentApplicationResourceArmPaginatedResult deserializedAgentApplicationResourceArmPaginatedResult + = new AgentApplicationResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedAgentApplicationResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AgentApplicationInner.fromJson(reader1)); + deserializedAgentApplicationResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedAgentApplicationResourceArmPaginatedResult; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AgentDeploymentResourceArmPaginatedResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AgentDeploymentResourceArmPaginatedResult.java new file mode 100644 index 000000000000..2b4a37e77f15 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AgentDeploymentResourceArmPaginatedResult.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentDeploymentInner; +import java.io.IOException; +import java.util.List; + +/** + * A paginated list of Agent Deployment entities. + */ +@Immutable +public final class AgentDeploymentResourceArmPaginatedResult + implements JsonSerializable { + /* + * The link to the next page of Agent Deployment objects. If null, there are no additional pages. + */ + private String nextLink; + + /* + * An array of objects of type Agent Deployment. + */ + private List value; + + /** + * Creates an instance of AgentDeploymentResourceArmPaginatedResult class. + */ + private AgentDeploymentResourceArmPaginatedResult() { + } + + /** + * Get the nextLink property: The link to the next page of Agent Deployment objects. If null, there are no + * additional pages. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: An array of objects of type Agent Deployment. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentDeploymentResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentDeploymentResourceArmPaginatedResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AgentDeploymentResourceArmPaginatedResult. + */ + public static AgentDeploymentResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentDeploymentResourceArmPaginatedResult deserializedAgentDeploymentResourceArmPaginatedResult + = new AgentDeploymentResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedAgentDeploymentResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> AgentDeploymentInner.fromJson(reader1)); + deserializedAgentDeploymentResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedAgentDeploymentResourceArmPaginatedResult; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CapabilityHostResourceArmPaginatedResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CapabilityHostResourceArmPaginatedResult.java new file mode 100644 index 000000000000..1785ef48bfb0 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CapabilityHostResourceArmPaginatedResult.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cognitiveservices.fluent.models.CapabilityHostInner; +import java.io.IOException; +import java.util.List; + +/** + * A paginated list of Capability Host entities. + */ +@Immutable +public final class CapabilityHostResourceArmPaginatedResult + implements JsonSerializable { + /* + * The link to the next page of Capability Host objects. If null, there are no additional pages. + */ + private String nextLink; + + /* + * An array of objects of type Capability Host. + */ + private List value; + + /** + * Creates an instance of CapabilityHostResourceArmPaginatedResult class. + */ + private CapabilityHostResourceArmPaginatedResult() { + } + + /** + * Get the nextLink property: The link to the next page of Capability Host objects. If null, there are no additional + * pages. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: An array of objects of type Capability Host. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CapabilityHostResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CapabilityHostResourceArmPaginatedResult if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CapabilityHostResourceArmPaginatedResult. + */ + public static CapabilityHostResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CapabilityHostResourceArmPaginatedResult deserializedCapabilityHostResourceArmPaginatedResult + = new CapabilityHostResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedCapabilityHostResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> CapabilityHostInner.fromJson(reader1)); + deserializedCapabilityHostResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedCapabilityHostResourceArmPaginatedResult; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAccountAssociationListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CommitmentPlanAccountAssociationListResult.java similarity index 79% rename from sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAccountAssociationListResult.java rename to sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CommitmentPlanAccountAssociationListResult.java index b49da06ac395..176626298852 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAccountAssociationListResult.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CommitmentPlanAccountAssociationListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cognitiveservices.models; +package com.azure.resourcemanager.cognitiveservices.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The list of cognitive services Commitment Plan Account Association operation response. */ -@Fluent +@Immutable public final class CommitmentPlanAccountAssociationListResult implements JsonSerializable { /* @@ -32,7 +32,7 @@ public final class CommitmentPlanAccountAssociationListResult /** * Creates an instance of CommitmentPlanAccountAssociationListResult class. */ - public CommitmentPlanAccountAssociationListResult() { + private CommitmentPlanAccountAssociationListResult() { } /** @@ -44,17 +44,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link used to get the next page of Commitment Plan Account Association. - * - * @param nextLink the nextLink value to set. - * @return the CommitmentPlanAccountAssociationListResult object itself. - */ - public CommitmentPlanAccountAssociationListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Get the value property: Gets the list of Cognitive Services Commitment Plan Account Association and their * properties. @@ -65,17 +54,6 @@ public List value() { return this.value; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CommitmentPlanListResult.java similarity index 78% rename from sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanListResult.java rename to sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CommitmentPlanListResult.java index 504f305cead6..75aa9a0de0fe 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanListResult.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CommitmentPlanListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cognitiveservices.models; +package com.azure.resourcemanager.cognitiveservices.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The list of cognitive services accounts operation response. */ -@Fluent +@Immutable public final class CommitmentPlanListResult implements JsonSerializable { /* * The link used to get the next page of CommitmentPlan. @@ -31,7 +31,7 @@ public final class CommitmentPlanListResult implements JsonSerializable value() { return this.value; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentTierListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CommitmentTierListResult.java similarity index 78% rename from sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentTierListResult.java rename to sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CommitmentTierListResult.java index 9facfada6a26..2d096dcf00a6 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentTierListResult.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CommitmentTierListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cognitiveservices.models; +package com.azure.resourcemanager.cognitiveservices.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The list of cognitive services accounts operation response. */ -@Fluent +@Immutable public final class CommitmentTierListResult implements JsonSerializable { /* * The link used to get the next page of CommitmentTier. @@ -31,7 +31,7 @@ public final class CommitmentTierListResult implements JsonSerializable value() { return this.value; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPropertiesV2BasicResourceArmPaginatedResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ConnectionPropertiesV2BasicResourceArmPaginatedResult.java similarity index 73% rename from sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPropertiesV2BasicResourceArmPaginatedResult.java rename to sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ConnectionPropertiesV2BasicResourceArmPaginatedResult.java index df180a616463..22b8b0c1b881 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPropertiesV2BasicResourceArmPaginatedResult.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ConnectionPropertiesV2BasicResourceArmPaginatedResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cognitiveservices.models; +package com.azure.resourcemanager.cognitiveservices.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The ConnectionPropertiesV2BasicResourceArmPaginatedResult model. */ -@Fluent +@Immutable public final class ConnectionPropertiesV2BasicResourceArmPaginatedResult implements JsonSerializable { /* @@ -32,7 +32,7 @@ public final class ConnectionPropertiesV2BasicResourceArmPaginatedResult /** * Creates an instance of ConnectionPropertiesV2BasicResourceArmPaginatedResult class. */ - public ConnectionPropertiesV2BasicResourceArmPaginatedResult() { + private ConnectionPropertiesV2BasicResourceArmPaginatedResult() { } /** @@ -44,17 +44,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The nextLink property. - * - * @param nextLink the nextLink value to set. - * @return the ConnectionPropertiesV2BasicResourceArmPaginatedResult object itself. - */ - public ConnectionPropertiesV2BasicResourceArmPaginatedResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Get the value property: The value property. * @@ -64,29 +53,6 @@ public List value() { return this.value; } - /** - * Set the value property: The value property. - * - * @param value the value value to set. - * @return the ConnectionPropertiesV2BasicResourceArmPaginatedResult object itself. - */ - public ConnectionPropertiesV2BasicResourceArmPaginatedResult - withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DefenderForAISettingResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/DefenderForAISettingResult.java similarity index 72% rename from sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DefenderForAISettingResult.java rename to sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/DefenderForAISettingResult.java index 406a8ed13b3e..21db5061a8e5 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DefenderForAISettingResult.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/DefenderForAISettingResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cognitiveservices.models; +package com.azure.resourcemanager.cognitiveservices.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The list of cognitive services Defender for AI Settings. */ -@Fluent +@Immutable public final class DefenderForAISettingResult implements JsonSerializable { /* * The link used to get the next page of Defender for AI Settings. @@ -31,7 +31,7 @@ public final class DefenderForAISettingResult implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The list of Defender for AI Settings. - * - * @param value the value value to set. - * @return the DefenderForAISettingResult object itself. - */ - public DefenderForAISettingResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/DeploymentListResult.java similarity index 78% rename from sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentListResult.java rename to sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/DeploymentListResult.java index 88108f03c718..c8f28df07878 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentListResult.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/DeploymentListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cognitiveservices.models; +package com.azure.resourcemanager.cognitiveservices.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The list of cognitive services accounts operation response. */ -@Fluent +@Immutable public final class DeploymentListResult implements JsonSerializable { /* * The link used to get the next page of Deployment. @@ -31,7 +31,7 @@ public final class DeploymentListResult implements JsonSerializable value() { return this.value; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentSkuListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/DeploymentSkuListResult.java similarity index 78% rename from sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentSkuListResult.java rename to sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/DeploymentSkuListResult.java index 8650b5178135..7accd24ad96f 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentSkuListResult.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/DeploymentSkuListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cognitiveservices.models; +package com.azure.resourcemanager.cognitiveservices.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The list of cognitive services accounts operation response. */ -@Fluent +@Immutable public final class DeploymentSkuListResult implements JsonSerializable { /* * The link used to get the next page of deployment skus. @@ -31,7 +31,7 @@ public final class DeploymentSkuListResult implements JsonSerializable value() { return this.value; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopeListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/EncryptionScopeListResult.java similarity index 72% rename from sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopeListResult.java rename to sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/EncryptionScopeListResult.java index 8d386c49ff7b..d64a6628df59 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopeListResult.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/EncryptionScopeListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cognitiveservices.models; +package com.azure.resourcemanager.cognitiveservices.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The list of cognitive services EncryptionScopes. */ -@Fluent +@Immutable public final class EncryptionScopeListResult implements JsonSerializable { /* * The link used to get the next page of EncryptionScope. @@ -31,7 +31,7 @@ public final class EncryptionScopeListResult implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The list of EncryptionScope. - * - * @param value the value value to set. - * @return the EncryptionScopeListResult object itself. - */ - public EncryptionScopeListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ManagedNetworkListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ManagedNetworkListResult.java new file mode 100644 index 000000000000..2104721588bc --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ManagedNetworkListResult.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsPropertiesBasicResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * List of managed networks of a cognitive services account. + */ +@Immutable +public final class ManagedNetworkListResult implements JsonSerializable { + /* + * The link to the next page constructed using the continuationToken. If null, there are no additional pages. + */ + private String nextLink; + + /* + * The list of managed network settings of an account. Since this list may be incomplete, the nextLink field should + * be used to request the next list of cognitive services accounts. + */ + private List value; + + /** + * Creates an instance of ManagedNetworkListResult class. + */ + private ManagedNetworkListResult() { + } + + /** + * Get the nextLink property: The link to the next page constructed using the continuationToken. If null, there are + * no additional pages. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: The list of managed network settings of an account. Since this list may be incomplete, + * the nextLink field should be used to request the next list of cognitive services accounts. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedNetworkListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedNetworkListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedNetworkListResult. + */ + public static ManagedNetworkListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedNetworkListResult deserializedManagedNetworkListResult = new ManagedNetworkListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedManagedNetworkListResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value = reader + .readArray(reader1 -> ManagedNetworkSettingsPropertiesBasicResourceInner.fromJson(reader1)); + deserializedManagedNetworkListResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedNetworkListResult; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacityListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ModelCapacityListResult.java similarity index 70% rename from sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacityListResult.java rename to sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ModelCapacityListResult.java index 6bed875ee339..95099bd29e25 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacityListResult.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ModelCapacityListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cognitiveservices.models; +package com.azure.resourcemanager.cognitiveservices.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The list of cognitive services accounts operation response. */ -@Fluent +@Immutable public final class ModelCapacityListResult implements JsonSerializable { /* * The link used to get the next page of ModelSkuCapacity. @@ -31,7 +31,7 @@ public final class ModelCapacityListResult implements JsonSerializable value() { return this.value; } - /** - * Set the value property: Gets the list of Cognitive Services accounts ModelSkuCapacity. - * - * @param value the value value to set. - * @return the ModelCapacityListResult object itself. - */ - public ModelCapacityListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -92,7 +59,6 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("nextLink", this.nextLink); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ModelListResult.java similarity index 72% rename from sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelListResult.java rename to sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ModelListResult.java index 806f7799a37b..9ae851778d2d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelListResult.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ModelListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cognitiveservices.models; +package com.azure.resourcemanager.cognitiveservices.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The list of cognitive services models. */ -@Fluent +@Immutable public final class ModelListResult implements JsonSerializable { /* * The link used to get the next page of Model. @@ -31,7 +31,7 @@ public final class ModelListResult implements JsonSerializable /** * Creates an instance of ModelListResult class. */ - public ModelListResult() { + private ModelListResult() { } /** @@ -43,17 +43,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link used to get the next page of Model. - * - * @param nextLink the nextLink value to set. - * @return the ModelListResult object itself. - */ - public ModelListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Get the value property: Gets the list of Cognitive Services accounts Model and their properties. * @@ -63,28 +52,6 @@ public List value() { return this.value; } - /** - * Set the value property: Gets the list of Cognitive Services accounts Model and their properties. - * - * @param value the value value to set. - * @return the ModelListResult object itself. - */ - public ModelListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfigurationList.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/NetworkSecurityPerimeterConfigurationList.java similarity index 72% rename from sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfigurationList.java rename to sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/NetworkSecurityPerimeterConfigurationList.java index 6342681fdf5a..3ee4b2415ed7 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfigurationList.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/NetworkSecurityPerimeterConfigurationList.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cognitiveservices.models; +package com.azure.resourcemanager.cognitiveservices.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * A list of NSP configurations for an Cognitive Services account. */ -@Fluent +@Immutable public final class NetworkSecurityPerimeterConfigurationList implements JsonSerializable { /* @@ -32,7 +32,7 @@ public final class NetworkSecurityPerimeterConfigurationList /** * Creates an instance of NetworkSecurityPerimeterConfigurationList class. */ - public NetworkSecurityPerimeterConfigurationList() { + private NetworkSecurityPerimeterConfigurationList() { } /** @@ -44,17 +44,6 @@ public List value() { return this.value; } - /** - * Set the value property: Array of NSP configurations List Result for an Cognitive Services account. - * - * @param value the value value to set. - * @return the NetworkSecurityPerimeterConfigurationList object itself. - */ - public NetworkSecurityPerimeterConfigurationList withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: Link to retrieve next page of results. * @@ -64,28 +53,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: Link to retrieve next page of results. - * - * @param nextLink the nextLink value to set. - * @return the NetworkSecurityPerimeterConfigurationList object itself. - */ - public NetworkSecurityPerimeterConfigurationList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OperationListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/OperationListResult.java similarity index 78% rename from sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OperationListResult.java rename to sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/OperationListResult.java index 7c873d943f97..744930ac9286 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OperationListResult.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/OperationListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cognitiveservices.models; +package com.azure.resourcemanager.cognitiveservices.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -20,23 +20,23 @@ @Immutable public final class OperationListResult implements JsonSerializable { /* - * List of operations supported by the resource provider + * The Operation items on this page */ private List value; /* - * URL to get the next set of operation list results (if there are any). + * The link to the next page of items */ private String nextLink; /** * Creates an instance of OperationListResult class. */ - public OperationListResult() { + private OperationListResult() { } /** - * Get the value property: List of operations supported by the resource provider. + * Get the value property: The Operation items on this page. * * @return the value value. */ @@ -45,7 +45,7 @@ public List value() { } /** - * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -53,23 +53,14 @@ public String nextLink() { return this.nextLink; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -79,6 +70,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the OperationListResult. */ public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ProjectCapabilityHostResourceArmPaginatedResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ProjectCapabilityHostResourceArmPaginatedResult.java new file mode 100644 index 000000000000..2deb4aa5be23 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ProjectCapabilityHostResourceArmPaginatedResult.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ProjectCapabilityHostInner; +import java.io.IOException; +import java.util.List; + +/** + * A paginated list of Project Capability Host entities. + */ +@Immutable +public final class ProjectCapabilityHostResourceArmPaginatedResult + implements JsonSerializable { + /* + * The link to the next page of Project Capability Host objects. If null, there are no additional pages. + */ + private String nextLink; + + /* + * An array of objects of type Project Capability Host. + */ + private List value; + + /** + * Creates an instance of ProjectCapabilityHostResourceArmPaginatedResult class. + */ + private ProjectCapabilityHostResourceArmPaginatedResult() { + } + + /** + * Get the nextLink property: The link to the next page of Project Capability Host objects. If null, there are no + * additional pages. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: An array of objects of type Project Capability Host. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProjectCapabilityHostResourceArmPaginatedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectCapabilityHostResourceArmPaginatedResult if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProjectCapabilityHostResourceArmPaginatedResult. + */ + public static ProjectCapabilityHostResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectCapabilityHostResourceArmPaginatedResult deserializedProjectCapabilityHostResourceArmPaginatedResult + = new ProjectCapabilityHostResourceArmPaginatedResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedProjectCapabilityHostResourceArmPaginatedResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ProjectCapabilityHostInner.fromJson(reader1)); + deserializedProjectCapabilityHostResourceArmPaginatedResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedProjectCapabilityHostResourceArmPaginatedResult; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ProjectListResult.java similarity index 78% rename from sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectListResult.java rename to sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ProjectListResult.java index a2e929f31ac2..8fa73da3b16d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectListResult.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ProjectListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cognitiveservices.models; +package com.azure.resourcemanager.cognitiveservices.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The list of cognitive services projects operation response. */ -@Fluent +@Immutable public final class ProjectListResult implements JsonSerializable { /* * The link used to get the next page of projects. @@ -31,7 +31,7 @@ public final class ProjectListResult implements JsonSerializable value() { return this.value; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTierListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/QuotaTierListResult.java similarity index 77% rename from sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTierListResult.java rename to sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/QuotaTierListResult.java index 5b07f3945b1c..3c71bd64db4a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTierListResult.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/QuotaTierListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cognitiveservices.models; +package com.azure.resourcemanager.cognitiveservices.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The list of Quota Tiers response. */ -@Fluent +@Immutable public final class QuotaTierListResult implements JsonSerializable { /* * The link used to get the next page of quota tiers. @@ -31,7 +31,7 @@ public final class QuotaTierListResult implements JsonSerializable value() { return this.value; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlockListItemsResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiBlockListItemsResult.java similarity index 72% rename from sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlockListItemsResult.java rename to sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiBlockListItemsResult.java index b8895c15dfde..3296b8dab6ae 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlockListItemsResult.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiBlockListItemsResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cognitiveservices.models; +package com.azure.resourcemanager.cognitiveservices.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The list of cognitive services RAI Blocklist Items. */ -@Fluent +@Immutable public final class RaiBlockListItemsResult implements JsonSerializable { /* * The link used to get the next page of RaiBlocklistItems. @@ -31,7 +31,7 @@ public final class RaiBlockListItemsResult implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The list of RaiBlocklistItems. - * - * @param value the value value to set. - * @return the RaiBlockListItemsResult object itself. - */ - public RaiBlockListItemsResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlockListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiBlockListResult.java similarity index 72% rename from sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlockListResult.java rename to sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiBlockListResult.java index f41800fa5d42..4417bcae152b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlockListResult.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiBlockListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cognitiveservices.models; +package com.azure.resourcemanager.cognitiveservices.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The list of cognitive services RAI Blocklists. */ -@Fluent +@Immutable public final class RaiBlockListResult implements JsonSerializable { /* * The link used to get the next page of RaiBlocklists. @@ -31,7 +31,7 @@ public final class RaiBlockListResult implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The list of RaiBlocklist. - * - * @param value the value value to set. - * @return the RaiBlockListResult object itself. - */ - public RaiBlockListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiContentFilterListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiContentFilterListResult.java similarity index 72% rename from sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiContentFilterListResult.java rename to sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiContentFilterListResult.java index f9a2ceecb9c9..95da9f767e37 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiContentFilterListResult.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiContentFilterListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cognitiveservices.models; +package com.azure.resourcemanager.cognitiveservices.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The list of Content Filters. */ -@Fluent +@Immutable public final class RaiContentFilterListResult implements JsonSerializable { /* * The link used to get the next page of Content Filters. @@ -31,7 +31,7 @@ public final class RaiContentFilterListResult implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The list of RaiContentFilter. - * - * @param value the value value to set. - * @return the RaiContentFilterListResult object itself. - */ - public RaiContentFilterListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiExternalSafetyProviderResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiExternalSafetyProviderResult.java new file mode 100644 index 000000000000..969d09513577 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiExternalSafetyProviderResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderSchemaInner; +import java.io.IOException; +import java.util.List; + +/** + * The list of cognitive services RAI External Safety Providers. + */ +@Immutable +public final class RaiExternalSafetyProviderResult implements JsonSerializable { + /* + * The link used to get the next page of Rai External Safety Provider. + */ + private String nextLink; + + /* + * The list of RaiExternalSafetyProvider. + */ + private List value; + + /** + * Creates an instance of RaiExternalSafetyProviderResult class. + */ + private RaiExternalSafetyProviderResult() { + } + + /** + * Get the nextLink property: The link used to get the next page of Rai External Safety Provider. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: The list of RaiExternalSafetyProvider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RaiExternalSafetyProviderResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RaiExternalSafetyProviderResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RaiExternalSafetyProviderResult. + */ + public static RaiExternalSafetyProviderResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RaiExternalSafetyProviderResult deserializedRaiExternalSafetyProviderResult + = new RaiExternalSafetyProviderResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedRaiExternalSafetyProviderResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> RaiExternalSafetyProviderSchemaInner.fromJson(reader1)); + deserializedRaiExternalSafetyProviderResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedRaiExternalSafetyProviderResult; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiPolicyListResult.java similarity index 72% rename from sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyListResult.java rename to sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiPolicyListResult.java index ca619ba3e9c6..20a88ba7c86c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyListResult.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiPolicyListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cognitiveservices.models; +package com.azure.resourcemanager.cognitiveservices.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The list of cognitive services RaiPolicies. */ -@Fluent +@Immutable public final class RaiPolicyListResult implements JsonSerializable { /* * The link used to get the next page of RaiPolicy. @@ -31,7 +31,7 @@ public final class RaiPolicyListResult implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The list of RaiPolicy. - * - * @param value the value value to set. - * @return the RaiPolicyListResult object itself. - */ - public RaiPolicyListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiToolLabelResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiToolLabelResult.java new file mode 100644 index 000000000000..c5a00f7cedb8 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiToolLabelResult.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiToolLabelInner; +import java.io.IOException; +import java.util.List; + +/** + * The list of Cognitive Services RAI Tool Labels. + */ +@Immutable +public final class RaiToolLabelResult implements JsonSerializable { + /* + * The link used to get the next page of RaiToolLabels. + */ + private String nextLink; + + /* + * The list of RAI Tool Labels. + */ + private List value; + + /** + * Creates an instance of RaiToolLabelResult class. + */ + private RaiToolLabelResult() { + } + + /** + * Get the nextLink property: The link used to get the next page of RaiToolLabels. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Get the value property: The list of RAI Tool Labels. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RaiToolLabelResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RaiToolLabelResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RaiToolLabelResult. + */ + public static RaiToolLabelResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RaiToolLabelResult deserializedRaiToolLabelResult = new RaiToolLabelResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nextLink".equals(fieldName)) { + deserializedRaiToolLabelResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> RaiToolLabelInner.fromJson(reader1)); + deserializedRaiToolLabelResult.value = value; + } else { + reader.skipChildren(); + } + } + + return deserializedRaiToolLabelResult; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopicResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiTopicResult.java similarity index 72% rename from sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopicResult.java rename to sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiTopicResult.java index 6290dd9831fd..1c94afb8e5de 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopicResult.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiTopicResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cognitiveservices.models; +package com.azure.resourcemanager.cognitiveservices.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The list of cognitive services RAI Topics. */ -@Fluent +@Immutable public final class RaiTopicResult implements JsonSerializable { /* * The link used to get the next page of RaiTopics. @@ -31,7 +31,7 @@ public final class RaiTopicResult implements JsonSerializable { /** * Creates an instance of RaiTopicResult class. */ - public RaiTopicResult() { + private RaiTopicResult() { } /** @@ -43,17 +43,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link used to get the next page of RaiTopics. - * - * @param nextLink the nextLink value to set. - * @return the RaiTopicResult object itself. - */ - public RaiTopicResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Get the value property: The list of RaiTopic. * @@ -63,28 +52,6 @@ public List value() { return this.value; } - /** - * Set the value property: The list of RaiTopic. - * - * @param value the value value to set. - * @return the RaiTopicResult object itself. - */ - public RaiTopicResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ResourceSkuListResult.java similarity index 62% rename from sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuListResult.java rename to sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ResourceSkuListResult.java index f4fa9615711b..9eff59dc3d0d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuListResult.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ResourceSkuListResult.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cognitiveservices.models; +package com.azure.resourcemanager.cognitiveservices.implementation.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,26 +16,26 @@ /** * The Get Skus operation response. */ -@Fluent +@Immutable public final class ResourceSkuListResult implements JsonSerializable { /* - * The list of skus available for the subscription. + * The ResourceSku items on this page */ private List value; /* - * The uri to fetch the next page of Skus. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of ResourceSkuListResult class. */ - public ResourceSkuListResult() { + private ResourceSkuListResult() { } /** - * Get the value property: The list of skus available for the subscription. + * Get the value property: The ResourceSku items on this page. * * @return the value value. */ @@ -45,18 +44,7 @@ public List value() { } /** - * Set the value property: The list of skus available for the subscription. - * - * @param value the value value to set. - * @return the ResourceSkuListResult object itself. - */ - public ResourceSkuListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The uri to fetch the next page of Skus. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -64,33 +52,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The uri to fetch the next page of Skus. - * - * @param nextLink the nextLink value to set. - * @return the ResourceSkuListResult object itself. - */ - public ResourceSkuListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property value in model ResourceSkuListResult")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ResourceSkuListResult.class); - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/package-info.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/package-info.java index dc4f03b180ef..d3d3cdded82c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/package-info.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the implementations for CognitiveServicesManagementClient. + * Package containing the implementations for CognitiveServices. * Cognitive Services Management Client. */ package com.azure.resourcemanager.cognitiveservices.implementation; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AadAuthTypeConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AadAuthTypeConnectionProperties.java index e2987a78d5a7..a20be5287163 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AadAuthTypeConnectionProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AadAuthTypeConnectionProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -131,15 +131,6 @@ public AadAuthTypeConnectionProperties withUseWorkspaceManagedIdentity(Boolean u return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AbusePenalty.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AbusePenalty.java index acc758094031..d14625be0407 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AbusePenalty.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AbusePenalty.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * The abuse penalty. */ -@Fluent +@Immutable public final class AbusePenalty implements JsonSerializable { /* * The action of AbusePenalty. @@ -37,7 +37,7 @@ public final class AbusePenalty implements JsonSerializable { /** * Creates an instance of AbusePenalty class. */ - public AbusePenalty() { + private AbusePenalty() { } /** @@ -49,17 +49,6 @@ public AbusePenaltyAction action() { return this.action; } - /** - * Set the action property: The action of AbusePenalty. - * - * @param action the action value to set. - * @return the AbusePenalty object itself. - */ - public AbusePenalty withAction(AbusePenaltyAction action) { - this.action = action; - return this; - } - /** * Get the rateLimitPercentage property: The percentage of rate limit. * @@ -69,17 +58,6 @@ public Float rateLimitPercentage() { return this.rateLimitPercentage; } - /** - * Set the rateLimitPercentage property: The percentage of rate limit. - * - * @param rateLimitPercentage the rateLimitPercentage value to set. - * @return the AbusePenalty object itself. - */ - public AbusePenalty withRateLimitPercentage(Float rateLimitPercentage) { - this.rateLimitPercentage = rateLimitPercentage; - return this; - } - /** * Get the expiration property: The datetime of expiration of the AbusePenalty. * @@ -89,25 +67,6 @@ public OffsetDateTime expiration() { return this.expiration; } - /** - * Set the expiration property: The datetime of expiration of the AbusePenalty. - * - * @param expiration the expiration value to set. - * @return the AbusePenalty object itself. - */ - public AbusePenalty withExpiration(OffsetDateTime expiration) { - this.expiration = expiration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AbusePenaltyAction.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AbusePenaltyAction.java index 97f64608cfb1..b469f4f45628 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AbusePenaltyAction.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AbusePenaltyAction.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccessKeyAuthTypeConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccessKeyAuthTypeConnectionProperties.java index 201c07de3975..c9c7787471f1 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccessKeyAuthTypeConnectionProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccessKeyAuthTypeConnectionProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -156,18 +156,6 @@ public AccessKeyAuthTypeConnectionProperties withUseWorkspaceManagedIdentity(Boo return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (credentials() != null) { - credentials().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Account.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Account.java index 4fd1256d3e81..1e5f47e59ca7 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Account.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Account.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -37,60 +37,60 @@ public interface Account { String type(); /** - * Gets the etag property: Resource Etag. + * Gets the properties property: Properties of Cognitive Services account. * - * @return the etag value. + * @return the properties value. */ - String etag(); + AccountProperties properties(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Gets the tags property: Resource tags. * - * @return the systemData value. + * @return the tags value. */ - SystemData systemData(); + Map tags(); /** - * Gets the kind property: The Kind of the resource. + * Gets the location property: The geo-location where the resource lives. * - * @return the kind value. + * @return the location value. */ - String kind(); + String location(); /** - * Gets the sku property: The resource model definition representing SKU. + * Gets the etag property: Resource Etag. * - * @return the sku value. + * @return the etag value. */ - Sku sku(); + String etag(); /** - * Gets the identity property: Identity for the resource. + * Gets the kind property: The kind (type) of cognitive service account. * - * @return the identity value. + * @return the kind value. */ - Identity identity(); + String kind(); /** - * Gets the tags property: Resource tags. + * Gets the sku property: The resource model definition representing SKU. * - * @return the tags value. + * @return the sku value. */ - Map tags(); + Sku sku(); /** - * Gets the location property: The geo-location where the resource lives. + * Gets the identity property: Identity for the resource. * - * @return the location value. + * @return the identity value. */ - String location(); + Identity identity(); /** - * Gets the properties property: Properties of Cognitive Services account. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the properties value. + * @return the systemData value. */ - AccountProperties properties(); + SystemData systemData(); /** * Gets the region of the resource. @@ -155,8 +155,8 @@ interface WithResourceGroup { * created, but also allows for any other optional properties to be specified. */ interface WithCreate - extends DefinitionStages.WithLocation, DefinitionStages.WithTags, DefinitionStages.WithKind, - DefinitionStages.WithSku, DefinitionStages.WithIdentity, DefinitionStages.WithProperties { + extends DefinitionStages.WithLocation, DefinitionStages.WithTags, DefinitionStages.WithProperties, + DefinitionStages.WithKind, DefinitionStages.WithSku, DefinitionStages.WithIdentity { /** * Executes the create request. * @@ -207,14 +207,27 @@ interface WithTags { WithCreate withTags(Map tags); } + /** + * The stage of the Account definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Properties of Cognitive Services account.. + * + * @param properties Properties of Cognitive Services account. + * @return the next definition stage. + */ + WithCreate withProperties(AccountProperties properties); + } + /** * The stage of the Account definition allowing to specify kind. */ interface WithKind { /** - * Specifies the kind property: The Kind of the resource.. + * Specifies the kind property: The kind (type) of cognitive service account.. * - * @param kind The Kind of the resource. + * @param kind The kind (type) of cognitive service account. * @return the next definition stage. */ WithCreate withKind(String kind); @@ -245,19 +258,6 @@ interface WithIdentity { */ WithCreate withIdentity(Identity identity); } - - /** - * The stage of the Account definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of Cognitive Services account.. - * - * @param properties Properties of Cognitive Services account. - * @return the next definition stage. - */ - WithCreate withProperties(AccountProperties properties); - } } /** @@ -270,8 +270,8 @@ interface WithProperties { /** * The template for Account update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithKind, UpdateStages.WithSku, - UpdateStages.WithIdentity, UpdateStages.WithProperties { + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties, UpdateStages.WithKind, + UpdateStages.WithSku, UpdateStages.WithIdentity { /** * Executes the update request. * @@ -305,14 +305,27 @@ interface WithTags { Update withTags(Map tags); } + /** + * The stage of the Account update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Properties of Cognitive Services account.. + * + * @param properties Properties of Cognitive Services account. + * @return the next definition stage. + */ + Update withProperties(AccountProperties properties); + } + /** * The stage of the Account update allowing to specify kind. */ interface WithKind { /** - * Specifies the kind property: The Kind of the resource.. + * Specifies the kind property: The kind (type) of cognitive service account.. * - * @param kind The Kind of the resource. + * @param kind The kind (type) of cognitive service account. * @return the next definition stage. */ Update withKind(String kind); @@ -343,19 +356,6 @@ interface WithIdentity { */ Update withIdentity(Identity identity); } - - /** - * The stage of the Account update allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of Cognitive Services account.. - * - * @param properties Properties of Cognitive Services account. - * @return the next definition stage. - */ - Update withProperties(AccountProperties properties); - } } /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountCapabilityHosts.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountCapabilityHosts.java index 53ac65d14e5d..edf68eb2a3c2 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountCapabilityHosts.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountCapabilityHosts.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; @@ -11,58 +12,83 @@ * Resource collection API of AccountCapabilityHosts. */ public interface AccountCapabilityHosts { + /** + * Get account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return account capabilityHost along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String accountName, String capabilityHostName, + Context context); + + /** + * Get account capabilityHost. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return account capabilityHost. + */ + CapabilityHost get(String resourceGroupName, String accountName, String capabilityHostName); + /** * Delete account capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void delete(String resourceGroupName, String accountName, String capabilityHostname); + void delete(String resourceGroupName, String accountName, String capabilityHostName); /** * Delete account capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void delete(String resourceGroupName, String accountName, String capabilityHostname, Context context); + void delete(String resourceGroupName, String accountName, String capabilityHostName, Context context); /** - * Get account capabilityHost. + * List capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return account capabilityHost along with {@link Response}. + * @return a paginated list of Capability Host entities as paginated response with {@link PagedIterable}. */ - Response getWithResponse(String resourceGroupName, String accountName, String capabilityHostname, - Context context); + PagedIterable list(String resourceGroupName, String accountName); /** - * Get account capabilityHost. + * List capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return account capabilityHost. + * @return a paginated list of Capability Host entities as paginated response with {@link PagedIterable}. */ - CapabilityHost get(String resourceGroupName, String accountName, String capabilityHostname); + PagedIterable list(String resourceGroupName, String accountName, Context context); /** * Get account capabilityHost. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountConnections.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountConnections.java index e1cc39f7499e..44119d8900fd 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountConnections.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountConnections.java @@ -1,19 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; /** * Resource collection API of AccountConnections. */ public interface AccountConnections { /** - * Delete Cognitive Services account connection by name. + * Lists Cognitive Services account connection by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -22,13 +23,13 @@ public interface AccountConnections { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return connection base resource schema along with {@link Response}. */ - Response deleteWithResponse(String resourceGroupName, String accountName, String connectionName, - Context context); + Response getWithResponse(String resourceGroupName, String accountName, + String connectionName, Context context); /** - * Delete Cognitive Services account connection by name. + * Lists Cognitive Services account connection by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -36,26 +37,28 @@ Response deleteWithResponse(String resourceGroupName, String accountName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema. */ - void delete(String resourceGroupName, String accountName, String connectionName); + ConnectionPropertiesV2BasicResource get(String resourceGroupName, String accountName, String connectionName); /** - * Lists Cognitive Services account connection by name. + * Create or update Cognitive Services account connection under the specified account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param connectionName Friendly name of the connection. + * @param connection The object for creating or updating a new account connection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return connection base resource schema along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String accountName, - String connectionName, Context context); + Response createWithResponse(String resourceGroupName, String accountName, + String connectionName, ConnectionPropertiesV2BasicResourceInner connection, Context context); /** - * Lists Cognitive Services account connection by name. + * Create or update Cognitive Services account connection under the specified account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -65,88 +68,91 @@ Response getWithResponse(String resourceGro * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return connection base resource schema. */ - ConnectionPropertiesV2BasicResource get(String resourceGroupName, String accountName, String connectionName); + ConnectionPropertiesV2BasicResource create(String resourceGroupName, String accountName, String connectionName); /** - * Lists all the available Cognitive Services account connections under the specified account. + * Update Cognitive Services account connection under the specified account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @param connection Parameters for account connection update. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return connection base resource schema along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String accountName); + Response updateWithResponse(String resourceGroupName, String accountName, + String connectionName, ConnectionUpdateContent connection, Context context); /** - * Lists all the available Cognitive Services account connections under the specified account. + * Update Cognitive Services account connection under the specified account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param target Target of the connection. - * @param category Category of the connection. - * @param includeAll query parameter that indicates if get connection call should return both connections and - * datastores. - * @param context The context to associate with this operation. + * @param connectionName Friendly name of the connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return connection base resource schema. */ - PagedIterable list(String resourceGroupName, String accountName, String target, - String category, Boolean includeAll, Context context); + ConnectionPropertiesV2BasicResource update(String resourceGroupName, String accountName, String connectionName); /** - * Lists Cognitive Services account connection by name. + * Delete Cognitive Services account connection by name. * - * @param id the resource ID. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema along with {@link Response}. + * @return the {@link Response}. */ - ConnectionPropertiesV2BasicResource getById(String id); + Response deleteWithResponse(String resourceGroupName, String accountName, String connectionName, + Context context); /** - * Lists Cognitive Services account connection by name. + * Delete Cognitive Services account connection by name. * - * @param id the resource ID. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param connectionName Friendly name of the connection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema along with {@link Response}. */ - Response getByIdWithResponse(String id, Context context); + void delete(String resourceGroupName, String accountName, String connectionName); /** - * Delete Cognitive Services account connection by name. + * Lists all the available Cognitive Services account connections under the specified account. * - * @param id the resource ID. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated response with {@link PagedIterable}. */ - void deleteById(String id); + PagedIterable list(String resourceGroupName, String accountName); /** - * Delete Cognitive Services account connection by name. + * Lists all the available Cognitive Services account connections under the specified account. * - * @param id the resource ID. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param target Target of the connection. + * @param category Category of the connection. + * @param includeAll query parameter that indicates if get connection call should return both connections and + * datastores. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new ConnectionPropertiesV2BasicResource resource. - * - * @param name resource name. - * @return the first stage of the new ConnectionPropertiesV2BasicResource definition. + * @return the paginated response with {@link PagedIterable}. */ - ConnectionPropertiesV2BasicResource.DefinitionStages.Blank define(String name); + PagedIterable list(String resourceGroupName, String accountName, String target, + String category, Boolean includeAll, Context context); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountKeyAuthTypeConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountKeyAuthTypeConnectionProperties.java index 29e752c84531..714640224a1d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountKeyAuthTypeConnectionProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountKeyAuthTypeConnectionProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -156,18 +156,6 @@ public AccountKeyAuthTypeConnectionProperties withUseWorkspaceManagedIdentity(Bo return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (credentials() != null) { - credentials().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountModel.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountModel.java index cc18bdd9f5f5..18adddf7e032 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountModel.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountModel.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountProperties.java index 547772ba9890..70800672ab5f 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -180,6 +180,11 @@ public final class AccountProperties implements JsonSerializable networkInjections; + /* + * Represents the foundry auto-upgrade configuration for a Cognitive Services account. + */ + private FoundryAutoUpgrade foundryAutoUpgrade; + /* * Specifies whether this resource support project management as child resources, used as containers for access * management, data isolation and cost in AI Foundry. @@ -681,6 +686,28 @@ public AccountProperties withNetworkInjections(List networkInj return this; } + /** + * Get the foundryAutoUpgrade property: Represents the foundry auto-upgrade configuration for a Cognitive Services + * account. + * + * @return the foundryAutoUpgrade value. + */ + public FoundryAutoUpgrade foundryAutoUpgrade() { + return this.foundryAutoUpgrade; + } + + /** + * Set the foundryAutoUpgrade property: Represents the foundry auto-upgrade configuration for a Cognitive Services + * account. + * + * @param foundryAutoUpgrade the foundryAutoUpgrade value to set. + * @return the AccountProperties object itself. + */ + public AccountProperties withFoundryAutoUpgrade(FoundryAutoUpgrade foundryAutoUpgrade) { + this.foundryAutoUpgrade = foundryAutoUpgrade; + return this; + } + /** * Get the allowProjectManagement property: Specifies whether this resource support project management as child * resources, used as containers for access management, data isolation and cost in AI Foundry. @@ -747,59 +774,6 @@ public AccountProperties withAssociatedProjects(List associatedProjects) return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (capabilities() != null) { - capabilities().forEach(e -> e.validate()); - } - if (skuChangeInfo() != null) { - skuChangeInfo().validate(); - } - if (networkAcls() != null) { - networkAcls().validate(); - } - if (encryption() != null) { - encryption().validate(); - } - if (userOwnedStorage() != null) { - userOwnedStorage().forEach(e -> e.validate()); - } - if (amlWorkspace() != null) { - amlWorkspace().validate(); - } - if (privateEndpointConnections() != null) { - privateEndpointConnections().forEach(e -> e.validate()); - } - if (apiProperties() != null) { - apiProperties().validate(); - } - if (callRateLimit() != null) { - callRateLimit().validate(); - } - if (quotaLimit() != null) { - quotaLimit().validate(); - } - if (locations() != null) { - locations().validate(); - } - if (commitmentPlanAssociations() != null) { - commitmentPlanAssociations().forEach(e -> e.validate()); - } - if (abusePenalty() != null) { - abusePenalty().validate(); - } - if (raiMonitorConfig() != null) { - raiMonitorConfig().validate(); - } - if (networkInjections() != null) { - networkInjections().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -827,6 +801,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("raiMonitorConfig", this.raiMonitorConfig); jsonWriter.writeArrayField("networkInjections", this.networkInjections, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("foundryAutoUpgrade", this.foundryAutoUpgrade); jsonWriter.writeBooleanField("allowProjectManagement", this.allowProjectManagement); jsonWriter.writeStringField("defaultProject", this.defaultProject); jsonWriter.writeArrayField("associatedProjects", this.associatedProjects, @@ -927,6 +902,8 @@ public static AccountProperties fromJson(JsonReader jsonReader) throws IOExcepti List networkInjections = reader.readArray(reader1 -> NetworkInjection.fromJson(reader1)); deserializedAccountProperties.networkInjections = networkInjections; + } else if ("foundryAutoUpgrade".equals(fieldName)) { + deserializedAccountProperties.foundryAutoUpgrade = FoundryAutoUpgrade.fromJson(reader); } else if ("allowProjectManagement".equals(fieldName)) { deserializedAccountProperties.allowProjectManagement = reader.getNullable(JsonReader::getBoolean); } else if ("defaultProject".equals(fieldName)) { diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountSku.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountSku.java index 03e27c878ef4..539fdd4a90aa 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountSku.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountSku.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Cognitive Services resource type and SKU. */ -@Fluent +@Immutable public final class AccountSku implements JsonSerializable { /* * Resource Namespace and Type @@ -29,7 +29,7 @@ public final class AccountSku implements JsonSerializable { /** * Creates an instance of AccountSku class. */ - public AccountSku() { + private AccountSku() { } /** @@ -41,17 +41,6 @@ public String resourceType() { return this.resourceType; } - /** - * Set the resourceType property: Resource Namespace and Type. - * - * @param resourceType the resourceType value to set. - * @return the AccountSku object itself. - */ - public AccountSku withResourceType(String resourceType) { - this.resourceType = resourceType; - return this; - } - /** * Get the sku property: The SKU of Cognitive Services account. * @@ -61,28 +50,6 @@ public Sku sku() { return this.sku; } - /** - * Set the sku property: The SKU of Cognitive Services account. - * - * @param sku the sku value to set. - * @return the AccountSku object itself. - */ - public AccountSku withSku(Sku sku) { - this.sku = sku; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountSkuListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountSkuListResult.java index 18341c0d873d..08a5aa96c08f 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountSkuListResult.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountSkuListResult.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Accounts.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Accounts.java index a1bc1b4c44e3..ab6b88335502 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Accounts.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Accounts.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -13,54 +13,54 @@ */ public interface Accounts { /** - * Deletes a Cognitive Services account from the resource group. + * Returns a Cognitive Services account specified by the parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location + * and SKU along with {@link Response}. */ - void deleteByResourceGroup(String resourceGroupName, String accountName); + Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, Context context); /** - * Deletes a Cognitive Services account from the resource group. + * Returns a Cognitive Services account specified by the parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location + * and SKU. */ - void delete(String resourceGroupName, String accountName, Context context); + Account getByResourceGroup(String resourceGroupName, String accountName); /** - * Returns a Cognitive Services account specified by the parameters. + * Deletes a Cognitive Services account from the resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU along with {@link Response}. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, Context context); + void deleteByResourceGroup(String resourceGroupName, String accountName); /** - * Returns a Cognitive Services account specified by the parameters. + * Deletes a Cognitive Services account from the resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location - * and SKU. */ - Account getByResourceGroup(String resourceGroupName, String accountName); + void delete(String resourceGroupName, String accountName, Context context); /** * Returns all the resources of a particular type belonging to a resource group. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ActionType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ActionType.java index ecb3703f0565..86a39a8fb893 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ActionType.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ActionType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -8,11 +8,11 @@ import java.util.Collection; /** - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ public final class ActionType extends ExpandableStringEnum { /** - * Static value Internal for ActionType. + * Actions are for internal-only APIs. */ public static final ActionType INTERNAL = fromString("Internal"); diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentApplication.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentApplication.java new file mode 100644 index 000000000000..e54bdd12f814 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentApplication.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentApplicationInner; + +/** + * An immutable client-side representation of AgentApplication. + */ +public interface AgentApplication { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + AgenticApplicationProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.AgentApplicationInner object. + * + * @return the inner object. + */ + AgentApplicationInner innerModel(); + + /** + * The entirety of the AgentApplication definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * The AgentApplication definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the AgentApplication definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the AgentApplication definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName, projectName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @return the next definition stage. + */ + WithProperties withExistingProject(String resourceGroupName, String accountName, String projectName); + } + + /** + * The stage of the AgentApplication definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: [Required] Additional attributes of the entity.. + * + * @param properties [Required] Additional attributes of the entity. + * @return the next definition stage. + */ + WithCreate withProperties(AgenticApplicationProperties properties); + } + + /** + * The stage of the AgentApplication definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate { + /** + * Executes the create request. + * + * @return the created resource. + */ + AgentApplication create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AgentApplication create(Context context); + } + } + + /** + * Begins update for the AgentApplication resource. + * + * @return the stage of resource update. + */ + AgentApplication.Update update(); + + /** + * The template for AgentApplication update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AgentApplication apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AgentApplication apply(Context context); + } + + /** + * The AgentApplication update stages. + */ + interface UpdateStages { + /** + * The stage of the AgentApplication update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: [Required] Additional attributes of the entity.. + * + * @param properties [Required] Additional attributes of the entity. + * @return the next definition stage. + */ + Update withProperties(AgenticApplicationProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AgentApplication refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AgentApplication refresh(Context context); + + /** + * Lists agents for an Agent Application. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Reference entities along with {@link Response}. + */ + Response listAgentsWithResponse(Context context); + + /** + * Lists agents for an Agent Application. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Reference entities. + */ + AgentReferenceResourceArmPaginatedResult listAgents(); + + /** + * Enables an Agent Application. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response enableWithResponse(Context context); + + /** + * Enables an Agent Application. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void enable(); + + /** + * Disables an Agent Application. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response disableWithResponse(Context context); + + /** + * Disables an Agent Application. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void disable(); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentApplications.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentApplications.java new file mode 100644 index 000000000000..3218d122e81c --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentApplications.java @@ -0,0 +1,249 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.util.List; + +/** + * Resource collection API of AgentApplications. + */ +public interface AgentApplications { + /** + * Gets an Agent Application by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Agent Application by name along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String accountName, String projectName, + String name, Context context); + + /** + * Gets an Agent Application by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Agent Application by name. + */ + AgentApplication get(String resourceGroupName, String accountName, String projectName, String name); + + /** + * Delete Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String projectName, String name); + + /** + * Delete Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String projectName, String name, Context context); + + /** + * Lists Agent Applications in the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Application entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, String projectName); + + /** + * Lists Agent Applications in the project. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param count Number of agent applications to be retrieved in a page of results. + * @param skip Number of agent applications to skip. + * @param skipToken Continuation token for pagination. + * @param names Names of agent applications to retrieve. + * @param searchText Search text for filtering agent applications. + * @param orderBy Field to order by. + * @param orderByAsc Whether to order in ascending order. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Application entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, String projectName, + Integer count, Integer skip, String skipToken, List names, String searchText, String orderBy, + Boolean orderByAsc, Context context); + + /** + * Lists agents for an Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Reference entities along with {@link Response}. + */ + Response listAgentsWithResponse(String resourceGroupName, + String accountName, String projectName, String name, Context context); + + /** + * Lists agents for an Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Reference entities. + */ + AgentReferenceResourceArmPaginatedResult listAgents(String resourceGroupName, String accountName, + String projectName, String name); + + /** + * Enables an Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response enableWithResponse(String resourceGroupName, String accountName, String projectName, String name, + Context context); + + /** + * Enables an Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void enable(String resourceGroupName, String accountName, String projectName, String name); + + /** + * Disables an Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response disableWithResponse(String resourceGroupName, String accountName, String projectName, String name, + Context context); + + /** + * Disables an Agent Application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param name Name for the Agent Application. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void disable(String resourceGroupName, String accountName, String projectName, String name); + + /** + * Gets an Agent Application by name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Agent Application by name along with {@link Response}. + */ + AgentApplication getById(String id); + + /** + * Gets an Agent Application by name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Agent Application by name along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete Agent Application. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete Agent Application. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AgentApplication resource. + * + * @param name resource name. + * @return the first stage of the new AgentApplication definition. + */ + AgentApplication.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeployment.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeployment.java new file mode 100644 index 000000000000..4c2453c11fe1 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeployment.java @@ -0,0 +1,231 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentDeploymentInner; + +/** + * An immutable client-side representation of AgentDeployment. + */ +public interface AgentDeployment { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + AgentDeploymentProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.AgentDeploymentInner object. + * + * @return the inner object. + */ + AgentDeploymentInner innerModel(); + + /** + * The entirety of the AgentDeployment definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * The AgentDeployment definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the AgentDeployment definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the AgentDeployment definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName, projectName, appName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @return the next definition stage. + */ + WithProperties withExistingApplication(String resourceGroupName, String accountName, String projectName, + String appName); + } + + /** + * The stage of the AgentDeployment definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: [Required] Additional attributes of the entity.. + * + * @param properties [Required] Additional attributes of the entity. + * @return the next definition stage. + */ + WithCreate withProperties(AgentDeploymentProperties properties); + } + + /** + * The stage of the AgentDeployment definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate { + /** + * Executes the create request. + * + * @return the created resource. + */ + AgentDeployment create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + AgentDeployment create(Context context); + } + } + + /** + * Begins update for the AgentDeployment resource. + * + * @return the stage of resource update. + */ + AgentDeployment.Update update(); + + /** + * The template for AgentDeployment update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + AgentDeployment apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + AgentDeployment apply(Context context); + } + + /** + * The AgentDeployment update stages. + */ + interface UpdateStages { + /** + * The stage of the AgentDeployment update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: [Required] Additional attributes of the entity.. + * + * @param properties [Required] Additional attributes of the entity. + * @return the next definition stage. + */ + Update withProperties(AgentDeploymentProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + AgentDeployment refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + AgentDeployment refresh(Context context); + + /** + * Starts an Agent Deployment. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response startWithResponse(Context context); + + /** + * Starts an Agent Deployment. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(); + + /** + * Stops an Agent Deployment. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response stopWithResponse(Context context); + + /** + * Stops an Agent Deployment. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentProperties.java new file mode 100644 index 000000000000..e57413f5687f --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentProperties.java @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Type representing an agent deployment as a management construct. + */ +@Fluent +public class AgentDeploymentProperties extends ResourceBase { + /* + * Gets or sets the type of deployment for the agent. + */ + private AgentDeploymentType deploymentType = AgentDeploymentType.fromString("AgentDeploymentProperties"); + + /* + * Gets or sets the display name of the deployment. + */ + private String displayName; + + /* + * Gets or sets the unique identifier of the deployment. + */ + private String deploymentId; + + /* + * Gets or sets the current operational state of the deployment (and, intrinsically, of the comprising agents). + */ + private AgentDeploymentState state; + + /* + * Gets or sets the supported protocol types and versions exposed by this deployment. + */ + private List protocols; + + /* + * Returns a flat list of agent:version deployed in this deployment. + */ + private List agents; + + /* + * Gets or sets the provisioning state of the agent deployment. + */ + private AgentDeploymentProvisioningState provisioningState; + + /** + * Creates an instance of AgentDeploymentProperties class. + */ + public AgentDeploymentProperties() { + } + + /** + * Get the deploymentType property: Gets or sets the type of deployment for the agent. + * + * @return the deploymentType value. + */ + public AgentDeploymentType deploymentType() { + return this.deploymentType; + } + + /** + * Get the displayName property: Gets or sets the display name of the deployment. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Gets or sets the display name of the deployment. + * + * @param displayName the displayName value to set. + * @return the AgentDeploymentProperties object itself. + */ + public AgentDeploymentProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the deploymentId property: Gets or sets the unique identifier of the deployment. + * + * @return the deploymentId value. + */ + public String deploymentId() { + return this.deploymentId; + } + + /** + * Set the deploymentId property: Gets or sets the unique identifier of the deployment. + * + * @param deploymentId the deploymentId value to set. + * @return the AgentDeploymentProperties object itself. + */ + public AgentDeploymentProperties withDeploymentId(String deploymentId) { + this.deploymentId = deploymentId; + return this; + } + + /** + * Get the state property: Gets or sets the current operational state of the deployment (and, intrinsically, of the + * comprising agents). + * + * @return the state value. + */ + public AgentDeploymentState state() { + return this.state; + } + + /** + * Set the state property: Gets or sets the current operational state of the deployment (and, intrinsically, of the + * comprising agents). + * + * @param state the state value to set. + * @return the AgentDeploymentProperties object itself. + */ + public AgentDeploymentProperties withState(AgentDeploymentState state) { + this.state = state; + return this; + } + + /** + * Get the protocols property: Gets or sets the supported protocol types and versions exposed by this deployment. + * + * @return the protocols value. + */ + public List protocols() { + return this.protocols; + } + + /** + * Set the protocols property: Gets or sets the supported protocol types and versions exposed by this deployment. + * + * @param protocols the protocols value to set. + * @return the AgentDeploymentProperties object itself. + */ + public AgentDeploymentProperties withProtocols(List protocols) { + this.protocols = protocols; + return this; + } + + /** + * Get the agents property: Returns a flat list of agent:version deployed in this deployment. + * + * @return the agents value. + */ + public List agents() { + return this.agents; + } + + /** + * Set the agents property: Returns a flat list of agent:version deployed in this deployment. + * + * @param agents the agents value to set. + * @return the AgentDeploymentProperties object itself. + */ + public AgentDeploymentProperties withAgents(List agents) { + this.agents = agents; + return this; + } + + /** + * Get the provisioningState property: Gets or sets the provisioning state of the agent deployment. + * + * @return the provisioningState value. + */ + public AgentDeploymentProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: Gets or sets the provisioning state of the agent deployment. + * + * @param provisioningState the provisioningState value to set. + * @return the AgentDeploymentProperties object itself. + */ + AgentDeploymentProperties withProvisioningState(AgentDeploymentProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AgentDeploymentProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AgentDeploymentProperties withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("deploymentType", + this.deploymentType == null ? null : this.deploymentType.toString()); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("deploymentId", this.deploymentId); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeArrayField("protocols", this.protocols, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("agents", this.agents, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentDeploymentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentDeploymentProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AgentDeploymentProperties. + */ + public static AgentDeploymentProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("deploymentType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Managed".equals(discriminatorValue)) { + return ManagedAgentDeployment.fromJson(readerToUse.reset()); + } else if ("Hosted".equals(discriminatorValue)) { + return HostedAgentDeployment.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static AgentDeploymentProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentDeploymentProperties deserializedAgentDeploymentProperties = new AgentDeploymentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedAgentDeploymentProperties.withDescription(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAgentDeploymentProperties.withTags(tags); + } else if ("deploymentType".equals(fieldName)) { + deserializedAgentDeploymentProperties.deploymentType + = AgentDeploymentType.fromString(reader.getString()); + } else if ("displayName".equals(fieldName)) { + deserializedAgentDeploymentProperties.displayName = reader.getString(); + } else if ("deploymentId".equals(fieldName)) { + deserializedAgentDeploymentProperties.deploymentId = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedAgentDeploymentProperties.state = AgentDeploymentState.fromString(reader.getString()); + } else if ("protocols".equals(fieldName)) { + List protocols + = reader.readArray(reader1 -> AgentProtocolVersion.fromJson(reader1)); + deserializedAgentDeploymentProperties.protocols = protocols; + } else if ("agents".equals(fieldName)) { + List agents + = reader.readArray(reader1 -> VersionedAgentReference.fromJson(reader1)); + deserializedAgentDeploymentProperties.agents = agents; + } else if ("provisioningState".equals(fieldName)) { + deserializedAgentDeploymentProperties.provisioningState + = AgentDeploymentProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAgentDeploymentProperties; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentProvisioningState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentProvisioningState.java new file mode 100644 index 000000000000..aad3f1ba8de8 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentProvisioningState.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning state of an agentic deployment, as an Azure resource. + */ +public final class AgentDeploymentProvisioningState extends ExpandableStringEnum { + /** + * The deployment was successfully completed. + */ + public static final AgentDeploymentProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * The deployment failed. + */ + public static final AgentDeploymentProvisioningState FAILED = fromString("Failed"); + + /** + * The deployment was canceled. + */ + public static final AgentDeploymentProvisioningState CANCELED = fromString("Canceled"); + + /** + * The deployment is being created. + */ + public static final AgentDeploymentProvisioningState CREATING = fromString("Creating"); + + /** + * The deployment is being updated. + */ + public static final AgentDeploymentProvisioningState UPDATING = fromString("Updating"); + + /** + * The deployment is being deleted. + */ + public static final AgentDeploymentProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of AgentDeploymentProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AgentDeploymentProvisioningState() { + } + + /** + * Creates or finds a AgentDeploymentProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AgentDeploymentProvisioningState. + */ + public static AgentDeploymentProvisioningState fromString(String name) { + return fromString(name, AgentDeploymentProvisioningState.class); + } + + /** + * Gets known AgentDeploymentProvisioningState values. + * + * @return known AgentDeploymentProvisioningState values. + */ + public static Collection values() { + return values(AgentDeploymentProvisioningState.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentState.java new file mode 100644 index 000000000000..a0ac8336cdc7 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentState.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Current operational state of the agentic functionality represented by this deployment. + */ +public final class AgentDeploymentState extends ExpandableStringEnum { + /** + * The deployment is starting. + */ + public static final AgentDeploymentState STARTING = fromString("Starting"); + + /** + * The deployment started/is operational. + */ + public static final AgentDeploymentState RUNNING = fromString("Running"); + + /** + * The deployment is being stopped. + */ + public static final AgentDeploymentState STOPPING = fromString("Stopping"); + + /** + * The deployment was stopped. + */ + public static final AgentDeploymentState STOPPED = fromString("Stopped"); + + /** + * The deployment failed. + */ + public static final AgentDeploymentState FAILED = fromString("Failed"); + + /** + * The deployment is being deleted. + */ + public static final AgentDeploymentState DELETING = fromString("Deleting"); + + /** + * The deployment was deleted. + */ + public static final AgentDeploymentState DELETED = fromString("Deleted"); + + /** + * The deployment is being updated. + */ + public static final AgentDeploymentState UPDATING = fromString("Updating"); + + /** + * Creates a new instance of AgentDeploymentState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AgentDeploymentState() { + } + + /** + * Creates or finds a AgentDeploymentState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AgentDeploymentState. + */ + public static AgentDeploymentState fromString(String name) { + return fromString(name, AgentDeploymentState.class); + } + + /** + * Gets known AgentDeploymentState values. + * + * @return known AgentDeploymentState values. + */ + public static Collection values() { + return values(AgentDeploymentState.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentType.java new file mode 100644 index 000000000000..56e85ba56b6f --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentType.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies the type of deployment for an agent, indicating how the underlying compute and network infrastructure is + * managed. + */ +public final class AgentDeploymentType extends ExpandableStringEnum { + /** + * The underlying infra is managed by the platform in the deployer's subscription. + */ + public static final AgentDeploymentType MANAGED = fromString("Managed"); + + /** + * The underlying infra is owned by the platform. + */ + public static final AgentDeploymentType HOSTED = fromString("Hosted"); + + /** + * The underlying infra is provisioned by the deployer (BYO). + */ + public static final AgentDeploymentType CUSTOM = fromString("Custom"); + + /** + * Creates a new instance of AgentDeploymentType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AgentDeploymentType() { + } + + /** + * Creates or finds a AgentDeploymentType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AgentDeploymentType. + */ + public static AgentDeploymentType fromString(String name) { + return fromString(name, AgentDeploymentType.class); + } + + /** + * Gets known AgentDeploymentType values. + * + * @return known AgentDeploymentType values. + */ + public static Collection values() { + return values(AgentDeploymentType.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeployments.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeployments.java new file mode 100644 index 000000000000..a0a2f65bf081 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeployments.java @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import java.util.List; + +/** + * Resource collection API of AgentDeployments. + */ +public interface AgentDeployments { + /** + * Gets an Agent Deployment by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Agent Deployment by name along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String accountName, String projectName, + String appName, String deploymentName, Context context); + + /** + * Gets an Agent Deployment by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Agent Deployment by name. + */ + AgentDeployment get(String resourceGroupName, String accountName, String projectName, String appName, + String deploymentName); + + /** + * Delete Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String projectName, String appName, + String deploymentName); + + /** + * Delete Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String projectName, String appName, String deploymentName, + Context context); + + /** + * Lists Agent Deployments in the application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Deployment entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, String projectName, + String appName); + + /** + * Lists Agent Deployments in the application. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param count Number of agent deployments to be retrieved in a page of results. + * @param skipToken Continuation token for pagination. + * @param names Names of agent deployments to retrieve. + * @param orderBy Field to order by. + * @param orderByAsc Whether to order in ascending order. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a paginated list of Agent Deployment entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, String projectName, + String appName, Integer count, String skipToken, List names, String orderBy, Boolean orderByAsc, + Context context); + + /** + * Starts an Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response startWithResponse(String resourceGroupName, String accountName, String projectName, String appName, + String deploymentName, Context context); + + /** + * Starts an Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void start(String resourceGroupName, String accountName, String projectName, String appName, String deploymentName); + + /** + * Stops an Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response stopWithResponse(String resourceGroupName, String accountName, String projectName, String appName, + String deploymentName, Context context); + + /** + * Stops an Agent Deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @param appName The name of the application associated with the Cognitive Services Account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void stop(String resourceGroupName, String accountName, String projectName, String appName, String deploymentName); + + /** + * Gets an Agent Deployment by name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Agent Deployment by name along with {@link Response}. + */ + AgentDeployment getById(String id); + + /** + * Gets an Agent Deployment by name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an Agent Deployment by name along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete Agent Deployment. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete Agent Deployment. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new AgentDeployment resource. + * + * @param name resource name. + * @return the first stage of the new AgentDeployment definition. + */ + AgentDeployment.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentProtocol.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentProtocol.java new file mode 100644 index 000000000000..766d381b81f5 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentProtocol.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Protocol used by the agent/exposed by a deployment. + */ +public final class AgentProtocol extends ExpandableStringEnum { + /** + * Agent protocol (aka Active). + */ + public static final AgentProtocol AGENT = fromString("Agent"); + + /** + * Agent2Agent standard. + */ + public static final AgentProtocol A2A = fromString("A2A"); + + /** + * OpenAI-compatible. + */ + public static final AgentProtocol RESPONSES = fromString("Responses"); + + /** + * Creates a new instance of AgentProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AgentProtocol() { + } + + /** + * Creates or finds a AgentProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding AgentProtocol. + */ + public static AgentProtocol fromString(String name) { + return fromString(name, AgentProtocol.class); + } + + /** + * Gets known AgentProtocol values. + * + * @return known AgentProtocol values. + */ + public static Collection values() { + return values(AgentProtocol.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentProtocolVersion.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentProtocolVersion.java new file mode 100644 index 000000000000..10df402394d8 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentProtocolVersion.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Type modeling the protocol and version used by an agent/exposed by a deployment. + */ +@Fluent +public final class AgentProtocolVersion implements JsonSerializable { + /* + * The protocol used by the agent/exposed by a deployment. + */ + private AgentProtocol protocol; + + /* + * The version of the protocol. + */ + private String version; + + /** + * Creates an instance of AgentProtocolVersion class. + */ + public AgentProtocolVersion() { + } + + /** + * Get the protocol property: The protocol used by the agent/exposed by a deployment. + * + * @return the protocol value. + */ + public AgentProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: The protocol used by the agent/exposed by a deployment. + * + * @param protocol the protocol value to set. + * @return the AgentProtocolVersion object itself. + */ + public AgentProtocolVersion withProtocol(AgentProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the version property: The version of the protocol. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version of the protocol. + * + * @param version the version value to set. + * @return the AgentProtocolVersion object itself. + */ + public AgentProtocolVersion withVersion(String version) { + this.version = version; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentProtocolVersion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentProtocolVersion if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AgentProtocolVersion. + */ + public static AgentProtocolVersion fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentProtocolVersion deserializedAgentProtocolVersion = new AgentProtocolVersion(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("protocol".equals(fieldName)) { + deserializedAgentProtocolVersion.protocol = AgentProtocol.fromString(reader.getString()); + } else if ("version".equals(fieldName)) { + deserializedAgentProtocolVersion.version = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAgentProtocolVersion; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AzureEntityResource.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentReference.java similarity index 55% rename from sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AzureEntityResource.java rename to sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentReference.java index 8ffcde76b21c..29eb931c1341 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AzureEntityResource.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentReference.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -13,16 +13,14 @@ import java.io.IOException; /** - * Entity Resource - * - * The resource model definition for an Azure Resource Manager resource with an etag. + * Agent Reference resource. */ @Immutable -public class AzureEntityResource extends ProxyResource { +public final class AgentReference extends ProxyResource { /* - * Resource Etag. + * [Required] Additional attributes of the entity. */ - private String etag; + private AgentReferenceProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -45,29 +43,18 @@ public class AzureEntityResource extends ProxyResource { private String id; /** - * Creates an instance of AzureEntityResource class. + * Creates an instance of AgentReference class. */ - public AzureEntityResource() { + private AgentReference() { } /** - * Get the etag property: Resource Etag. + * Get the properties property: [Required] Additional attributes of the entity. * - * @return the etag value. + * @return the properties value. */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: Resource Etag. - * - * @param etag the etag value to set. - * @return the AzureEntityResource object itself. - */ - AzureEntityResource withEtag(String etag) { - this.etag = etag; - return this; + public AgentReferenceProperties properties() { + return this.properties; } /** @@ -79,17 +66,6 @@ public SystemData systemData() { return this.systemData; } - /** - * Set the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @param systemData the systemData value to set. - * @return the AzureEntityResource object itself. - */ - AzureEntityResource withSystemData(SystemData systemData) { - this.systemData = systemData; - return this; - } - /** * Get the type property: The type of the resource. * @@ -120,55 +96,48 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } /** - * Reads an instance of AzureEntityResource from the JsonReader. + * Reads an instance of AgentReference from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of AzureEntityResource if the JsonReader was pointing to an instance of it, or null if it was + * @return An instance of AgentReference if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the AzureEntityResource. + * @throws IOException If an error occurs while reading the AgentReference. */ - public static AzureEntityResource fromJson(JsonReader jsonReader) throws IOException { + public static AgentReference fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - AzureEntityResource deserializedAzureEntityResource = new AzureEntityResource(); + AgentReference deserializedAgentReference = new AgentReference(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("id".equals(fieldName)) { - deserializedAzureEntityResource.id = reader.getString(); + deserializedAgentReference.id = reader.getString(); } else if ("name".equals(fieldName)) { - deserializedAzureEntityResource.name = reader.getString(); + deserializedAgentReference.name = reader.getString(); } else if ("type".equals(fieldName)) { - deserializedAzureEntityResource.type = reader.getString(); - } else if ("etag".equals(fieldName)) { - deserializedAzureEntityResource.etag = reader.getString(); + deserializedAgentReference.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAgentReference.properties = AgentReferenceProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { - deserializedAzureEntityResource.systemData = SystemData.fromJson(reader); + deserializedAgentReference.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } } - return deserializedAzureEntityResource; + return deserializedAgentReference; }); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentReferenceProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentReferenceProperties.java new file mode 100644 index 000000000000..f1ecd79b282d --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentReferenceProperties.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Type modeling a reference to a version of an agent definition. + */ +@Fluent +public class AgentReferenceProperties implements JsonSerializable { + /* + * Gets the agent's unique identifier within the organization (subscription). + */ + private String agentId; + + /* + * Gets the agent's name (unique within the project/app). + */ + private String agentName; + + /** + * Creates an instance of AgentReferenceProperties class. + */ + public AgentReferenceProperties() { + } + + /** + * Get the agentId property: Gets the agent's unique identifier within the organization (subscription). + * + * @return the agentId value. + */ + public String agentId() { + return this.agentId; + } + + /** + * Set the agentId property: Gets the agent's unique identifier within the organization (subscription). + * + * @param agentId the agentId value to set. + * @return the AgentReferenceProperties object itself. + */ + public AgentReferenceProperties withAgentId(String agentId) { + this.agentId = agentId; + return this; + } + + /** + * Get the agentName property: Gets the agent's name (unique within the project/app). + * + * @return the agentName value. + */ + public String agentName() { + return this.agentName; + } + + /** + * Set the agentName property: Gets the agent's name (unique within the project/app). + * + * @param agentName the agentName value to set. + * @return the AgentReferenceProperties object itself. + */ + public AgentReferenceProperties withAgentName(String agentName) { + this.agentName = agentName; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("agentId", this.agentId); + jsonWriter.writeStringField("agentName", this.agentName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentReferenceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentReferenceProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AgentReferenceProperties. + */ + public static AgentReferenceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentReferenceProperties deserializedAgentReferenceProperties = new AgentReferenceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("agentId".equals(fieldName)) { + deserializedAgentReferenceProperties.agentId = reader.getString(); + } else if ("agentName".equals(fieldName)) { + deserializedAgentReferenceProperties.agentName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAgentReferenceProperties; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentReferenceResourceArmPaginatedResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentReferenceResourceArmPaginatedResult.java new file mode 100644 index 000000000000..38252f34decd --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentReferenceResourceArmPaginatedResult.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentReferenceResourceArmPaginatedResultInner; +import java.util.List; + +/** + * An immutable client-side representation of AgentReferenceResourceArmPaginatedResult. + */ +public interface AgentReferenceResourceArmPaginatedResult { + /** + * Gets the nextLink property: The link to the next page of Agent Reference objects. If null, there are no + * additional pages. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the value property: An array of objects of type Agent Reference. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner + * com.azure.resourcemanager.cognitiveservices.fluent.models.AgentReferenceResourceArmPaginatedResultInner object. + * + * @return the inner object. + */ + AgentReferenceResourceArmPaginatedResultInner innerModel(); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgenticApplicationProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgenticApplicationProperties.java new file mode 100644 index 000000000000..3dde964e4cf9 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgenticApplicationProperties.java @@ -0,0 +1,324 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Resource type representing an agentic application as a management construct. + */ +@Fluent +public final class AgenticApplicationProperties extends ResourceBase { + /* + * The display name of the application. + */ + private String displayName; + + /* + * The application's dedicated invocation endpoint. + */ + private String baseUrl; + + /* + * The list of agent definitions comprising this application, returned as references to the objects under the parent + * project; use this to obtain a flat list of all agent-version pairs represented by this application. + */ + private List agents; + + /* + * The EntraId Agentic Blueprint of the application. + */ + private AssignedIdentity agentIdentityBlueprint; + + /* + * The (default) agent instance identity of the application. + */ + private AssignedIdentity defaultInstanceIdentity; + + /* + * Gets or sets the authorization policy associated with this agentic application instance. + */ + private ApplicationAuthorizationPolicy authorizationPolicy; + + /* + * Gets or sets the traffic routing policy for the application's deployments. + */ + private ApplicationTrafficRoutingPolicy trafficRoutingPolicy; + + /* + * Provisioning state of the application. + */ + private AgenticApplicationProvisioningState provisioningState; + + /* + * Enabledstate of the application. + */ + private Boolean isEnabled; + + /** + * Creates an instance of AgenticApplicationProperties class. + */ + public AgenticApplicationProperties() { + } + + /** + * Get the displayName property: The display name of the application. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name of the application. + * + * @param displayName the displayName value to set. + * @return the AgenticApplicationProperties object itself. + */ + public AgenticApplicationProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the baseUrl property: The application's dedicated invocation endpoint. + * + * @return the baseUrl value. + */ + public String baseUrl() { + return this.baseUrl; + } + + /** + * Set the baseUrl property: The application's dedicated invocation endpoint. + * + * @param baseUrl the baseUrl value to set. + * @return the AgenticApplicationProperties object itself. + */ + public AgenticApplicationProperties withBaseUrl(String baseUrl) { + this.baseUrl = baseUrl; + return this; + } + + /** + * Get the agents property: The list of agent definitions comprising this application, returned as references to the + * objects under the parent project; use this to obtain a flat list of all agent-version pairs represented by this + * application. + * + * @return the agents value. + */ + public List agents() { + return this.agents; + } + + /** + * Set the agents property: The list of agent definitions comprising this application, returned as references to the + * objects under the parent project; use this to obtain a flat list of all agent-version pairs represented by this + * application. + * + * @param agents the agents value to set. + * @return the AgenticApplicationProperties object itself. + */ + public AgenticApplicationProperties withAgents(List agents) { + this.agents = agents; + return this; + } + + /** + * Get the agentIdentityBlueprint property: The EntraId Agentic Blueprint of the application. + * + * @return the agentIdentityBlueprint value. + */ + public AssignedIdentity agentIdentityBlueprint() { + return this.agentIdentityBlueprint; + } + + /** + * Set the agentIdentityBlueprint property: The EntraId Agentic Blueprint of the application. + * + * @param agentIdentityBlueprint the agentIdentityBlueprint value to set. + * @return the AgenticApplicationProperties object itself. + */ + public AgenticApplicationProperties withAgentIdentityBlueprint(AssignedIdentity agentIdentityBlueprint) { + this.agentIdentityBlueprint = agentIdentityBlueprint; + return this; + } + + /** + * Get the defaultInstanceIdentity property: The (default) agent instance identity of the application. + * + * @return the defaultInstanceIdentity value. + */ + public AssignedIdentity defaultInstanceIdentity() { + return this.defaultInstanceIdentity; + } + + /** + * Set the defaultInstanceIdentity property: The (default) agent instance identity of the application. + * + * @param defaultInstanceIdentity the defaultInstanceIdentity value to set. + * @return the AgenticApplicationProperties object itself. + */ + public AgenticApplicationProperties withDefaultInstanceIdentity(AssignedIdentity defaultInstanceIdentity) { + this.defaultInstanceIdentity = defaultInstanceIdentity; + return this; + } + + /** + * Get the authorizationPolicy property: Gets or sets the authorization policy associated with this agentic + * application instance. + * + * @return the authorizationPolicy value. + */ + public ApplicationAuthorizationPolicy authorizationPolicy() { + return this.authorizationPolicy; + } + + /** + * Set the authorizationPolicy property: Gets or sets the authorization policy associated with this agentic + * application instance. + * + * @param authorizationPolicy the authorizationPolicy value to set. + * @return the AgenticApplicationProperties object itself. + */ + public AgenticApplicationProperties withAuthorizationPolicy(ApplicationAuthorizationPolicy authorizationPolicy) { + this.authorizationPolicy = authorizationPolicy; + return this; + } + + /** + * Get the trafficRoutingPolicy property: Gets or sets the traffic routing policy for the application's deployments. + * + * @return the trafficRoutingPolicy value. + */ + public ApplicationTrafficRoutingPolicy trafficRoutingPolicy() { + return this.trafficRoutingPolicy; + } + + /** + * Set the trafficRoutingPolicy property: Gets or sets the traffic routing policy for the application's deployments. + * + * @param trafficRoutingPolicy the trafficRoutingPolicy value to set. + * @return the AgenticApplicationProperties object itself. + */ + public AgenticApplicationProperties withTrafficRoutingPolicy(ApplicationTrafficRoutingPolicy trafficRoutingPolicy) { + this.trafficRoutingPolicy = trafficRoutingPolicy; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the application. + * + * @return the provisioningState value. + */ + public AgenticApplicationProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the isEnabled property: Enabledstate of the application. + * + * @return the isEnabled value. + */ + public Boolean isEnabled() { + return this.isEnabled; + } + + /** + * {@inheritDoc} + */ + @Override + public AgenticApplicationProperties withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public AgenticApplicationProperties withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("baseUrl", this.baseUrl); + jsonWriter.writeArrayField("agents", this.agents, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("agentIdentityBlueprint", this.agentIdentityBlueprint); + jsonWriter.writeJsonField("defaultInstanceIdentity", this.defaultInstanceIdentity); + jsonWriter.writeJsonField("authorizationPolicy", this.authorizationPolicy); + jsonWriter.writeJsonField("trafficRoutingPolicy", this.trafficRoutingPolicy); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgenticApplicationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgenticApplicationProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AgenticApplicationProperties. + */ + public static AgenticApplicationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgenticApplicationProperties deserializedAgenticApplicationProperties = new AgenticApplicationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedAgenticApplicationProperties.withDescription(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAgenticApplicationProperties.withTags(tags); + } else if ("displayName".equals(fieldName)) { + deserializedAgenticApplicationProperties.displayName = reader.getString(); + } else if ("baseUrl".equals(fieldName)) { + deserializedAgenticApplicationProperties.baseUrl = reader.getString(); + } else if ("agents".equals(fieldName)) { + List agents + = reader.readArray(reader1 -> AgentReferenceProperties.fromJson(reader1)); + deserializedAgenticApplicationProperties.agents = agents; + } else if ("agentIdentityBlueprint".equals(fieldName)) { + deserializedAgenticApplicationProperties.agentIdentityBlueprint = AssignedIdentity.fromJson(reader); + } else if ("defaultInstanceIdentity".equals(fieldName)) { + deserializedAgenticApplicationProperties.defaultInstanceIdentity + = AssignedIdentity.fromJson(reader); + } else if ("authorizationPolicy".equals(fieldName)) { + deserializedAgenticApplicationProperties.authorizationPolicy + = ApplicationAuthorizationPolicy.fromJson(reader); + } else if ("trafficRoutingPolicy".equals(fieldName)) { + deserializedAgenticApplicationProperties.trafficRoutingPolicy + = ApplicationTrafficRoutingPolicy.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedAgenticApplicationProperties.provisioningState + = AgenticApplicationProvisioningState.fromString(reader.getString()); + } else if ("isEnabled".equals(fieldName)) { + deserializedAgenticApplicationProperties.isEnabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedAgenticApplicationProperties; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgenticApplicationProvisioningState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgenticApplicationProvisioningState.java new file mode 100644 index 000000000000..3298d06c1777 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgenticApplicationProvisioningState.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning state of an agentic application. + */ +public final class AgenticApplicationProvisioningState + extends ExpandableStringEnum { + /** + * The application was successfully provisioned. + */ + public static final AgenticApplicationProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * The application provisioning failed. + */ + public static final AgenticApplicationProvisioningState FAILED = fromString("Failed"); + + /** + * The application provisioning was canceled. + */ + public static final AgenticApplicationProvisioningState CANCELED = fromString("Canceled"); + + /** + * The application is being created. + */ + public static final AgenticApplicationProvisioningState CREATING = fromString("Creating"); + + /** + * The application is being updated. + */ + public static final AgenticApplicationProvisioningState UPDATING = fromString("Updating"); + + /** + * The application is being deleted. + */ + public static final AgenticApplicationProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of AgenticApplicationProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AgenticApplicationProvisioningState() { + } + + /** + * Creates or finds a AgenticApplicationProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AgenticApplicationProvisioningState. + */ + public static AgenticApplicationProvisioningState fromString(String name) { + return fromString(name, AgenticApplicationProvisioningState.class); + } + + /** + * Gets known AgenticApplicationProvisioningState values. + * + * @return known AgenticApplicationProvisioningState values. + */ + public static Collection values() { + return values(AgenticApplicationProvisioningState.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApiKeyAuthConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApiKeyAuthConnectionProperties.java index 03db65c1d70e..a9e566c5049b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApiKeyAuthConnectionProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApiKeyAuthConnectionProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -175,18 +175,6 @@ public ApiKeyAuthConnectionProperties withUseWorkspaceManagedIdentity(Boolean us return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (credentials() != null) { - credentials().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApiKeys.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApiKeys.java index 06727954ec7d..e6ebe7fa42eb 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApiKeys.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApiKeys.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApiProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApiProperties.java index 2fe8be1b99f3..8bc699315777 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApiProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApiProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -299,14 +299,6 @@ public ApiProperties withAdditionalProperties(Map additionalProp return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApplicationAuthorizationPolicy.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApplicationAuthorizationPolicy.java new file mode 100644 index 000000000000..70999b3d83da --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApplicationAuthorizationPolicy.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents a policy for authorizing applications based on specified authentication and authorization schemes. + */ +@Immutable +public class ApplicationAuthorizationPolicy implements JsonSerializable { + /* + * Authorization scheme type. + */ + private BuiltInAuthorizationScheme type = BuiltInAuthorizationScheme.fromString("ApplicationAuthorizationPolicy"); + + /** + * Creates an instance of ApplicationAuthorizationPolicy class. + */ + public ApplicationAuthorizationPolicy() { + } + + /** + * Get the type property: Authorization scheme type. + * + * @return the type value. + */ + public BuiltInAuthorizationScheme type() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationAuthorizationPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationAuthorizationPolicy if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationAuthorizationPolicy. + */ + public static ApplicationAuthorizationPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("type".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("Default".equals(discriminatorValue)) { + return RoleBasedBuiltInAuthorizationPolicy.fromJson(readerToUse.reset()); + } else if ("OrganizationScope".equals(discriminatorValue)) { + return OrganizationSharedBuiltInAuthorizationPolicy.fromJson(readerToUse.reset()); + } else if ("Channels".equals(discriminatorValue)) { + return ChannelsBuiltInAuthorizationPolicy.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static ApplicationAuthorizationPolicy fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationAuthorizationPolicy deserializedApplicationAuthorizationPolicy + = new ApplicationAuthorizationPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedApplicationAuthorizationPolicy.type + = BuiltInAuthorizationScheme.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationAuthorizationPolicy; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApplicationTrafficRoutingPolicy.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApplicationTrafficRoutingPolicy.java new file mode 100644 index 000000000000..d84e2612604a --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApplicationTrafficRoutingPolicy.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Type representing an application traffic policy as a property of an agentic application. + */ +@Fluent +public final class ApplicationTrafficRoutingPolicy implements JsonSerializable { + /* + * Methodology used to route traffic to the application's deployments. + */ + private TrafficRoutingProtocol protocol; + + /* + * Gets or sets the collection of traffic routing rules. + */ + private List rules; + + /** + * Creates an instance of ApplicationTrafficRoutingPolicy class. + */ + public ApplicationTrafficRoutingPolicy() { + } + + /** + * Get the protocol property: Methodology used to route traffic to the application's deployments. + * + * @return the protocol value. + */ + public TrafficRoutingProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Methodology used to route traffic to the application's deployments. + * + * @param protocol the protocol value to set. + * @return the ApplicationTrafficRoutingPolicy object itself. + */ + public ApplicationTrafficRoutingPolicy withProtocol(TrafficRoutingProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the rules property: Gets or sets the collection of traffic routing rules. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: Gets or sets the collection of traffic routing rules. + * + * @param rules the rules value to set. + * @return the ApplicationTrafficRoutingPolicy object itself. + */ + public ApplicationTrafficRoutingPolicy withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplicationTrafficRoutingPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApplicationTrafficRoutingPolicy if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ApplicationTrafficRoutingPolicy. + */ + public static ApplicationTrafficRoutingPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApplicationTrafficRoutingPolicy deserializedApplicationTrafficRoutingPolicy + = new ApplicationTrafficRoutingPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("protocol".equals(fieldName)) { + deserializedApplicationTrafficRoutingPolicy.protocol + = TrafficRoutingProtocol.fromString(reader.getString()); + } else if ("rules".equals(fieldName)) { + List rules = reader.readArray(reader1 -> TrafficRoutingRule.fromJson(reader1)); + deserializedApplicationTrafficRoutingPolicy.rules = rules; + } else { + reader.skipChildren(); + } + } + + return deserializedApplicationTrafficRoutingPolicy; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AssignedIdentity.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AssignedIdentity.java new file mode 100644 index 000000000000..32660c23138a --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/AssignedIdentity.java @@ -0,0 +1,243 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Type representing an identity assignment. + */ +@Fluent +public final class AssignedIdentity implements JsonSerializable { + /* + * Specifies the kind of Entra identity described by this object. + */ + private IdentityKind kind; + + /* + * Enumeration of identity types, from the perspective of management. + */ + private IdentityManagementType type; + + /* + * The client ID of the identity. + */ + private String clientId; + + /* + * The principal ID of the identity. + */ + private String principalId; + + /* + * The tenant ID of the identity. + */ + private String tenantId; + + /* + * The subject of this identity assignment. + */ + private String subject; + + /* + * Represents the provisioning state of an identity resource. + */ + private IdentityProvisioningState provisioningState; + + /** + * Creates an instance of AssignedIdentity class. + */ + public AssignedIdentity() { + } + + /** + * Get the kind property: Specifies the kind of Entra identity described by this object. + * + * @return the kind value. + */ + public IdentityKind kind() { + return this.kind; + } + + /** + * Set the kind property: Specifies the kind of Entra identity described by this object. + * + * @param kind the kind value to set. + * @return the AssignedIdentity object itself. + */ + public AssignedIdentity withKind(IdentityKind kind) { + this.kind = kind; + return this; + } + + /** + * Get the type property: Enumeration of identity types, from the perspective of management. + * + * @return the type value. + */ + public IdentityManagementType type() { + return this.type; + } + + /** + * Set the type property: Enumeration of identity types, from the perspective of management. + * + * @param type the type value to set. + * @return the AssignedIdentity object itself. + */ + public AssignedIdentity withType(IdentityManagementType type) { + this.type = type; + return this; + } + + /** + * Get the clientId property: The client ID of the identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: The client ID of the identity. + * + * @param clientId the clientId value to set. + * @return the AssignedIdentity object itself. + */ + public AssignedIdentity withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the principalId property: The principal ID of the identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The principal ID of the identity. + * + * @param principalId the principalId value to set. + * @return the AssignedIdentity object itself. + */ + public AssignedIdentity withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the tenantId property: The tenant ID of the identity. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: The tenant ID of the identity. + * + * @param tenantId the tenantId value to set. + * @return the AssignedIdentity object itself. + */ + public AssignedIdentity withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the subject property: The subject of this identity assignment. + * + * @return the subject value. + */ + public String subject() { + return this.subject; + } + + /** + * Set the subject property: The subject of this identity assignment. + * + * @param subject the subject value to set. + * @return the AssignedIdentity object itself. + */ + public AssignedIdentity withSubject(String subject) { + this.subject = subject; + return this; + } + + /** + * Get the provisioningState property: Represents the provisioning state of an identity resource. + * + * @return the provisioningState value. + */ + public IdentityProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("clientId", this.clientId); + jsonWriter.writeStringField("principalId", this.principalId); + jsonWriter.writeStringField("tenantId", this.tenantId); + jsonWriter.writeStringField("subject", this.subject); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AssignedIdentity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AssignedIdentity if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AssignedIdentity. + */ + public static AssignedIdentity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AssignedIdentity deserializedAssignedIdentity = new AssignedIdentity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("kind".equals(fieldName)) { + deserializedAssignedIdentity.kind = IdentityKind.fromString(reader.getString()); + } else if ("type".equals(fieldName)) { + deserializedAssignedIdentity.type = IdentityManagementType.fromString(reader.getString()); + } else if ("clientId".equals(fieldName)) { + deserializedAssignedIdentity.clientId = reader.getString(); + } else if ("principalId".equals(fieldName)) { + deserializedAssignedIdentity.principalId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedAssignedIdentity.tenantId = reader.getString(); + } else if ("subject".equals(fieldName)) { + deserializedAssignedIdentity.subject = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedAssignedIdentity.provisioningState + = IdentityProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAssignedIdentity; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/BillingMeterInfo.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/BillingMeterInfo.java index f831835e18b5..84ac27ed78cd 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/BillingMeterInfo.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/BillingMeterInfo.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * The BillingMeterInfo model. */ -@Fluent +@Immutable public final class BillingMeterInfo implements JsonSerializable { /* * The name property. @@ -34,7 +34,7 @@ public final class BillingMeterInfo implements JsonSerializable { + /** + * Standard AzureML RBAC. + */ + public static final BuiltInAuthorizationScheme DEFAULT = fromString("Default"); + + /** + * Claim-based, requires membership in the tenant. + */ + public static final BuiltInAuthorizationScheme ORGANIZATION_SCOPE = fromString("OrganizationScope"); + + /** + * Channels-specific (AzureBotService) authorization. + */ + public static final BuiltInAuthorizationScheme CHANNELS = fromString("Channels"); + + /** + * Custom scheme defined by the application author. + */ + public static final BuiltInAuthorizationScheme CUSTOM = fromString("Custom"); + + /** + * Creates a new instance of BuiltInAuthorizationScheme value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BuiltInAuthorizationScheme() { + } + + /** + * Creates or finds a BuiltInAuthorizationScheme from its string representation. + * + * @param name a name to look for. + * @return the corresponding BuiltInAuthorizationScheme. + */ + public static BuiltInAuthorizationScheme fromString(String name) { + return fromString(name, BuiltInAuthorizationScheme.class); + } + + /** + * Gets known BuiltInAuthorizationScheme values. + * + * @return known BuiltInAuthorizationScheme values. + */ + public static Collection values() { + return values(BuiltInAuthorizationScheme.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ByPassSelection.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ByPassSelection.java index c3a57b207a9a..6125ba994344 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ByPassSelection.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ByPassSelection.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CalculateModelCapacityParameter.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CalculateModelCapacityParameter.java index 6ca7e248e97d..71dd4be17f73 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CalculateModelCapacityParameter.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CalculateModelCapacityParameter.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -98,20 +98,6 @@ public CalculateModelCapacityParameter withWorkloads(List e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CalculateModelCapacityResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CalculateModelCapacityResult.java index 0da20eb1fd7e..ad4021bf24d2 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CalculateModelCapacityResult.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CalculateModelCapacityResult.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CalculateModelCapacityResultEstimatedCapacity.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CalculateModelCapacityResultEstimatedCapacity.java index 072d3c1392f5..a20cdd76827f 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CalculateModelCapacityResultEstimatedCapacity.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CalculateModelCapacityResultEstimatedCapacity.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Model Estimated Capacity. */ -@Fluent +@Immutable public final class CalculateModelCapacityResultEstimatedCapacity implements JsonSerializable { /* @@ -30,7 +30,7 @@ public final class CalculateModelCapacityResultEstimatedCapacity /** * Creates an instance of CalculateModelCapacityResultEstimatedCapacity class. */ - public CalculateModelCapacityResultEstimatedCapacity() { + private CalculateModelCapacityResultEstimatedCapacity() { } /** @@ -42,17 +42,6 @@ public Integer value() { return this.value; } - /** - * Set the value property: The value property. - * - * @param value the value value to set. - * @return the CalculateModelCapacityResultEstimatedCapacity object itself. - */ - public CalculateModelCapacityResultEstimatedCapacity withValue(Integer value) { - this.value = value; - return this; - } - /** * Get the deployableValue property: The deployableValue property. * @@ -62,25 +51,6 @@ public Integer deployableValue() { return this.deployableValue; } - /** - * Set the deployableValue property: The deployableValue property. - * - * @param deployableValue the deployableValue value to set. - * @return the CalculateModelCapacityResultEstimatedCapacity object itself. - */ - public CalculateModelCapacityResultEstimatedCapacity withDeployableValue(Integer deployableValue) { - this.deployableValue = deployableValue; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CallRateLimit.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CallRateLimit.java index 641ee15eacc0..2860da0df016 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CallRateLimit.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CallRateLimit.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The call rate limit Cognitive Services account. */ -@Fluent +@Immutable public final class CallRateLimit implements JsonSerializable { /* * The count value of Call Rate Limit. @@ -35,7 +35,7 @@ public final class CallRateLimit implements JsonSerializable { /** * Creates an instance of CallRateLimit class. */ - public CallRateLimit() { + private CallRateLimit() { } /** @@ -47,17 +47,6 @@ public Float count() { return this.count; } - /** - * Set the count property: The count value of Call Rate Limit. - * - * @param count the count value to set. - * @return the CallRateLimit object itself. - */ - public CallRateLimit withCount(Float count) { - this.count = count; - return this; - } - /** * Get the renewalPeriod property: The renewal period in seconds of Call Rate Limit. * @@ -67,17 +56,6 @@ public Float renewalPeriod() { return this.renewalPeriod; } - /** - * Set the renewalPeriod property: The renewal period in seconds of Call Rate Limit. - * - * @param renewalPeriod the renewalPeriod value to set. - * @return the CallRateLimit object itself. - */ - public CallRateLimit withRenewalPeriod(Float renewalPeriod) { - this.renewalPeriod = renewalPeriod; - return this; - } - /** * Get the rules property: The rules property. * @@ -87,28 +65,6 @@ public List rules() { return this.rules; } - /** - * Set the rules property: The rules property. - * - * @param rules the rules value to set. - * @return the CallRateLimit object itself. - */ - public CallRateLimit withRules(List rules) { - this.rules = rules; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (rules() != null) { - rules().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHost.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHost.java index cb81db20e686..20c1f7daa6ea 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHost.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHost.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostKind.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostKind.java index 03deade8d6a5..edeccef85a52 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostKind.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostKind.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostProperties.java index 4e0bfc7dc8ec..d24abccebeb8 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -53,6 +53,11 @@ public final class CapabilityHostProperties extends ResourceBase { */ private List vectorStoreConnections; + /* + * Whether public hosting environment is enabled for the capability host + */ + private Boolean enablePublicHostingEnvironment; + /** * Creates an instance of CapabilityHostProperties class. */ @@ -194,6 +199,28 @@ public CapabilityHostProperties withVectorStoreConnections(List vectorSt return this; } + /** + * Get the enablePublicHostingEnvironment property: Whether public hosting environment is enabled for the capability + * host. + * + * @return the enablePublicHostingEnvironment value. + */ + public Boolean enablePublicHostingEnvironment() { + return this.enablePublicHostingEnvironment; + } + + /** + * Set the enablePublicHostingEnvironment property: Whether public hosting environment is enabled for the capability + * host. + * + * @param enablePublicHostingEnvironment the enablePublicHostingEnvironment value to set. + * @return the CapabilityHostProperties object itself. + */ + public CapabilityHostProperties withEnablePublicHostingEnvironment(Boolean enablePublicHostingEnvironment) { + this.enablePublicHostingEnvironment = enablePublicHostingEnvironment; + return this; + } + /** * {@inheritDoc} */ @@ -212,15 +239,6 @@ public CapabilityHostProperties withTags(Map tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ @@ -240,6 +258,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { (writer, element) -> writer.writeString(element)); jsonWriter.writeArrayField("vectorStoreConnections", this.vectorStoreConnections, (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("enablePublicHostingEnvironment", this.enablePublicHostingEnvironment); return jsonWriter.writeEndObject(); } @@ -283,6 +302,9 @@ public static CapabilityHostProperties fromJson(JsonReader jsonReader) throws IO } else if ("vectorStoreConnections".equals(fieldName)) { List vectorStoreConnections = reader.readArray(reader1 -> reader1.getString()); deserializedCapabilityHostProperties.vectorStoreConnections = vectorStoreConnections; + } else if ("enablePublicHostingEnvironment".equals(fieldName)) { + deserializedCapabilityHostProperties.enablePublicHostingEnvironment + = reader.getNullable(JsonReader::getBoolean); } else { reader.skipChildren(); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostProvisioningState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostProvisioningState.java index d4c0094f5a54..746f155e22ff 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostProvisioningState.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapacityConfig.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapacityConfig.java index 4a76be6e9cef..938a31b66724 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapacityConfig.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapacityConfig.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The capacity configuration. */ -@Fluent +@Immutable public final class CapacityConfig implements JsonSerializable { /* * The minimum capacity. @@ -45,7 +45,7 @@ public final class CapacityConfig implements JsonSerializable { /** * Creates an instance of CapacityConfig class. */ - public CapacityConfig() { + private CapacityConfig() { } /** @@ -57,17 +57,6 @@ public Integer minimum() { return this.minimum; } - /** - * Set the minimum property: The minimum capacity. - * - * @param minimum the minimum value to set. - * @return the CapacityConfig object itself. - */ - public CapacityConfig withMinimum(Integer minimum) { - this.minimum = minimum; - return this; - } - /** * Get the maximum property: The maximum capacity. * @@ -77,17 +66,6 @@ public Integer maximum() { return this.maximum; } - /** - * Set the maximum property: The maximum capacity. - * - * @param maximum the maximum value to set. - * @return the CapacityConfig object itself. - */ - public CapacityConfig withMaximum(Integer maximum) { - this.maximum = maximum; - return this; - } - /** * Get the step property: The minimal incremental between allowed values for capacity. * @@ -97,17 +75,6 @@ public Integer step() { return this.step; } - /** - * Set the step property: The minimal incremental between allowed values for capacity. - * - * @param step the step value to set. - * @return the CapacityConfig object itself. - */ - public CapacityConfig withStep(Integer step) { - this.step = step; - return this; - } - /** * Get the defaultProperty property: The default capacity. * @@ -117,17 +84,6 @@ public Integer defaultProperty() { return this.defaultProperty; } - /** - * Set the defaultProperty property: The default capacity. - * - * @param defaultProperty the defaultProperty value to set. - * @return the CapacityConfig object itself. - */ - public CapacityConfig withDefaultProperty(Integer defaultProperty) { - this.defaultProperty = defaultProperty; - return this; - } - /** * Get the allowedValues property: The array of allowed values for capacity. * @@ -137,25 +93,6 @@ public List allowedValues() { return this.allowedValues; } - /** - * Set the allowedValues property: The array of allowed values for capacity. - * - * @param allowedValues the allowedValues value to set. - * @return the CapacityConfig object itself. - */ - public CapacityConfig withAllowedValues(List allowedValues) { - this.allowedValues = allowedValues; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ChannelsBuiltInAuthorizationPolicy.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ChannelsBuiltInAuthorizationPolicy.java new file mode 100644 index 000000000000..30796c87ca50 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ChannelsBuiltInAuthorizationPolicy.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents a built-in authorization policy specific to Azure Bot Service/Channels authentication. + */ +@Immutable +public final class ChannelsBuiltInAuthorizationPolicy extends ApplicationAuthorizationPolicy { + /* + * Authorization scheme type. + */ + private BuiltInAuthorizationScheme type = BuiltInAuthorizationScheme.CHANNELS; + + /** + * Creates an instance of ChannelsBuiltInAuthorizationPolicy class. + */ + public ChannelsBuiltInAuthorizationPolicy() { + } + + /** + * Get the type property: Authorization scheme type. + * + * @return the type value. + */ + @Override + public BuiltInAuthorizationScheme type() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChannelsBuiltInAuthorizationPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChannelsBuiltInAuthorizationPolicy if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ChannelsBuiltInAuthorizationPolicy. + */ + public static ChannelsBuiltInAuthorizationPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ChannelsBuiltInAuthorizationPolicy deserializedChannelsBuiltInAuthorizationPolicy + = new ChannelsBuiltInAuthorizationPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedChannelsBuiltInAuthorizationPolicy.type + = BuiltInAuthorizationScheme.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedChannelsBuiltInAuthorizationPolicy; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CheckDomainAvailabilityParameter.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CheckDomainAvailabilityParameter.java index a338dfe8dc4a..a198152e0be5 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CheckDomainAvailabilityParameter.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CheckDomainAvailabilityParameter.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -28,7 +27,7 @@ public final class CheckDomainAvailabilityParameter implements JsonSerializable< private String type; /* - * The Kind of the resource. + * The kind (type) of cognitive service account. */ private String kind; @@ -79,7 +78,7 @@ public CheckDomainAvailabilityParameter withType(String type) { } /** - * Get the kind property: The Kind of the resource. + * Get the kind property: The kind (type) of cognitive service account. * * @return the kind value. */ @@ -88,7 +87,7 @@ public String kind() { } /** - * Set the kind property: The Kind of the resource. + * Set the kind property: The kind (type) of cognitive service account. * * @param kind the kind value to set. * @return the CheckDomainAvailabilityParameter object itself. @@ -98,26 +97,6 @@ public CheckDomainAvailabilityParameter withKind(String kind) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (subdomainName() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property subdomainName in model CheckDomainAvailabilityParameter")); - } - if (type() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property type in model CheckDomainAvailabilityParameter")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(CheckDomainAvailabilityParameter.class); - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CheckSkuAvailabilityParameter.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CheckSkuAvailabilityParameter.java index 84877f6044fe..cd780867bbcc 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CheckSkuAvailabilityParameter.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CheckSkuAvailabilityParameter.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -99,31 +98,6 @@ public CheckSkuAvailabilityParameter withType(String type) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (skus() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property skus in model CheckSkuAvailabilityParameter")); - } - if (kind() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property kind in model CheckSkuAvailabilityParameter")); - } - if (type() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property type in model CheckSkuAvailabilityParameter")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(CheckSkuAvailabilityParameter.class); - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentCost.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentCost.java index 642845ffa3cb..f05fc9b6a00a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentCost.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentCost.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Cognitive Services account commitment cost. */ -@Fluent +@Immutable public final class CommitmentCost implements JsonSerializable { /* * Commitment meter Id. @@ -29,7 +29,7 @@ public final class CommitmentCost implements JsonSerializable { /** * Creates an instance of CommitmentCost class. */ - public CommitmentCost() { + private CommitmentCost() { } /** @@ -41,17 +41,6 @@ public String commitmentMeterId() { return this.commitmentMeterId; } - /** - * Set the commitmentMeterId property: Commitment meter Id. - * - * @param commitmentMeterId the commitmentMeterId value to set. - * @return the CommitmentCost object itself. - */ - public CommitmentCost withCommitmentMeterId(String commitmentMeterId) { - this.commitmentMeterId = commitmentMeterId; - return this; - } - /** * Get the overageMeterId property: Overage meter Id. * @@ -61,25 +50,6 @@ public String overageMeterId() { return this.overageMeterId; } - /** - * Set the overageMeterId property: Overage meter Id. - * - * @param overageMeterId the overageMeterId value to set. - * @return the CommitmentCost object itself. - */ - public CommitmentCost withOverageMeterId(String overageMeterId) { - this.overageMeterId = overageMeterId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPeriod.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPeriod.java index d3042c3c2a1c..5f844962064c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPeriod.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPeriod.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -114,17 +114,6 @@ public String endDate() { return this.endDate; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (quota() != null) { - quota().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlan.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlan.java index 1fa149698d60..751ca56e018a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlan.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlan.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -36,46 +36,46 @@ public interface CommitmentPlan { String type(); /** - * Gets the etag property: Resource Etag. + * Gets the properties property: Properties of Cognitive Services account commitment plan. * - * @return the etag value. + * @return the properties value. */ - String etag(); + CommitmentPlanProperties properties(); /** - * Gets the kind property: The Kind of the resource. + * Gets the tags property: Resource tags. * - * @return the kind value. + * @return the tags value. */ - String kind(); + Map tags(); /** - * Gets the sku property: The resource model definition representing SKU. + * Gets the location property: The geo-location where the resource lives. * - * @return the sku value. + * @return the location value. */ - Sku sku(); + String location(); /** - * Gets the tags property: Resource tags. + * Gets the etag property: Resource Etag. * - * @return the tags value. + * @return the etag value. */ - Map tags(); + String etag(); /** - * Gets the location property: The geo-location where the resource lives. + * Gets the kind property: The kind (type) of cognitive service account. * - * @return the location value. + * @return the kind value. */ - String location(); + String kind(); /** - * Gets the properties property: Properties of Cognitive Services account commitment plan. + * Gets the sku property: The resource model definition representing SKU. * - * @return the properties value. + * @return the sku value. */ - CommitmentPlanProperties properties(); + Sku sku(); /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -147,7 +147,7 @@ interface WithResourceGroup { * resource to be created, but also allows for any other optional properties to be specified. */ interface WithCreate extends DefinitionStages.WithLocation, DefinitionStages.WithTags, - DefinitionStages.WithKind, DefinitionStages.WithSku, DefinitionStages.WithProperties { + DefinitionStages.WithProperties, DefinitionStages.WithKind, DefinitionStages.WithSku { /** * Executes the create request. * @@ -199,42 +199,42 @@ interface WithTags { } /** - * The stage of the CommitmentPlan definition allowing to specify kind. + * The stage of the CommitmentPlan definition allowing to specify properties. */ - interface WithKind { + interface WithProperties { /** - * Specifies the kind property: The Kind of the resource.. + * Specifies the properties property: Properties of Cognitive Services account commitment plan.. * - * @param kind The Kind of the resource. + * @param properties Properties of Cognitive Services account commitment plan. * @return the next definition stage. */ - WithCreate withKind(String kind); + WithCreate withProperties(CommitmentPlanProperties properties); } /** - * The stage of the CommitmentPlan definition allowing to specify sku. + * The stage of the CommitmentPlan definition allowing to specify kind. */ - interface WithSku { + interface WithKind { /** - * Specifies the sku property: The resource model definition representing SKU. + * Specifies the kind property: The kind (type) of cognitive service account.. * - * @param sku The resource model definition representing SKU. + * @param kind The kind (type) of cognitive service account. * @return the next definition stage. */ - WithCreate withSku(Sku sku); + WithCreate withKind(String kind); } /** - * The stage of the CommitmentPlan definition allowing to specify properties. + * The stage of the CommitmentPlan definition allowing to specify sku. */ - interface WithProperties { + interface WithSku { /** - * Specifies the properties property: Properties of Cognitive Services account commitment plan.. + * Specifies the sku property: The resource model definition representing SKU. * - * @param properties Properties of Cognitive Services account commitment plan. + * @param sku The resource model definition representing SKU. * @return the next definition stage. */ - WithCreate withProperties(CommitmentPlanProperties properties); + WithCreate withSku(Sku sku); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAccountAssociation.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAccountAssociation.java index 134319e098c3..b5ca01ea5499 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAccountAssociation.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAccountAssociation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAssociation.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAssociation.java index 7c77dad3cd0b..1c3dcb0e12c9 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAssociation.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAssociation.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * The commitment plan association. */ -@Fluent +@Immutable public final class CommitmentPlanAssociation implements JsonSerializable { /* * The Azure resource id of the commitment plan. @@ -29,7 +29,7 @@ public final class CommitmentPlanAssociation implements JsonSerializable provisioningIssues() { return this.provisioningIssues; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (current() != null) { - current().validate(); - } - if (next() != null) { - next().validate(); - } - if (last() != null) { - last().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanProvisioningState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanProvisioningState.java index 681a488d0c3b..ef50ec0b5c10 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanProvisioningState.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlans.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlans.java index b2021a3adfc9..39c223b41a5b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlans.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlans.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -13,33 +13,6 @@ * Resource collection API of CommitmentPlans. */ public interface CommitmentPlans { - /** - * Gets the commitmentPlans associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the commitmentPlans associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName); - - /** - * Gets the commitmentPlans associated with the Cognitive Services account. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the commitmentPlans associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String accountName, Context context); - /** * Gets the specified commitmentPlans associated with the Cognitive Services account. * @@ -125,27 +98,31 @@ CommitmentPlan createOrUpdate(String resourceGroupName, String accountName, Stri void delete(String resourceGroupName, String accountName, String commitmentPlanName, Context context); /** - * Deletes a Cognitive Services commitment plan from the resource group. + * Gets the commitmentPlans associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param accountName The name of Cognitive Services account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the commitmentPlans associated with the Cognitive Services account as paginated response with + * {@link PagedIterable}. */ - void deletePlan(String resourceGroupName, String commitmentPlanName); + PagedIterable list(String resourceGroupName, String accountName); /** - * Deletes a Cognitive Services commitment plan from the resource group. + * Gets the commitmentPlans associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param accountName The name of Cognitive Services account. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the commitmentPlans associated with the Cognitive Services account as paginated response with + * {@link PagedIterable}. */ - void deletePlan(String resourceGroupName, String commitmentPlanName, Context context); + PagedIterable list(String resourceGroupName, String accountName, Context context); /** * Returns a Cognitive Services commitment plan specified by the parameters. @@ -174,43 +151,44 @@ Response getByResourceGroupWithResponse(String resourceGroupName CommitmentPlan getByResourceGroup(String resourceGroupName, String commitmentPlanName); /** - * Returns all the resources of a particular type belonging to a resource group. + * Deletes a Cognitive Services commitment plan from the resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName); + void deletePlan(String resourceGroupName, String commitmentPlanName); /** - * Returns all the resources of a particular type belonging to a resource group. + * Deletes a Cognitive Services commitment plan from the resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services accounts operation response as paginated response with - * {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + void deletePlan(String resourceGroupName, String commitmentPlanName, Context context); /** - * Returns all the resources of a particular type belonging to a subscription. + * Returns all the resources of a particular type belonging to a resource group. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the list of cognitive services accounts operation response as paginated response with * {@link PagedIterable}. */ - PagedIterable listPlansBySubscription(); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Returns all the resources of a particular type belonging to a subscription. + * Returns all the resources of a particular type belonging to a resource group. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -218,36 +196,29 @@ Response getByResourceGroupWithResponse(String resourceGroupName * @return the list of cognitive services accounts operation response as paginated response with * {@link PagedIterable}. */ - PagedIterable listPlansBySubscription(Context context); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Gets the associations of the Cognitive Services commitment plan. + * Returns all the resources of a particular type belonging to a subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the associations of the Cognitive Services commitment plan as paginated response with + * @return the list of cognitive services accounts operation response as paginated response with * {@link PagedIterable}. */ - PagedIterable listAssociations(String resourceGroupName, - String commitmentPlanName); + PagedIterable listPlansBySubscription(); /** - * Gets the associations of the Cognitive Services commitment plan. + * Returns all the resources of a particular type belonging to a subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the associations of the Cognitive Services commitment plan as paginated response with + * @return the list of cognitive services accounts operation response as paginated response with * {@link PagedIterable}. */ - PagedIterable listAssociations(String resourceGroupName, - String commitmentPlanName, Context context); + PagedIterable listPlansBySubscription(Context context); /** * Gets the association of the Cognitive Services commitment plan. @@ -308,6 +279,35 @@ CommitmentPlanAccountAssociation getAssociation(String resourceGroupName, String void deleteAssociation(String resourceGroupName, String commitmentPlanName, String commitmentPlanAssociationName, Context context); + /** + * Gets the associations of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the associations of the Cognitive Services commitment plan as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listAssociations(String resourceGroupName, + String commitmentPlanName); + + /** + * Gets the associations of the Cognitive Services commitment plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the associations of the Cognitive Services commitment plan as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listAssociations(String resourceGroupName, + String commitmentPlanName, Context context); + /** * Returns a Cognitive Services commitment plan specified by the parameters. * diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentQuota.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentQuota.java index b13a4e641317..079a5fdc6e9b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentQuota.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentQuota.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Cognitive Services account commitment quota. */ -@Fluent +@Immutable public final class CommitmentQuota implements JsonSerializable { /* * Commitment quota quantity. @@ -29,7 +29,7 @@ public final class CommitmentQuota implements JsonSerializable /** * Creates an instance of CommitmentQuota class. */ - public CommitmentQuota() { + private CommitmentQuota() { } /** @@ -41,17 +41,6 @@ public Long quantity() { return this.quantity; } - /** - * Set the quantity property: Commitment quota quantity. - * - * @param quantity the quantity value to set. - * @return the CommitmentQuota object itself. - */ - public CommitmentQuota withQuantity(Long quantity) { - this.quantity = quantity; - return this; - } - /** * Get the unit property: Commitment quota unit. * @@ -61,25 +50,6 @@ public String unit() { return this.unit; } - /** - * Set the unit property: Commitment quota unit. - * - * @param unit the unit value to set. - * @return the CommitmentQuota object itself. - */ - public CommitmentQuota withUnit(String unit) { - this.unit = unit; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentTier.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentTier.java index 4740db822406..b61e4d894e65 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentTier.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentTier.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -11,7 +11,7 @@ */ public interface CommitmentTier { /** - * Gets the kind property: The Kind of the resource. + * Gets the kind property: The kind (type) of cognitive service account. * * @return the kind value. */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentTiers.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentTiers.java index b65297d16902..3fa75524462b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentTiers.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentTiers.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -14,7 +14,7 @@ public interface CommitmentTiers { /** * List Commitment Tiers. * - * @param location Resource location. + * @param location The location name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -26,7 +26,7 @@ public interface CommitmentTiers { /** * List Commitment Tiers. * - * @param location Resource location. + * @param location The location name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperationStatus.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperationStatus.java new file mode 100644 index 000000000000..e2a24cf118d3 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperationStatus.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ComputeOperationStatusInner; + +/** + * An immutable client-side representation of ComputeOperationStatus. + */ +public interface ComputeOperationStatus { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The properties of the compute operation status. + * + * @return the properties value. + */ + ComputeOperationStatusProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.ComputeOperationStatusInner object. + * + * @return the inner object. + */ + ComputeOperationStatusInner innerModel(); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperationStatusProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperationStatusProperties.java new file mode 100644 index 000000000000..43ae3f310b10 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperationStatusProperties.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * The properties of a compute operation status. + */ +@Immutable +public final class ComputeOperationStatusProperties implements JsonSerializable { + /* + * The start time of the operation. + */ + private OffsetDateTime startTime; + + /* + * The end time of the operation. + */ + private OffsetDateTime endTime; + + /* + * The status of the operation. + */ + private ComputeOperationStatusType status; + + /* + * Error details if the operation failed. + */ + private ManagementError error; + + /** + * Creates an instance of ComputeOperationStatusProperties class. + */ + private ComputeOperationStatusProperties() { + } + + /** + * Get the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Get the status property: The status of the operation. + * + * @return the status value. + */ + public ComputeOperationStatusType status() { + return this.status; + } + + /** + * Get the error property: Error details if the operation failed. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeJsonField("error", this.error); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ComputeOperationStatusProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ComputeOperationStatusProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ComputeOperationStatusProperties. + */ + public static ComputeOperationStatusProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ComputeOperationStatusProperties deserializedComputeOperationStatusProperties + = new ComputeOperationStatusProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("startTime".equals(fieldName)) { + deserializedComputeOperationStatusProperties.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedComputeOperationStatusProperties.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("status".equals(fieldName)) { + deserializedComputeOperationStatusProperties.status + = ComputeOperationStatusType.fromString(reader.getString()); + } else if ("error".equals(fieldName)) { + deserializedComputeOperationStatusProperties.error = ManagementError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedComputeOperationStatusProperties; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperationStatusType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperationStatusType.java new file mode 100644 index 000000000000..fc0d7573e4d2 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperationStatusType.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The status type of a compute operation. + */ +public final class ComputeOperationStatusType extends ExpandableStringEnum { + /** + * The operation is in progress. + */ + public static final ComputeOperationStatusType IN_PROGRESS = fromString("InProgress"); + + /** + * The operation has succeeded. + */ + public static final ComputeOperationStatusType SUCCEEDED = fromString("Succeeded"); + + /** + * The operation has failed. + */ + public static final ComputeOperationStatusType FAILED = fromString("Failed"); + + /** + * The operation has been canceled. + */ + public static final ComputeOperationStatusType CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of ComputeOperationStatusType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ComputeOperationStatusType() { + } + + /** + * Creates or finds a ComputeOperationStatusType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ComputeOperationStatusType. + */ + public static ComputeOperationStatusType fromString(String name) { + return fromString(name, ComputeOperationStatusType.class); + } + + /** + * Gets known ComputeOperationStatusType values. + * + * @return known ComputeOperationStatusType values. + */ + public static Collection values() { + return values(ComputeOperationStatusType.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperations.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperations.java new file mode 100644 index 000000000000..9746c3c051ea --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperations.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ComputeOperations. + */ +public interface ComputeOperations { + /** + * Gets the status of a compute operation. + * + * @param location The name of the Azure region. + * @param operationId The ID of the compute operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a compute operation along with {@link Response}. + */ + Response getWithResponse(String location, String operationId, Context context); + + /** + * Gets the status of a compute operation. + * + * @param location The name of the Azure region. + * @param operationId The ID of the compute operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a compute operation. + */ + ComputeOperationStatus get(String location, String operationId); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAccessKey.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAccessKey.java index 30c37e026de0..0a520b8c4c79 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAccessKey.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAccessKey.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -72,14 +72,6 @@ public ConnectionAccessKey withSecretAccessKey(String secretAccessKey) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAccountKey.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAccountKey.java index a6fd87a4c298..3a6769ab290c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAccountKey.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAccountKey.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -47,14 +47,6 @@ public ConnectionAccountKey withKey(String key) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionApiKey.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionApiKey.java index 4938a40abfdc..e80b47b8454b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionApiKey.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionApiKey.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -47,14 +47,6 @@ public ConnectionApiKey withKey(String key) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAuthType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAuthType.java index 641213de5d0d..642ea751554a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAuthType.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAuthType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -71,6 +71,41 @@ public final class ConnectionAuthType extends ExpandableStringEnum UUID.fromString(nonNullReader.getString())); + deserializedConnectionOAuth2.clientId = reader.getString(); } else if ("clientSecret".equals(fieldName)) { deserializedConnectionOAuth2.clientSecret = reader.getString(); } else if ("developerToken".equals(fieldName)) { diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPersonalAccessToken.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPersonalAccessToken.java index d5b6ad6b6a52..c942979810e2 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPersonalAccessToken.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPersonalAccessToken.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -47,14 +47,6 @@ public ConnectionPersonalAccessToken withPat(String pat) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPropertiesV2.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPropertiesV2.java index 3982f0c54d81..9f76c62c2a19 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPropertiesV2.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPropertiesV2.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -345,14 +345,6 @@ public ConnectionPropertiesV2 withUseWorkspaceManagedIdentity(Boolean useWorkspa return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPropertiesV2BasicResource.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPropertiesV2BasicResource.java index 200523508a53..58c66fe07127 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPropertiesV2BasicResource.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPropertiesV2BasicResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -84,13 +84,14 @@ interface Blank extends WithParentResource { */ interface WithParentResource { /** - * Specifies resourceGroupName, accountName. + * Specifies resourceGroupName, accountName, projectName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. * @return the next definition stage. */ - WithProperties withExistingAccount(String resourceGroupName, String accountName); + WithProperties withExistingProject(String resourceGroupName, String accountName, String projectName); } /** diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionServicePrincipal.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionServicePrincipal.java index 8d4a1b99abda..29b905db695d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionServicePrincipal.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionServicePrincipal.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -97,14 +97,6 @@ public ConnectionServicePrincipal withTenantId(String tenantId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionSharedAccessSignature.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionSharedAccessSignature.java index b8d4a648959e..2e405c3bf493 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionSharedAccessSignature.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionSharedAccessSignature.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -47,14 +47,6 @@ public ConnectionSharedAccessSignature withSas(String sas) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionUpdateContent.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionUpdateContent.java index 6829a8345816..ccef05933e10 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionUpdateContent.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionUpdateContent.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -47,17 +47,6 @@ public ConnectionUpdateContent withProperties(ConnectionPropertiesV2 properties) return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionUsernamePassword.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionUsernamePassword.java index 080749cd3d49..2e299d2c3fb0 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionUsernamePassword.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionUsernamePassword.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -99,14 +99,6 @@ public ConnectionUsernamePassword withUsername(String username) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ContentLevel.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ContentLevel.java index 79c45c7639f5..6a88f6fe5005 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ContentLevel.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ContentLevel.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomBlocklistConfig.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomBlocklistConfig.java index 129709334279..268d0d2c809f 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomBlocklistConfig.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomBlocklistConfig.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -64,15 +64,6 @@ public CustomBlocklistConfig withBlocking(Boolean blocking) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomKeys.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomKeys.java index bd9f48d71c82..3801409dc041 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomKeys.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomKeys.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -48,14 +48,6 @@ public CustomKeys withKeys(Map keys) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomKeysConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomKeysConnectionProperties.java index 9d8ce5d9d779..ef26dc4ad4ed 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomKeysConnectionProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomKeysConnectionProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -160,18 +160,6 @@ public CustomKeysConnectionProperties withUseWorkspaceManagedIdentity(Boolean us return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (credentials() != null) { - credentials().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomTopicConfig.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomTopicConfig.java index e34bee32d28c..7e314548d3fe 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomTopicConfig.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomTopicConfig.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -64,15 +64,6 @@ public CustomTopicConfig withBlocking(Boolean blocking) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DefenderForAISetting.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DefenderForAISetting.java index 6733e5a77f9f..6c0234e2bebd 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DefenderForAISetting.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DefenderForAISetting.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DefenderForAISettingState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DefenderForAISettingState.java index bacc79169dd9..92b9c24b3479 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DefenderForAISettingState.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DefenderForAISettingState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DefenderForAISettings.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DefenderForAISettings.java index c6cbbe169242..23936244acb7 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DefenderForAISettings.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DefenderForAISettings.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -13,57 +13,57 @@ */ public interface DefenderForAISettings { /** - * Lists the Defender for AI settings. + * Gets the specified Defender for AI setting by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. + * @param defenderForAISettingName The name of the defender for AI setting. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services Defender for AI Settings as paginated response with {@link PagedIterable}. + * @return the specified Defender for AI setting by name along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String accountName); + Response getWithResponse(String resourceGroupName, String accountName, + String defenderForAISettingName, Context context); /** - * Lists the Defender for AI settings. + * Gets the specified Defender for AI setting by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. + * @param defenderForAISettingName The name of the defender for AI setting. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of cognitive services Defender for AI Settings as paginated response with {@link PagedIterable}. + * @return the specified Defender for AI setting by name. */ - PagedIterable list(String resourceGroupName, String accountName, Context context); + DefenderForAISetting get(String resourceGroupName, String accountName, String defenderForAISettingName); /** - * Gets the specified Defender for AI setting by name. + * Lists the Defender for AI settings. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param defenderForAISettingName The name of the defender for AI setting. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Defender for AI setting by name along with {@link Response}. + * @return the list of cognitive services Defender for AI Settings as paginated response with {@link PagedIterable}. */ - Response getWithResponse(String resourceGroupName, String accountName, - String defenderForAISettingName, Context context); + PagedIterable list(String resourceGroupName, String accountName); /** - * Gets the specified Defender for AI setting by name. + * Lists the Defender for AI settings. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param defenderForAISettingName The name of the defender for AI setting. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Defender for AI setting by name. + * @return the list of cognitive services Defender for AI Settings as paginated response with {@link PagedIterable}. */ - DefenderForAISetting get(String resourceGroupName, String accountName, String defenderForAISettingName); + PagedIterable list(String resourceGroupName, String accountName, Context context); /** * Gets the specified Defender for AI setting by name. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeletedAccounts.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeletedAccounts.java index e5002692f7e9..a2f9e21b737f 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeletedAccounts.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeletedAccounts.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -15,7 +15,7 @@ public interface DeletedAccounts { /** * Returns a Cognitive Services account specified by the parameters. * - * @param location Resource location. + * @param location The location name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param context The context to associate with this operation. @@ -30,7 +30,7 @@ public interface DeletedAccounts { /** * Returns a Cognitive Services account specified by the parameters. * - * @param location Resource location. + * @param location The location name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -44,7 +44,7 @@ public interface DeletedAccounts { /** * Deletes a Cognitive Services account from the resource group. * - * @param location Resource location. + * @param location The location name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -56,7 +56,7 @@ public interface DeletedAccounts { /** * Deletes a Cognitive Services account from the resource group. * - * @param location Resource location. + * @param location The location name. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param context The context to associate with this operation. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Deployment.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Deployment.java index 4144d6d29d45..0364e1be11c2 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Deployment.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Deployment.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; +import com.azure.core.http.rest.Response; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.cognitiveservices.fluent.models.DeploymentInner; @@ -34,6 +35,13 @@ public interface Deployment { */ String type(); + /** + * Gets the properties property: Properties of Cognitive Services account deployment. + * + * @return the properties value. + */ + DeploymentProperties properties(); + /** * Gets the sku property: The resource model definition representing SKU. * @@ -55,13 +63,6 @@ public interface Deployment { */ Map tags(); - /** - * Gets the properties property: Properties of Cognitive Services account deployment. - * - * @return the properties value. - */ - DeploymentProperties properties(); - /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -119,7 +120,7 @@ interface WithParentResource { * be created, but also allows for any other optional properties to be specified. */ interface WithCreate - extends DefinitionStages.WithTags, DefinitionStages.WithSku, DefinitionStages.WithProperties { + extends DefinitionStages.WithTags, DefinitionStages.WithProperties, DefinitionStages.WithSku { /** * Executes the create request. * @@ -150,29 +151,29 @@ interface WithTags { } /** - * The stage of the Deployment definition allowing to specify sku. + * The stage of the Deployment definition allowing to specify properties. */ - interface WithSku { + interface WithProperties { /** - * Specifies the sku property: The resource model definition representing SKU. + * Specifies the properties property: Properties of Cognitive Services account deployment.. * - * @param sku The resource model definition representing SKU. + * @param properties Properties of Cognitive Services account deployment. * @return the next definition stage. */ - WithCreate withSku(Sku sku); + WithCreate withProperties(DeploymentProperties properties); } /** - * The stage of the Deployment definition allowing to specify properties. + * The stage of the Deployment definition allowing to specify sku. */ - interface WithProperties { + interface WithSku { /** - * Specifies the properties property: Properties of Cognitive Services account deployment.. + * Specifies the sku property: The resource model definition representing SKU. * - * @param properties Properties of Cognitive Services account deployment. + * @param sku The resource model definition representing SKU. * @return the next definition stage. */ - WithCreate withProperties(DeploymentProperties properties); + WithCreate withSku(Sku sku); } } @@ -248,4 +249,62 @@ interface WithSku { * @return the refreshed resource. */ Deployment refresh(Context context); + + /** + * Pause a deployment + * + * Pauses inferencing on a deployment by setting the deploymentState to 'Paused' (see + * #/definitions/DeploymentProperties/properties/deploymentState). Only Standard, DataZoneStandard, and + * GlobalStandard SKUs support this operation. Inference requests to the paused deployment endpoint will receive + * HTTP 423 (Locked). This operation is idempotent. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account deployment along with {@link Response}. + */ + Response pauseWithResponse(Context context); + + /** + * Pause a deployment + * + * Pauses inferencing on a deployment by setting the deploymentState to 'Paused' (see + * #/definitions/DeploymentProperties/properties/deploymentState). Only Standard, DataZoneStandard, and + * GlobalStandard SKUs support this operation. Inference requests to the paused deployment endpoint will receive + * HTTP 423 (Locked). This operation is idempotent. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account deployment. + */ + Deployment pause(); + + /** + * Resume a deployment + * + * Resumes inferencing on a previously paused deployment by setting the deploymentState to 'Running' (see + * #/definitions/DeploymentProperties/properties/deploymentState). This operation is idempotent and can be safely + * called on already running deployments. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account deployment along with {@link Response}. + */ + Response resumeWithResponse(Context context); + + /** + * Resume a deployment + * + * Resumes inferencing on a previously paused deployment by setting the deploymentState to 'Running' (see + * #/definitions/DeploymentProperties/properties/deploymentState). This operation is idempotent and can be safely + * called on already running deployments. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account deployment. + */ + Deployment resume(); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentCapacitySettings.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentCapacitySettings.java index ab7a60896d7a..6acb9b6fb69a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentCapacitySettings.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentCapacitySettings.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -72,14 +72,6 @@ public DeploymentCapacitySettings withPriority(Integer priority) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentModel.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentModel.java index 12e2d9b925e6..7a0dbccaf297 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentModel.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentModel.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -205,17 +205,6 @@ DeploymentModel withCallRateLimit(CallRateLimit callRateLimit) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (callRateLimit() != null) { - callRateLimit().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentModelVersionUpgradeOption.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentModelVersionUpgradeOption.java index f02ac3106a1c..a634fa606b40 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentModelVersionUpgradeOption.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentModelVersionUpgradeOption.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentProperties.java index f08237b2a1c3..8b79ef8c0ec4 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -84,6 +84,27 @@ public final class DeploymentProperties implements JsonSerializable e.validate()); - } - if (capacitySettings() != null) { - capacitySettings().validate(); - } + * @return the deploymentState value. + */ + public DeploymentState deploymentState() { + return this.deploymentState; + } + + /** + * Set the deploymentState property: The state of the deployment. Controls whether the deployment is accepting + * inference requests. Use 'Running' for active deployments that process requests, or 'Paused' to temporarily stop + * inference while preserving the deployment configuration. + * + * @param deploymentState the deploymentState value to set. + * @return the DeploymentProperties object itself. + */ + public DeploymentProperties withDeploymentState(DeploymentState deploymentState) { + this.deploymentState = deploymentState; + return this; + } + + /** + * Get the routing property: Routing configuration for the deployment. This property is only applicable when the + * deployed model is 'model-router' version 2025-11-18 or later. Allows you to select the models subset for routing + * and the routing mode (balanced, accuracy, cost) for routing across all supported models or the model subset. + * + * @return the routing value. + */ + public DeploymentRouting routing() { + return this.routing; + } + + /** + * Set the routing property: Routing configuration for the deployment. This property is only applicable when the + * deployed model is 'model-router' version 2025-11-18 or later. Allows you to select the models subset for routing + * and the routing mode (balanced, accuracy, cost) for routing across all supported models or the model subset. + * + * @param routing the routing value to set. + * @return the DeploymentProperties object itself. + */ + public DeploymentProperties withRouting(DeploymentRouting routing) { + this.routing = routing; + return this; } /** @@ -337,6 +409,10 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("capacitySettings", this.capacitySettings); jsonWriter.writeStringField("parentDeploymentName", this.parentDeploymentName); jsonWriter.writeStringField("spilloverDeploymentName", this.spilloverDeploymentName); + jsonWriter.writeStringField("serviceTier", this.serviceTier == null ? null : this.serviceTier.toString()); + jsonWriter.writeStringField("deploymentState", + this.deploymentState == null ? null : this.deploymentState.toString()); + jsonWriter.writeJsonField("routing", this.routing); return jsonWriter.writeEndObject(); } @@ -386,6 +462,12 @@ public static DeploymentProperties fromJson(JsonReader jsonReader) throws IOExce deserializedDeploymentProperties.parentDeploymentName = reader.getString(); } else if ("spilloverDeploymentName".equals(fieldName)) { deserializedDeploymentProperties.spilloverDeploymentName = reader.getString(); + } else if ("serviceTier".equals(fieldName)) { + deserializedDeploymentProperties.serviceTier = ServiceTier.fromString(reader.getString()); + } else if ("deploymentState".equals(fieldName)) { + deserializedDeploymentProperties.deploymentState = DeploymentState.fromString(reader.getString()); + } else if ("routing".equals(fieldName)) { + deserializedDeploymentProperties.routing = DeploymentRouting.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentProvisioningState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentProvisioningState.java index 156ea6f2272e..7d220b06aa1d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentProvisioningState.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentRouting.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentRouting.java new file mode 100644 index 000000000000..fd3e4e8e9169 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentRouting.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Routing configuration for the deployment. Specifies how requests are routed across multiple models. + */ +@Fluent +public final class DeploymentRouting implements JsonSerializable { + /* + * The routing mode that determines how requests are distributed across models. + */ + private RoutingMode mode; + + /* + * Optional. The list of models that the model router can use to route requests across. If not specified, the model + * router will route to all available models specified in the model-router version. + */ + private List models; + + /** + * Creates an instance of DeploymentRouting class. + */ + public DeploymentRouting() { + } + + /** + * Get the mode property: The routing mode that determines how requests are distributed across models. + * + * @return the mode value. + */ + public RoutingMode mode() { + return this.mode; + } + + /** + * Set the mode property: The routing mode that determines how requests are distributed across models. + * + * @param mode the mode value to set. + * @return the DeploymentRouting object itself. + */ + public DeploymentRouting withMode(RoutingMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the models property: Optional. The list of models that the model router can use to route requests across. If + * not specified, the model router will route to all available models specified in the model-router version. + * + * @return the models value. + */ + public List models() { + return this.models; + } + + /** + * Set the models property: Optional. The list of models that the model router can use to route requests across. If + * not specified, the model router will route to all available models specified in the model-router version. + * + * @param models the models value to set. + * @return the DeploymentRouting object itself. + */ + public DeploymentRouting withModels(List models) { + this.models = models; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + jsonWriter.writeArrayField("models", this.models, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeploymentRouting from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeploymentRouting if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DeploymentRouting. + */ + public static DeploymentRouting fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DeploymentRouting deserializedDeploymentRouting = new DeploymentRouting(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mode".equals(fieldName)) { + deserializedDeploymentRouting.mode = RoutingMode.fromString(reader.getString()); + } else if ("models".equals(fieldName)) { + List models = reader.readArray(reader1 -> DeploymentModel.fromJson(reader1)); + deserializedDeploymentRouting.models = models; + } else { + reader.skipChildren(); + } + } + + return deserializedDeploymentRouting; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentScaleSettings.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentScaleSettings.java index d3abb37de7d8..89ca4100e0c0 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentScaleSettings.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentScaleSettings.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -88,14 +88,6 @@ public Integer activeCapacity() { return this.activeCapacity; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentScaleType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentScaleType.java index 6ffc8a932d64..e1df252bd222 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentScaleType.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentScaleType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentState.java new file mode 100644 index 000000000000..1d91b008eb1b --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentState.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The state of the deployment. Controls whether the deployment is accepting inference requests. Use 'Running' for + * active deployments that process requests, or 'Paused' to temporarily stop inference while preserving the deployment + * configuration. + */ +public final class DeploymentState extends ExpandableStringEnum { + /** + * The deployment is running and accepting inference requests. + */ + public static final DeploymentState RUNNING = fromString("Running"); + + /** + * The deployment is paused and not accepting inference requests. + */ + public static final DeploymentState PAUSED = fromString("Paused"); + + /** + * Creates a new instance of DeploymentState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DeploymentState() { + } + + /** + * Creates or finds a DeploymentState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeploymentState. + */ + public static DeploymentState fromString(String name) { + return fromString(name, DeploymentState.class); + } + + /** + * Gets known DeploymentState values. + * + * @return known DeploymentState values. + */ + public static Collection values() { + return values(DeploymentState.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Deployments.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Deployments.java index 184e984957ab..cae21bfbdcef 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Deployments.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Deployments.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -13,84 +13,84 @@ */ public interface Deployments { /** - * Gets the deployments associated with the Cognitive Services account. + * Gets the specified deployments associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployments associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. + * @return the specified deployments associated with the Cognitive Services account along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String accountName); + Response getWithResponse(String resourceGroupName, String accountName, String deploymentName, + Context context); /** - * Gets the deployments associated with the Cognitive Services account. + * Gets the specified deployments associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the deployments associated with the Cognitive Services account as paginated response with - * {@link PagedIterable}. + * @return the specified deployments associated with the Cognitive Services account. */ - PagedIterable list(String resourceGroupName, String accountName, Context context); + Deployment get(String resourceGroupName, String accountName, String deploymentName); /** - * Gets the specified deployments associated with the Cognitive Services account. + * Deletes the specified deployment associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param deploymentName The name of the deployment associated with the Cognitive Services Account. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified deployments associated with the Cognitive Services account along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String accountName, String deploymentName, - Context context); + void delete(String resourceGroupName, String accountName, String deploymentName); /** - * Gets the specified deployments associated with the Cognitive Services account. + * Deletes the specified deployment associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified deployments associated with the Cognitive Services account. */ - Deployment get(String resourceGroupName, String accountName, String deploymentName); + void delete(String resourceGroupName, String accountName, String deploymentName, Context context); /** - * Deletes the specified deployment associated with the Cognitive Services account. + * Gets the deployments associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployments associated with the Cognitive Services account as paginated response with + * {@link PagedIterable}. */ - void delete(String resourceGroupName, String accountName, String deploymentName); + PagedIterable list(String resourceGroupName, String accountName); /** - * Deletes the specified deployment associated with the Cognitive Services account. + * Gets the deployments associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param deploymentName The name of the deployment associated with the Cognitive Services Account. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployments associated with the Cognitive Services account as paginated response with + * {@link PagedIterable}. */ - void delete(String resourceGroupName, String accountName, String deploymentName, Context context); + PagedIterable list(String resourceGroupName, String accountName, Context context); /** * Lists the specified deployments skus associated with the Cognitive Services account. @@ -122,6 +122,80 @@ Response getWithResponse(String resourceGroupName, String accountNam PagedIterable listSkus(String resourceGroupName, String accountName, String deploymentName, Context context); + /** + * Pause a deployment + * + * Pauses inferencing on a deployment by setting the deploymentState to 'Paused' (see + * #/definitions/DeploymentProperties/properties/deploymentState). Only Standard, DataZoneStandard, and + * GlobalStandard SKUs support this operation. Inference requests to the paused deployment endpoint will receive + * HTTP 423 (Locked). This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account deployment along with {@link Response}. + */ + Response pauseWithResponse(String resourceGroupName, String accountName, String deploymentName, + Context context); + + /** + * Pause a deployment + * + * Pauses inferencing on a deployment by setting the deploymentState to 'Paused' (see + * #/definitions/DeploymentProperties/properties/deploymentState). Only Standard, DataZoneStandard, and + * GlobalStandard SKUs support this operation. Inference requests to the paused deployment endpoint will receive + * HTTP 423 (Locked). This operation is idempotent. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account deployment. + */ + Deployment pause(String resourceGroupName, String accountName, String deploymentName); + + /** + * Resume a deployment + * + * Resumes inferencing on a previously paused deployment by setting the deploymentState to 'Running' (see + * #/definitions/DeploymentProperties/properties/deploymentState). This operation is idempotent and can be safely + * called on already running deployments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account deployment along with {@link Response}. + */ + Response resumeWithResponse(String resourceGroupName, String accountName, String deploymentName, + Context context); + + /** + * Resume a deployment + * + * Resumes inferencing on a previously paused deployment by setting the deploymentState to 'Running' (see + * #/definitions/DeploymentProperties/properties/deploymentState). This operation is idempotent and can be safely + * called on already running deployments. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param deploymentName The name of the deployment associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services account deployment. + */ + Deployment resume(String resourceGroupName, String accountName, String deploymentName); + /** * Gets the specified deployments associated with the Cognitive Services account. * diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeprecationStatus.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeprecationStatus.java index 41ef4793a5a3..25e13f011ff4 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeprecationStatus.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeprecationStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DomainAvailability.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DomainAvailability.java index 57dac1a2011b..4fa491b7d79e 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DomainAvailability.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/DomainAvailability.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -39,7 +39,7 @@ public interface DomainAvailability { String type(); /** - * Gets the kind property: The Kind of the resource. + * Gets the kind property: The kind (type) of cognitive service account. * * @return the kind value. */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Encryption.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Encryption.java index 21f57510ddff..c97022b8961d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Encryption.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Encryption.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -72,17 +72,6 @@ public Encryption withKeySource(KeySource keySource) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (keyVaultProperties() != null) { - keyVaultProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScope.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScope.java index 4390f2d78142..e33b784d672a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScope.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScope.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -34,6 +34,13 @@ public interface EncryptionScope { */ String type(); + /** + * Gets the properties property: Properties of Cognitive Services EncryptionScope. + * + * @return the properties value. + */ + EncryptionScopeProperties properties(); + /** * Gets the etag property: Resource Etag. * @@ -48,13 +55,6 @@ public interface EncryptionScope { */ Map tags(); - /** - * Gets the properties property: Properties of Cognitive Services EncryptionScope. - * - * @return the properties value. - */ - EncryptionScopeProperties properties(); - /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopeProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopeProperties.java index cd51f56c2f66..f90da17cee12 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopeProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopeProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -78,18 +78,6 @@ public EncryptionScopeProperties withKeySource(KeySource keySource) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (keyVaultProperties() != null) { - keyVaultProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopeProvisioningState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopeProvisioningState.java index aa9d4ca1fefd..f049dc913a6e 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopeProvisioningState.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopeProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopeState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopeState.java index dd0e65cfcb7f..e554d47b196d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopeState.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopeState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopes.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopes.java index 16081ccc6159..06595bb18665 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopes.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopes.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -13,84 +13,84 @@ */ public interface EncryptionScopes { /** - * Gets the content filters associated with the Azure OpenAI account. + * Gets the specified EncryptionScope associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. + * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. + * @return the specified EncryptionScope associated with the Cognitive Services account along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String accountName); + Response getWithResponse(String resourceGroupName, String accountName, String encryptionScopeName, + Context context); /** - * Gets the content filters associated with the Azure OpenAI account. + * Gets the specified EncryptionScope associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. + * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. + * @return the specified EncryptionScope associated with the Cognitive Services account. */ - PagedIterable list(String resourceGroupName, String accountName, Context context); + EncryptionScope get(String resourceGroupName, String accountName, String encryptionScopeName); /** - * Gets the specified EncryptionScope associated with the Cognitive Services account. + * Deletes the specified encryptionScope associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified EncryptionScope associated with the Cognitive Services account along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String accountName, String encryptionScopeName, - Context context); + void delete(String resourceGroupName, String accountName, String encryptionScopeName); /** - * Gets the specified EncryptionScope associated with the Cognitive Services account. + * Deletes the specified encryptionScope associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified EncryptionScope associated with the Cognitive Services account. */ - EncryptionScope get(String resourceGroupName, String accountName, String encryptionScopeName); + void delete(String resourceGroupName, String accountName, String encryptionScopeName, Context context); /** - * Deletes the specified encryptionScope associated with the Cognitive Services account. + * Gets the content filters associated with the Azure OpenAI account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the content filters associated with the Azure OpenAI account as paginated response with + * {@link PagedIterable}. */ - void delete(String resourceGroupName, String accountName, String encryptionScopeName); + PagedIterable list(String resourceGroupName, String accountName); /** - * Deletes the specified encryptionScope associated with the Cognitive Services account. + * Gets the content filters associated with the Azure OpenAI account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param encryptionScopeName The name of the encryptionScope associated with the Cognitive Services Account. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the content filters associated with the Azure OpenAI account as paginated response with + * {@link PagedIterable}. */ - void delete(String resourceGroupName, String accountName, String encryptionScopeName, Context context); + PagedIterable list(String resourceGroupName, String accountName, Context context); /** * Gets the specified EncryptionScope associated with the Cognitive Services account. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FirewallSku.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FirewallSku.java new file mode 100644 index 000000000000..d896eca41404 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FirewallSku.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Firewall Sku used for FQDN Rules. + */ +public final class FirewallSku extends ExpandableStringEnum { + /** + * Static value Standard for FirewallSku. + */ + public static final FirewallSku STANDARD = fromString("Standard"); + + /** + * Static value Basic for FirewallSku. + */ + public static final FirewallSku BASIC = fromString("Basic"); + + /** + * Creates a new instance of FirewallSku value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FirewallSku() { + } + + /** + * Creates or finds a FirewallSku from its string representation. + * + * @param name a name to look for. + * @return the corresponding FirewallSku. + */ + public static FirewallSku fromString(String name) { + return fromString(name, FirewallSku.class); + } + + /** + * Gets known FirewallSku values. + * + * @return known FirewallSku values. + */ + public static Collection values() { + return values(FirewallSku.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FoundryAutoUpgrade.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FoundryAutoUpgrade.java new file mode 100644 index 000000000000..452ad73e4645 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FoundryAutoUpgrade.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Represents the foundry auto-upgrade configuration for a Cognitive Services account. + * Customers can opt out of auto-upgrade by setting mode to Disabled. + */ +@Fluent +public final class FoundryAutoUpgrade implements JsonSerializable { + /* + * Gets or sets the auto-upgrade mode. + */ + private FoundryAutoUpgradeMode mode; + + /* + * Gets or sets a value indicating whether the auto-upgrade is planned by Microsoft. + */ + private Boolean plannedByMicrosoft; + + /* + * Gets or sets the status reason for the auto-upgrade configuration. + */ + private String statusReason; + + /* + * Gets or sets the scheduled time for the auto-upgrade. + */ + private OffsetDateTime scheduledAt; + + /** + * Creates an instance of FoundryAutoUpgrade class. + */ + public FoundryAutoUpgrade() { + } + + /** + * Get the mode property: Gets or sets the auto-upgrade mode. + * + * @return the mode value. + */ + public FoundryAutoUpgradeMode mode() { + return this.mode; + } + + /** + * Set the mode property: Gets or sets the auto-upgrade mode. + * + * @param mode the mode value to set. + * @return the FoundryAutoUpgrade object itself. + */ + public FoundryAutoUpgrade withMode(FoundryAutoUpgradeMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the plannedByMicrosoft property: Gets or sets a value indicating whether the auto-upgrade is planned by + * Microsoft. + * + * @return the plannedByMicrosoft value. + */ + public Boolean plannedByMicrosoft() { + return this.plannedByMicrosoft; + } + + /** + * Set the plannedByMicrosoft property: Gets or sets a value indicating whether the auto-upgrade is planned by + * Microsoft. + * + * @param plannedByMicrosoft the plannedByMicrosoft value to set. + * @return the FoundryAutoUpgrade object itself. + */ + public FoundryAutoUpgrade withPlannedByMicrosoft(Boolean plannedByMicrosoft) { + this.plannedByMicrosoft = plannedByMicrosoft; + return this; + } + + /** + * Get the statusReason property: Gets or sets the status reason for the auto-upgrade configuration. + * + * @return the statusReason value. + */ + public String statusReason() { + return this.statusReason; + } + + /** + * Set the statusReason property: Gets or sets the status reason for the auto-upgrade configuration. + * + * @param statusReason the statusReason value to set. + * @return the FoundryAutoUpgrade object itself. + */ + public FoundryAutoUpgrade withStatusReason(String statusReason) { + this.statusReason = statusReason; + return this; + } + + /** + * Get the scheduledAt property: Gets or sets the scheduled time for the auto-upgrade. + * + * @return the scheduledAt value. + */ + public OffsetDateTime scheduledAt() { + return this.scheduledAt; + } + + /** + * Set the scheduledAt property: Gets or sets the scheduled time for the auto-upgrade. + * + * @param scheduledAt the scheduledAt value to set. + * @return the FoundryAutoUpgrade object itself. + */ + public FoundryAutoUpgrade withScheduledAt(OffsetDateTime scheduledAt) { + this.scheduledAt = scheduledAt; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + jsonWriter.writeBooleanField("plannedByMicrosoft", this.plannedByMicrosoft); + jsonWriter.writeStringField("statusReason", this.statusReason); + jsonWriter.writeStringField("scheduledAt", + this.scheduledAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.scheduledAt)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FoundryAutoUpgrade from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FoundryAutoUpgrade if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FoundryAutoUpgrade. + */ + public static FoundryAutoUpgrade fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FoundryAutoUpgrade deserializedFoundryAutoUpgrade = new FoundryAutoUpgrade(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mode".equals(fieldName)) { + deserializedFoundryAutoUpgrade.mode = FoundryAutoUpgradeMode.fromString(reader.getString()); + } else if ("plannedByMicrosoft".equals(fieldName)) { + deserializedFoundryAutoUpgrade.plannedByMicrosoft = reader.getNullable(JsonReader::getBoolean); + } else if ("statusReason".equals(fieldName)) { + deserializedFoundryAutoUpgrade.statusReason = reader.getString(); + } else if ("scheduledAt".equals(fieldName)) { + deserializedFoundryAutoUpgrade.scheduledAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedFoundryAutoUpgrade; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FoundryAutoUpgradeMode.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FoundryAutoUpgradeMode.java new file mode 100644 index 000000000000..bedd73a6489f --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FoundryAutoUpgradeMode.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Represents the mode for foundry auto-upgrade configuration. + */ +public final class FoundryAutoUpgradeMode extends ExpandableStringEnum { + /** + * Auto-upgrade is enabled. + */ + public static final FoundryAutoUpgradeMode ENABLED = fromString("Enabled"); + + /** + * Auto-upgrade is disabled (opted out). + */ + public static final FoundryAutoUpgradeMode DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of FoundryAutoUpgradeMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FoundryAutoUpgradeMode() { + } + + /** + * Creates or finds a FoundryAutoUpgradeMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding FoundryAutoUpgradeMode. + */ + public static FoundryAutoUpgradeMode fromString(String name) { + return fromString(name, FoundryAutoUpgradeMode.class); + } + + /** + * Gets known FoundryAutoUpgradeMode values. + * + * @return known FoundryAutoUpgradeMode values. + */ + public static Collection values() { + return values(FoundryAutoUpgradeMode.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FqdnOutboundRule.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FqdnOutboundRule.java new file mode 100644 index 000000000000..4e7c1dbd166d --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/FqdnOutboundRule.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * FQDN Outbound Rule for the managed network of a cognitive services account. + */ +@Fluent +public final class FqdnOutboundRule extends OutboundRule { + /* + * Type of a managed network Outbound Rule of a cognitive services account. + */ + private RuleType type = RuleType.FQDN; + + /* + * The destination property. + */ + private String destination; + + /** + * Creates an instance of FqdnOutboundRule class. + */ + public FqdnOutboundRule() { + } + + /** + * Get the type property: Type of a managed network Outbound Rule of a cognitive services account. + * + * @return the type value. + */ + @Override + public RuleType type() { + return this.type; + } + + /** + * Get the destination property: The destination property. + * + * @return the destination value. + */ + public String destination() { + return this.destination; + } + + /** + * Set the destination property: The destination property. + * + * @param destination the destination value to set. + * @return the FqdnOutboundRule object itself. + */ + public FqdnOutboundRule withDestination(String destination) { + this.destination = destination; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FqdnOutboundRule withCategory(RuleCategory category) { + super.withCategory(category); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public FqdnOutboundRule withStatus(RuleStatus status) { + super.withStatus(status); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", category() == null ? null : category().toString()); + jsonWriter.writeStringField("status", status() == null ? null : status().toString()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("destination", this.destination); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FqdnOutboundRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FqdnOutboundRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the FqdnOutboundRule. + */ + public static FqdnOutboundRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FqdnOutboundRule deserializedFqdnOutboundRule = new FqdnOutboundRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedFqdnOutboundRule.withCategory(RuleCategory.fromString(reader.getString())); + } else if ("status".equals(fieldName)) { + deserializedFqdnOutboundRule.withStatus(RuleStatus.fromString(reader.getString())); + } else if ("errorInformation".equals(fieldName)) { + deserializedFqdnOutboundRule.withErrorInformation(reader.getString()); + } else if ("parentRuleNames".equals(fieldName)) { + List parentRuleNames = reader.readArray(reader1 -> reader1.getString()); + deserializedFqdnOutboundRule.withParentRuleNames(parentRuleNames); + } else if ("type".equals(fieldName)) { + deserializedFqdnOutboundRule.type = RuleType.fromString(reader.getString()); + } else if ("destination".equals(fieldName)) { + deserializedFqdnOutboundRule.destination = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFqdnOutboundRule; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/HostedAgentDeployment.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/HostedAgentDeployment.java new file mode 100644 index 000000000000..6824fdf953e4 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/HostedAgentDeployment.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Represents a hosted agent deployment where the underlying infrastructure is owned by the platform. + */ +@Fluent +public final class HostedAgentDeployment extends AgentDeploymentProperties { + /* + * Gets or sets the type of deployment for the agent. + */ + private AgentDeploymentType deploymentType = AgentDeploymentType.HOSTED; + + /* + * Gets or sets the minimum number of replicas for this hosted deployment. + */ + private Integer minReplicas; + + /* + * Gets or sets the maximum number of replicas for this hosted deployment. + */ + private Integer maxReplicas; + + /** + * Creates an instance of HostedAgentDeployment class. + */ + public HostedAgentDeployment() { + } + + /** + * Get the deploymentType property: Gets or sets the type of deployment for the agent. + * + * @return the deploymentType value. + */ + @Override + public AgentDeploymentType deploymentType() { + return this.deploymentType; + } + + /** + * Get the minReplicas property: Gets or sets the minimum number of replicas for this hosted deployment. + * + * @return the minReplicas value. + */ + public Integer minReplicas() { + return this.minReplicas; + } + + /** + * Set the minReplicas property: Gets or sets the minimum number of replicas for this hosted deployment. + * + * @param minReplicas the minReplicas value to set. + * @return the HostedAgentDeployment object itself. + */ + public HostedAgentDeployment withMinReplicas(Integer minReplicas) { + this.minReplicas = minReplicas; + return this; + } + + /** + * Get the maxReplicas property: Gets or sets the maximum number of replicas for this hosted deployment. + * + * @return the maxReplicas value. + */ + public Integer maxReplicas() { + return this.maxReplicas; + } + + /** + * Set the maxReplicas property: Gets or sets the maximum number of replicas for this hosted deployment. + * + * @param maxReplicas the maxReplicas value to set. + * @return the HostedAgentDeployment object itself. + */ + public HostedAgentDeployment withMaxReplicas(Integer maxReplicas) { + this.maxReplicas = maxReplicas; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public HostedAgentDeployment withDisplayName(String displayName) { + super.withDisplayName(displayName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public HostedAgentDeployment withDeploymentId(String deploymentId) { + super.withDeploymentId(deploymentId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public HostedAgentDeployment withState(AgentDeploymentState state) { + super.withState(state); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public HostedAgentDeployment withProtocols(List protocols) { + super.withProtocols(protocols); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public HostedAgentDeployment withAgents(List agents) { + super.withAgents(agents); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public HostedAgentDeployment withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public HostedAgentDeployment withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("displayName", displayName()); + jsonWriter.writeStringField("deploymentId", deploymentId()); + jsonWriter.writeStringField("state", state() == null ? null : state().toString()); + jsonWriter.writeArrayField("protocols", protocols(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("agents", agents(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("deploymentType", + this.deploymentType == null ? null : this.deploymentType.toString()); + jsonWriter.writeNumberField("minReplicas", this.minReplicas); + jsonWriter.writeNumberField("maxReplicas", this.maxReplicas); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HostedAgentDeployment from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HostedAgentDeployment if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the HostedAgentDeployment. + */ + public static HostedAgentDeployment fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HostedAgentDeployment deserializedHostedAgentDeployment = new HostedAgentDeployment(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedHostedAgentDeployment.withDescription(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedHostedAgentDeployment.withTags(tags); + } else if ("displayName".equals(fieldName)) { + deserializedHostedAgentDeployment.withDisplayName(reader.getString()); + } else if ("deploymentId".equals(fieldName)) { + deserializedHostedAgentDeployment.withDeploymentId(reader.getString()); + } else if ("state".equals(fieldName)) { + deserializedHostedAgentDeployment.withState(AgentDeploymentState.fromString(reader.getString())); + } else if ("protocols".equals(fieldName)) { + List protocols + = reader.readArray(reader1 -> AgentProtocolVersion.fromJson(reader1)); + deserializedHostedAgentDeployment.withProtocols(protocols); + } else if ("agents".equals(fieldName)) { + List agents + = reader.readArray(reader1 -> VersionedAgentReference.fromJson(reader1)); + deserializedHostedAgentDeployment.withAgents(agents); + } else if ("provisioningState".equals(fieldName)) { + deserializedHostedAgentDeployment + .withProvisioningState(AgentDeploymentProvisioningState.fromString(reader.getString())); + } else if ("deploymentType".equals(fieldName)) { + deserializedHostedAgentDeployment.deploymentType + = AgentDeploymentType.fromString(reader.getString()); + } else if ("minReplicas".equals(fieldName)) { + deserializedHostedAgentDeployment.minReplicas = reader.getNullable(JsonReader::getInt); + } else if ("maxReplicas".equals(fieldName)) { + deserializedHostedAgentDeployment.maxReplicas = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedHostedAgentDeployment; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/HostingModel.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/HostingModel.java index 2ba358625a0a..99af491bff83 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/HostingModel.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/HostingModel.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Identity.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Identity.java index db3e3d0f4bbf..822c8614671c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Identity.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Identity.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -108,21 +108,6 @@ public Identity withUserAssignedIdentities(Map use return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (userAssignedIdentities() != null) { - userAssignedIdentities().values().forEach(e -> { - if (e != null) { - e.validate(); - } - }); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IdentityKind.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IdentityKind.java new file mode 100644 index 000000000000..31c6e8d55be5 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IdentityKind.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specifies the kind of Entra identity described by this object. + */ +public final class IdentityKind extends ExpandableStringEnum { + /** + * Represents a class identity, used for agentic applications. + */ + public static final IdentityKind AGENT_BLUEPRINT = fromString("AgentBlueprint"); + + /** + * Represents an instance identity. + */ + public static final IdentityKind AGENT_INSTANCE = fromString("AgentInstance"); + + /** + * Represents an agentic instance identity with user-like traits. + */ + public static final IdentityKind AGENTIC_USER = fromString("AgenticUser"); + + /** + * Represents a classic managed identity. + */ + public static final IdentityKind MANAGED = fromString("Managed"); + + /** + * No identity. + */ + public static final IdentityKind NONE = fromString("None"); + + /** + * Creates a new instance of IdentityKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IdentityKind() { + } + + /** + * Creates or finds a IdentityKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding IdentityKind. + */ + public static IdentityKind fromString(String name) { + return fromString(name, IdentityKind.class); + } + + /** + * Gets known IdentityKind values. + * + * @return known IdentityKind values. + */ + public static Collection values() { + return values(IdentityKind.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IdentityManagementType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IdentityManagementType.java new file mode 100644 index 000000000000..3cbe13f1aa7e --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IdentityManagementType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enumeration of identity types, from the perspective of management. + */ +public final class IdentityManagementType extends ExpandableStringEnum { + /** + * Platform-managed identity. + */ + public static final IdentityManagementType SYSTEM = fromString("System"); + + /** + * User-managed identity. + */ + public static final IdentityManagementType USER = fromString("User"); + + /** + * No identity. + */ + public static final IdentityManagementType NONE = fromString("None"); + + /** + * Creates a new instance of IdentityManagementType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IdentityManagementType() { + } + + /** + * Creates or finds a IdentityManagementType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IdentityManagementType. + */ + public static IdentityManagementType fromString(String name) { + return fromString(name, IdentityManagementType.class); + } + + /** + * Gets known IdentityManagementType values. + * + * @return known IdentityManagementType values. + */ + public static Collection values() { + return values(IdentityManagementType.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IdentityProvisioningState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IdentityProvisioningState.java new file mode 100644 index 000000000000..04d8b5b34989 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IdentityProvisioningState.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Represents the provisioning state of an identity resource. + */ +public final class IdentityProvisioningState extends ExpandableStringEnum { + /** + * Identity is being created. + */ + public static final IdentityProvisioningState CREATING = fromString("Creating"); + + /** + * Identity is being updated. + */ + public static final IdentityProvisioningState UPDATING = fromString("Updating"); + + /** + * Identity has been successfully provisioned. + */ + public static final IdentityProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Identity provisioning has failed. + */ + public static final IdentityProvisioningState FAILED = fromString("Failed"); + + /** + * Identity provisioning has been canceled. + */ + public static final IdentityProvisioningState CANCELED = fromString("Canceled"); + + /** + * Identity is being deleted. + */ + public static final IdentityProvisioningState DELETING = fromString("Deleting"); + + /** + * Creates a new instance of IdentityProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IdentityProvisioningState() { + } + + /** + * Creates or finds a IdentityProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding IdentityProvisioningState. + */ + public static IdentityProvisioningState fromString(String name) { + return fromString(name, IdentityProvisioningState.class); + } + + /** + * Gets known IdentityProvisioningState values. + * + * @return known IdentityProvisioningState values. + */ + public static Collection values() { + return values(IdentityProvisioningState.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IpRule.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IpRule.java index 318b463ab632..0de85f99a07a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IpRule.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IpRule.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -51,19 +50,6 @@ public IpRule withValue(String value) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER.atError().log(new IllegalArgumentException("Missing required property value in model IpRule")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(IpRule.class); - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IsolationMode.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IsolationMode.java new file mode 100644 index 000000000000..f4db2cf4d2a4 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/IsolationMode.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Isolation mode for the managed network of a cognitive services account. + */ +public final class IsolationMode extends ExpandableStringEnum { + /** + * Static value Disabled for IsolationMode. + */ + public static final IsolationMode DISABLED = fromString("Disabled"); + + /** + * Static value AllowInternetOutbound for IsolationMode. + */ + public static final IsolationMode ALLOW_INTERNET_OUTBOUND = fromString("AllowInternetOutbound"); + + /** + * Static value AllowOnlyApprovedOutbound for IsolationMode. + */ + public static final IsolationMode ALLOW_ONLY_APPROVED_OUTBOUND = fromString("AllowOnlyApprovedOutbound"); + + /** + * Creates a new instance of IsolationMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IsolationMode() { + } + + /** + * Creates or finds a IsolationMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding IsolationMode. + */ + public static IsolationMode fromString(String name) { + return fromString(name, IsolationMode.class); + } + + /** + * Gets known IsolationMode values. + * + * @return known IsolationMode values. + */ + public static Collection values() { + return values(IsolationMode.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/KeyName.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/KeyName.java index fd06e6072510..a386afd0cea3 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/KeyName.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/KeyName.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/KeySource.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/KeySource.java index b699987b980d..fd1b8f082057 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/KeySource.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/KeySource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/KeyVaultProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/KeyVaultProperties.java index e83148b6c1b2..2d45ce81a9e6 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/KeyVaultProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/KeyVaultProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -122,14 +122,6 @@ public KeyVaultProperties withIdentityClientId(String identityClientId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/LocationBasedModelCapacities.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/LocationBasedModelCapacities.java index 5d78821b56c3..c8be2f4c95fb 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/LocationBasedModelCapacities.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/LocationBasedModelCapacities.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -14,7 +14,7 @@ public interface LocationBasedModelCapacities { /** * List Location Based ModelCapacities. * - * @param location Resource location. + * @param location The location name. * @param modelFormat The format of the Model. * @param modelName The name of the Model. * @param modelVersion The version of the Model. @@ -30,7 +30,7 @@ PagedIterable list(String location, String mod /** * List Location Based ModelCapacities. * - * @param location Resource location. + * @param location The location name. * @param modelFormat The format of the Model. * @param modelName The name of the Model. * @param modelVersion The version of the Model. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedAgentDeployment.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedAgentDeployment.java new file mode 100644 index 000000000000..79103b0d73d0 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedAgentDeployment.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Represents a managed agent deployment where the underlying infrastructure is managed by the platform in the + * deployer's subscription. + */ +@Fluent +public final class ManagedAgentDeployment extends AgentDeploymentProperties { + /* + * Gets or sets the type of deployment for the agent. + */ + private AgentDeploymentType deploymentType = AgentDeploymentType.MANAGED; + + /** + * Creates an instance of ManagedAgentDeployment class. + */ + public ManagedAgentDeployment() { + } + + /** + * Get the deploymentType property: Gets or sets the type of deployment for the agent. + * + * @return the deploymentType value. + */ + @Override + public AgentDeploymentType deploymentType() { + return this.deploymentType; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedAgentDeployment withDisplayName(String displayName) { + super.withDisplayName(displayName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedAgentDeployment withDeploymentId(String deploymentId) { + super.withDeploymentId(deploymentId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedAgentDeployment withState(AgentDeploymentState state) { + super.withState(state); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedAgentDeployment withProtocols(List protocols) { + super.withProtocols(protocols); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedAgentDeployment withAgents(List agents) { + super.withAgents(agents); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedAgentDeployment withDescription(String description) { + super.withDescription(description); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedAgentDeployment withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", description()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("displayName", displayName()); + jsonWriter.writeStringField("deploymentId", deploymentId()); + jsonWriter.writeStringField("state", state() == null ? null : state().toString()); + jsonWriter.writeArrayField("protocols", protocols(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("agents", agents(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("deploymentType", + this.deploymentType == null ? null : this.deploymentType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedAgentDeployment from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedAgentDeployment if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedAgentDeployment. + */ + public static ManagedAgentDeployment fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedAgentDeployment deserializedManagedAgentDeployment = new ManagedAgentDeployment(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedManagedAgentDeployment.withDescription(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedManagedAgentDeployment.withTags(tags); + } else if ("displayName".equals(fieldName)) { + deserializedManagedAgentDeployment.withDisplayName(reader.getString()); + } else if ("deploymentId".equals(fieldName)) { + deserializedManagedAgentDeployment.withDeploymentId(reader.getString()); + } else if ("state".equals(fieldName)) { + deserializedManagedAgentDeployment.withState(AgentDeploymentState.fromString(reader.getString())); + } else if ("protocols".equals(fieldName)) { + List protocols + = reader.readArray(reader1 -> AgentProtocolVersion.fromJson(reader1)); + deserializedManagedAgentDeployment.withProtocols(protocols); + } else if ("agents".equals(fieldName)) { + List agents + = reader.readArray(reader1 -> VersionedAgentReference.fromJson(reader1)); + deserializedManagedAgentDeployment.withAgents(agents); + } else if ("provisioningState".equals(fieldName)) { + deserializedManagedAgentDeployment + .withProvisioningState(AgentDeploymentProvisioningState.fromString(reader.getString())); + } else if ("deploymentType".equals(fieldName)) { + deserializedManagedAgentDeployment.deploymentType + = AgentDeploymentType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedAgentDeployment; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedIdentityAuthTypeConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedIdentityAuthTypeConnectionProperties.java index b69635d6b17f..f92aa79cab38 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedIdentityAuthTypeConnectionProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedIdentityAuthTypeConnectionProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -157,18 +157,6 @@ public ManagedIdentityAuthTypeConnectionProperties withTarget(String target) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (credentials() != null) { - credentials().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkKind.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkKind.java new file mode 100644 index 000000000000..379e71718083 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkKind.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The Kind of the managed network. Users can switch from V1 to V2 for granular access controls, but cannot switch back + * to V1 once V2 is enabled. + */ +public final class ManagedNetworkKind extends ExpandableStringEnum { + /** + * Static value V1 for ManagedNetworkKind. + */ + public static final ManagedNetworkKind V1 = fromString("V1"); + + /** + * Static value V2 for ManagedNetworkKind. + */ + public static final ManagedNetworkKind V2 = fromString("V2"); + + /** + * Creates a new instance of ManagedNetworkKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedNetworkKind() { + } + + /** + * Creates or finds a ManagedNetworkKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedNetworkKind. + */ + public static ManagedNetworkKind fromString(String name) { + return fromString(name, ManagedNetworkKind.class); + } + + /** + * Gets known ManagedNetworkKind values. + * + * @return known ManagedNetworkKind values. + */ + public static Collection values() { + return values(ManagedNetworkKind.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisionOptions.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisionOptions.java new file mode 100644 index 000000000000..1e72e31669aa --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisionOptions.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Managed Network Provisioning options for managed network of a cognitive services account. + */ +@Immutable +public final class ManagedNetworkProvisionOptions implements JsonSerializable { + /** + * Creates an instance of ManagedNetworkProvisionOptions class. + */ + public ManagedNetworkProvisionOptions() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedNetworkProvisionOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedNetworkProvisionOptions if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedNetworkProvisionOptions. + */ + public static ManagedNetworkProvisionOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedNetworkProvisionOptions deserializedManagedNetworkProvisionOptions + = new ManagedNetworkProvisionOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + reader.skipChildren(); + } + + return deserializedManagedNetworkProvisionOptions; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisionStatus.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisionStatus.java new file mode 100644 index 000000000000..cea1aa190f6d --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisionStatus.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkProvisionStatusInner; + +/** + * An immutable client-side representation of ManagedNetworkProvisionStatus. + */ +public interface ManagedNetworkProvisionStatus { + /** + * Gets the status property: Status for the managed network of a cognitive services account. + * + * @return the status value. + */ + ManagedNetworkStatus status(); + + /** + * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkProvisionStatusInner + * object. + * + * @return the inner object. + */ + ManagedNetworkProvisionStatusInner innerModel(); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisioningState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisioningState.java new file mode 100644 index 000000000000..23e2b46cf7e5 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisioningState.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for ManagedNetworkProvisioningState. + */ +public final class ManagedNetworkProvisioningState extends ExpandableStringEnum { + /** + * Static value Deferred for ManagedNetworkProvisioningState. + */ + public static final ManagedNetworkProvisioningState DEFERRED = fromString("Deferred"); + + /** + * Static value Updating for ManagedNetworkProvisioningState. + */ + public static final ManagedNetworkProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value Succeeded for ManagedNetworkProvisioningState. + */ + public static final ManagedNetworkProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for ManagedNetworkProvisioningState. + */ + public static final ManagedNetworkProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Deleting for ManagedNetworkProvisioningState. + */ + public static final ManagedNetworkProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value Deleted for ManagedNetworkProvisioningState. + */ + public static final ManagedNetworkProvisioningState DELETED = fromString("Deleted"); + + /** + * Creates a new instance of ManagedNetworkProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedNetworkProvisioningState() { + } + + /** + * Creates or finds a ManagedNetworkProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedNetworkProvisioningState. + */ + public static ManagedNetworkProvisioningState fromString(String name) { + return fromString(name, ManagedNetworkProvisioningState.class); + } + + /** + * Gets known ManagedNetworkProvisioningState values. + * + * @return known ManagedNetworkProvisioningState values. + */ + public static Collection values() { + return values(ManagedNetworkProvisioningState.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisions.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisions.java new file mode 100644 index 000000000000..96e549a5fc92 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisions.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.Context; + +/** + * Resource collection API of ManagedNetworkProvisions. + */ +public interface ManagedNetworkProvisions { + /** + * Provisions the managed network of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ManagedNetworkProvisionStatus provisionManagedNetwork(String resourceGroupName, String accountName, + String managedNetworkName); + + /** + * Provisions the managed network of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body Managed Network Provisioning Options for a cognitive services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ManagedNetworkProvisionStatus provisionManagedNetwork(String resourceGroupName, String accountName, + String managedNetworkName, ManagedNetworkProvisionOptions body, Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettings.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettings.java new file mode 100644 index 000000000000..7df62878fcea --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettings.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsInner; +import java.util.Map; + +/** + * An immutable client-side representation of ManagedNetworkSettings. + */ +public interface ManagedNetworkSettings { + /** + * Gets the isolationMode property: Isolation mode for the managed network of a cognitive services account. + * + * @return the isolationMode value. + */ + IsolationMode isolationMode(); + + /** + * Gets the networkId property: The networkId property. + * + * @return the networkId value. + */ + String networkId(); + + /** + * Gets the outboundRules property: Dictionary of <OutboundRule>. + * + * @return the outboundRules value. + */ + Map outboundRules(); + + /** + * Gets the status property: Status of the Provisioning for the managed network of a cognitive services account. + * + * @return the status value. + */ + ManagedNetworkProvisionStatus status(); + + /** + * Gets the firewallSku property: Firewall Sku used for FQDN Rules. + * + * @return the firewallSku value. + */ + FirewallSku firewallSku(); + + /** + * Gets the managedNetworkKind property: The Kind of the managed network. Users can switch from V1 to V2 for + * granular access controls, but cannot switch back to V1 once V2 is enabled. + * + * @return the managedNetworkKind value. + */ + ManagedNetworkKind managedNetworkKind(); + + /** + * Gets the firewallPublicIpAddress property: Public IP address assigned to the Azure Firewall. + * + * @return the firewallPublicIpAddress value. + */ + String firewallPublicIpAddress(); + + /** + * Gets the provisioningState property: The provisioning state of the managed network settings. + * + * @return the provisioningState value. + */ + ManagedNetworkProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsInner object. + * + * @return the inner object. + */ + ManagedNetworkSettingsInner innerModel(); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsBasicResource.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsBasicResource.java new file mode 100644 index 000000000000..6092f8edbc08 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsBasicResource.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsBasicResourceInner; + +/** + * An immutable client-side representation of ManagedNetworkSettingsBasicResource. + */ +public interface ManagedNetworkSettingsBasicResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Managed Network settings for a cognitive services account. + * + * @return the properties value. + */ + ManagedNetworkSettings properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsBasicResourceInner + * object. + * + * @return the inner object. + */ + ManagedNetworkSettingsBasicResourceInner innerModel(); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsEx.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsEx.java new file mode 100644 index 000000000000..0f7868422b53 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsEx.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkProvisionStatusInner; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsInner; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * The ManagedNetworkSettingsEx model. + */ +@Fluent +public final class ManagedNetworkSettingsEx extends ManagedNetworkSettingsInner { + /* + * The changeableIsolationModes property. + */ + private List changeableIsolationModes; + + /* + * The provisioning state of the managed network settings. + */ + private ManagedNetworkProvisioningState provisioningState; + + /* + * Public IP address assigned to the Azure Firewall. + */ + private String firewallPublicIpAddress; + + /* + * The networkId property. + */ + private String networkId; + + /** + * Creates an instance of ManagedNetworkSettingsEx class. + */ + public ManagedNetworkSettingsEx() { + } + + /** + * Get the changeableIsolationModes property: The changeableIsolationModes property. + * + * @return the changeableIsolationModes value. + */ + public List changeableIsolationModes() { + return this.changeableIsolationModes; + } + + /** + * Get the provisioningState property: The provisioning state of the managed network settings. + * + * @return the provisioningState value. + */ + @Override + public ManagedNetworkProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the firewallPublicIpAddress property: Public IP address assigned to the Azure Firewall. + * + * @return the firewallPublicIpAddress value. + */ + @Override + public String firewallPublicIpAddress() { + return this.firewallPublicIpAddress; + } + + /** + * Get the networkId property: The networkId property. + * + * @return the networkId value. + */ + @Override + public String networkId() { + return this.networkId; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedNetworkSettingsEx withIsolationMode(IsolationMode isolationMode) { + super.withIsolationMode(isolationMode); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedNetworkSettingsEx withOutboundRules(Map outboundRules) { + super.withOutboundRules(outboundRules); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedNetworkSettingsEx withStatus(ManagedNetworkProvisionStatusInner status) { + super.withStatus(status); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedNetworkSettingsEx withFirewallSku(FirewallSku firewallSku) { + super.withFirewallSku(firewallSku); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ManagedNetworkSettingsEx withManagedNetworkKind(ManagedNetworkKind managedNetworkKind) { + super.withManagedNetworkKind(managedNetworkKind); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("isolationMode", isolationMode() == null ? null : isolationMode().toString()); + jsonWriter.writeMapField("outboundRules", outboundRules(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("status", status()); + jsonWriter.writeStringField("firewallSku", firewallSku() == null ? null : firewallSku().toString()); + jsonWriter.writeStringField("managedNetworkKind", + managedNetworkKind() == null ? null : managedNetworkKind().toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedNetworkSettingsEx from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedNetworkSettingsEx if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedNetworkSettingsEx. + */ + public static ManagedNetworkSettingsEx fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedNetworkSettingsEx deserializedManagedNetworkSettingsEx = new ManagedNetworkSettingsEx(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("isolationMode".equals(fieldName)) { + deserializedManagedNetworkSettingsEx + .withIsolationMode(IsolationMode.fromString(reader.getString())); + } else if ("networkId".equals(fieldName)) { + deserializedManagedNetworkSettingsEx.networkId = reader.getString(); + } else if ("outboundRules".equals(fieldName)) { + Map outboundRules = reader.readMap(reader1 -> OutboundRule.fromJson(reader1)); + deserializedManagedNetworkSettingsEx.withOutboundRules(outboundRules); + } else if ("status".equals(fieldName)) { + deserializedManagedNetworkSettingsEx + .withStatus(ManagedNetworkProvisionStatusInner.fromJson(reader)); + } else if ("firewallSku".equals(fieldName)) { + deserializedManagedNetworkSettingsEx.withFirewallSku(FirewallSku.fromString(reader.getString())); + } else if ("managedNetworkKind".equals(fieldName)) { + deserializedManagedNetworkSettingsEx + .withManagedNetworkKind(ManagedNetworkKind.fromString(reader.getString())); + } else if ("firewallPublicIpAddress".equals(fieldName)) { + deserializedManagedNetworkSettingsEx.firewallPublicIpAddress = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedManagedNetworkSettingsEx.provisioningState + = ManagedNetworkProvisioningState.fromString(reader.getString()); + } else if ("changeableIsolationModes".equals(fieldName)) { + List changeableIsolationModes + = reader.readArray(reader1 -> IsolationMode.fromString(reader1.getString())); + deserializedManagedNetworkSettingsEx.changeableIsolationModes = changeableIsolationModes; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedNetworkSettingsEx; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsOperations.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsOperations.java new file mode 100644 index 000000000000..97f78b95e50b --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsOperations.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ManagedNetworkSettingsOperations. + */ +public interface ManagedNetworkSettingsOperations { + /** + * Get API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI for managed network settings of a cognitive services account along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, + String accountName, String managedNetworkName, Context context); + + /** + * Get API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI for managed network settings of a cognitive services account. + */ + ManagedNetworkSettingsPropertiesBasicResource get(String resourceGroupName, String accountName, + String managedNetworkName); + + /** + * Delete API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String managedNetworkName); + + /** + * Delete API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String managedNetworkName, Context context); + + /** + * List API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed networks of a cognitive services account as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * List API for managed network settings of a cognitive services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed networks of a cognitive services account as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, + Context context); + + /** + * Get API for managed network settings of a cognitive services account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI for managed network settings of a cognitive services account along with {@link Response}. + */ + ManagedNetworkSettingsPropertiesBasicResource getById(String id); + + /** + * Get API for managed network settings of a cognitive services account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return aPI for managed network settings of a cognitive services account along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete API for managed network settings of a cognitive services account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete API for managed network settings of a cognitive services account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ManagedNetworkSettingsPropertiesBasicResource resource. + * + * @param name resource name. + * @return the first stage of the new ManagedNetworkSettingsPropertiesBasicResource definition. + */ + ManagedNetworkSettingsPropertiesBasicResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsProperties.java new file mode 100644 index 000000000000..13409f37ee89 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsProperties.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties of the managed network settings of a cognitive services account. + */ +@Fluent +public final class ManagedNetworkSettingsProperties implements JsonSerializable { + /* + * Managed Network settings for a cognitive services account. + */ + private ManagedNetworkSettingsEx managedNetwork; + + /* + * The current deployment state of the managed network resource. The provisioningState is to indicate states for + * resource provisioning. + */ + private ManagedNetworkProvisioningState provisioningState; + + /** + * Creates an instance of ManagedNetworkSettingsProperties class. + */ + public ManagedNetworkSettingsProperties() { + } + + /** + * Get the managedNetwork property: Managed Network settings for a cognitive services account. + * + * @return the managedNetwork value. + */ + public ManagedNetworkSettingsEx managedNetwork() { + return this.managedNetwork; + } + + /** + * Set the managedNetwork property: Managed Network settings for a cognitive services account. + * + * @param managedNetwork the managedNetwork value to set. + * @return the ManagedNetworkSettingsProperties object itself. + */ + public ManagedNetworkSettingsProperties withManagedNetwork(ManagedNetworkSettingsEx managedNetwork) { + this.managedNetwork = managedNetwork; + return this; + } + + /** + * Get the provisioningState property: The current deployment state of the managed network resource. The + * provisioningState is to indicate states for resource provisioning. + * + * @return the provisioningState value. + */ + public ManagedNetworkProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("managedNetwork", this.managedNetwork); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedNetworkSettingsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedNetworkSettingsProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedNetworkSettingsProperties. + */ + public static ManagedNetworkSettingsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedNetworkSettingsProperties deserializedManagedNetworkSettingsProperties + = new ManagedNetworkSettingsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("managedNetwork".equals(fieldName)) { + deserializedManagedNetworkSettingsProperties.managedNetwork + = ManagedNetworkSettingsEx.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedManagedNetworkSettingsProperties.provisioningState + = ManagedNetworkProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedNetworkSettingsProperties; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsPropertiesBasicResource.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsPropertiesBasicResource.java new file mode 100644 index 000000000000..0db311c69932 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsPropertiesBasicResource.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsPropertiesBasicResourceInner; + +/** + * An immutable client-side representation of ManagedNetworkSettingsPropertiesBasicResource. + */ +public interface ManagedNetworkSettingsPropertiesBasicResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The properties of the managed network settings of a cognitive services account. + * + * @return the properties value. + */ + ManagedNetworkSettingsProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner + * com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsPropertiesBasicResourceInner + * object. + * + * @return the inner object. + */ + ManagedNetworkSettingsPropertiesBasicResourceInner innerModel(); + + /** + * The entirety of the ManagedNetworkSettingsPropertiesBasicResource definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The ManagedNetworkSettingsPropertiesBasicResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ManagedNetworkSettingsPropertiesBasicResource definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the ManagedNetworkSettingsPropertiesBasicResource definition allowing to specify parent + * resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @return the next definition stage. + */ + WithCreate withExistingAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the ManagedNetworkSettingsPropertiesBasicResource definition which contains all the minimum + * required properties for the resource to be created, but also allows for any other optional properties to be + * specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ManagedNetworkSettingsPropertiesBasicResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ManagedNetworkSettingsPropertiesBasicResource create(Context context); + } + + /** + * The stage of the ManagedNetworkSettingsPropertiesBasicResource definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The properties of the managed network settings of a cognitive services + * account.. + * + * @param properties The properties of the managed network settings of a cognitive services account. + * @return the next definition stage. + */ + WithCreate withProperties(ManagedNetworkSettingsProperties properties); + } + } + + /** + * Begins update for the ManagedNetworkSettingsPropertiesBasicResource resource. + * + * @return the stage of resource update. + */ + ManagedNetworkSettingsPropertiesBasicResource.Update update(); + + /** + * The template for ManagedNetworkSettingsPropertiesBasicResource update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ManagedNetworkSettingsPropertiesBasicResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ManagedNetworkSettingsPropertiesBasicResource apply(Context context); + } + + /** + * The ManagedNetworkSettingsPropertiesBasicResource update stages. + */ + interface UpdateStages { + /** + * The stage of the ManagedNetworkSettingsPropertiesBasicResource update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The properties of the managed network settings of a cognitive services + * account.. + * + * @param properties The properties of the managed network settings of a cognitive services account. + * @return the next definition stage. + */ + Update withProperties(ManagedNetworkSettingsProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ManagedNetworkSettingsPropertiesBasicResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ManagedNetworkSettingsPropertiesBasicResource refresh(Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkStatus.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkStatus.java new file mode 100644 index 000000000000..5b450b418d63 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkStatus.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Status for the managed network of a cognitive services account. + */ +public final class ManagedNetworkStatus extends ExpandableStringEnum { + /** + * Static value Inactive for ManagedNetworkStatus. + */ + public static final ManagedNetworkStatus INACTIVE = fromString("Inactive"); + + /** + * Static value Active for ManagedNetworkStatus. + */ + public static final ManagedNetworkStatus ACTIVE = fromString("Active"); + + /** + * Creates a new instance of ManagedNetworkStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedNetworkStatus() { + } + + /** + * Creates or finds a ManagedNetworkStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedNetworkStatus. + */ + public static ManagedNetworkStatus fromString(String name) { + return fromString(name, ManagedNetworkStatus.class); + } + + /** + * Gets known ManagedNetworkStatus values. + * + * @return known ManagedNetworkStatus values. + */ + public static Collection values() { + return values(ManagedNetworkStatus.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedPERequirement.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedPERequirement.java index aa558bc5e20d..c50698875302 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedPERequirement.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedPERequirement.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedPEStatus.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedPEStatus.java index b200a2be3392..54f73edae10d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedPEStatus.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedPEStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/MetricName.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/MetricName.java index df0a6ab8834f..4c5bcda658e7 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/MetricName.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/MetricName.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * A metric name. */ -@Fluent +@Immutable public final class MetricName implements JsonSerializable { /* * The name of the metric. @@ -29,7 +29,7 @@ public final class MetricName implements JsonSerializable { /** * Creates an instance of MetricName class. */ - public MetricName() { + private MetricName() { } /** @@ -41,17 +41,6 @@ public String value() { return this.value; } - /** - * Set the value property: The name of the metric. - * - * @param value the value value to set. - * @return the MetricName object itself. - */ - public MetricName withValue(String value) { - this.value = value; - return this; - } - /** * Get the localizedValue property: The friendly name of the metric. * @@ -61,25 +50,6 @@ public String localizedValue() { return this.localizedValue; } - /** - * Set the localizedValue property: The friendly name of the metric. - * - * @param localizedValue the localizedValue value to set. - * @return the MetricName object itself. - */ - public MetricName withLocalizedValue(String localizedValue) { - this.localizedValue = localizedValue; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Model.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Model.java index bc5af45b2b68..fc0883ae2a9a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Model.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Model.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacities.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacities.java index c722bc23b6c9..03ce548aa724 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacities.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacities.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacityCalculatorWorkload.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacityCalculatorWorkload.java index de461450a32c..85fa708e798a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacityCalculatorWorkload.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacityCalculatorWorkload.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -73,17 +73,6 @@ public ModelCapacityCalculatorWorkloadRequestParam requestParameters() { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (requestParameters() != null) { - requestParameters().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacityCalculatorWorkloadRequestParam.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacityCalculatorWorkloadRequestParam.java index d3ddcaf69eb0..3a954f5a9528 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacityCalculatorWorkloadRequestParam.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacityCalculatorWorkloadRequestParam.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -73,14 +73,6 @@ public ModelCapacityCalculatorWorkloadRequestParam withAvgGeneratedTokens(Long a return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacityListResultValueItem.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacityListResultValueItem.java index b99f6abb20f8..eb9035da3bef 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacityListResultValueItem.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacityListResultValueItem.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelDeprecationInfo.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelDeprecationInfo.java index 959fe434ca7b..fe0685867ea8 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelDeprecationInfo.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelDeprecationInfo.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Cognitive Services account ModelDeprecationInfo. */ -@Fluent +@Immutable public final class ModelDeprecationInfo implements JsonSerializable { /* * The datetime of deprecation of the fineTune Model. @@ -36,7 +36,7 @@ public final class ModelDeprecationInfo implements JsonSerializable { /** - * Static value Stable for ModelLifecycleStatus. + * Legacy state. Replaced with GenerallyAvailable going forward. */ public static final ModelLifecycleStatus STABLE = fromString("Stable"); /** - * Static value Preview for ModelLifecycleStatus. + * Model is in preview and may be subject to changes. */ public static final ModelLifecycleStatus PREVIEW = fromString("Preview"); /** - * Static value GenerallyAvailable for ModelLifecycleStatus. + * Model is generally available for production use. */ public static final ModelLifecycleStatus GENERALLY_AVAILABLE = fromString("GenerallyAvailable"); /** - * Static value Deprecating for ModelLifecycleStatus. + * Model is being deprecated and will be removed in the future. Only customers with existing deployments can create + * new deployments with this model. */ public static final ModelLifecycleStatus DEPRECATING = fromString("Deprecating"); /** - * Static value Deprecated for ModelLifecycleStatus. + * Model has been deprecated, also known as retired, and is no longer supported. Inference calls to deployments of + * models in this lifecycle state will return 410 errors. */ public static final ModelLifecycleStatus DEPRECATED = fromString("Deprecated"); /** - * Static value Legacy for ModelLifecycleStatus. + * Model is a legacy version that is no longer recommended for use. Customers should migrate to newer models. Check + * replacementConfig for upgrade information. */ public static final ModelLifecycleStatus LEGACY = fromString("Legacy"); diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelSku.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelSku.java index f5543a11cdd6..02e97886fa9b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelSku.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelSku.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -18,7 +18,7 @@ /** * Describes an available Cognitive Services Model SKU. */ -@Fluent +@Immutable public final class ModelSku implements JsonSerializable { /* * The name of the model SKU. @@ -53,7 +53,7 @@ public final class ModelSku implements JsonSerializable { /** * Creates an instance of ModelSku class. */ - public ModelSku() { + private ModelSku() { } /** @@ -65,17 +65,6 @@ public String name() { return this.name; } - /** - * Set the name property: The name of the model SKU. - * - * @param name the name value to set. - * @return the ModelSku object itself. - */ - public ModelSku withName(String name) { - this.name = name; - return this; - } - /** * Get the usageName property: The usage name of the model SKU. * @@ -85,17 +74,6 @@ public String usageName() { return this.usageName; } - /** - * Set the usageName property: The usage name of the model SKU. - * - * @param usageName the usageName value to set. - * @return the ModelSku object itself. - */ - public ModelSku withUsageName(String usageName) { - this.usageName = usageName; - return this; - } - /** * Get the deprecationDate property: The datetime of deprecation of the model SKU. * @@ -105,17 +83,6 @@ public OffsetDateTime deprecationDate() { return this.deprecationDate; } - /** - * Set the deprecationDate property: The datetime of deprecation of the model SKU. - * - * @param deprecationDate the deprecationDate value to set. - * @return the ModelSku object itself. - */ - public ModelSku withDeprecationDate(OffsetDateTime deprecationDate) { - this.deprecationDate = deprecationDate; - return this; - } - /** * Get the capacity property: The capacity configuration. * @@ -125,17 +92,6 @@ public CapacityConfig capacity() { return this.capacity; } - /** - * Set the capacity property: The capacity configuration. - * - * @param capacity the capacity value to set. - * @return the ModelSku object itself. - */ - public ModelSku withCapacity(CapacityConfig capacity) { - this.capacity = capacity; - return this; - } - /** * Get the rateLimits property: The list of rateLimit. * @@ -145,17 +101,6 @@ public List rateLimits() { return this.rateLimits; } - /** - * Set the rateLimits property: The list of rateLimit. - * - * @param rateLimits the rateLimits value to set. - * @return the ModelSku object itself. - */ - public ModelSku withRateLimits(List rateLimits) { - this.rateLimits = rateLimits; - return this; - } - /** * Get the cost property: The list of billing meter info. * @@ -165,34 +110,6 @@ public List cost() { return this.cost; } - /** - * Set the cost property: The list of billing meter info. - * - * @param cost the cost value to set. - * @return the ModelSku object itself. - */ - public ModelSku withCost(List cost) { - this.cost = cost; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (capacity() != null) { - capacity().validate(); - } - if (rateLimits() != null) { - rateLimits().forEach(e -> e.validate()); - } - if (cost() != null) { - cost().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelSkuCapacityProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelSkuCapacityProperties.java index da27c7a8c9a8..b7682acaf7fa 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelSkuCapacityProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelSkuCapacityProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Cognitive Services account ModelSkuCapacity. */ -@Fluent +@Immutable public final class ModelSkuCapacityProperties implements JsonSerializable { /* * Properties of Cognitive Services account deployment model. @@ -36,10 +36,20 @@ public final class ModelSkuCapacityProperties implements JsonSerializable regions) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (regions() != null) { - regions().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkInjection.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkInjection.java index 7006b564ce36..2913dafa7bf9 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkInjection.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkInjection.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -102,14 +102,6 @@ public NetworkInjection withUseMicrosoftManagedNetwork(Boolean useMicrosoftManag return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkRuleAction.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkRuleAction.java index b16e0defbddb..3315f7471af6 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkRuleAction.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkRuleAction.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkRuleSet.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkRuleSet.java index 732d51ffb935..0ed8a863229b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkRuleSet.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkRuleSet.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -126,20 +126,6 @@ public NetworkRuleSet withVirtualNetworkRules(List virtualNe return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (ipRules() != null) { - ipRules().forEach(e -> e.validate()); - } - if (virtualNetworkRules() != null) { - virtualNetworkRules().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeter.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeter.java index 149d5276aac9..7507a023c831 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeter.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeter.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Information about a linked Network Security Perimeter. */ -@Fluent +@Immutable public final class NetworkSecurityPerimeter implements JsonSerializable { /* * Fully qualified identifier of the resource @@ -34,7 +34,7 @@ public final class NetworkSecurityPerimeter implements JsonSerializable { /* * Network Security Perimeter Access Rule Name @@ -29,7 +29,7 @@ public final class NetworkSecurityPerimeterAccessRule implements JsonSerializabl /** * Creates an instance of NetworkSecurityPerimeterAccessRule class. */ - public NetworkSecurityPerimeterAccessRule() { + private NetworkSecurityPerimeterAccessRule() { } /** @@ -41,17 +41,6 @@ public String name() { return this.name; } - /** - * Set the name property: Network Security Perimeter Access Rule Name. - * - * @param name the name value to set. - * @return the NetworkSecurityPerimeterAccessRule object itself. - */ - public NetworkSecurityPerimeterAccessRule withName(String name) { - this.name = name; - return this; - } - /** * Get the properties property: Properties of Network Security Perimeter Access Rule. * @@ -61,28 +50,6 @@ public NetworkSecurityPerimeterAccessRuleProperties properties() { return this.properties; } - /** - * Set the properties property: Properties of Network Security Perimeter Access Rule. - * - * @param properties the properties value to set. - * @return the NetworkSecurityPerimeterAccessRule object itself. - */ - public NetworkSecurityPerimeterAccessRule withProperties(NetworkSecurityPerimeterAccessRuleProperties properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterAccessRuleProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterAccessRuleProperties.java index c35f17fb9610..92db2f0d9d04 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterAccessRuleProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterAccessRuleProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The Properties of Network Security Perimeter Rule. */ -@Fluent +@Immutable public final class NetworkSecurityPerimeterAccessRuleProperties implements JsonSerializable { /* @@ -46,7 +46,7 @@ public final class NetworkSecurityPerimeterAccessRuleProperties /** * Creates an instance of NetworkSecurityPerimeterAccessRuleProperties class. */ - public NetworkSecurityPerimeterAccessRuleProperties() { + private NetworkSecurityPerimeterAccessRuleProperties() { } /** @@ -58,17 +58,6 @@ public NspAccessRuleDirection direction() { return this.direction; } - /** - * Set the direction property: Direction of Access Rule. - * - * @param direction the direction value to set. - * @return the NetworkSecurityPerimeterAccessRuleProperties object itself. - */ - public NetworkSecurityPerimeterAccessRuleProperties withDirection(NspAccessRuleDirection direction) { - this.direction = direction; - return this; - } - /** * Get the addressPrefixes property: Address prefixes for inbound rules. * @@ -78,17 +67,6 @@ public List addressPrefixes() { return this.addressPrefixes; } - /** - * Set the addressPrefixes property: Address prefixes for inbound rules. - * - * @param addressPrefixes the addressPrefixes value to set. - * @return the NetworkSecurityPerimeterAccessRuleProperties object itself. - */ - public NetworkSecurityPerimeterAccessRuleProperties withAddressPrefixes(List addressPrefixes) { - this.addressPrefixes = addressPrefixes; - return this; - } - /** * Get the subscriptions property: Subscriptions for inbound rules. * @@ -98,18 +76,6 @@ public List subsc return this.subscriptions; } - /** - * Set the subscriptions property: Subscriptions for inbound rules. - * - * @param subscriptions the subscriptions value to set. - * @return the NetworkSecurityPerimeterAccessRuleProperties object itself. - */ - public NetworkSecurityPerimeterAccessRuleProperties - withSubscriptions(List subscriptions) { - this.subscriptions = subscriptions; - return this; - } - /** * Get the networkSecurityPerimeters property: NetworkSecurityPerimeters for inbound rules. * @@ -119,18 +85,6 @@ public List networkSecurityPerimeters() { return this.networkSecurityPerimeters; } - /** - * Set the networkSecurityPerimeters property: NetworkSecurityPerimeters for inbound rules. - * - * @param networkSecurityPerimeters the networkSecurityPerimeters value to set. - * @return the NetworkSecurityPerimeterAccessRuleProperties object itself. - */ - public NetworkSecurityPerimeterAccessRuleProperties - withNetworkSecurityPerimeters(List networkSecurityPerimeters) { - this.networkSecurityPerimeters = networkSecurityPerimeters; - return this; - } - /** * Get the fullyQualifiedDomainNames property: Fully qualified domain name for outbound rules. * @@ -140,32 +94,6 @@ public List fullyQualifiedDomainNames() { return this.fullyQualifiedDomainNames; } - /** - * Set the fullyQualifiedDomainNames property: Fully qualified domain name for outbound rules. - * - * @param fullyQualifiedDomainNames the fullyQualifiedDomainNames value to set. - * @return the NetworkSecurityPerimeterAccessRuleProperties object itself. - */ - public NetworkSecurityPerimeterAccessRuleProperties - withFullyQualifiedDomainNames(List fullyQualifiedDomainNames) { - this.fullyQualifiedDomainNames = fullyQualifiedDomainNames; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (subscriptions() != null) { - subscriptions().forEach(e -> e.validate()); - } - if (networkSecurityPerimeters() != null) { - networkSecurityPerimeters().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem.java index f03395794eef..4425fef24079 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Subscription for inbound rule. */ -@Fluent +@Immutable public final class NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem implements JsonSerializable { /* @@ -25,7 +25,7 @@ public final class NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem /** * Creates an instance of NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem class. */ - public NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem() { + private NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem() { } /** @@ -37,25 +37,6 @@ public String id() { return this.id; } - /** - * Set the id property: Fully qualified identifier of subscription. - * - * @param id the id value to set. - * @return the NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem object itself. - */ - public NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem withId(String id) { - this.id = id; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfiguration.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfiguration.java index 3f71ccd9928e..924d8dc3b47a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfiguration.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfiguration.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfigurationAssociationInfo.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfigurationAssociationInfo.java index 19a76de9e782..e8752cc6c585 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfigurationAssociationInfo.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfigurationAssociationInfo.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Network Security Perimeter Configuration Association Information. */ -@Fluent +@Immutable public final class NetworkSecurityPerimeterConfigurationAssociationInfo implements JsonSerializable { /* @@ -30,7 +30,7 @@ public final class NetworkSecurityPerimeterConfigurationAssociationInfo /** * Creates an instance of NetworkSecurityPerimeterConfigurationAssociationInfo class. */ - public NetworkSecurityPerimeterConfigurationAssociationInfo() { + private NetworkSecurityPerimeterConfigurationAssociationInfo() { } /** @@ -42,17 +42,6 @@ public String name() { return this.name; } - /** - * Set the name property: Name of the resource association. - * - * @param name the name value to set. - * @return the NetworkSecurityPerimeterConfigurationAssociationInfo object itself. - */ - public NetworkSecurityPerimeterConfigurationAssociationInfo withName(String name) { - this.name = name; - return this; - } - /** * Get the accessMode property: Access Mode of the resource association. * @@ -62,25 +51,6 @@ public String accessMode() { return this.accessMode; } - /** - * Set the accessMode property: Access Mode of the resource association. - * - * @param accessMode the accessMode value to set. - * @return the NetworkSecurityPerimeterConfigurationAssociationInfo object itself. - */ - public NetworkSecurityPerimeterConfigurationAssociationInfo withAccessMode(String accessMode) { - this.accessMode = accessMode; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfigurationProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfigurationProperties.java index 24b80b4bf89b..ee7d82ea8963 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfigurationProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfigurationProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The properties of an NSP Configuration. */ -@Fluent +@Immutable public final class NetworkSecurityPerimeterConfigurationProperties implements JsonSerializable { /* @@ -46,7 +46,7 @@ public final class NetworkSecurityPerimeterConfigurationProperties /** * Creates an instance of NetworkSecurityPerimeterConfigurationProperties class. */ - public NetworkSecurityPerimeterConfigurationProperties() { + private NetworkSecurityPerimeterConfigurationProperties() { } /** @@ -67,18 +67,6 @@ public List provisioningIssues() { return this.provisioningIssues; } - /** - * Set the provisioningIssues property: List of Provisioning Issues. - * - * @param provisioningIssues the provisioningIssues value to set. - * @return the NetworkSecurityPerimeterConfigurationProperties object itself. - */ - public NetworkSecurityPerimeterConfigurationProperties - withProvisioningIssues(List provisioningIssues) { - this.provisioningIssues = provisioningIssues; - return this; - } - /** * Get the networkSecurityPerimeter property: Information about a linked Network Security Perimeter. * @@ -88,18 +76,6 @@ public NetworkSecurityPerimeter networkSecurityPerimeter() { return this.networkSecurityPerimeter; } - /** - * Set the networkSecurityPerimeter property: Information about a linked Network Security Perimeter. - * - * @param networkSecurityPerimeter the networkSecurityPerimeter value to set. - * @return the NetworkSecurityPerimeterConfigurationProperties object itself. - */ - public NetworkSecurityPerimeterConfigurationProperties - withNetworkSecurityPerimeter(NetworkSecurityPerimeter networkSecurityPerimeter) { - this.networkSecurityPerimeter = networkSecurityPerimeter; - return this; - } - /** * Get the resourceAssociation property: Network Security Perimeter Configuration Association Information. * @@ -109,18 +85,6 @@ public NetworkSecurityPerimeterConfigurationAssociationInfo resourceAssociation( return this.resourceAssociation; } - /** - * Set the resourceAssociation property: Network Security Perimeter Configuration Association Information. - * - * @param resourceAssociation the resourceAssociation value to set. - * @return the NetworkSecurityPerimeterConfigurationProperties object itself. - */ - public NetworkSecurityPerimeterConfigurationProperties - withResourceAssociation(NetworkSecurityPerimeterConfigurationAssociationInfo resourceAssociation) { - this.resourceAssociation = resourceAssociation; - return this; - } - /** * Get the profile property: Network Security Perimeter Profile Information. * @@ -130,37 +94,6 @@ public NetworkSecurityPerimeterProfileInfo profile() { return this.profile; } - /** - * Set the profile property: Network Security Perimeter Profile Information. - * - * @param profile the profile value to set. - * @return the NetworkSecurityPerimeterConfigurationProperties object itself. - */ - public NetworkSecurityPerimeterConfigurationProperties withProfile(NetworkSecurityPerimeterProfileInfo profile) { - this.profile = profile; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (provisioningIssues() != null) { - provisioningIssues().forEach(e -> e.validate()); - } - if (networkSecurityPerimeter() != null) { - networkSecurityPerimeter().validate(); - } - if (resourceAssociation() != null) { - resourceAssociation().validate(); - } - if (profile() != null) { - profile().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfigurations.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfigurations.java index 0f80927e1b88..bf7bd0b593fe 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfigurations.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfigurations.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -13,59 +13,59 @@ */ public interface NetworkSecurityPerimeterConfigurations { /** - * Gets a list of NSP configurations for an account. + * Gets the specified NSP configurations for an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. + * @param nspConfigurationName The name of the NSP Configuration. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of NSP configurations for an account as paginated response with {@link PagedIterable}. + * @return the specified NSP configurations for an account along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String accountName); + Response getWithResponse(String resourceGroupName, String accountName, + String nspConfigurationName, Context context); /** - * Gets a list of NSP configurations for an account. + * Gets the specified NSP configurations for an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. + * @param nspConfigurationName The name of the NSP Configuration. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of NSP configurations for an account as paginated response with {@link PagedIterable}. + * @return the specified NSP configurations for an account. */ - PagedIterable list(String resourceGroupName, String accountName, - Context context); + NetworkSecurityPerimeterConfiguration get(String resourceGroupName, String accountName, + String nspConfigurationName); /** - * Gets the specified NSP configurations for an account. + * Gets a list of NSP configurations for an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP Configuration. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified NSP configurations for an account along with {@link Response}. + * @return a list of NSP configurations for an account as paginated response with {@link PagedIterable}. */ - Response getWithResponse(String resourceGroupName, String accountName, - String nspConfigurationName, Context context); + PagedIterable list(String resourceGroupName, String accountName); /** - * Gets the specified NSP configurations for an account. + * Gets a list of NSP configurations for an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param nspConfigurationName The name of the NSP Configuration. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified NSP configurations for an account. + * @return a list of NSP configurations for an account as paginated response with {@link PagedIterable}. */ - NetworkSecurityPerimeterConfiguration get(String resourceGroupName, String accountName, - String nspConfigurationName); + PagedIterable list(String resourceGroupName, String accountName, + Context context); /** * Reconcile the NSP configuration for an account. @@ -76,7 +76,7 @@ NetworkSecurityPerimeterConfiguration get(String resourceGroupName, String accou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSP Configuration for an Cognitive Services account. + * @return the response. */ NetworkSecurityPerimeterConfiguration reconcile(String resourceGroupName, String accountName, String nspConfigurationName); @@ -91,7 +91,7 @@ NetworkSecurityPerimeterConfiguration reconcile(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return nSP Configuration for an Cognitive Services account. + * @return the response. */ NetworkSecurityPerimeterConfiguration reconcile(String resourceGroupName, String accountName, String nspConfigurationName, Context context); diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterProfileInfo.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterProfileInfo.java index c38d47369ce0..bb95b8388b88 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterProfileInfo.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterProfileInfo.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Network Security Perimeter Profile Information. */ -@Fluent +@Immutable public final class NetworkSecurityPerimeterProfileInfo implements JsonSerializable { /* @@ -46,7 +46,7 @@ public final class NetworkSecurityPerimeterProfileInfo /** * Creates an instance of NetworkSecurityPerimeterProfileInfo class. */ - public NetworkSecurityPerimeterProfileInfo() { + private NetworkSecurityPerimeterProfileInfo() { } /** @@ -58,17 +58,6 @@ public String name() { return this.name; } - /** - * Set the name property: Name of the resource profile. - * - * @param name the name value to set. - * @return the NetworkSecurityPerimeterProfileInfo object itself. - */ - public NetworkSecurityPerimeterProfileInfo withName(String name) { - this.name = name; - return this; - } - /** * Get the accessRulesVersion property: Access rules version of the resource profile. * @@ -78,17 +67,6 @@ public Long accessRulesVersion() { return this.accessRulesVersion; } - /** - * Set the accessRulesVersion property: Access rules version of the resource profile. - * - * @param accessRulesVersion the accessRulesVersion value to set. - * @return the NetworkSecurityPerimeterProfileInfo object itself. - */ - public NetworkSecurityPerimeterProfileInfo withAccessRulesVersion(Long accessRulesVersion) { - this.accessRulesVersion = accessRulesVersion; - return this; - } - /** * Get the accessRules property: The accessRules property. * @@ -98,17 +76,6 @@ public List accessRules() { return this.accessRules; } - /** - * Set the accessRules property: The accessRules property. - * - * @param accessRules the accessRules value to set. - * @return the NetworkSecurityPerimeterProfileInfo object itself. - */ - public NetworkSecurityPerimeterProfileInfo withAccessRules(List accessRules) { - this.accessRules = accessRules; - return this; - } - /** * Get the diagnosticSettingsVersion property: Current diagnostic settings version. * @@ -118,17 +85,6 @@ public Long diagnosticSettingsVersion() { return this.diagnosticSettingsVersion; } - /** - * Set the diagnosticSettingsVersion property: Current diagnostic settings version. - * - * @param diagnosticSettingsVersion the diagnosticSettingsVersion value to set. - * @return the NetworkSecurityPerimeterProfileInfo object itself. - */ - public NetworkSecurityPerimeterProfileInfo withDiagnosticSettingsVersion(Long diagnosticSettingsVersion) { - this.diagnosticSettingsVersion = diagnosticSettingsVersion; - return this; - } - /** * Get the enabledLogCategories property: List of enabled log categories. * @@ -138,28 +94,6 @@ public List enabledLogCategories() { return this.enabledLogCategories; } - /** - * Set the enabledLogCategories property: List of enabled log categories. - * - * @param enabledLogCategories the enabledLogCategories value to set. - * @return the NetworkSecurityPerimeterProfileInfo object itself. - */ - public NetworkSecurityPerimeterProfileInfo withEnabledLogCategories(List enabledLogCategories) { - this.enabledLogCategories = enabledLogCategories; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (accessRules() != null) { - accessRules().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NoneAuthTypeConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NoneAuthTypeConnectionProperties.java index 7a7f5b91aa72..c365b91f1155 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NoneAuthTypeConnectionProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NoneAuthTypeConnectionProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -131,15 +131,6 @@ public NoneAuthTypeConnectionProperties withUseWorkspaceManagedIdentity(Boolean return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NspAccessRuleDirection.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NspAccessRuleDirection.java index d46607686483..8fd471541470 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NspAccessRuleDirection.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/NspAccessRuleDirection.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OAuth2AuthTypeConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OAuth2AuthTypeConnectionProperties.java index 9f4452be4425..f312be5560f1 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OAuth2AuthTypeConnectionProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OAuth2AuthTypeConnectionProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -159,18 +159,6 @@ public OAuth2AuthTypeConnectionProperties withUseWorkspaceManagedIdentity(Boolea return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (credentials() != null) { - credentials().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Operation.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Operation.java index d7b244daa4a3..ea3f53a43ac7 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Operation.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Operation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -20,7 +20,7 @@ public interface Operation { /** * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for ARM/control-plane operations. + * operations and "false" for Azure Resource Manager/control-plane operations. * * @return the isDataAction value. */ @@ -42,8 +42,8 @@ public interface Operation { Origin origin(); /** - * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal - * only APIs. + * Gets the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. * * @return the actionType value. */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OperationDisplay.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OperationDisplay.java index bb2a2fde1a7d..51d1e4e6bf90 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OperationDisplay.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OperationDisplay.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -12,7 +12,7 @@ import java.io.IOException; /** - * Localized display information for this particular operation. + * Localized display information for an operation. */ @Immutable public final class OperationDisplay implements JsonSerializable { @@ -42,7 +42,7 @@ public final class OperationDisplay implements JsonSerializable { + OrganizationSharedBuiltInAuthorizationPolicy deserializedOrganizationSharedBuiltInAuthorizationPolicy + = new OrganizationSharedBuiltInAuthorizationPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedOrganizationSharedBuiltInAuthorizationPolicy.type + = BuiltInAuthorizationScheme.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOrganizationSharedBuiltInAuthorizationPolicy; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Origin.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Origin.java index 1dec976befd1..2042adc83ad0 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Origin.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Origin.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -13,17 +13,17 @@ */ public final class Origin extends ExpandableStringEnum { /** - * Static value user for Origin. + * Indicates the operation is initiated by a user. */ public static final Origin USER = fromString("user"); /** - * Static value system for Origin. + * Indicates the operation is initiated by a system. */ public static final Origin SYSTEM = fromString("system"); /** - * Static value user,system for Origin. + * Indicates the operation is initiated by a user or system. */ public static final Origin USER_SYSTEM = fromString("user,system"); diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRule.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRule.java new file mode 100644 index 000000000000..f0d16e260d04 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRule.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Outbound Rule for the managed network of a cognitive services account. + */ +@Fluent +public class OutboundRule implements JsonSerializable { + /* + * Type of a managed network Outbound Rule of a cognitive services account. + */ + private RuleType type = RuleType.fromString("OutboundRule"); + + /* + * Category of a managed network Outbound Rule of a cognitive services account. + */ + private RuleCategory category; + + /* + * Type of a managed network Outbound Rule of a cognitive services account. + */ + private RuleStatus status; + + /* + * Error information about an outbound rule of a cognitive services account if RuleStatus is failed. + */ + private String errorInformation; + + /* + * The parentRuleNames property. + */ + private List parentRuleNames; + + /** + * Creates an instance of OutboundRule class. + */ + public OutboundRule() { + } + + /** + * Get the type property: Type of a managed network Outbound Rule of a cognitive services account. + * + * @return the type value. + */ + public RuleType type() { + return this.type; + } + + /** + * Get the category property: Category of a managed network Outbound Rule of a cognitive services account. + * + * @return the category value. + */ + public RuleCategory category() { + return this.category; + } + + /** + * Set the category property: Category of a managed network Outbound Rule of a cognitive services account. + * + * @param category the category value to set. + * @return the OutboundRule object itself. + */ + public OutboundRule withCategory(RuleCategory category) { + this.category = category; + return this; + } + + /** + * Get the status property: Type of a managed network Outbound Rule of a cognitive services account. + * + * @return the status value. + */ + public RuleStatus status() { + return this.status; + } + + /** + * Set the status property: Type of a managed network Outbound Rule of a cognitive services account. + * + * @param status the status value to set. + * @return the OutboundRule object itself. + */ + public OutboundRule withStatus(RuleStatus status) { + this.status = status; + return this; + } + + /** + * Get the errorInformation property: Error information about an outbound rule of a cognitive services account if + * RuleStatus is failed. + * + * @return the errorInformation value. + */ + public String errorInformation() { + return this.errorInformation; + } + + /** + * Set the errorInformation property: Error information about an outbound rule of a cognitive services account if + * RuleStatus is failed. + * + * @param errorInformation the errorInformation value to set. + * @return the OutboundRule object itself. + */ + OutboundRule withErrorInformation(String errorInformation) { + this.errorInformation = errorInformation; + return this; + } + + /** + * Get the parentRuleNames property: The parentRuleNames property. + * + * @return the parentRuleNames value. + */ + public List parentRuleNames() { + return this.parentRuleNames; + } + + /** + * Set the parentRuleNames property: The parentRuleNames property. + * + * @param parentRuleNames the parentRuleNames value to set. + * @return the OutboundRule object itself. + */ + OutboundRule withParentRuleNames(List parentRuleNames) { + this.parentRuleNames = parentRuleNames; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("category", this.category == null ? null : this.category.toString()); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OutboundRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OutboundRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OutboundRule. + */ + public static OutboundRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("type".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("FQDN".equals(discriminatorValue)) { + return FqdnOutboundRule.fromJson(readerToUse.reset()); + } else if ("PrivateEndpoint".equals(discriminatorValue)) { + return PrivateEndpointOutboundRule.fromJson(readerToUse.reset()); + } else if ("ServiceTag".equals(discriminatorValue)) { + return ServiceTagOutboundRule.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static OutboundRule fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OutboundRule deserializedOutboundRule = new OutboundRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedOutboundRule.type = RuleType.fromString(reader.getString()); + } else if ("category".equals(fieldName)) { + deserializedOutboundRule.category = RuleCategory.fromString(reader.getString()); + } else if ("status".equals(fieldName)) { + deserializedOutboundRule.status = RuleStatus.fromString(reader.getString()); + } else if ("errorInformation".equals(fieldName)) { + deserializedOutboundRule.errorInformation = reader.getString(); + } else if ("parentRuleNames".equals(fieldName)) { + List parentRuleNames = reader.readArray(reader1 -> reader1.getString()); + deserializedOutboundRule.parentRuleNames = parentRuleNames; + } else { + reader.skipChildren(); + } + } + + return deserializedOutboundRule; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRuleBasicResource.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRuleBasicResource.java new file mode 100644 index 000000000000..86688a8183ff --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRuleBasicResource.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.OutboundRuleBasicResourceInner; + +/** + * An immutable client-side representation of OutboundRuleBasicResource. + */ +public interface OutboundRuleBasicResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Outbound Rule for the managed network of a cognitive services account. + * + * @return the properties value. + */ + OutboundRule properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.OutboundRuleBasicResourceInner object. + * + * @return the inner object. + */ + OutboundRuleBasicResourceInner innerModel(); + + /** + * The entirety of the OutboundRuleBasicResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * The OutboundRuleBasicResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the OutboundRuleBasicResource definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the OutboundRuleBasicResource definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName, managedNetworkName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @return the next definition stage. + */ + WithProperties withExistingManagedNetwork(String resourceGroupName, String accountName, + String managedNetworkName); + } + + /** + * The stage of the OutboundRuleBasicResource definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Outbound Rule for the managed network of a cognitive services + * account.. + * + * @param properties Outbound Rule for the managed network of a cognitive services account. + * @return the next definition stage. + */ + WithCreate withProperties(OutboundRule properties); + } + + /** + * The stage of the OutboundRuleBasicResource definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate { + /** + * Executes the create request. + * + * @return the created resource. + */ + OutboundRuleBasicResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + OutboundRuleBasicResource create(Context context); + } + } + + /** + * Begins update for the OutboundRuleBasicResource resource. + * + * @return the stage of resource update. + */ + OutboundRuleBasicResource.Update update(); + + /** + * The template for OutboundRuleBasicResource update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + OutboundRuleBasicResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + OutboundRuleBasicResource apply(Context context); + } + + /** + * The OutboundRuleBasicResource update stages. + */ + interface UpdateStages { + /** + * The stage of the OutboundRuleBasicResource update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Outbound Rule for the managed network of a cognitive services + * account.. + * + * @param properties Outbound Rule for the managed network of a cognitive services account. + * @return the next definition stage. + */ + Update withProperties(OutboundRule properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + OutboundRuleBasicResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + OutboundRuleBasicResource refresh(Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRuleListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRuleListResult.java new file mode 100644 index 000000000000..7455ca325ae0 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRuleListResult.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.resourcemanager.cognitiveservices.fluent.models.OutboundRuleListResultInner; +import java.util.List; + +/** + * An immutable client-side representation of OutboundRuleListResult. + */ +public interface OutboundRuleListResult { + /** + * Gets the nextLink property: The link to the next page constructed using the continuationToken. If null, there are + * no additional pages. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the value property: The list of cognitive services accounts. Since this list may be incomplete, the nextLink + * field should be used to request the next list of cognitive services accounts. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.OutboundRuleListResultInner object. + * + * @return the inner object. + */ + OutboundRuleListResultInner innerModel(); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRules.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRules.java new file mode 100644 index 000000000000..8de7cdd5199c --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRules.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of OutboundRules. + */ +public interface OutboundRules { + /** + * The GET API for retrieving a single outbound rule of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String accountName, + String managedNetworkName, String ruleName, Context context); + + /** + * The GET API for retrieving a single outbound rule of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type. + */ + OutboundRuleBasicResource get(String resourceGroupName, String accountName, String managedNetworkName, + String ruleName); + + /** + * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String managedNetworkName, String ruleName); + + /** + * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param ruleName Name of the cognitive services account managed network outbound rule. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String managedNetworkName, String ruleName, + Context context); + + /** + * The GET API for retrieving the list of outbound rules of the managed network associated with the cognitive + * services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a cognitive services account as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, + String managedNetworkName); + + /** + * The GET API for retrieving the list of outbound rules of the managed network associated with the cognitive + * services account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of outbound rules for the managed network of a cognitive services account as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, + String managedNetworkName, Context context); + + /** + * The GET API for retrieving a single outbound rule of the managed network associated with the cognitive services + * account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + OutboundRuleBasicResource getById(String id); + + /** + * The GET API for retrieving a single outbound rule of the managed network associated with the cognitive services + * account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete proxy resource types can be created by aliasing this type using a specific property type along + * with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services + * account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * The DELETE API for deleting a single outbound rule of the managed network associated with the cognitive services + * account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new OutboundRuleBasicResource resource. + * + * @param name resource name. + * @return the first stage of the new OutboundRuleBasicResource definition. + */ + OutboundRuleBasicResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRulesOperations.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRulesOperations.java new file mode 100644 index 000000000000..046eff08083d --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRulesOperations.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsBasicResourceInner; + +/** + * Resource collection API of OutboundRulesOperations. + */ +public interface OutboundRulesOperations { + /** + * The POST API for updating the outbound rules of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + OutboundRuleListResult post(String resourceGroupName, String accountName, String managedNetworkName, + ManagedNetworkSettingsBasicResourceInner body); + + /** + * The POST API for updating the outbound rules of the managed network associated with the cognitive services + * account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param managedNetworkName Name of the managedNetwork associated with the cognitive services account. Only + * 'default' is supported. + * @param body The Managed Network Settings object of the account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + OutboundRuleListResult post(String resourceGroupName, String accountName, String managedNetworkName, + ManagedNetworkSettingsBasicResourceInner body, Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatAuthTypeConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatAuthTypeConnectionProperties.java index 15729e0dfc9c..58d620dc96fe 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatAuthTypeConnectionProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatAuthTypeConnectionProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -156,18 +156,6 @@ public PatAuthTypeConnectionProperties withUseWorkspaceManagedIdentity(Boolean u return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (credentials() != null) { - credentials().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatchResourceTags.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatchResourceTags.java index 50424df478e8..3bc0f2889c53 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatchResourceTags.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatchResourceTags.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -48,14 +48,6 @@ public PatchResourceTags withTags(Map tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatchResourceTagsAndSku.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatchResourceTagsAndSku.java index c24f0f9a9209..ba7b104decc1 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatchResourceTagsAndSku.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatchResourceTagsAndSku.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -56,18 +56,6 @@ public PatchResourceTagsAndSku withTags(Map tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (sku() != null) { - sku().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpoint.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpoint.java index de6d41029bd4..a52b4bd1c420 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpoint.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpoint.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -12,12 +12,12 @@ import java.io.IOException; /** - * The Private Endpoint resource. + * The private endpoint resource. */ @Immutable public final class PrivateEndpoint implements JsonSerializable { /* - * The ARM identifier for Private Endpoint + * The resource identifier of the private endpoint */ private String id; @@ -28,7 +28,7 @@ public PrivateEndpoint() { } /** - * Get the id property: The ARM identifier for Private Endpoint. + * Get the id property: The resource identifier of the private endpoint. * * @return the id value. */ @@ -36,14 +36,6 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnection.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnection.java index 63e032aa5189..cb0a222e9cb2 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnection.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnection.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -35,32 +35,32 @@ public interface PrivateEndpointConnection { String type(); /** - * Gets the etag property: Resource Etag. + * Gets the properties property: Resource properties. * - * @return the etag value. + * @return the properties value. */ - String etag(); + PrivateEndpointConnectionProperties properties(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Gets the etag property: Resource Etag. * - * @return the systemData value. + * @return the etag value. */ - SystemData systemData(); + String etag(); /** - * Gets the properties property: Resource properties. + * Gets the location property: The location of the private endpoint connection. * - * @return the properties value. + * @return the location value. */ - PrivateEndpointConnectionProperties properties(); + String location(); /** - * Gets the location property: The location of the private endpoint connection. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the location value. + * @return the systemData value. */ - String location(); + SystemData systemData(); /** * Gets the region of the resource. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnectionListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnectionListResult.java index 78973ef59936..e08551a83896 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnectionListResult.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnectionListResult.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnectionProperties.java index 46ea235ba09c..57369694d322 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnectionProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnectionProperties.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -117,26 +116,6 @@ public PrivateEndpointConnectionProperties withGroupIds(List groupIds) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (privateEndpoint() != null) { - privateEndpoint().validate(); - } - if (privateLinkServiceConnectionState() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property privateLinkServiceConnectionState in model PrivateEndpointConnectionProperties")); - } else { - privateLinkServiceConnectionState().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionProperties.class); - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnectionProvisioningState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnectionProvisioningState.java index 8c1c9bdffc1a..5a5f1564afb1 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnectionProvisioningState.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnectionProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -13,22 +13,22 @@ public final class PrivateEndpointConnectionProvisioningState extends ExpandableStringEnum { /** - * Static value Succeeded for PrivateEndpointConnectionProvisioningState. + * Connection has been provisioned. */ public static final PrivateEndpointConnectionProvisioningState SUCCEEDED = fromString("Succeeded"); /** - * Static value Creating for PrivateEndpointConnectionProvisioningState. + * Connection is being created. */ public static final PrivateEndpointConnectionProvisioningState CREATING = fromString("Creating"); /** - * Static value Deleting for PrivateEndpointConnectionProvisioningState. + * Connection is being deleted. */ public static final PrivateEndpointConnectionProvisioningState DELETING = fromString("Deleting"); /** - * Static value Failed for PrivateEndpointConnectionProvisioningState. + * Connection provisioning has failed. */ public static final PrivateEndpointConnectionProvisioningState FAILED = fromString("Failed"); diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnections.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnections.java index 39bef9e3b330..8c0da4b4f438 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnections.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnections.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -12,89 +12,89 @@ */ public interface PrivateEndpointConnections { /** - * Gets the private endpoint connections associated with the Cognitive Services account. + * Gets the specified private endpoint connection associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive + * Services Account. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connections associated with the Cognitive Services account along with + * @return the specified private endpoint connection associated with the Cognitive Services account along with * {@link Response}. */ - Response listWithResponse(String resourceGroupName, String accountName, - Context context); + Response getWithResponse(String resourceGroupName, String accountName, + String privateEndpointConnectionName, Context context); /** - * Gets the private endpoint connections associated with the Cognitive Services account. + * Gets the specified private endpoint connection associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive + * Services Account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the private endpoint connections associated with the Cognitive Services account. + * @return the specified private endpoint connection associated with the Cognitive Services account. */ - PrivateEndpointConnectionListResult list(String resourceGroupName, String accountName); + PrivateEndpointConnection get(String resourceGroupName, String accountName, String privateEndpointConnectionName); /** - * Gets the specified private endpoint connection associated with the Cognitive Services account. + * Deletes the specified private endpoint connection associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive * Services Account. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the Cognitive Services account along with - * {@link Response}. */ - Response getWithResponse(String resourceGroupName, String accountName, - String privateEndpointConnectionName, Context context); + void delete(String resourceGroupName, String accountName, String privateEndpointConnectionName); /** - * Gets the specified private endpoint connection associated with the Cognitive Services account. + * Deletes the specified private endpoint connection associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive * Services Account. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the Cognitive Services account. */ - PrivateEndpointConnection get(String resourceGroupName, String accountName, String privateEndpointConnectionName); + void delete(String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context); /** - * Deletes the specified private endpoint connection associated with the Cognitive Services account. + * Gets the private endpoint connections associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connections associated with the Cognitive Services account along with + * {@link Response}. */ - void delete(String resourceGroupName, String accountName, String privateEndpointConnectionName); + Response listWithResponse(String resourceGroupName, String accountName, + Context context); /** - * Deletes the specified private endpoint connection associated with the Cognitive Services account. + * Gets the private endpoint connections associated with the Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Cognitive - * Services Account. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the private endpoint connections associated with the Cognitive Services account. */ - void delete(String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context); + PrivateEndpointConnectionListResult list(String resourceGroupName, String accountName); /** * Gets the specified private endpoint connection associated with the Cognitive Services account. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointOutboundRule.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointOutboundRule.java new file mode 100644 index 000000000000..22204060a5e4 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointOutboundRule.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Private Endpoint outbound rule for the managed network of a cognitive services account. + */ +@Fluent +public final class PrivateEndpointOutboundRule extends OutboundRule { + /* + * Type of a managed network Outbound Rule of a cognitive services account. + */ + private RuleType type = RuleType.PRIVATE_ENDPOINT; + + /* + * Private Endpoint destination. + */ + private PrivateEndpointOutboundRuleDestination destination; + + /* + * List of FQDNs associated with the private endpoint outbound rule. + */ + private List fqdns; + + /** + * Creates an instance of PrivateEndpointOutboundRule class. + */ + public PrivateEndpointOutboundRule() { + } + + /** + * Get the type property: Type of a managed network Outbound Rule of a cognitive services account. + * + * @return the type value. + */ + @Override + public RuleType type() { + return this.type; + } + + /** + * Get the destination property: Private Endpoint destination. + * + * @return the destination value. + */ + public PrivateEndpointOutboundRuleDestination destination() { + return this.destination; + } + + /** + * Set the destination property: Private Endpoint destination. + * + * @param destination the destination value to set. + * @return the PrivateEndpointOutboundRule object itself. + */ + public PrivateEndpointOutboundRule withDestination(PrivateEndpointOutboundRuleDestination destination) { + this.destination = destination; + return this; + } + + /** + * Get the fqdns property: List of FQDNs associated with the private endpoint outbound rule. + * + * @return the fqdns value. + */ + public List fqdns() { + return this.fqdns; + } + + /** + * Set the fqdns property: List of FQDNs associated with the private endpoint outbound rule. + * + * @param fqdns the fqdns value to set. + * @return the PrivateEndpointOutboundRule object itself. + */ + public PrivateEndpointOutboundRule withFqdns(List fqdns) { + this.fqdns = fqdns; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PrivateEndpointOutboundRule withCategory(RuleCategory category) { + super.withCategory(category); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PrivateEndpointOutboundRule withStatus(RuleStatus status) { + super.withStatus(status); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", category() == null ? null : category().toString()); + jsonWriter.writeStringField("status", status() == null ? null : status().toString()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeJsonField("destination", this.destination); + jsonWriter.writeArrayField("fqdns", this.fqdns, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointOutboundRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointOutboundRule if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpointOutboundRule. + */ + public static PrivateEndpointOutboundRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointOutboundRule deserializedPrivateEndpointOutboundRule = new PrivateEndpointOutboundRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedPrivateEndpointOutboundRule.withCategory(RuleCategory.fromString(reader.getString())); + } else if ("status".equals(fieldName)) { + deserializedPrivateEndpointOutboundRule.withStatus(RuleStatus.fromString(reader.getString())); + } else if ("errorInformation".equals(fieldName)) { + deserializedPrivateEndpointOutboundRule.withErrorInformation(reader.getString()); + } else if ("parentRuleNames".equals(fieldName)) { + List parentRuleNames = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateEndpointOutboundRule.withParentRuleNames(parentRuleNames); + } else if ("type".equals(fieldName)) { + deserializedPrivateEndpointOutboundRule.type = RuleType.fromString(reader.getString()); + } else if ("destination".equals(fieldName)) { + deserializedPrivateEndpointOutboundRule.destination + = PrivateEndpointOutboundRuleDestination.fromJson(reader); + } else if ("fqdns".equals(fieldName)) { + List fqdns = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateEndpointOutboundRule.fqdns = fqdns; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointOutboundRule; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointOutboundRuleDestination.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointOutboundRuleDestination.java new file mode 100644 index 000000000000..c685f722181e --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointOutboundRuleDestination.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Private Endpoint destination for an outbound rule. + */ +@Fluent +public final class PrivateEndpointOutboundRuleDestination + implements JsonSerializable { + /* + * The Azure resource ID of the target private endpoint service. + */ + private String serviceResourceId; + + /* + * The subresource of the target service to connect to. + */ + private String subresourceTarget; + + /** + * Creates an instance of PrivateEndpointOutboundRuleDestination class. + */ + public PrivateEndpointOutboundRuleDestination() { + } + + /** + * Get the serviceResourceId property: The Azure resource ID of the target private endpoint service. + * + * @return the serviceResourceId value. + */ + public String serviceResourceId() { + return this.serviceResourceId; + } + + /** + * Set the serviceResourceId property: The Azure resource ID of the target private endpoint service. + * + * @param serviceResourceId the serviceResourceId value to set. + * @return the PrivateEndpointOutboundRuleDestination object itself. + */ + public PrivateEndpointOutboundRuleDestination withServiceResourceId(String serviceResourceId) { + this.serviceResourceId = serviceResourceId; + return this; + } + + /** + * Get the subresourceTarget property: The subresource of the target service to connect to. + * + * @return the subresourceTarget value. + */ + public String subresourceTarget() { + return this.subresourceTarget; + } + + /** + * Set the subresourceTarget property: The subresource of the target service to connect to. + * + * @param subresourceTarget the subresourceTarget value to set. + * @return the PrivateEndpointOutboundRuleDestination object itself. + */ + public PrivateEndpointOutboundRuleDestination withSubresourceTarget(String subresourceTarget) { + this.subresourceTarget = subresourceTarget; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("serviceResourceId", this.serviceResourceId); + jsonWriter.writeStringField("subresourceTarget", this.subresourceTarget); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointOutboundRuleDestination from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointOutboundRuleDestination if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpointOutboundRuleDestination. + */ + public static PrivateEndpointOutboundRuleDestination fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointOutboundRuleDestination deserializedPrivateEndpointOutboundRuleDestination + = new PrivateEndpointOutboundRuleDestination(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceResourceId".equals(fieldName)) { + deserializedPrivateEndpointOutboundRuleDestination.serviceResourceId = reader.getString(); + } else if ("subresourceTarget".equals(fieldName)) { + deserializedPrivateEndpointOutboundRuleDestination.subresourceTarget = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointOutboundRuleDestination; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointServiceConnectionStatus.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointServiceConnectionStatus.java index add57e1ad780..2234525b4ef9 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointServiceConnectionStatus.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointServiceConnectionStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -13,17 +13,17 @@ public final class PrivateEndpointServiceConnectionStatus extends ExpandableStringEnum { /** - * Static value Pending for PrivateEndpointServiceConnectionStatus. + * Connection waiting for approval or rejection. */ public static final PrivateEndpointServiceConnectionStatus PENDING = fromString("Pending"); /** - * Static value Approved for PrivateEndpointServiceConnectionStatus. + * Connection approved. */ public static final PrivateEndpointServiceConnectionStatus APPROVED = fromString("Approved"); /** - * Static value Rejected for PrivateEndpointServiceConnectionStatus. + * Connection Rejected. */ public static final PrivateEndpointServiceConnectionStatus REJECTED = fromString("Rejected"); diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResource.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResource.java index a8f3aaae8606..e35abaeb2ef2 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResource.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResource.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; @@ -15,7 +15,7 @@ /** * A private link resource. */ -@Fluent +@Immutable public final class PrivateLinkResource extends ProxyResource { /* * Resource properties. @@ -45,7 +45,7 @@ public final class PrivateLinkResource extends ProxyResource { /** * Creates an instance of PrivateLinkResource class. */ - public PrivateLinkResource() { + private PrivateLinkResource() { } /** @@ -57,17 +57,6 @@ public PrivateLinkResourceProperties properties() { return this.properties; } - /** - * Set the properties property: Resource properties. - * - * @param properties the properties value to set. - * @return the PrivateLinkResource object itself. - */ - public PrivateLinkResource withProperties(PrivateLinkResourceProperties properties) { - this.properties = properties; - return this; - } - /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -107,17 +96,6 @@ public String id() { return this.id; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResourceListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResourceListResult.java index eb736c648cb4..efc23025a9ae 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResourceListResult.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResourceListResult.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResourceProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResourceProperties.java index b69106003697..7170a6fa06d6 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResourceProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResourceProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Properties of a private link resource. */ -@Fluent +@Immutable public final class PrivateLinkResourceProperties implements JsonSerializable { /* * The private link resource group id. @@ -40,7 +40,7 @@ public final class PrivateLinkResourceProperties implements JsonSerializable requiredZoneNames() { return this.requiredZoneNames; } - /** - * Set the requiredZoneNames property: The private link resource Private link DNS zone name. - * - * @param requiredZoneNames the requiredZoneNames value to set. - * @return the PrivateLinkResourceProperties object itself. - */ - public PrivateLinkResourceProperties withRequiredZoneNames(List requiredZoneNames) { - this.requiredZoneNames = requiredZoneNames; - return this; - } - /** * Get the displayName property: The private link resource display name. * @@ -90,14 +79,6 @@ public String displayName() { return this.displayName; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResources.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResources.java index c2139fe8a693..1cefdbe6d1c8 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResources.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResources.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkServiceConnectionState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkServiceConnectionState.java index d8f5848acc7c..180630ad647a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkServiceConnectionState.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkServiceConnectionState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -101,14 +101,6 @@ public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequi return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Project.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Project.java index ea7272aba813..8f59c5da7232 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Project.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Project.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -36,46 +36,46 @@ public interface Project { String type(); /** - * Gets the etag property: Resource Etag. + * Gets the properties property: Properties of Cognitive Services project. * - * @return the etag value. + * @return the properties value. */ - String etag(); + ProjectProperties properties(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Gets the tags property: Resource tags. * - * @return the systemData value. + * @return the tags value. */ - SystemData systemData(); + Map tags(); /** - * Gets the identity property: Identity for the resource. + * Gets the location property: The geo-location where the resource lives. * - * @return the identity value. + * @return the location value. */ - Identity identity(); + String location(); /** - * Gets the tags property: Resource tags. + * Gets the etag property: Resource Etag. * - * @return the tags value. + * @return the etag value. */ - Map tags(); + String etag(); /** - * Gets the location property: The geo-location where the resource lives. + * Gets the identity property: Identity for the resource. * - * @return the location value. + * @return the identity value. */ - String location(); + Identity identity(); /** - * Gets the properties property: Properties of Cognitive Services project. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the properties value. + * @return the systemData value. */ - ProjectProperties properties(); + SystemData systemData(); /** * Gets the region of the resource. @@ -141,7 +141,7 @@ interface WithParentResource { * created, but also allows for any other optional properties to be specified. */ interface WithCreate extends DefinitionStages.WithLocation, DefinitionStages.WithTags, - DefinitionStages.WithIdentity, DefinitionStages.WithProperties { + DefinitionStages.WithProperties, DefinitionStages.WithIdentity { /** * Executes the create request. * @@ -193,29 +193,29 @@ interface WithTags { } /** - * The stage of the Project definition allowing to specify identity. + * The stage of the Project definition allowing to specify properties. */ - interface WithIdentity { + interface WithProperties { /** - * Specifies the identity property: Identity for the resource.. + * Specifies the properties property: Properties of Cognitive Services project.. * - * @param identity Identity for the resource. + * @param properties Properties of Cognitive Services project. * @return the next definition stage. */ - WithCreate withIdentity(Identity identity); + WithCreate withProperties(ProjectProperties properties); } /** - * The stage of the Project definition allowing to specify properties. + * The stage of the Project definition allowing to specify identity. */ - interface WithProperties { + interface WithIdentity { /** - * Specifies the properties property: Properties of Cognitive Services project.. + * Specifies the identity property: Identity for the resource.. * - * @param properties Properties of Cognitive Services project. + * @param identity Identity for the resource. * @return the next definition stage. */ - WithCreate withProperties(ProjectProperties properties); + WithCreate withIdentity(Identity identity); } } @@ -229,7 +229,7 @@ interface WithProperties { /** * The template for Project update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithProperties { + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties, UpdateStages.WithIdentity { /** * Executes the update request. * @@ -264,29 +264,29 @@ interface WithTags { } /** - * The stage of the Project update allowing to specify identity. + * The stage of the Project update allowing to specify properties. */ - interface WithIdentity { + interface WithProperties { /** - * Specifies the identity property: Identity for the resource.. + * Specifies the properties property: Properties of Cognitive Services project.. * - * @param identity Identity for the resource. + * @param properties Properties of Cognitive Services project. * @return the next definition stage. */ - Update withIdentity(Identity identity); + Update withProperties(ProjectProperties properties); } /** - * The stage of the Project update allowing to specify properties. + * The stage of the Project update allowing to specify identity. */ - interface WithProperties { + interface WithIdentity { /** - * Specifies the properties property: Properties of Cognitive Services project.. + * Specifies the identity property: Identity for the resource.. * - * @param properties Properties of Cognitive Services project. + * @param identity Identity for the resource. * @return the next definition stage. */ - Update withProperties(ProjectProperties properties); + Update withIdentity(Identity identity); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectCapabilityHost.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectCapabilityHost.java new file mode 100644 index 000000000000..f35ab7acda77 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectCapabilityHost.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ProjectCapabilityHostInner; + +/** + * An immutable client-side representation of ProjectCapabilityHost. + */ +public interface ProjectCapabilityHost { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: [Required] Additional attributes of the entity. + * + * @return the properties value. + */ + ProjectCapabilityHostProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.ProjectCapabilityHostInner object. + * + * @return the inner object. + */ + ProjectCapabilityHostInner innerModel(); + + /** + * The entirety of the ProjectCapabilityHost definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * The ProjectCapabilityHost definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ProjectCapabilityHost definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the ProjectCapabilityHost definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName, projectName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param projectName The name of Cognitive Services account's project. + * @return the next definition stage. + */ + WithProperties withExistingProject(String resourceGroupName, String accountName, String projectName); + } + + /** + * The stage of the ProjectCapabilityHost definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: [Required] Additional attributes of the entity.. + * + * @param properties [Required] Additional attributes of the entity. + * @return the next definition stage. + */ + WithCreate withProperties(ProjectCapabilityHostProperties properties); + } + + /** + * The stage of the ProjectCapabilityHost definition which contains all the minimum required properties for the + * resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate { + /** + * Executes the create request. + * + * @return the created resource. + */ + ProjectCapabilityHost create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ProjectCapabilityHost create(Context context); + } + } + + /** + * Begins update for the ProjectCapabilityHost resource. + * + * @return the stage of resource update. + */ + ProjectCapabilityHost.Update update(); + + /** + * The template for ProjectCapabilityHost update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ProjectCapabilityHost apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ProjectCapabilityHost apply(Context context); + } + + /** + * The ProjectCapabilityHost update stages. + */ + interface UpdateStages { + /** + * The stage of the ProjectCapabilityHost update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: [Required] Additional attributes of the entity.. + * + * @param properties [Required] Additional attributes of the entity. + * @return the next definition stage. + */ + Update withProperties(ProjectCapabilityHostProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ProjectCapabilityHost refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ProjectCapabilityHost refresh(Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectCapabilityHostProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectCapabilityHostProperties.java new file mode 100644 index 000000000000..1e68fcaffed5 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectCapabilityHostProperties.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The ProjectCapabilityHostProperties model. + */ +@Fluent +public final class ProjectCapabilityHostProperties implements JsonSerializable { + /* + * List of AI services connections. + */ + private List aiServicesConnections; + + /* + * List of connection names from those available in the account or project to be used for vector database (e.g. + * CosmosDB). + */ + private List vectorStoreConnections; + + /* + * List of connection names from those available in the account or project to be used as a storage resource. + */ + private List storageConnections; + + /* + * List of connection names from those available in the account or project to be used for Thread storage. + */ + private List threadStorageConnections; + + /* + * Provisioning state for the CapabilityHost. + */ + private CapabilityHostProvisioningState provisioningState; + + /** + * Creates an instance of ProjectCapabilityHostProperties class. + */ + public ProjectCapabilityHostProperties() { + } + + /** + * Get the aiServicesConnections property: List of AI services connections. + * + * @return the aiServicesConnections value. + */ + public List aiServicesConnections() { + return this.aiServicesConnections; + } + + /** + * Set the aiServicesConnections property: List of AI services connections. + * + * @param aiServicesConnections the aiServicesConnections value to set. + * @return the ProjectCapabilityHostProperties object itself. + */ + public ProjectCapabilityHostProperties withAiServicesConnections(List aiServicesConnections) { + this.aiServicesConnections = aiServicesConnections; + return this; + } + + /** + * Get the vectorStoreConnections property: List of connection names from those available in the account or project + * to be used for vector database (e.g. CosmosDB). + * + * @return the vectorStoreConnections value. + */ + public List vectorStoreConnections() { + return this.vectorStoreConnections; + } + + /** + * Set the vectorStoreConnections property: List of connection names from those available in the account or project + * to be used for vector database (e.g. CosmosDB). + * + * @param vectorStoreConnections the vectorStoreConnections value to set. + * @return the ProjectCapabilityHostProperties object itself. + */ + public ProjectCapabilityHostProperties withVectorStoreConnections(List vectorStoreConnections) { + this.vectorStoreConnections = vectorStoreConnections; + return this; + } + + /** + * Get the storageConnections property: List of connection names from those available in the account or project to + * be used as a storage resource. + * + * @return the storageConnections value. + */ + public List storageConnections() { + return this.storageConnections; + } + + /** + * Set the storageConnections property: List of connection names from those available in the account or project to + * be used as a storage resource. + * + * @param storageConnections the storageConnections value to set. + * @return the ProjectCapabilityHostProperties object itself. + */ + public ProjectCapabilityHostProperties withStorageConnections(List storageConnections) { + this.storageConnections = storageConnections; + return this; + } + + /** + * Get the threadStorageConnections property: List of connection names from those available in the account or + * project to be used for Thread storage. + * + * @return the threadStorageConnections value. + */ + public List threadStorageConnections() { + return this.threadStorageConnections; + } + + /** + * Set the threadStorageConnections property: List of connection names from those available in the account or + * project to be used for Thread storage. + * + * @param threadStorageConnections the threadStorageConnections value to set. + * @return the ProjectCapabilityHostProperties object itself. + */ + public ProjectCapabilityHostProperties withThreadStorageConnections(List threadStorageConnections) { + this.threadStorageConnections = threadStorageConnections; + return this; + } + + /** + * Get the provisioningState property: Provisioning state for the CapabilityHost. + * + * @return the provisioningState value. + */ + public CapabilityHostProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("aiServicesConnections", this.aiServicesConnections, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("vectorStoreConnections", this.vectorStoreConnections, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("storageConnections", this.storageConnections, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("threadStorageConnections", this.threadStorageConnections, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProjectCapabilityHostProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProjectCapabilityHostProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProjectCapabilityHostProperties. + */ + public static ProjectCapabilityHostProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProjectCapabilityHostProperties deserializedProjectCapabilityHostProperties + = new ProjectCapabilityHostProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("aiServicesConnections".equals(fieldName)) { + List aiServicesConnections = reader.readArray(reader1 -> reader1.getString()); + deserializedProjectCapabilityHostProperties.aiServicesConnections = aiServicesConnections; + } else if ("vectorStoreConnections".equals(fieldName)) { + List vectorStoreConnections = reader.readArray(reader1 -> reader1.getString()); + deserializedProjectCapabilityHostProperties.vectorStoreConnections = vectorStoreConnections; + } else if ("storageConnections".equals(fieldName)) { + List storageConnections = reader.readArray(reader1 -> reader1.getString()); + deserializedProjectCapabilityHostProperties.storageConnections = storageConnections; + } else if ("threadStorageConnections".equals(fieldName)) { + List threadStorageConnections = reader.readArray(reader1 -> reader1.getString()); + deserializedProjectCapabilityHostProperties.threadStorageConnections = threadStorageConnections; + } else if ("provisioningState".equals(fieldName)) { + deserializedProjectCapabilityHostProperties.provisioningState + = CapabilityHostProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedProjectCapabilityHostProperties; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectCapabilityHosts.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectCapabilityHosts.java index 2c3347becad5..ff3902e4d967 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectCapabilityHosts.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectCapabilityHosts.java @@ -1,105 +1,153 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CapabilityHostInner; /** * Resource collection API of ProjectCapabilityHosts. */ public interface ProjectCapabilityHosts { /** - * Delete project capabilityHost. + * Get project capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return project capabilityHost along with {@link Response}. */ - void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostname); + Response getWithResponse(String resourceGroupName, String accountName, String projectName, + String capabilityHostName, Context context); /** - * Delete project capabilityHost. + * Get project capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param context The context to associate with this operation. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return project capabilityHost. */ - void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostname, - Context context); + ProjectCapabilityHost get(String resourceGroupName, String accountName, String projectName, + String capabilityHostName); /** - * Get project capabilityHost. + * Delete project capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param context The context to associate with this operation. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return project capabilityHost along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String accountName, String projectName, - String capabilityHostname, Context context); + void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostName); /** - * Get project capabilityHost. + * Delete project capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. + * @param capabilityHostName The name of the capability host associated with the Cognitive Services Resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return project capabilityHost. */ - CapabilityHost get(String resourceGroupName, String accountName, String projectName, String capabilityHostname); + void delete(String resourceGroupName, String accountName, String projectName, String capabilityHostName, + Context context); /** - * Create or update project capabilityHost. + * List capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope. + * @return a paginated list of Project Capability Host entities as paginated response with {@link PagedIterable}. */ - CapabilityHost createOrUpdate(String resourceGroupName, String accountName, String projectName, - String capabilityHostname, CapabilityHostInner capabilityHost); + PagedIterable list(String resourceGroupName, String accountName, String projectName); /** - * Create or update project capabilityHost. + * List capabilityHost. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param capabilityHostname The name of the capability host associated with the Cognitive Services Resource. - * @param capabilityHost CapabilityHost definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return azure Resource Manager resource envelope. + * @return a paginated list of Project Capability Host entities as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, String projectName, + Context context); + + /** + * Get project capabilityHost. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return project capabilityHost along with {@link Response}. + */ + ProjectCapabilityHost getById(String id); + + /** + * Get project capabilityHost. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return project capabilityHost along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete project capabilityHost. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete project capabilityHost. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ProjectCapabilityHost resource. + * + * @param name resource name. + * @return the first stage of the new ProjectCapabilityHost definition. */ - CapabilityHost createOrUpdate(String resourceGroupName, String accountName, String projectName, - String capabilityHostname, CapabilityHostInner capabilityHost, Context context); + ProjectCapabilityHost.DefinitionStages.Blank define(String name); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectConnections.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectConnections.java index e2c0a4db4859..232f328ed24d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectConnections.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectConnections.java @@ -1,20 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; /** * Resource collection API of ProjectConnections. */ public interface ProjectConnections { /** - * Delete Cognitive Services project connection by name. + * Lists Cognitive Services project connection by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -24,13 +23,13 @@ public interface ProjectConnections { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * @return connection base resource schema along with {@link Response}. */ - Response deleteWithResponse(String resourceGroupName, String accountName, String projectName, - String connectionName, Context context); + Response getWithResponse(String resourceGroupName, String accountName, + String projectName, String connectionName, Context context); /** - * Delete Cognitive Services project connection by name. + * Lists Cognitive Services project connection by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -39,11 +38,13 @@ Response deleteWithResponse(String resourceGroupName, String accountName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return connection base resource schema. */ - void delete(String resourceGroupName, String accountName, String projectName, String connectionName); + ConnectionPropertiesV2BasicResource get(String resourceGroupName, String accountName, String projectName, + String connectionName); /** - * Lists Cognitive Services project connection by name. + * Delete Cognitive Services project connection by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -53,13 +54,13 @@ Response deleteWithResponse(String resourceGroupName, String accountName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema along with {@link Response}. + * @return the {@link Response}. */ - Response getWithResponse(String resourceGroupName, String accountName, - String projectName, String connectionName, Context context); + Response deleteWithResponse(String resourceGroupName, String accountName, String projectName, + String connectionName, Context context); /** - * Lists Cognitive Services project connection by name. + * Delete Cognitive Services project connection by name. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -68,106 +69,92 @@ Response getWithResponse(String resourceGro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema. */ - ConnectionPropertiesV2BasicResource get(String resourceGroupName, String accountName, String projectName, - String connectionName); + void delete(String resourceGroupName, String accountName, String projectName, String connectionName); /** - * Update Cognitive Services project connection under the specified project. + * Lists all the available Cognitive Services project connections under the specified project. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. - * @param connection Parameters for account connection update. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema along with {@link Response}. + * @return the paginated response with {@link PagedIterable}. */ - Response updateWithResponse(String resourceGroupName, String accountName, - String projectName, String connectionName, ConnectionUpdateContent connection, Context context); + PagedIterable list(String resourceGroupName, String accountName, + String projectName); /** - * Update Cognitive Services project connection under the specified project. + * Lists all the available Cognitive Services project connections under the specified project. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. + * @param target Target of the connection. + * @param category Category of the connection. + * @param includeAll query parameter that indicates if get connection call should return both connections and + * datastores. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema. + * @return the paginated response with {@link PagedIterable}. */ - ConnectionPropertiesV2BasicResource update(String resourceGroupName, String accountName, String projectName, - String connectionName); + PagedIterable list(String resourceGroupName, String accountName, + String projectName, String target, String category, Boolean includeAll, Context context); /** - * Create or update Cognitive Services project connection under the specified project. + * Lists Cognitive Services project connection by name. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. - * @param connection The object for creating or updating a new account connection. - * @param context The context to associate with this operation. + * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return connection base resource schema along with {@link Response}. */ - Response createWithResponse(String resourceGroupName, String accountName, - String projectName, String connectionName, ConnectionPropertiesV2BasicResourceInner connection, - Context context); + ConnectionPropertiesV2BasicResource getById(String id); /** - * Create or update Cognitive Services project connection under the specified project. + * Lists Cognitive Services project connection by name. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param connectionName Friendly name of the connection. + * @param id the resource ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection base resource schema. + * @return connection base resource schema along with {@link Response}. */ - ConnectionPropertiesV2BasicResource create(String resourceGroupName, String accountName, String projectName, - String connectionName); + Response getByIdWithResponse(String id, Context context); /** - * Lists all the available Cognitive Services project connections under the specified project. + * Delete Cognitive Services project connection by name. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. + * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. */ - PagedIterable list(String resourceGroupName, String accountName, - String projectName); + void deleteById(String id); /** - * Lists all the available Cognitive Services project connections under the specified project. + * Delete Cognitive Services project connection by name. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName The name of Cognitive Services account. - * @param projectName The name of Cognitive Services account's project. - * @param target Target of the connection. - * @param category Category of the connection. - * @param includeAll query parameter that indicates if get connection call should return both connections and - * datastores. + * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - PagedIterable list(String resourceGroupName, String accountName, - String projectName, String target, String category, Boolean includeAll, Context context); + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ConnectionPropertiesV2BasicResource resource. + * + * @param name resource name. + * @return the first stage of the new ConnectionPropertiesV2BasicResource definition. + */ + ConnectionPropertiesV2BasicResource.DefinitionStages.Blank define(String name); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectProperties.java index 062562ac1c6e..2b7c1066a408 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -116,14 +116,6 @@ public Boolean isDefault() { return this.isDefault; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Projects.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Projects.java index 42a83edf52c2..6e69108d07a5 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Projects.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Projects.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -13,59 +13,59 @@ */ public interface Projects { /** - * Deletes a Cognitive Services project from the resource group. + * Returns a Cognitive Services project specified by the parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU along with {@link Response}. */ - void delete(String resourceGroupName, String accountName, String projectName); + Response getWithResponse(String resourceGroupName, String accountName, String projectName, + Context context); /** - * Deletes a Cognitive Services project from the resource group. + * Returns a Cognitive Services project specified by the parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's + * type, location and SKU. */ - void delete(String resourceGroupName, String accountName, String projectName, Context context); + Project get(String resourceGroupName, String accountName, String projectName); /** - * Returns a Cognitive Services project specified by the parameters. + * Deletes a Cognitive Services project from the resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String accountName, String projectName, - Context context); + void delete(String resourceGroupName, String accountName, String projectName); /** - * Returns a Cognitive Services project specified by the parameters. + * Deletes a Cognitive Services project from the resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param projectName The name of Cognitive Services account's project. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return cognitive Services project is an Azure resource representing the provisioned account's project, it's - * type, location and SKU. */ - Project get(String resourceGroupName, String accountName, String projectName); + void delete(String resourceGroupName, String accountName, String projectName, Context context); /** * Returns all the projects in a Cognitive Services account. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProvisioningIssue.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProvisioningIssue.java index 1ea7c25ebe26..0c5a1112beec 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProvisioningIssue.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProvisioningIssue.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * The ProvisioningIssue model. */ -@Fluent +@Immutable public final class ProvisioningIssue implements JsonSerializable { /* * Name of the NSP provisioning issue @@ -29,7 +29,7 @@ public final class ProvisioningIssue implements JsonSerializable { /* * Type of Issue @@ -45,7 +45,7 @@ public final class ProvisioningIssueProperties implements JsonSerializable suggestedResourceIds() { return this.suggestedResourceIds; } - /** - * Set the suggestedResourceIds property: IDs of resources that can be associated to the same perimeter to remediate - * the issue. - * - * @param suggestedResourceIds the suggestedResourceIds value to set. - * @return the ProvisioningIssueProperties object itself. - */ - public ProvisioningIssueProperties withSuggestedResourceIds(List suggestedResourceIds) { - this.suggestedResourceIds = suggestedResourceIds; - return this; - } - /** * Get the suggestedAccessRules property: Optional array, suggested access rules. * @@ -139,29 +94,6 @@ public List suggestedAccessRules() { return this.suggestedAccessRules; } - /** - * Set the suggestedAccessRules property: Optional array, suggested access rules. - * - * @param suggestedAccessRules the suggestedAccessRules value to set. - * @return the ProvisioningIssueProperties object itself. - */ - public ProvisioningIssueProperties - withSuggestedAccessRules(List suggestedAccessRules) { - this.suggestedAccessRules = suggestedAccessRules; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (suggestedAccessRules() != null) { - suggestedAccessRules().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProvisioningState.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProvisioningState.java index ff0de17bad37..0bbe1646973e 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProvisioningState.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -42,14 +42,14 @@ public final class ProvisioningState extends ExpandableStringEnum { /* * The count property. @@ -35,7 +35,7 @@ public final class QuotaLimit implements JsonSerializable { /** * Creates an instance of QuotaLimit class. */ - public QuotaLimit() { + private QuotaLimit() { } /** @@ -47,17 +47,6 @@ public Float count() { return this.count; } - /** - * Set the count property: The count property. - * - * @param count the count value to set. - * @return the QuotaLimit object itself. - */ - public QuotaLimit withCount(Float count) { - this.count = count; - return this; - } - /** * Get the renewalPeriod property: The renewalPeriod property. * @@ -67,17 +56,6 @@ public Float renewalPeriod() { return this.renewalPeriod; } - /** - * Set the renewalPeriod property: The renewalPeriod property. - * - * @param renewalPeriod the renewalPeriod value to set. - * @return the QuotaLimit object itself. - */ - public QuotaLimit withRenewalPeriod(Float renewalPeriod) { - this.renewalPeriod = renewalPeriod; - return this; - } - /** * Get the rules property: The rules property. * @@ -87,28 +65,6 @@ public List rules() { return this.rules; } - /** - * Set the rules property: The rules property. - * - * @param rules the rules value to set. - * @return the QuotaLimit object itself. - */ - public QuotaLimit withRules(List rules) { - this.rules = rules; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (rules() != null) { - rules().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaScopeType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaScopeType.java new file mode 100644 index 000000000000..af1bcb4b9a36 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaScopeType.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The quota scope that determines the level at which the quota is applied. + */ +public final class QuotaScopeType extends ExpandableStringEnum { + /** + * Static value Regional for QuotaScopeType. + */ + public static final QuotaScopeType REGIONAL = fromString("Regional"); + + /** + * Static value Global for QuotaScopeType. + */ + public static final QuotaScopeType GLOBAL = fromString("Global"); + + /** + * Static value DataZone for QuotaScopeType. + */ + public static final QuotaScopeType DATA_ZONE = fromString("DataZone"); + + /** + * Static value Classic for QuotaScopeType. + */ + public static final QuotaScopeType CLASSIC = fromString("Classic"); + + /** + * Creates a new instance of QuotaScopeType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public QuotaScopeType() { + } + + /** + * Creates or finds a QuotaScopeType from its string representation. + * + * @param name a name to look for. + * @return the corresponding QuotaScopeType. + */ + public static QuotaScopeType fromString(String name) { + return fromString(name, QuotaScopeType.class); + } + + /** + * Gets known QuotaScopeType values. + * + * @return known QuotaScopeType values. + */ + public static Collection values() { + return values(QuotaScopeType.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTier.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTier.java index 261171eb3c8b..79173bf5a8cf 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTier.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTier.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTierProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTierProperties.java index 98201d8b316f..72bf189a9f44 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTierProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTierProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -92,17 +92,6 @@ public QuotaTierUpgradeEligibilityInfo tierUpgradeEligibilityInfo() { return this.tierUpgradeEligibilityInfo; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (tierUpgradeEligibilityInfo() != null) { - tierUpgradeEligibilityInfo().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTierUpgradeEligibilityInfo.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTierUpgradeEligibilityInfo.java index d7138df85cf2..d2b1d508931c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTierUpgradeEligibilityInfo.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTierUpgradeEligibilityInfo.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * Information about the quota tier upgrade eligibility for the subscription. */ -@Fluent +@Immutable public final class QuotaTierUpgradeEligibilityInfo implements JsonSerializable { /* * Name of the next quota tier for the subscription. @@ -43,7 +43,7 @@ public final class QuotaTierUpgradeEligibilityInfo implements JsonSerializable list(); - - /** - * Returns all the resources of a particular type belonging to a subscription. + * Gets the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It + * holds current tier information. * + * @param defaultParameter Default parameter. Leave the value as default. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Quota Tiers response as paginated response with {@link PagedIterable}. + * @return the Quota Tier for a subscription + * + * Gets the Quota Tier information for the given subscription along with {@link Response}. */ - PagedIterable list(Context context); + Response getWithResponse(String defaultParameter, Context context); /** * Gets the Quota Tier for a subscription @@ -38,28 +35,35 @@ public interface QuotaTiers { * Gets the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It * holds current tier information. * - * @param defaultParameter Default parameter. Leave the value as "default". - * @param context The context to associate with this operation. + * @param defaultParameter Default parameter. Leave the value as default. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Quota Tier information for the given subscription along with {@link Response}. + * @return the Quota Tier for a subscription + * + * Gets the Quota Tier information for the given subscription. */ - Response getWithResponse(String defaultParameter, Context context); + QuotaTier get(String defaultParameter); /** - * Gets the Quota Tier for a subscription + * Returns all the resources of a particular type belonging to a subscription. * - * Gets the Quota Tier information for the given subscription. QuotaTiers is a subscription wide resource type. It - * holds current tier information. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Quota Tiers response as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Returns all the resources of a particular type belonging to a subscription. * - * @param defaultParameter Default parameter. Leave the value as "default". + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Quota Tier information for the given subscription. + * @return the list of Quota Tiers response as paginated response with {@link PagedIterable}. */ - QuotaTier get(String defaultParameter); + PagedIterable list(Context context); /** * Gets the Quota Tier for a subscription @@ -71,7 +75,9 @@ public interface QuotaTiers { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Quota Tier information for the given subscription along with {@link Response}. + * @return the Quota Tier for a subscription + * + * Gets the Quota Tier information for the given subscription along with {@link Response}. */ QuotaTier getById(String id); @@ -86,7 +92,9 @@ public interface QuotaTiers { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Quota Tier information for the given subscription along with {@link Response}. + * @return the Quota Tier for a subscription + * + * Gets the Quota Tier information for the given subscription along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaUsageStatus.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaUsageStatus.java index 3a354c9bf9f8..2dfbb7fc7094 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaUsageStatus.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaUsageStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiActionType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiActionType.java new file mode 100644 index 000000000000..6cabf82d74a3 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiActionType.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The action types to apply to the content filters. + */ +public final class RaiActionType extends ExpandableStringEnum { + /** + * Static value None for RaiActionType. + */ + public static final RaiActionType NONE = fromString("None"); + + /** + * Static value BLOCKING for RaiActionType. + */ + public static final RaiActionType BLOCKING = fromString("BLOCKING"); + + /** + * Static value ANNOTATING for RaiActionType. + */ + public static final RaiActionType ANNOTATING = fromString("ANNOTATING"); + + /** + * Static value HITL for RaiActionType. + */ + public static final RaiActionType HITL = fromString("HITL"); + + /** + * Static value RETRY for RaiActionType. + */ + public static final RaiActionType RETRY = fromString("RETRY"); + + /** + * Creates a new instance of RaiActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RaiActionType() { + } + + /** + * Creates or finds a RaiActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RaiActionType. + */ + public static RaiActionType fromString(String name) { + return fromString(name, RaiActionType.class); + } + + /** + * Gets known RaiActionType values. + * + * @return known RaiActionType values. + */ + public static Collection values() { + return values(RaiActionType.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklist.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklist.java index cea387c7af30..df36f4953777 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklist.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklist.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -34,6 +34,13 @@ public interface RaiBlocklist { */ String type(); + /** + * Gets the properties property: Properties of Cognitive Services RaiBlocklist. + * + * @return the properties value. + */ + RaiBlocklistProperties properties(); + /** * Gets the etag property: Resource Etag. * @@ -48,13 +55,6 @@ public interface RaiBlocklist { */ Map tags(); - /** - * Gets the properties property: Properties of Cognitive Services RaiBlocklist. - * - * @return the properties value. - */ - RaiBlocklistProperties properties(); - /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistConfig.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistConfig.java index b192ec757017..0acdaa46ef9c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistConfig.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistConfig.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -72,14 +72,6 @@ public RaiBlocklistConfig withBlocking(Boolean blocking) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItem.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItem.java index ef4bb5762a26..40ae0c3fdd98 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItem.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItem.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -34,6 +34,13 @@ public interface RaiBlocklistItem { */ String type(); + /** + * Gets the properties property: Properties of Cognitive Services RaiBlocklist Item. + * + * @return the properties value. + */ + RaiBlocklistItemProperties properties(); + /** * Gets the etag property: Resource Etag. * @@ -48,13 +55,6 @@ public interface RaiBlocklistItem { */ Map tags(); - /** - * Gets the properties property: Properties of Cognitive Services RaiBlocklist Item. - * - * @return the properties value. - */ - RaiBlocklistItemProperties properties(); - /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItemBulkRequest.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItemBulkRequest.java index 233bc9dbcd85..d79adbc17a60 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItemBulkRequest.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItemBulkRequest.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -72,17 +72,6 @@ public RaiBlocklistItemBulkRequest withProperties(RaiBlocklistItemProperties pro return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItemProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItemProperties.java index b18510490c1a..e78e3b88f48f 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItemProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItemProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -72,14 +72,6 @@ public RaiBlocklistItemProperties withIsRegex(Boolean isRegex) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItems.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItems.java index d44da2ca7501..4f86d4117042 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItems.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItems.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -14,92 +14,92 @@ */ public interface RaiBlocklistItems { /** - * Gets the blocklist items associated with the custom blocklist. + * Gets the specified custom blocklist Item associated with the custom blocklist. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. + * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blocklist items associated with the custom blocklist as paginated response with - * {@link PagedIterable}. + * @return the specified custom blocklist Item associated with the custom blocklist along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String accountName, String raiBlocklistName); + Response getWithResponse(String resourceGroupName, String accountName, String raiBlocklistName, + String raiBlocklistItemName, Context context); /** - * Gets the blocklist items associated with the custom blocklist. + * Gets the specified custom blocklist Item associated with the custom blocklist. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param context The context to associate with this operation. + * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the blocklist items associated with the custom blocklist as paginated response with - * {@link PagedIterable}. + * @return the specified custom blocklist Item associated with the custom blocklist. */ - PagedIterable list(String resourceGroupName, String accountName, String raiBlocklistName, - Context context); + RaiBlocklistItem get(String resourceGroupName, String accountName, String raiBlocklistName, + String raiBlocklistItemName); /** - * Gets the specified custom blocklist Item associated with the custom blocklist. + * Deletes the specified blocklist Item associated with the custom blocklist. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified custom blocklist Item associated with the custom blocklist along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String accountName, String raiBlocklistName, - String raiBlocklistItemName, Context context); + void delete(String resourceGroupName, String accountName, String raiBlocklistName, String raiBlocklistItemName); /** - * Gets the specified custom blocklist Item associated with the custom blocklist. + * Deletes the specified blocklist Item associated with the custom blocklist. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified custom blocklist Item associated with the custom blocklist. */ - RaiBlocklistItem get(String resourceGroupName, String accountName, String raiBlocklistName, - String raiBlocklistItemName); + void delete(String resourceGroupName, String accountName, String raiBlocklistName, String raiBlocklistItemName, + Context context); /** - * Deletes the specified blocklist Item associated with the custom blocklist. + * Gets the blocklist items associated with the custom blocklist. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blocklist items associated with the custom blocklist as paginated response with + * {@link PagedIterable}. */ - void delete(String resourceGroupName, String accountName, String raiBlocklistName, String raiBlocklistItemName); + PagedIterable list(String resourceGroupName, String accountName, String raiBlocklistName); /** - * Deletes the specified blocklist Item associated with the custom blocklist. + * Gets the blocklist items associated with the custom blocklist. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param raiBlocklistItemName The name of the RaiBlocklist Item associated with the custom blocklist. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the blocklist items associated with the custom blocklist as paginated response with + * {@link PagedIterable}. */ - void delete(String resourceGroupName, String accountName, String raiBlocklistName, String raiBlocklistItemName, + PagedIterable list(String resourceGroupName, String accountName, String raiBlocklistName, Context context); /** @@ -147,7 +147,7 @@ RaiBlocklist batchAdd(String resourceGroupName, String accountName, String raiBl * @return the {@link Response}. */ Response batchDeleteWithResponse(String resourceGroupName, String accountName, String raiBlocklistName, - Object raiBlocklistItemsNames, Context context); + List raiBlocklistItemsNames, Context context); /** * Batch operation to delete blocklist items. @@ -161,7 +161,7 @@ Response batchDeleteWithResponse(String resourceGroupName, String accountN * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ void batchDelete(String resourceGroupName, String accountName, String raiBlocklistName, - Object raiBlocklistItemsNames); + List raiBlocklistItemsNames); /** * Gets the specified custom blocklist Item associated with the custom blocklist. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistProperties.java index 174552ccc931..662d1f41204c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -47,14 +47,6 @@ public RaiBlocklistProperties withDescription(String description) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklists.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklists.java index a3d471f84713..5a64820eec30 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklists.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklists.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -13,84 +13,84 @@ */ public interface RaiBlocklists { /** - * Gets the custom blocklists associated with the Azure OpenAI account. + * Gets the specified custom blocklist associated with the Azure OpenAI account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the custom blocklists associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. + * @return the specified custom blocklist associated with the Azure OpenAI account along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String accountName); + Response getWithResponse(String resourceGroupName, String accountName, String raiBlocklistName, + Context context); /** - * Gets the custom blocklists associated with the Azure OpenAI account. + * Gets the specified custom blocklist associated with the Azure OpenAI account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. + * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the custom blocklists associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. + * @return the specified custom blocklist associated with the Azure OpenAI account. */ - PagedIterable list(String resourceGroupName, String accountName, Context context); + RaiBlocklist get(String resourceGroupName, String accountName, String raiBlocklistName); /** - * Gets the specified custom blocklist associated with the Azure OpenAI account. + * Deletes the specified custom blocklist associated with the Azure OpenAI account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified custom blocklist associated with the Azure OpenAI account along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String accountName, String raiBlocklistName, - Context context); + void delete(String resourceGroupName, String accountName, String raiBlocklistName); /** - * Gets the specified custom blocklist associated with the Azure OpenAI account. + * Deletes the specified custom blocklist associated with the Azure OpenAI account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified custom blocklist associated with the Azure OpenAI account. */ - RaiBlocklist get(String resourceGroupName, String accountName, String raiBlocklistName); + void delete(String resourceGroupName, String accountName, String raiBlocklistName, Context context); /** - * Deletes the specified custom blocklist associated with the Azure OpenAI account. + * Gets the custom blocklists associated with the Azure OpenAI account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom blocklists associated with the Azure OpenAI account as paginated response with + * {@link PagedIterable}. */ - void delete(String resourceGroupName, String accountName, String raiBlocklistName); + PagedIterable list(String resourceGroupName, String accountName); /** - * Deletes the specified custom blocklist associated with the Azure OpenAI account. + * Gets the custom blocklists associated with the Azure OpenAI account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param raiBlocklistName The name of the RaiBlocklist associated with the Cognitive Services Account. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the custom blocklists associated with the Azure OpenAI account as paginated response with + * {@link PagedIterable}. */ - void delete(String resourceGroupName, String accountName, String raiBlocklistName, Context context); + PagedIterable list(String resourceGroupName, String accountName, Context context); /** * Gets the specified custom blocklist associated with the Azure OpenAI account. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiContentFilter.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiContentFilter.java index d3a07abf6576..6e26f51a64f0 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiContentFilter.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiContentFilter.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiContentFilterProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiContentFilterProperties.java index 3e749b80c128..ed3c4304e3c9 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiContentFilterProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiContentFilterProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Azure OpenAI Content Filter Properties. */ -@Fluent +@Immutable public final class RaiContentFilterProperties implements JsonSerializable { /* * Name of Content Filter. @@ -34,7 +34,7 @@ public final class RaiContentFilterProperties implements JsonSerializable list(String location); + Response getWithResponse(String location, String filterName, Context context); /** - * List Content Filters types. + * Get Content Filters by Name. * - * @param location Resource location. - * @param context The context to associate with this operation. + * @param location The name of the Azure region. + * @param filterName The name of the RAI Content Filter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of Content Filters as paginated response with {@link PagedIterable}. + * @return content Filters by Name. */ - PagedIterable list(String location, Context context); + RaiContentFilter get(String location, String filterName); /** - * Get Content Filters by Name. + * List Content Filters types. * - * @param location Resource location. - * @param filterName The name of the RAI Content Filter. - * @param context The context to associate with this operation. + * @param location The name of the Azure region. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return content Filters by Name along with {@link Response}. + * @return the list of Content Filters as paginated response with {@link PagedIterable}. */ - Response getWithResponse(String location, String filterName, Context context); + PagedIterable list(String location); /** - * Get Content Filters by Name. + * List Content Filters types. * - * @param location Resource location. - * @param filterName The name of the RAI Content Filter. + * @param location The name of the Azure region. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return content Filters by Name. + * @return the list of Content Filters as paginated response with {@link PagedIterable}. */ - RaiContentFilter get(String location, String filterName); + PagedIterable list(String location, Context context); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProvider.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProvider.java new file mode 100644 index 000000000000..dac1a59d4269 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProvider.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderInner; +import java.util.Map; + +/** + * An immutable client-side representation of RaiExternalSafetyProvider. + */ +public interface RaiExternalSafetyProvider { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: Resource Etag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: Properties of Cognitive Services Rai External Safety provider. + * + * @return the properties value. + */ + RaiExternalSafetyProviderProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderInner object. + * + * @return the inner object. + */ + RaiExternalSafetyProviderInner innerModel(); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviderProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviderProperties.java new file mode 100644 index 000000000000..d9cd1b086a10 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviderProperties.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * RAI External SafetyProvider properties. + */ +@Immutable +public final class RaiExternalSafetyProviderProperties + implements JsonSerializable { + /* + * The unique identifier of the safety provider. + */ + private String providerId; + + /* + * Name of the safety provider. + */ + private String providerName; + + /* + * Safety provider mode sync/async. + */ + private String mode; + + /* + * Webhook URL for the safety provider. + */ + private String url; + + /* + * Creation time of the safety provider. + */ + private OffsetDateTime createdAt; + + /* + * Last modified time of the safety provider. + */ + private OffsetDateTime lastModifiedAt; + + /** + * Creates an instance of RaiExternalSafetyProviderProperties class. + */ + private RaiExternalSafetyProviderProperties() { + } + + /** + * Get the providerId property: The unique identifier of the safety provider. + * + * @return the providerId value. + */ + public String providerId() { + return this.providerId; + } + + /** + * Get the providerName property: Name of the safety provider. + * + * @return the providerName value. + */ + public String providerName() { + return this.providerName; + } + + /** + * Get the mode property: Safety provider mode sync/async. + * + * @return the mode value. + */ + public String mode() { + return this.mode; + } + + /** + * Get the url property: Webhook URL for the safety provider. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Get the createdAt property: Creation time of the safety provider. + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Get the lastModifiedAt property: Last modified time of the safety provider. + * + * @return the lastModifiedAt value. + */ + public OffsetDateTime lastModifiedAt() { + return this.lastModifiedAt; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("providerId", this.providerId); + jsonWriter.writeStringField("providerName", this.providerName); + jsonWriter.writeStringField("mode", this.mode); + jsonWriter.writeStringField("url", this.url); + jsonWriter.writeStringField("createdAt", + this.createdAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdAt)); + jsonWriter.writeStringField("lastModifiedAt", + this.lastModifiedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedAt)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RaiExternalSafetyProviderProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RaiExternalSafetyProviderProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RaiExternalSafetyProviderProperties. + */ + public static RaiExternalSafetyProviderProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RaiExternalSafetyProviderProperties deserializedRaiExternalSafetyProviderProperties + = new RaiExternalSafetyProviderProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("providerId".equals(fieldName)) { + deserializedRaiExternalSafetyProviderProperties.providerId = reader.getString(); + } else if ("providerName".equals(fieldName)) { + deserializedRaiExternalSafetyProviderProperties.providerName = reader.getString(); + } else if ("mode".equals(fieldName)) { + deserializedRaiExternalSafetyProviderProperties.mode = reader.getString(); + } else if ("url".equals(fieldName)) { + deserializedRaiExternalSafetyProviderProperties.url = reader.getString(); + } else if ("createdAt".equals(fieldName)) { + deserializedRaiExternalSafetyProviderProperties.createdAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedAt".equals(fieldName)) { + deserializedRaiExternalSafetyProviderProperties.lastModifiedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedRaiExternalSafetyProviderProperties; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviderSchema.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviderSchema.java new file mode 100644 index 000000000000..3c8ffa3b113b --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviderSchema.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderSchemaInner; +import java.util.Map; + +/** + * An immutable client-side representation of RaiExternalSafetyProviderSchema. + */ +public interface RaiExternalSafetyProviderSchema { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Properties of Cognitive Services Rai External Safety provider. + * + * @return the properties value. + */ + RaiExternalSafetyProviderSchemaProperties properties(); + + /** + * Gets the etag property: Resource Etag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderSchemaInner + * object. + * + * @return the inner object. + */ + RaiExternalSafetyProviderSchemaInner innerModel(); + + /** + * The entirety of the RaiExternalSafetyProviderSchema definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The RaiExternalSafetyProviderSchema definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the RaiExternalSafetyProviderSchema definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the RaiExternalSafetyProviderSchema definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @return the next definition stage. + */ + WithCreate withExistingAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the RaiExternalSafetyProviderSchema definition which contains all the minimum required + * properties for the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + RaiExternalSafetyProviderSchema create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RaiExternalSafetyProviderSchema create(Context context); + } + + /** + * The stage of the RaiExternalSafetyProviderSchema definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Properties of Cognitive Services Rai External Safety provider.. + * + * @param properties Properties of Cognitive Services Rai External Safety provider. + * @return the next definition stage. + */ + WithCreate withProperties(RaiExternalSafetyProviderSchemaProperties properties); + } + } + + /** + * Begins update for the RaiExternalSafetyProviderSchema resource. + * + * @return the stage of resource update. + */ + RaiExternalSafetyProviderSchema.Update update(); + + /** + * The template for RaiExternalSafetyProviderSchema update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + RaiExternalSafetyProviderSchema apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + RaiExternalSafetyProviderSchema apply(Context context); + } + + /** + * The RaiExternalSafetyProviderSchema update stages. + */ + interface UpdateStages { + /** + * The stage of the RaiExternalSafetyProviderSchema update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Properties of Cognitive Services Rai External Safety provider.. + * + * @param properties Properties of Cognitive Services Rai External Safety provider. + * @return the next definition stage. + */ + Update withProperties(RaiExternalSafetyProviderSchemaProperties properties); + } + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviderSchemaProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviderSchemaProperties.java new file mode 100644 index 000000000000..2909a46b6237 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviderSchemaProperties.java @@ -0,0 +1,291 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * RAI External SafetyProvider schema properties. + */ +@Fluent +public final class RaiExternalSafetyProviderSchemaProperties + implements JsonSerializable { + /* + * The unique identifier of the safety provider. + */ + private String providerId; + + /* + * Name of the safety provider. + */ + private String providerName; + + /* + * Safety provider mode sync/async. + */ + private String mode; + + /* + * Webhook URL for the safety provider. + */ + private String url; + + /* + * The name of the secret in Key Vault that contains the api key to access the webhook. + */ + private String secretName; + + /* + * The managed identity to access the Key Vault. + */ + private String managedIdentity; + + /* + * The Key Vault URI that contains the api key for safety provider urls. + */ + private String keyVaultUri; + + /* + * Creation time of the safety provider. + */ + private OffsetDateTime createdAt; + + /* + * Last modified time of the safety provider. + */ + private OffsetDateTime lastModifiedAt; + + /** + * Creates an instance of RaiExternalSafetyProviderSchemaProperties class. + */ + public RaiExternalSafetyProviderSchemaProperties() { + } + + /** + * Get the providerId property: The unique identifier of the safety provider. + * + * @return the providerId value. + */ + public String providerId() { + return this.providerId; + } + + /** + * Set the providerId property: The unique identifier of the safety provider. + * + * @param providerId the providerId value to set. + * @return the RaiExternalSafetyProviderSchemaProperties object itself. + */ + public RaiExternalSafetyProviderSchemaProperties withProviderId(String providerId) { + this.providerId = providerId; + return this; + } + + /** + * Get the providerName property: Name of the safety provider. + * + * @return the providerName value. + */ + public String providerName() { + return this.providerName; + } + + /** + * Set the providerName property: Name of the safety provider. + * + * @param providerName the providerName value to set. + * @return the RaiExternalSafetyProviderSchemaProperties object itself. + */ + public RaiExternalSafetyProviderSchemaProperties withProviderName(String providerName) { + this.providerName = providerName; + return this; + } + + /** + * Get the mode property: Safety provider mode sync/async. + * + * @return the mode value. + */ + public String mode() { + return this.mode; + } + + /** + * Set the mode property: Safety provider mode sync/async. + * + * @param mode the mode value to set. + * @return the RaiExternalSafetyProviderSchemaProperties object itself. + */ + public RaiExternalSafetyProviderSchemaProperties withMode(String mode) { + this.mode = mode; + return this; + } + + /** + * Get the url property: Webhook URL for the safety provider. + * + * @return the url value. + */ + public String url() { + return this.url; + } + + /** + * Set the url property: Webhook URL for the safety provider. + * + * @param url the url value to set. + * @return the RaiExternalSafetyProviderSchemaProperties object itself. + */ + public RaiExternalSafetyProviderSchemaProperties withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the secretName property: The name of the secret in Key Vault that contains the api key to access the webhook. + * + * @return the secretName value. + */ + public String secretName() { + return this.secretName; + } + + /** + * Set the secretName property: The name of the secret in Key Vault that contains the api key to access the webhook. + * + * @param secretName the secretName value to set. + * @return the RaiExternalSafetyProviderSchemaProperties object itself. + */ + public RaiExternalSafetyProviderSchemaProperties withSecretName(String secretName) { + this.secretName = secretName; + return this; + } + + /** + * Get the managedIdentity property: The managed identity to access the Key Vault. + * + * @return the managedIdentity value. + */ + public String managedIdentity() { + return this.managedIdentity; + } + + /** + * Set the managedIdentity property: The managed identity to access the Key Vault. + * + * @param managedIdentity the managedIdentity value to set. + * @return the RaiExternalSafetyProviderSchemaProperties object itself. + */ + public RaiExternalSafetyProviderSchemaProperties withManagedIdentity(String managedIdentity) { + this.managedIdentity = managedIdentity; + return this; + } + + /** + * Get the keyVaultUri property: The Key Vault URI that contains the api key for safety provider urls. + * + * @return the keyVaultUri value. + */ + public String keyVaultUri() { + return this.keyVaultUri; + } + + /** + * Set the keyVaultUri property: The Key Vault URI that contains the api key for safety provider urls. + * + * @param keyVaultUri the keyVaultUri value to set. + * @return the RaiExternalSafetyProviderSchemaProperties object itself. + */ + public RaiExternalSafetyProviderSchemaProperties withKeyVaultUri(String keyVaultUri) { + this.keyVaultUri = keyVaultUri; + return this; + } + + /** + * Get the createdAt property: Creation time of the safety provider. + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Get the lastModifiedAt property: Last modified time of the safety provider. + * + * @return the lastModifiedAt value. + */ + public OffsetDateTime lastModifiedAt() { + return this.lastModifiedAt; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("providerId", this.providerId); + jsonWriter.writeStringField("providerName", this.providerName); + jsonWriter.writeStringField("mode", this.mode); + jsonWriter.writeStringField("url", this.url); + jsonWriter.writeStringField("secretName", this.secretName); + jsonWriter.writeStringField("managedIdentity", this.managedIdentity); + jsonWriter.writeStringField("keyVaultUri", this.keyVaultUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RaiExternalSafetyProviderSchemaProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RaiExternalSafetyProviderSchemaProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RaiExternalSafetyProviderSchemaProperties. + */ + public static RaiExternalSafetyProviderSchemaProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RaiExternalSafetyProviderSchemaProperties deserializedRaiExternalSafetyProviderSchemaProperties + = new RaiExternalSafetyProviderSchemaProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("providerId".equals(fieldName)) { + deserializedRaiExternalSafetyProviderSchemaProperties.providerId = reader.getString(); + } else if ("providerName".equals(fieldName)) { + deserializedRaiExternalSafetyProviderSchemaProperties.providerName = reader.getString(); + } else if ("mode".equals(fieldName)) { + deserializedRaiExternalSafetyProviderSchemaProperties.mode = reader.getString(); + } else if ("url".equals(fieldName)) { + deserializedRaiExternalSafetyProviderSchemaProperties.url = reader.getString(); + } else if ("secretName".equals(fieldName)) { + deserializedRaiExternalSafetyProviderSchemaProperties.secretName = reader.getString(); + } else if ("managedIdentity".equals(fieldName)) { + deserializedRaiExternalSafetyProviderSchemaProperties.managedIdentity = reader.getString(); + } else if ("keyVaultUri".equals(fieldName)) { + deserializedRaiExternalSafetyProviderSchemaProperties.keyVaultUri = reader.getString(); + } else if ("createdAt".equals(fieldName)) { + deserializedRaiExternalSafetyProviderSchemaProperties.createdAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedAt".equals(fieldName)) { + deserializedRaiExternalSafetyProviderSchemaProperties.lastModifiedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedRaiExternalSafetyProviderSchemaProperties; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviders.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviders.java new file mode 100644 index 000000000000..6bf5d6413305 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviders.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderSchemaInner; + +/** + * Resource collection API of RaiExternalSafetyProviders. + */ +public interface RaiExternalSafetyProviders { + /** + * Gets the specified external safety provider associated with the Subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified external safety provider associated with the Subscription along with {@link Response}. + */ + Response getWithResponse(String safetyProviderName, Context context); + + /** + * Gets the specified external safety provider associated with the Subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified external safety provider associated with the Subscription. + */ + RaiExternalSafetyProviderSchema get(String safetyProviderName); + + /** + * Create the rai safety provider associated with the subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @param safetyProvider Properties describing the rai external safety provider. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services Rai External Safety provider Schema along with {@link Response}. + */ + Response createOrUpdateWithResponse(String safetyProviderName, + RaiExternalSafetyProviderSchemaInner safetyProvider, Context context); + + /** + * Create the rai safety provider associated with the subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @param safetyProvider Properties describing the rai external safety provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services Rai External Safety provider Schema. + */ + ProxyResource createOrUpdate(String safetyProviderName, RaiExternalSafetyProviderSchemaInner safetyProvider); + + /** + * Deletes the specified custom topic associated with the subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String safetyProviderName); + + /** + * Deletes the specified custom topic associated with the subscription. + * + * @param safetyProviderName The name of the Rai External Safety Provider associated with the Cognitive Services + * Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String safetyProviderName, Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProvidersOperations.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProvidersOperations.java new file mode 100644 index 000000000000..be6871c61ecb --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProvidersOperations.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of RaiExternalSafetyProvidersOperations. + */ +public interface RaiExternalSafetyProvidersOperations { + /** + * Gets the safety providers associated with the subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the safety providers associated with the subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Gets the safety providers associated with the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the safety providers associated with the subscription as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiMonitorConfig.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiMonitorConfig.java index 66dc32bd4161..bf96a808f6dc 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiMonitorConfig.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiMonitorConfig.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -72,14 +72,6 @@ public RaiMonitorConfig withIdentityClientId(String identityClientId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicies.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicies.java index be9fd029218b..999254099e2b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicies.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicies.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -13,84 +13,84 @@ */ public interface RaiPolicies { /** - * Gets the content filters associated with the Azure OpenAI account. + * Gets the specified Content Filters associated with the Azure OpenAI account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. + * @return the specified Content Filters associated with the Azure OpenAI account along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String accountName); + Response getWithResponse(String resourceGroupName, String accountName, String raiPolicyName, + Context context); /** - * Gets the content filters associated with the Azure OpenAI account. + * Gets the specified Content Filters associated with the Azure OpenAI account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param context The context to associate with this operation. + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the content filters associated with the Azure OpenAI account as paginated response with - * {@link PagedIterable}. + * @return the specified Content Filters associated with the Azure OpenAI account. */ - PagedIterable list(String resourceGroupName, String accountName, Context context); + RaiPolicy get(String resourceGroupName, String accountName, String raiPolicyName); /** - * Gets the specified Content Filters associated with the Azure OpenAI account. + * Deletes the specified Content Filters associated with the Azure OpenAI account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Content Filters associated with the Azure OpenAI account along with {@link Response}. */ - Response getWithResponse(String resourceGroupName, String accountName, String raiPolicyName, - Context context); + void delete(String resourceGroupName, String accountName, String raiPolicyName); /** - * Gets the specified Content Filters associated with the Azure OpenAI account. + * Deletes the specified Content Filters associated with the Azure OpenAI account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified Content Filters associated with the Azure OpenAI account. */ - RaiPolicy get(String resourceGroupName, String accountName, String raiPolicyName); + void delete(String resourceGroupName, String accountName, String raiPolicyName, Context context); /** - * Deletes the specified Content Filters associated with the Azure OpenAI account. + * Gets the content filters associated with the Azure OpenAI account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the content filters associated with the Azure OpenAI account as paginated response with + * {@link PagedIterable}. */ - void delete(String resourceGroupName, String accountName, String raiPolicyName); + PagedIterable list(String resourceGroupName, String accountName); /** - * Deletes the specified Content Filters associated with the Azure OpenAI account. + * Gets the content filters associated with the Azure OpenAI account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. - * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the content filters associated with the Azure OpenAI account as paginated response with + * {@link PagedIterable}. */ - void delete(String resourceGroupName, String accountName, String raiPolicyName, Context context); + PagedIterable list(String resourceGroupName, String accountName, Context context); /** * Gets the specified Content Filters associated with the Azure OpenAI account. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicy.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicy.java index 7abe5b258d4e..02ba26aba154 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicy.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -34,6 +34,13 @@ public interface RaiPolicy { */ String type(); + /** + * Gets the properties property: Properties of Cognitive Services RaiPolicy. + * + * @return the properties value. + */ + RaiPolicyProperties properties(); + /** * Gets the etag property: Resource Etag. * @@ -48,13 +55,6 @@ public interface RaiPolicy { */ Map tags(); - /** - * Gets the properties property: Properties of Cognitive Services RaiPolicy. - * - * @return the properties value. - */ - RaiPolicyProperties properties(); - /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyContentFilter.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyContentFilter.java index e5c24b8ebda1..87e2c8062fb8 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyContentFilter.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyContentFilter.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -41,6 +41,11 @@ public final class RaiPolicyContentFilter implements JsonSerializable customTopics; + /* + * The list of Safety Providers. + */ + private List safetyProviders; + /** * Creates an instance of RaiPolicyProperties class. */ @@ -168,20 +173,23 @@ public RaiPolicyProperties withCustomTopics(List customTopics } /** - * Validates the instance. + * Get the safetyProviders property: The list of Safety Providers. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the safetyProviders value. */ - public void validate() { - if (contentFilters() != null) { - contentFilters().forEach(e -> e.validate()); - } - if (customBlocklists() != null) { - customBlocklists().forEach(e -> e.validate()); - } - if (customTopics() != null) { - customTopics().forEach(e -> e.validate()); - } + public List safetyProviders() { + return this.safetyProviders; + } + + /** + * Set the safetyProviders property: The list of Safety Providers. + * + * @param safetyProviders the safetyProviders value to set. + * @return the RaiPolicyProperties object itself. + */ + public RaiPolicyProperties withSafetyProviders(List safetyProviders) { + this.safetyProviders = safetyProviders; + return this; } /** @@ -197,6 +205,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeArrayField("customBlocklists", this.customBlocklists, (writer, element) -> writer.writeJson(element)); jsonWriter.writeArrayField("customTopics", this.customTopics, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("safetyProviders", this.safetyProviders, + (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -233,6 +243,10 @@ public static RaiPolicyProperties fromJson(JsonReader jsonReader) throws IOExcep List customTopics = reader.readArray(reader1 -> CustomTopicConfig.fromJson(reader1)); deserializedRaiPolicyProperties.customTopics = customTopics; + } else if ("safetyProviders".equals(fieldName)) { + List safetyProviders + = reader.readArray(reader1 -> SafetyProviderConfig.fromJson(reader1)); + deserializedRaiPolicyProperties.safetyProviders = safetyProviders; } else { reader.skipChildren(); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyType.java index 5411df36d399..de1538ff3d8e 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyType.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiSafetyProviderConfig.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiSafetyProviderConfig.java new file mode 100644 index 000000000000..d7db17a80902 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiSafetyProviderConfig.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Azure OpenAI RAI safety provider config. + */ +@Fluent +public class RaiSafetyProviderConfig implements JsonSerializable { + /* + * Name of RAI Safety Provider. + */ + private String safetyProviderName; + + /* + * If blocking would occur. + */ + private Boolean blocking; + + /** + * Creates an instance of RaiSafetyProviderConfig class. + */ + public RaiSafetyProviderConfig() { + } + + /** + * Get the safetyProviderName property: Name of RAI Safety Provider. + * + * @return the safetyProviderName value. + */ + public String safetyProviderName() { + return this.safetyProviderName; + } + + /** + * Set the safetyProviderName property: Name of RAI Safety Provider. + * + * @param safetyProviderName the safetyProviderName value to set. + * @return the RaiSafetyProviderConfig object itself. + */ + public RaiSafetyProviderConfig withSafetyProviderName(String safetyProviderName) { + this.safetyProviderName = safetyProviderName; + return this; + } + + /** + * Get the blocking property: If blocking would occur. + * + * @return the blocking value. + */ + public Boolean blocking() { + return this.blocking; + } + + /** + * Set the blocking property: If blocking would occur. + * + * @param blocking the blocking value to set. + * @return the RaiSafetyProviderConfig object itself. + */ + public RaiSafetyProviderConfig withBlocking(Boolean blocking) { + this.blocking = blocking; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("safetyProviderName", this.safetyProviderName); + jsonWriter.writeBooleanField("blocking", this.blocking); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RaiSafetyProviderConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RaiSafetyProviderConfig if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the RaiSafetyProviderConfig. + */ + public static RaiSafetyProviderConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RaiSafetyProviderConfig deserializedRaiSafetyProviderConfig = new RaiSafetyProviderConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("safetyProviderName".equals(fieldName)) { + deserializedRaiSafetyProviderConfig.safetyProviderName = reader.getString(); + } else if ("blocking".equals(fieldName)) { + deserializedRaiSafetyProviderConfig.blocking = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedRaiSafetyProviderConfig; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabel.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabel.java new file mode 100644 index 000000000000..f017be7f1424 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabel.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiToolLabelInner; +import java.util.Map; + +/** + * An immutable client-side representation of RaiToolLabel. + */ +public interface RaiToolLabel { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Properties of the RAI Tool Label. + * + * @return the properties value. + */ + RaiToolLabelProperties properties(); + + /** + * Gets the etag property: Resource Etag. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.RaiToolLabelInner object. + * + * @return the inner object. + */ + RaiToolLabelInner innerModel(); + + /** + * The entirety of the RaiToolLabel definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The RaiToolLabel definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the RaiToolLabel definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the RaiToolLabel definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, accountName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @return the next definition stage. + */ + WithCreate withExistingAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the RaiToolLabel definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + RaiToolLabel create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + RaiToolLabel create(Context context); + } + + /** + * The stage of the RaiToolLabel definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the RaiToolLabel definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the RAI Tool Label.. + * + * @param properties Properties of the RAI Tool Label. + * @return the next definition stage. + */ + WithCreate withProperties(RaiToolLabelProperties properties); + } + } + + /** + * Begins update for the RaiToolLabel resource. + * + * @return the stage of resource update. + */ + RaiToolLabel.Update update(); + + /** + * The template for RaiToolLabel update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + RaiToolLabel apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + RaiToolLabel apply(Context context); + } + + /** + * The RaiToolLabel update stages. + */ + interface UpdateStages { + /** + * The stage of the RaiToolLabel update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the RAI Tool Label.. + * + * @param properties Properties of the RAI Tool Label. + * @return the next definition stage. + */ + Update withProperties(RaiToolLabelProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + RaiToolLabel refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + RaiToolLabel refresh(Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabelProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabelProperties.java new file mode 100644 index 000000000000..ca340263db4f --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabelProperties.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * RAI Tool Label properties. + */ +@Fluent +public final class RaiToolLabelProperties implements JsonSerializable { + /* + * The unique tool connection name, e.g., 'Web_Search'. + */ + private String toolConnectionName; + + /* + * Account-level tool label definition. + */ + private RaiToolLabelPropertiesAccountScope accountScope; + + /* + * List of project-level tool label definitions. + */ + private List projectScopes; + + /** + * Creates an instance of RaiToolLabelProperties class. + */ + public RaiToolLabelProperties() { + } + + /** + * Get the toolConnectionName property: The unique tool connection name, e.g., 'Web_Search'. + * + * @return the toolConnectionName value. + */ + public String toolConnectionName() { + return this.toolConnectionName; + } + + /** + * Set the toolConnectionName property: The unique tool connection name, e.g., 'Web_Search'. + * + * @param toolConnectionName the toolConnectionName value to set. + * @return the RaiToolLabelProperties object itself. + */ + public RaiToolLabelProperties withToolConnectionName(String toolConnectionName) { + this.toolConnectionName = toolConnectionName; + return this; + } + + /** + * Get the accountScope property: Account-level tool label definition. + * + * @return the accountScope value. + */ + public RaiToolLabelPropertiesAccountScope accountScope() { + return this.accountScope; + } + + /** + * Set the accountScope property: Account-level tool label definition. + * + * @param accountScope the accountScope value to set. + * @return the RaiToolLabelProperties object itself. + */ + public RaiToolLabelProperties withAccountScope(RaiToolLabelPropertiesAccountScope accountScope) { + this.accountScope = accountScope; + return this; + } + + /** + * Get the projectScopes property: List of project-level tool label definitions. + * + * @return the projectScopes value. + */ + public List projectScopes() { + return this.projectScopes; + } + + /** + * Set the projectScopes property: List of project-level tool label definitions. + * + * @param projectScopes the projectScopes value to set. + * @return the RaiToolLabelProperties object itself. + */ + public RaiToolLabelProperties withProjectScopes(List projectScopes) { + this.projectScopes = projectScopes; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("toolConnectionName", this.toolConnectionName); + jsonWriter.writeJsonField("accountScope", this.accountScope); + jsonWriter.writeArrayField("projectScopes", this.projectScopes, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RaiToolLabelProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RaiToolLabelProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RaiToolLabelProperties. + */ + public static RaiToolLabelProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RaiToolLabelProperties deserializedRaiToolLabelProperties = new RaiToolLabelProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("toolConnectionName".equals(fieldName)) { + deserializedRaiToolLabelProperties.toolConnectionName = reader.getString(); + } else if ("accountScope".equals(fieldName)) { + deserializedRaiToolLabelProperties.accountScope + = RaiToolLabelPropertiesAccountScope.fromJson(reader); + } else if ("projectScopes".equals(fieldName)) { + List projectScopes + = reader.readArray(reader1 -> RaiToolLabelPropertiesProjectScopesItem.fromJson(reader1)); + deserializedRaiToolLabelProperties.projectScopes = projectScopes; + } else { + reader.skipChildren(); + } + } + + return deserializedRaiToolLabelProperties; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabelPropertiesAccountScope.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabelPropertiesAccountScope.java new file mode 100644 index 000000000000..ee00f0a0f47f --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabelPropertiesAccountScope.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Account-level tool label definition. + */ +@Fluent +public final class RaiToolLabelPropertiesAccountScope implements JsonSerializable { + /* + * Dictionary of label key-value pairs for the account scope. + */ + private Map labelValues; + + /** + * Creates an instance of RaiToolLabelPropertiesAccountScope class. + */ + public RaiToolLabelPropertiesAccountScope() { + } + + /** + * Get the labelValues property: Dictionary of label key-value pairs for the account scope. + * + * @return the labelValues value. + */ + public Map labelValues() { + return this.labelValues; + } + + /** + * Set the labelValues property: Dictionary of label key-value pairs for the account scope. + * + * @param labelValues the labelValues value to set. + * @return the RaiToolLabelPropertiesAccountScope object itself. + */ + public RaiToolLabelPropertiesAccountScope withLabelValues(Map labelValues) { + this.labelValues = labelValues; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("labelValues", this.labelValues, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RaiToolLabelPropertiesAccountScope from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RaiToolLabelPropertiesAccountScope if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RaiToolLabelPropertiesAccountScope. + */ + public static RaiToolLabelPropertiesAccountScope fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RaiToolLabelPropertiesAccountScope deserializedRaiToolLabelPropertiesAccountScope + = new RaiToolLabelPropertiesAccountScope(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("labelValues".equals(fieldName)) { + Map labelValues = reader.readMap(reader1 -> reader1.getString()); + deserializedRaiToolLabelPropertiesAccountScope.labelValues = labelValues; + } else { + reader.skipChildren(); + } + } + + return deserializedRaiToolLabelPropertiesAccountScope; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabelPropertiesProjectScopesItem.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabelPropertiesProjectScopesItem.java new file mode 100644 index 000000000000..9fd37bcbb5ef --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabelPropertiesProjectScopesItem.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The RaiToolLabelPropertiesProjectScopesItem model. + */ +@Fluent +public final class RaiToolLabelPropertiesProjectScopesItem + implements JsonSerializable { + /* + * Project name to which this scope applies. + */ + private String project; + + /* + * Dictionary of label key-value pairs for the project scope. + */ + private Map labelValues; + + /** + * Creates an instance of RaiToolLabelPropertiesProjectScopesItem class. + */ + public RaiToolLabelPropertiesProjectScopesItem() { + } + + /** + * Get the project property: Project name to which this scope applies. + * + * @return the project value. + */ + public String project() { + return this.project; + } + + /** + * Set the project property: Project name to which this scope applies. + * + * @param project the project value to set. + * @return the RaiToolLabelPropertiesProjectScopesItem object itself. + */ + public RaiToolLabelPropertiesProjectScopesItem withProject(String project) { + this.project = project; + return this; + } + + /** + * Get the labelValues property: Dictionary of label key-value pairs for the project scope. + * + * @return the labelValues value. + */ + public Map labelValues() { + return this.labelValues; + } + + /** + * Set the labelValues property: Dictionary of label key-value pairs for the project scope. + * + * @param labelValues the labelValues value to set. + * @return the RaiToolLabelPropertiesProjectScopesItem object itself. + */ + public RaiToolLabelPropertiesProjectScopesItem withLabelValues(Map labelValues) { + this.labelValues = labelValues; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("project", this.project); + jsonWriter.writeMapField("labelValues", this.labelValues, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RaiToolLabelPropertiesProjectScopesItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RaiToolLabelPropertiesProjectScopesItem if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RaiToolLabelPropertiesProjectScopesItem. + */ + public static RaiToolLabelPropertiesProjectScopesItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RaiToolLabelPropertiesProjectScopesItem deserializedRaiToolLabelPropertiesProjectScopesItem + = new RaiToolLabelPropertiesProjectScopesItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("project".equals(fieldName)) { + deserializedRaiToolLabelPropertiesProjectScopesItem.project = reader.getString(); + } else if ("labelValues".equals(fieldName)) { + Map labelValues = reader.readMap(reader1 -> reader1.getString()); + deserializedRaiToolLabelPropertiesProjectScopesItem.labelValues = labelValues; + } else { + reader.skipChildren(); + } + } + + return deserializedRaiToolLabelPropertiesProjectScopesItem; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabels.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabels.java new file mode 100644 index 000000000000..e7b54aebbc5c --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabels.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of RaiToolLabels. + */ +public interface RaiToolLabels { + /** + * Gets the specified RAI Tool Label associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiToolConnectionName The name of the Rai Tool Label. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified RAI Tool Label associated with the Azure OpenAI account along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String accountName, String raiToolConnectionName, + Context context); + + /** + * Gets the specified RAI Tool Label associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiToolConnectionName The name of the Rai Tool Label. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified RAI Tool Label associated with the Azure OpenAI account. + */ + RaiToolLabel get(String resourceGroupName, String accountName, String raiToolConnectionName); + + /** + * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiToolConnectionName The name of the Rai Tool Label. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String raiToolConnectionName); + + /** + * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param raiToolConnectionName The name of the Rai Tool Label. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String accountName, String raiToolConnectionName, Context context); + + /** + * Lists all RAI Tool Labels associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Cognitive Services RAI Tool Labels as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Lists all RAI Tool Labels associated with the Azure OpenAI account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName The name of Cognitive Services account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the list of Cognitive Services RAI Tool Labels as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String accountName, Context context); + + /** + * Gets the specified RAI Tool Label associated with the Azure OpenAI account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified RAI Tool Label associated with the Azure OpenAI account along with {@link Response}. + */ + RaiToolLabel getById(String id); + + /** + * Gets the specified RAI Tool Label associated with the Azure OpenAI account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified RAI Tool Label associated with the Azure OpenAI account along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Deletes the specified RAI Tool Label associated with the Azure OpenAI account. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new RaiToolLabel resource. + * + * @param name resource name. + * @return the first stage of the new RaiToolLabel definition. + */ + RaiToolLabel.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopic.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopic.java index 06709a66f0e6..c49de9f4bcc1 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopic.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopic.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -34,6 +34,13 @@ public interface RaiTopic { */ String type(); + /** + * Gets the properties property: Properties of Cognitive Services Rai Topic. + * + * @return the properties value. + */ + RaiTopicProperties properties(); + /** * Gets the etag property: Resource Etag. * @@ -48,13 +55,6 @@ public interface RaiTopic { */ Map tags(); - /** - * Gets the properties property: Properties of Cognitive Services Rai Topic. - * - * @return the properties value. - */ - RaiTopicProperties properties(); - /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopicConfig.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopicConfig.java index b86f58dd4e74..f50c335bad54 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopicConfig.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopicConfig.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -72,14 +72,6 @@ public RaiTopicConfig withBlocking(Boolean blocking) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopicProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopicProperties.java index ad923a53acbd..01e82a9b9cbb 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopicProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopicProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -225,14 +225,6 @@ public RaiTopicProperties withLastModifiedAt(OffsetDateTime lastModifiedAt) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopics.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopics.java index 7b514d612047..9311fc4b9079 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopics.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopics.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RegenerateKeyParameters.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RegenerateKeyParameters.java index 299538a584b6..a427be7f275e 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RegenerateKeyParameters.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RegenerateKeyParameters.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -48,21 +47,6 @@ public RegenerateKeyParameters withKeyName(KeyName keyName) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (keyName() == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Missing required property keyName in model RegenerateKeyParameters")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(RegenerateKeyParameters.class); - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RegionSetting.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RegionSetting.java index d28be39391b1..66252df02953 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RegionSetting.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RegionSetting.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -97,14 +97,6 @@ public RegionSetting withCustomsubdomain(String customsubdomain) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ReplacementConfig.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ReplacementConfig.java index c75c70efe5fa..281396913bf7 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ReplacementConfig.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ReplacementConfig.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -17,7 +17,7 @@ /** * Configuration for model replacement. */ -@Fluent +@Immutable public final class ReplacementConfig implements JsonSerializable { /* * The name of the replacement model. @@ -44,7 +44,7 @@ public final class ReplacementConfig implements JsonSerializable { /* * The path property. @@ -29,7 +29,7 @@ public final class RequestMatchPattern implements JsonSerializable tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceIdentityType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceIdentityType.java index 39d435cc9357..af0eb2de1550 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceIdentityType.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceIdentityType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceProviders.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceProviders.java index 4513afcf16d3..2876ab94c76d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceProviders.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceProviders.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -14,8 +14,8 @@ public interface ResourceProviders { /** * Check available SKUs. * - * @param location Resource location. - * @param parameters Check SKU Availability POST body. + * @param location The location name. + * @param parameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -28,8 +28,8 @@ Response checkSkuAvailabilityWithResponse(String loca /** * Check available SKUs. * - * @param location Resource location. - * @param parameters Check SKU Availability POST body. + * @param location The location name. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -40,7 +40,7 @@ Response checkSkuAvailabilityWithResponse(String loca /** * Check whether a domain is available. * - * @param parameters Check Domain Availability parameter. + * @param parameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -53,7 +53,7 @@ Response checkDomainAvailabilityWithResponse(CheckDomainAvai /** * Check whether a domain is available. * - * @param parameters Check Domain Availability parameter. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -64,7 +64,7 @@ Response checkDomainAvailabilityWithResponse(CheckDomainAvai /** * Model capacity calculator. * - * @param parameters Check Domain Availability parameter. + * @param parameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -77,7 +77,7 @@ Response checkDomainAvailabilityWithResponse(CheckDomainAvai /** * Model capacity calculator. * - * @param parameters Check Domain Availability parameter. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSku.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSku.java index 3cd0336b01a4..7d36ccefe0e9 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSku.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSku.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictionInfo.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictionInfo.java index 62ae2c1c6908..a89c7b2b6360 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictionInfo.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictionInfo.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The ResourceSkuRestrictionInfo model. */ -@Fluent +@Immutable public final class ResourceSkuRestrictionInfo implements JsonSerializable { /* * Locations where the SKU is restricted @@ -30,7 +30,7 @@ public final class ResourceSkuRestrictionInfo implements JsonSerializable locations() { return this.locations; } - /** - * Set the locations property: Locations where the SKU is restricted. - * - * @param locations the locations value to set. - * @return the ResourceSkuRestrictionInfo object itself. - */ - public ResourceSkuRestrictionInfo withLocations(List locations) { - this.locations = locations; - return this; - } - /** * Get the zones property: List of availability zones where the SKU is restricted. * @@ -62,25 +51,6 @@ public List zones() { return this.zones; } - /** - * Set the zones property: List of availability zones where the SKU is restricted. - * - * @param zones the zones value to set. - * @return the ResourceSkuRestrictionInfo object itself. - */ - public ResourceSkuRestrictionInfo withZones(List zones) { - this.zones = zones; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictions.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictions.java index 34817c0ebe82..a65979efc1ca 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictions.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictions.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Describes restrictions of a SKU. */ -@Fluent +@Immutable public final class ResourceSkuRestrictions implements JsonSerializable { /* * The type of restrictions. @@ -41,7 +41,7 @@ public final class ResourceSkuRestrictions implements JsonSerializable values() { return this.values; } - /** - * Set the values property: The value of restrictions. If the restriction type is set to location. This would be - * different locations where the SKU is restricted. - * - * @param values the values value to set. - * @return the ResourceSkuRestrictions object itself. - */ - public ResourceSkuRestrictions withValues(List values) { - this.values = values; - return this; - } - /** * Get the restrictionInfo property: The information about the restriction where the SKU cannot be used. * @@ -95,17 +72,6 @@ public ResourceSkuRestrictionInfo restrictionInfo() { return this.restrictionInfo; } - /** - * Set the restrictionInfo property: The information about the restriction where the SKU cannot be used. - * - * @param restrictionInfo the restrictionInfo value to set. - * @return the ResourceSkuRestrictions object itself. - */ - public ResourceSkuRestrictions withRestrictionInfo(ResourceSkuRestrictionInfo restrictionInfo) { - this.restrictionInfo = restrictionInfo; - return this; - } - /** * Get the reasonCode property: The reason for restriction. * @@ -115,28 +81,6 @@ public ResourceSkuRestrictionsReasonCode reasonCode() { return this.reasonCode; } - /** - * Set the reasonCode property: The reason for restriction. - * - * @param reasonCode the reasonCode value to set. - * @return the ResourceSkuRestrictions object itself. - */ - public ResourceSkuRestrictions withReasonCode(ResourceSkuRestrictionsReasonCode reasonCode) { - this.reasonCode = reasonCode; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (restrictionInfo() != null) { - restrictionInfo().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictionsReasonCode.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictionsReasonCode.java index ebd3935487c7..bcea279cc496 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictionsReasonCode.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictionsReasonCode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictionsType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictionsType.java index d548bfc7e647..d5b782d926d5 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictionsType.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictionsType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkus.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkus.java index 884b44e3f9fe..e8d00d7f7228 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkus.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RoleBasedBuiltInAuthorizationPolicy.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RoleBasedBuiltInAuthorizationPolicy.java new file mode 100644 index 000000000000..941ca99d76a7 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RoleBasedBuiltInAuthorizationPolicy.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Built-in role-based authorization policy. + */ +@Immutable +public final class RoleBasedBuiltInAuthorizationPolicy extends ApplicationAuthorizationPolicy { + /* + * Authorization scheme type. + */ + private BuiltInAuthorizationScheme type = BuiltInAuthorizationScheme.DEFAULT; + + /** + * Creates an instance of RoleBasedBuiltInAuthorizationPolicy class. + */ + public RoleBasedBuiltInAuthorizationPolicy() { + } + + /** + * Get the type property: Authorization scheme type. + * + * @return the type value. + */ + @Override + public BuiltInAuthorizationScheme type() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RoleBasedBuiltInAuthorizationPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RoleBasedBuiltInAuthorizationPolicy if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RoleBasedBuiltInAuthorizationPolicy. + */ + public static RoleBasedBuiltInAuthorizationPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RoleBasedBuiltInAuthorizationPolicy deserializedRoleBasedBuiltInAuthorizationPolicy + = new RoleBasedBuiltInAuthorizationPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedRoleBasedBuiltInAuthorizationPolicy.type + = BuiltInAuthorizationScheme.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedRoleBasedBuiltInAuthorizationPolicy; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RoutingMethods.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RoutingMethods.java index 19b93117da33..dee5121771f9 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RoutingMethods.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RoutingMethods.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RoutingMode.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RoutingMode.java new file mode 100644 index 000000000000..98086ab8ed82 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RoutingMode.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The routing mode that determines how requests are distributed across models. + */ +public final class RoutingMode extends ExpandableStringEnum { + /** + * Route requests to minimize cost while meeting performance requirements. + */ + public static final RoutingMode COST = fromString("cost"); + + /** + * Balance cost and accuracy when routing requests across models. + */ + public static final RoutingMode BALANCED = fromString("balanced"); + + /** + * Route requests to maximize accuracy regardless of cost. + */ + public static final RoutingMode ACCURACY = fromString("accuracy"); + + /** + * Creates a new instance of RoutingMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RoutingMode() { + } + + /** + * Creates or finds a RoutingMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding RoutingMode. + */ + public static RoutingMode fromString(String name) { + return fromString(name, RoutingMode.class); + } + + /** + * Gets known RoutingMode values. + * + * @return known RoutingMode values. + */ + public static Collection values() { + return values(RoutingMode.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleAction.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleAction.java new file mode 100644 index 000000000000..5421f2388738 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleAction.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The action enum for a managed network outbound rule. + */ +public final class RuleAction extends ExpandableStringEnum { + /** + * Static value Allow for RuleAction. + */ + public static final RuleAction ALLOW = fromString("Allow"); + + /** + * Static value Deny for RuleAction. + */ + public static final RuleAction DENY = fromString("Deny"); + + /** + * Creates a new instance of RuleAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RuleAction() { + } + + /** + * Creates or finds a RuleAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuleAction. + */ + public static RuleAction fromString(String name) { + return fromString(name, RuleAction.class); + } + + /** + * Gets known RuleAction values. + * + * @return known RuleAction values. + */ + public static Collection values() { + return values(RuleAction.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleCategory.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleCategory.java new file mode 100644 index 000000000000..0f59515ada74 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleCategory.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Category of a managed network Outbound Rule of a cognitive services account. + */ +public final class RuleCategory extends ExpandableStringEnum { + /** + * Static value Required for RuleCategory. + */ + public static final RuleCategory REQUIRED = fromString("Required"); + + /** + * Static value Recommended for RuleCategory. + */ + public static final RuleCategory RECOMMENDED = fromString("Recommended"); + + /** + * Static value UserDefined for RuleCategory. + */ + public static final RuleCategory USER_DEFINED = fromString("UserDefined"); + + /** + * Static value Dependency for RuleCategory. + */ + public static final RuleCategory DEPENDENCY = fromString("Dependency"); + + /** + * Creates a new instance of RuleCategory value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RuleCategory() { + } + + /** + * Creates or finds a RuleCategory from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuleCategory. + */ + public static RuleCategory fromString(String name) { + return fromString(name, RuleCategory.class); + } + + /** + * Gets known RuleCategory values. + * + * @return known RuleCategory values. + */ + public static Collection values() { + return values(RuleCategory.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleStatus.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleStatus.java new file mode 100644 index 000000000000..3c54e5f321e9 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleStatus.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of a managed network Outbound Rule of a cognitive services account. + */ +public final class RuleStatus extends ExpandableStringEnum { + /** + * Static value Inactive for RuleStatus. + */ + public static final RuleStatus INACTIVE = fromString("Inactive"); + + /** + * Static value Active for RuleStatus. + */ + public static final RuleStatus ACTIVE = fromString("Active"); + + /** + * Static value Provisioning for RuleStatus. + */ + public static final RuleStatus PROVISIONING = fromString("Provisioning"); + + /** + * Static value Deleting for RuleStatus. + */ + public static final RuleStatus DELETING = fromString("Deleting"); + + /** + * Static value Failed for RuleStatus. + */ + public static final RuleStatus FAILED = fromString("Failed"); + + /** + * Creates a new instance of RuleStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RuleStatus() { + } + + /** + * Creates or finds a RuleStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuleStatus. + */ + public static RuleStatus fromString(String name) { + return fromString(name, RuleStatus.class); + } + + /** + * Gets known RuleStatus values. + * + * @return known RuleStatus values. + */ + public static Collection values() { + return values(RuleStatus.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleType.java new file mode 100644 index 000000000000..9c93f4cb878f --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of a managed network Outbound Rule of a cognitive services account. + */ +public final class RuleType extends ExpandableStringEnum { + /** + * Static value FQDN for RuleType. + */ + public static final RuleType FQDN = fromString("FQDN"); + + /** + * Static value PrivateEndpoint for RuleType. + */ + public static final RuleType PRIVATE_ENDPOINT = fromString("PrivateEndpoint"); + + /** + * Static value ServiceTag for RuleType. + */ + public static final RuleType SERVICE_TAG = fromString("ServiceTag"); + + /** + * Creates a new instance of RuleType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RuleType() { + } + + /** + * Creates or finds a RuleType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuleType. + */ + public static RuleType fromString(String name) { + return fromString(name, RuleType.class); + } + + /** + * Gets known RuleType values. + * + * @return known RuleType values. + */ + public static Collection values() { + return values(RuleType.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SafetyProviderConfig.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SafetyProviderConfig.java new file mode 100644 index 000000000000..ed4323fb5cbc --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SafetyProviderConfig.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Gets or sets the source to which safety providers applies. + */ +@Fluent +public final class SafetyProviderConfig extends RaiSafetyProviderConfig { + /* + * Content source to apply the Content Filters. + */ + private RaiPolicyContentSource source; + + /** + * Creates an instance of SafetyProviderConfig class. + */ + public SafetyProviderConfig() { + } + + /** + * Get the source property: Content source to apply the Content Filters. + * + * @return the source value. + */ + public RaiPolicyContentSource source() { + return this.source; + } + + /** + * Set the source property: Content source to apply the Content Filters. + * + * @param source the source value to set. + * @return the SafetyProviderConfig object itself. + */ + public SafetyProviderConfig withSource(RaiPolicyContentSource source) { + this.source = source; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SafetyProviderConfig withSafetyProviderName(String safetyProviderName) { + super.withSafetyProviderName(safetyProviderName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public SafetyProviderConfig withBlocking(Boolean blocking) { + super.withBlocking(blocking); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("safetyProviderName", safetyProviderName()); + jsonWriter.writeBooleanField("blocking", blocking()); + jsonWriter.writeStringField("source", this.source == null ? null : this.source.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SafetyProviderConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SafetyProviderConfig if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SafetyProviderConfig. + */ + public static SafetyProviderConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SafetyProviderConfig deserializedSafetyProviderConfig = new SafetyProviderConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("safetyProviderName".equals(fieldName)) { + deserializedSafetyProviderConfig.withSafetyProviderName(reader.getString()); + } else if ("blocking".equals(fieldName)) { + deserializedSafetyProviderConfig.withBlocking(reader.getNullable(JsonReader::getBoolean)); + } else if ("source".equals(fieldName)) { + deserializedSafetyProviderConfig.source = RaiPolicyContentSource.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedSafetyProviderConfig; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SasAuthTypeConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SasAuthTypeConnectionProperties.java index 86ff330992d9..5aa4160bcdda 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SasAuthTypeConnectionProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SasAuthTypeConnectionProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -156,18 +156,6 @@ public SasAuthTypeConnectionProperties withUseWorkspaceManagedIdentity(Boolean u return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (credentials() != null) { - credentials().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ScenarioType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ScenarioType.java index 7c99f09da556..0f6c936f28c1 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ScenarioType.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ScenarioType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServicePrincipalAuthTypeConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServicePrincipalAuthTypeConnectionProperties.java index c405a2f5b2e3..367c22a54051 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServicePrincipalAuthTypeConnectionProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServicePrincipalAuthTypeConnectionProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -157,18 +157,6 @@ public ServicePrincipalAuthTypeConnectionProperties withTarget(String target) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (credentials() != null) { - credentials().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServiceTagOutboundRule.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServiceTagOutboundRule.java new file mode 100644 index 000000000000..36006fafeda3 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServiceTagOutboundRule.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Service Tag outbound rule for the managed network of a cognitive services account. + */ +@Fluent +public final class ServiceTagOutboundRule extends OutboundRule { + /* + * Type of a managed network Outbound Rule of a cognitive services account. + */ + private RuleType type = RuleType.SERVICE_TAG; + + /* + * Service Tag destination. + */ + private ServiceTagOutboundRuleDestination destination; + + /** + * Creates an instance of ServiceTagOutboundRule class. + */ + public ServiceTagOutboundRule() { + } + + /** + * Get the type property: Type of a managed network Outbound Rule of a cognitive services account. + * + * @return the type value. + */ + @Override + public RuleType type() { + return this.type; + } + + /** + * Get the destination property: Service Tag destination. + * + * @return the destination value. + */ + public ServiceTagOutboundRuleDestination destination() { + return this.destination; + } + + /** + * Set the destination property: Service Tag destination. + * + * @param destination the destination value to set. + * @return the ServiceTagOutboundRule object itself. + */ + public ServiceTagOutboundRule withDestination(ServiceTagOutboundRuleDestination destination) { + this.destination = destination; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ServiceTagOutboundRule withCategory(RuleCategory category) { + super.withCategory(category); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ServiceTagOutboundRule withStatus(RuleStatus status) { + super.withStatus(status); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", category() == null ? null : category().toString()); + jsonWriter.writeStringField("status", status() == null ? null : status().toString()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeJsonField("destination", this.destination); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceTagOutboundRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceTagOutboundRule if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceTagOutboundRule. + */ + public static ServiceTagOutboundRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceTagOutboundRule deserializedServiceTagOutboundRule = new ServiceTagOutboundRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("category".equals(fieldName)) { + deserializedServiceTagOutboundRule.withCategory(RuleCategory.fromString(reader.getString())); + } else if ("status".equals(fieldName)) { + deserializedServiceTagOutboundRule.withStatus(RuleStatus.fromString(reader.getString())); + } else if ("errorInformation".equals(fieldName)) { + deserializedServiceTagOutboundRule.withErrorInformation(reader.getString()); + } else if ("parentRuleNames".equals(fieldName)) { + List parentRuleNames = reader.readArray(reader1 -> reader1.getString()); + deserializedServiceTagOutboundRule.withParentRuleNames(parentRuleNames); + } else if ("type".equals(fieldName)) { + deserializedServiceTagOutboundRule.type = RuleType.fromString(reader.getString()); + } else if ("destination".equals(fieldName)) { + deserializedServiceTagOutboundRule.destination = ServiceTagOutboundRuleDestination.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceTagOutboundRule; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServiceTagOutboundRuleDestination.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServiceTagOutboundRuleDestination.java new file mode 100644 index 000000000000..6302a6956434 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServiceTagOutboundRuleDestination.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Service Tag destination for an outbound rule. + */ +@Fluent +public final class ServiceTagOutboundRuleDestination implements JsonSerializable { + /* + * Name of the Azure service tag to target. + */ + private String serviceTag; + + /* + * Network protocol used by the service tag rule. + */ + private String protocol; + + /* + * Destination port ranges. + */ + private String portRanges; + + /* + * The action for the service tag outbound rule. + */ + private RuleAction action; + + /* + * Optional address prefixes. If provided, the serviceTag property will be ignored. + */ + private List addressPrefixes; + + /** + * Creates an instance of ServiceTagOutboundRuleDestination class. + */ + public ServiceTagOutboundRuleDestination() { + } + + /** + * Get the serviceTag property: Name of the Azure service tag to target. + * + * @return the serviceTag value. + */ + public String serviceTag() { + return this.serviceTag; + } + + /** + * Set the serviceTag property: Name of the Azure service tag to target. + * + * @param serviceTag the serviceTag value to set. + * @return the ServiceTagOutboundRuleDestination object itself. + */ + public ServiceTagOutboundRuleDestination withServiceTag(String serviceTag) { + this.serviceTag = serviceTag; + return this; + } + + /** + * Get the protocol property: Network protocol used by the service tag rule. + * + * @return the protocol value. + */ + public String protocol() { + return this.protocol; + } + + /** + * Set the protocol property: Network protocol used by the service tag rule. + * + * @param protocol the protocol value to set. + * @return the ServiceTagOutboundRuleDestination object itself. + */ + public ServiceTagOutboundRuleDestination withProtocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the portRanges property: Destination port ranges. + * + * @return the portRanges value. + */ + public String portRanges() { + return this.portRanges; + } + + /** + * Set the portRanges property: Destination port ranges. + * + * @param portRanges the portRanges value to set. + * @return the ServiceTagOutboundRuleDestination object itself. + */ + public ServiceTagOutboundRuleDestination withPortRanges(String portRanges) { + this.portRanges = portRanges; + return this; + } + + /** + * Get the action property: The action for the service tag outbound rule. + * + * @return the action value. + */ + public RuleAction action() { + return this.action; + } + + /** + * Set the action property: The action for the service tag outbound rule. + * + * @param action the action value to set. + * @return the ServiceTagOutboundRuleDestination object itself. + */ + public ServiceTagOutboundRuleDestination withAction(RuleAction action) { + this.action = action; + return this; + } + + /** + * Get the addressPrefixes property: Optional address prefixes. If provided, the serviceTag property will be + * ignored. + * + * @return the addressPrefixes value. + */ + public List addressPrefixes() { + return this.addressPrefixes; + } + + /** + * Set the addressPrefixes property: Optional address prefixes. If provided, the serviceTag property will be + * ignored. + * + * @param addressPrefixes the addressPrefixes value to set. + * @return the ServiceTagOutboundRuleDestination object itself. + */ + public ServiceTagOutboundRuleDestination withAddressPrefixes(List addressPrefixes) { + this.addressPrefixes = addressPrefixes; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("serviceTag", this.serviceTag); + jsonWriter.writeStringField("protocol", this.protocol); + jsonWriter.writeStringField("portRanges", this.portRanges); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + jsonWriter.writeArrayField("addressPrefixes", this.addressPrefixes, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceTagOutboundRuleDestination from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceTagOutboundRuleDestination if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceTagOutboundRuleDestination. + */ + public static ServiceTagOutboundRuleDestination fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceTagOutboundRuleDestination deserializedServiceTagOutboundRuleDestination + = new ServiceTagOutboundRuleDestination(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceTag".equals(fieldName)) { + deserializedServiceTagOutboundRuleDestination.serviceTag = reader.getString(); + } else if ("protocol".equals(fieldName)) { + deserializedServiceTagOutboundRuleDestination.protocol = reader.getString(); + } else if ("portRanges".equals(fieldName)) { + deserializedServiceTagOutboundRuleDestination.portRanges = reader.getString(); + } else if ("action".equals(fieldName)) { + deserializedServiceTagOutboundRuleDestination.action = RuleAction.fromString(reader.getString()); + } else if ("addressPrefixes".equals(fieldName)) { + List addressPrefixes = reader.readArray(reader1 -> reader1.getString()); + deserializedServiceTagOutboundRuleDestination.addressPrefixes = addressPrefixes; + } else { + reader.skipChildren(); + } + } + + return deserializedServiceTagOutboundRuleDestination; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServiceTier.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServiceTier.java new file mode 100644 index 000000000000..2488272d1f68 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServiceTier.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The service tier for the deployment. Determines the pricing and performance level for request processing. Use + * 'Default' for standard pricing or 'Priority' for higher-priority processing with premium pricing. Note: Pause + * operations are only supported on Standard, DataZoneStandard, and GlobalStandard SKUs. + */ +public final class ServiceTier extends ExpandableStringEnum { + /** + * Default service tier meaning the request will be processed with the standard pricing and performance for the + * selected model. + */ + public static final ServiceTier DEFAULT = fromString("Default"); + + /** + * Priority service tier meaning the request will be processed with higher pricing and performance for the selected + * model. + */ + public static final ServiceTier PRIORITY = fromString("Priority"); + + /** + * Creates a new instance of ServiceTier value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ServiceTier() { + } + + /** + * Creates or finds a ServiceTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServiceTier. + */ + public static ServiceTier fromString(String name) { + return fromString(name, ServiceTier.class); + } + + /** + * Gets known ServiceTier values. + * + * @return known ServiceTier values. + */ + public static Collection values() { + return values(ServiceTier.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Sku.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Sku.java index b6a993f595ef..b884089eac00 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Sku.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Sku.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -159,19 +158,6 @@ public Sku withCapacity(Integer capacity) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER.atError().log(new IllegalArgumentException("Missing required property name in model Sku")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(Sku.class); - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuAvailability.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuAvailability.java index cb8a4746a934..75737d8d271f 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuAvailability.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuAvailability.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,10 +14,10 @@ /** * SKU availability. */ -@Fluent +@Immutable public final class SkuAvailability implements JsonSerializable { /* - * The Kind of the resource. + * The kind (type) of cognitive service account. */ private String kind; @@ -27,7 +27,7 @@ public final class SkuAvailability implements JsonSerializable private String type; /* - * The SKU of Cognitive Services account. + * The name of SKU. */ private String skuName; @@ -49,11 +49,11 @@ public final class SkuAvailability implements JsonSerializable /** * Creates an instance of SkuAvailability class. */ - public SkuAvailability() { + private SkuAvailability() { } /** - * Get the kind property: The Kind of the resource. + * Get the kind property: The kind (type) of cognitive service account. * * @return the kind value. */ @@ -61,17 +61,6 @@ public String kind() { return this.kind; } - /** - * Set the kind property: The Kind of the resource. - * - * @param kind the kind value to set. - * @return the SkuAvailability object itself. - */ - public SkuAvailability withKind(String kind) { - this.kind = kind; - return this; - } - /** * Get the type property: The Type of the resource. * @@ -82,18 +71,7 @@ public String type() { } /** - * Set the type property: The Type of the resource. - * - * @param type the type value to set. - * @return the SkuAvailability object itself. - */ - public SkuAvailability withType(String type) { - this.type = type; - return this; - } - - /** - * Get the skuName property: The SKU of Cognitive Services account. + * Get the skuName property: The name of SKU. * * @return the skuName value. */ @@ -101,17 +79,6 @@ public String skuName() { return this.skuName; } - /** - * Set the skuName property: The SKU of Cognitive Services account. - * - * @param skuName the skuName value to set. - * @return the SkuAvailability object itself. - */ - public SkuAvailability withSkuName(String skuName) { - this.skuName = skuName; - return this; - } - /** * Get the skuAvailable property: Indicates the given SKU is available or not. * @@ -121,17 +88,6 @@ public Boolean skuAvailable() { return this.skuAvailable; } - /** - * Set the skuAvailable property: Indicates the given SKU is available or not. - * - * @param skuAvailable the skuAvailable value to set. - * @return the SkuAvailability object itself. - */ - public SkuAvailability withSkuAvailable(Boolean skuAvailable) { - this.skuAvailable = skuAvailable; - return this; - } - /** * Get the reason property: Reason why the SKU is not available. * @@ -141,17 +97,6 @@ public String reason() { return this.reason; } - /** - * Set the reason property: Reason why the SKU is not available. - * - * @param reason the reason value to set. - * @return the SkuAvailability object itself. - */ - public SkuAvailability withReason(String reason) { - this.reason = reason; - return this; - } - /** * Get the message property: Additional error message. * @@ -161,25 +106,6 @@ public String message() { return this.message; } - /** - * Set the message property: Additional error message. - * - * @param message the message value to set. - * @return the SkuAvailability object itself. - */ - public SkuAvailability withMessage(String message) { - this.message = message; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuAvailabilityListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuAvailabilityListResult.java index 4ef193ca8fb8..090763e50bd1 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuAvailabilityListResult.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuAvailabilityListResult.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuCapability.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuCapability.java index 088b5fcfbfc3..debcdaba2918 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuCapability.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuCapability.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * SkuCapability indicates the capability of a certain feature. */ -@Fluent +@Immutable public final class SkuCapability implements JsonSerializable { /* * The name of the SkuCapability. @@ -29,7 +29,7 @@ public final class SkuCapability implements JsonSerializable { /** * Creates an instance of SkuCapability class. */ - public SkuCapability() { + private SkuCapability() { } /** @@ -41,17 +41,6 @@ public String name() { return this.name; } - /** - * Set the name property: The name of the SkuCapability. - * - * @param name the name value to set. - * @return the SkuCapability object itself. - */ - public SkuCapability withName(String name) { - this.name = name; - return this; - } - /** * Get the value property: The value of the SkuCapability. * @@ -61,25 +50,6 @@ public String value() { return this.value; } - /** - * Set the value property: The value of the SkuCapability. - * - * @param value the value value to set. - * @return the SkuCapability object itself. - */ - public SkuCapability withValue(String value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuChangeInfo.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuChangeInfo.java index fded44755926..bf4d7b071cb9 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuChangeInfo.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuChangeInfo.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Sku change info of account. */ -@Fluent +@Immutable public final class SkuChangeInfo implements JsonSerializable { /* * Gets the count of downgrades. @@ -34,7 +34,7 @@ public final class SkuChangeInfo implements JsonSerializable { /** * Creates an instance of SkuChangeInfo class. */ - public SkuChangeInfo() { + private SkuChangeInfo() { } /** @@ -46,17 +46,6 @@ public Float countOfDowngrades() { return this.countOfDowngrades; } - /** - * Set the countOfDowngrades property: Gets the count of downgrades. - * - * @param countOfDowngrades the countOfDowngrades value to set. - * @return the SkuChangeInfo object itself. - */ - public SkuChangeInfo withCountOfDowngrades(Float countOfDowngrades) { - this.countOfDowngrades = countOfDowngrades; - return this; - } - /** * Get the countOfUpgradesAfterDowngrades property: Gets the count of upgrades after downgrades. * @@ -66,17 +55,6 @@ public Float countOfUpgradesAfterDowngrades() { return this.countOfUpgradesAfterDowngrades; } - /** - * Set the countOfUpgradesAfterDowngrades property: Gets the count of upgrades after downgrades. - * - * @param countOfUpgradesAfterDowngrades the countOfUpgradesAfterDowngrades value to set. - * @return the SkuChangeInfo object itself. - */ - public SkuChangeInfo withCountOfUpgradesAfterDowngrades(Float countOfUpgradesAfterDowngrades) { - this.countOfUpgradesAfterDowngrades = countOfUpgradesAfterDowngrades; - return this; - } - /** * Get the lastChangeDate property: Gets the last change date. * @@ -86,25 +64,6 @@ public String lastChangeDate() { return this.lastChangeDate; } - /** - * Set the lastChangeDate property: Gets the last change date. - * - * @param lastChangeDate the lastChangeDate value to set. - * @return the SkuChangeInfo object itself. - */ - public SkuChangeInfo withLastChangeDate(String lastChangeDate) { - this.lastChangeDate = lastChangeDate; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuResource.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuResource.java index a8f4f7dae106..ca9f42862bf8 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuResource.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuTier.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuTier.java index 3a23a9779068..e9e78a089181 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuTier.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuTier.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SubscriptionRaiPolicies.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SubscriptionRaiPolicies.java new file mode 100644 index 000000000000..c7cc2dea41be --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/SubscriptionRaiPolicies.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiPolicyInner; + +/** + * Resource collection API of SubscriptionRaiPolicies. + */ +public interface SubscriptionRaiPolicies { + /** + * Gets the specified Content Filters associated with the Subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Content Filters associated with the Subscription along with {@link Response}. + */ + Response getWithResponse(String raiPolicyName, Context context); + + /** + * Gets the specified Content Filters associated with the Subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specified Content Filters associated with the Subscription. + */ + RaiPolicy get(String raiPolicyName); + + /** + * Update the state of specified Content Filters associated with the subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @param raiPolicy Properties describing the Content Filters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services RaiPolicy along with {@link Response}. + */ + Response createOrUpdateWithResponse(String raiPolicyName, RaiPolicyInner raiPolicy, Context context); + + /** + * Update the state of specified Content Filters associated with the subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @param raiPolicy Properties describing the Content Filters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cognitive Services RaiPolicy. + */ + RaiPolicy createOrUpdate(String raiPolicyName, RaiPolicyInner raiPolicy); + + /** + * Deletes the specified Content Filters associated with the subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String raiPolicyName); + + /** + * Deletes the specified Content Filters associated with the subscription. + * + * @param raiPolicyName The name of the RaiPolicy associated with the Cognitive Services Account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String raiPolicyName, Context context); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TestRaiExternalSafetyProviders.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TestRaiExternalSafetyProviders.java new file mode 100644 index 000000000000..df017b0c026e --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TestRaiExternalSafetyProviders.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +/** + * Resource collection API of TestRaiExternalSafetyProviders. + */ +public interface TestRaiExternalSafetyProviders { + /** + * Begins definition for a new RaiExternalSafetyProviderSchema resource. + * + * @param name resource name. + * @return the first stage of the new RaiExternalSafetyProviderSchema definition. + */ + RaiExternalSafetyProviderSchema.DefinitionStages.Blank define(String name); +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ThrottlingRule.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ThrottlingRule.java index a948076095ff..d13bc6bd1928 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ThrottlingRule.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/ThrottlingRule.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The ThrottlingRule model. */ -@Fluent +@Immutable public final class ThrottlingRule implements JsonSerializable { /* * The key property. @@ -50,7 +50,7 @@ public final class ThrottlingRule implements JsonSerializable { /** * Creates an instance of ThrottlingRule class. */ - public ThrottlingRule() { + private ThrottlingRule() { } /** @@ -62,17 +62,6 @@ public String key() { return this.key; } - /** - * Set the key property: The key property. - * - * @param key the key value to set. - * @return the ThrottlingRule object itself. - */ - public ThrottlingRule withKey(String key) { - this.key = key; - return this; - } - /** * Get the renewalPeriod property: The renewalPeriod property. * @@ -82,17 +71,6 @@ public Float renewalPeriod() { return this.renewalPeriod; } - /** - * Set the renewalPeriod property: The renewalPeriod property. - * - * @param renewalPeriod the renewalPeriod value to set. - * @return the ThrottlingRule object itself. - */ - public ThrottlingRule withRenewalPeriod(Float renewalPeriod) { - this.renewalPeriod = renewalPeriod; - return this; - } - /** * Get the count property: The count property. * @@ -102,17 +80,6 @@ public Float count() { return this.count; } - /** - * Set the count property: The count property. - * - * @param count the count value to set. - * @return the ThrottlingRule object itself. - */ - public ThrottlingRule withCount(Float count) { - this.count = count; - return this; - } - /** * Get the minCount property: The minCount property. * @@ -122,17 +89,6 @@ public Float minCount() { return this.minCount; } - /** - * Set the minCount property: The minCount property. - * - * @param minCount the minCount value to set. - * @return the ThrottlingRule object itself. - */ - public ThrottlingRule withMinCount(Float minCount) { - this.minCount = minCount; - return this; - } - /** * Get the dynamicThrottlingEnabled property: The dynamicThrottlingEnabled property. * @@ -142,17 +98,6 @@ public Boolean dynamicThrottlingEnabled() { return this.dynamicThrottlingEnabled; } - /** - * Set the dynamicThrottlingEnabled property: The dynamicThrottlingEnabled property. - * - * @param dynamicThrottlingEnabled the dynamicThrottlingEnabled value to set. - * @return the ThrottlingRule object itself. - */ - public ThrottlingRule withDynamicThrottlingEnabled(Boolean dynamicThrottlingEnabled) { - this.dynamicThrottlingEnabled = dynamicThrottlingEnabled; - return this; - } - /** * Get the matchPatterns property: The matchPatterns property. * @@ -162,28 +107,6 @@ public List matchPatterns() { return this.matchPatterns; } - /** - * Set the matchPatterns property: The matchPatterns property. - * - * @param matchPatterns the matchPatterns value to set. - * @return the ThrottlingRule object itself. - */ - public ThrottlingRule withMatchPatterns(List matchPatterns) { - this.matchPatterns = matchPatterns; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (matchPatterns() != null) { - matchPatterns().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TierUpgradePolicy.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TierUpgradePolicy.java index 111944798fbc..f8e5eb0ce79c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TierUpgradePolicy.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TierUpgradePolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TrafficRoutingProtocol.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TrafficRoutingProtocol.java new file mode 100644 index 000000000000..4645d0848314 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TrafficRoutingProtocol.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Traffic routing protocol, used to distribute an application's inbound traffic to its deployments. + */ +public final class TrafficRoutingProtocol extends ExpandableStringEnum { + /** + * Percentage based routing. + */ + public static final TrafficRoutingProtocol FIXED_RATIO = fromString("FixedRatio"); + + /** + * Creates a new instance of TrafficRoutingProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TrafficRoutingProtocol() { + } + + /** + * Creates or finds a TrafficRoutingProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding TrafficRoutingProtocol. + */ + public static TrafficRoutingProtocol fromString(String name) { + return fromString(name, TrafficRoutingProtocol.class); + } + + /** + * Gets known TrafficRoutingProtocol values. + * + * @return known TrafficRoutingProtocol values. + */ + public static Collection values() { + return values(TrafficRoutingProtocol.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TrafficRoutingRule.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TrafficRoutingRule.java new file mode 100644 index 000000000000..b9ef27b6ac9b --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/TrafficRoutingRule.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents a rule for routing traffic to a specific deployment. + */ +@Fluent +public final class TrafficRoutingRule implements JsonSerializable { + /* + * The identifier of this traffic routing rule. + */ + private String ruleId; + + /* + * A user-provided description for this traffic routing rule. + */ + private String description; + + /* + * The unique identifier of the deployment to which traffic is routed by this rule. + */ + private String deploymentId; + + /* + * Gets or sets the percentage of traffic allocated to this instance. + */ + private Integer trafficPercentage; + + /** + * Creates an instance of TrafficRoutingRule class. + */ + public TrafficRoutingRule() { + } + + /** + * Get the ruleId property: The identifier of this traffic routing rule. + * + * @return the ruleId value. + */ + public String ruleId() { + return this.ruleId; + } + + /** + * Set the ruleId property: The identifier of this traffic routing rule. + * + * @param ruleId the ruleId value to set. + * @return the TrafficRoutingRule object itself. + */ + public TrafficRoutingRule withRuleId(String ruleId) { + this.ruleId = ruleId; + return this; + } + + /** + * Get the description property: A user-provided description for this traffic routing rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: A user-provided description for this traffic routing rule. + * + * @param description the description value to set. + * @return the TrafficRoutingRule object itself. + */ + public TrafficRoutingRule withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the deploymentId property: The unique identifier of the deployment to which traffic is routed by this rule. + * + * @return the deploymentId value. + */ + public String deploymentId() { + return this.deploymentId; + } + + /** + * Set the deploymentId property: The unique identifier of the deployment to which traffic is routed by this rule. + * + * @param deploymentId the deploymentId value to set. + * @return the TrafficRoutingRule object itself. + */ + public TrafficRoutingRule withDeploymentId(String deploymentId) { + this.deploymentId = deploymentId; + return this; + } + + /** + * Get the trafficPercentage property: Gets or sets the percentage of traffic allocated to this instance. + * + * @return the trafficPercentage value. + */ + public Integer trafficPercentage() { + return this.trafficPercentage; + } + + /** + * Set the trafficPercentage property: Gets or sets the percentage of traffic allocated to this instance. + * + * @param trafficPercentage the trafficPercentage value to set. + * @return the TrafficRoutingRule object itself. + */ + public TrafficRoutingRule withTrafficPercentage(Integer trafficPercentage) { + this.trafficPercentage = trafficPercentage; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ruleId", this.ruleId); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("deploymentId", this.deploymentId); + jsonWriter.writeNumberField("trafficPercentage", this.trafficPercentage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TrafficRoutingRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TrafficRoutingRule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TrafficRoutingRule. + */ + public static TrafficRoutingRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TrafficRoutingRule deserializedTrafficRoutingRule = new TrafficRoutingRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleId".equals(fieldName)) { + deserializedTrafficRoutingRule.ruleId = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedTrafficRoutingRule.description = reader.getString(); + } else if ("deploymentId".equals(fieldName)) { + deserializedTrafficRoutingRule.deploymentId = reader.getString(); + } else if ("trafficPercentage".equals(fieldName)) { + deserializedTrafficRoutingRule.trafficPercentage = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedTrafficRoutingRule; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UnitType.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UnitType.java index 8f8e914eb2b4..2e5e1eff1a91 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UnitType.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UnitType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UpgradeAvailabilityStatus.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UpgradeAvailabilityStatus.java index 443e76e21759..fc504c3cd47d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UpgradeAvailabilityStatus.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UpgradeAvailabilityStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Usage.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Usage.java index 165c86d9ec40..0c1e1c38ee39 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Usage.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Usage.java @@ -1,264 +1,82 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; -import com.azure.core.annotation.Fluent; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; +import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageInner; /** - * The usage data for a usage request. + * An immutable client-side representation of Usage. */ -@Fluent -public final class Usage implements JsonSerializable { - /* - * The unit of the metric. - */ - private UnitType unit; - - /* - * The name information for the metric. - */ - private MetricName name; - - /* - * The quota period used to summarize the usage values. - */ - private String quotaPeriod; - - /* - * Maximum value for this metric. - */ - private Double limit; - - /* - * Current value for this metric. - */ - private Double currentValue; - - /* - * Next reset time for current quota. - */ - private String nextResetTime; - - /* - * Cognitive Services account quota usage status. - */ - private QuotaUsageStatus status; - - /** - * Creates an instance of Usage class. - */ - public Usage() { - } - +public interface Usage { /** - * Get the unit property: The unit of the metric. + * Gets the unit property: The unit of the metric. * * @return the unit value. */ - public UnitType unit() { - return this.unit; - } + UnitType unit(); /** - * Set the unit property: The unit of the metric. - * - * @param unit the unit value to set. - * @return the Usage object itself. - */ - public Usage withUnit(UnitType unit) { - this.unit = unit; - return this; - } - - /** - * Get the name property: The name information for the metric. + * Gets the name property: The name information for the metric. * * @return the name value. */ - public MetricName name() { - return this.name; - } - - /** - * Set the name property: The name information for the metric. - * - * @param name the name value to set. - * @return the Usage object itself. - */ - public Usage withName(MetricName name) { - this.name = name; - return this; - } + MetricName name(); /** - * Get the quotaPeriod property: The quota period used to summarize the usage values. + * Gets the quotaPeriod property: The quota period used to summarize the usage values. * * @return the quotaPeriod value. */ - public String quotaPeriod() { - return this.quotaPeriod; - } - - /** - * Set the quotaPeriod property: The quota period used to summarize the usage values. - * - * @param quotaPeriod the quotaPeriod value to set. - * @return the Usage object itself. - */ - public Usage withQuotaPeriod(String quotaPeriod) { - this.quotaPeriod = quotaPeriod; - return this; - } + String quotaPeriod(); /** - * Get the limit property: Maximum value for this metric. + * Gets the limit property: Maximum value for this metric. * * @return the limit value. */ - public Double limit() { - return this.limit; - } + Double limit(); /** - * Set the limit property: Maximum value for this metric. - * - * @param limit the limit value to set. - * @return the Usage object itself. - */ - public Usage withLimit(Double limit) { - this.limit = limit; - return this; - } - - /** - * Get the currentValue property: Current value for this metric. + * Gets the currentValue property: Current value for this metric. * * @return the currentValue value. */ - public Double currentValue() { - return this.currentValue; - } + Double currentValue(); /** - * Set the currentValue property: Current value for this metric. - * - * @param currentValue the currentValue value to set. - * @return the Usage object itself. - */ - public Usage withCurrentValue(Double currentValue) { - this.currentValue = currentValue; - return this; - } - - /** - * Get the nextResetTime property: Next reset time for current quota. + * Gets the nextResetTime property: Next reset time for current quota. * * @return the nextResetTime value. */ - public String nextResetTime() { - return this.nextResetTime; - } - - /** - * Set the nextResetTime property: Next reset time for current quota. - * - * @param nextResetTime the nextResetTime value to set. - * @return the Usage object itself. - */ - public Usage withNextResetTime(String nextResetTime) { - this.nextResetTime = nextResetTime; - return this; - } + String nextResetTime(); /** - * Get the status property: Cognitive Services account quota usage status. + * Gets the status property: Cognitive Services account quota usage status. * * @return the status value. */ - public QuotaUsageStatus status() { - return this.status; - } + QuotaUsageStatus status(); /** - * Set the status property: Cognitive Services account quota usage status. + * Gets the scopeType property: The scope type of the quota usage. * - * @param status the status value to set. - * @return the Usage object itself. + * @return the scopeType value. */ - public Usage withStatus(QuotaUsageStatus status) { - this.status = status; - return this; - } + QuotaScopeType scopeType(); /** - * Validates the instance. + * Gets the scopeId property: The scope identifier of the quota usage. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the scopeId value. */ - public void validate() { - if (name() != null) { - name().validate(); - } - } + String scopeId(); /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("unit", this.unit == null ? null : this.unit.toString()); - jsonWriter.writeJsonField("name", this.name); - jsonWriter.writeStringField("quotaPeriod", this.quotaPeriod); - jsonWriter.writeNumberField("limit", this.limit); - jsonWriter.writeNumberField("currentValue", this.currentValue); - jsonWriter.writeStringField("nextResetTime", this.nextResetTime); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of Usage from the JsonReader. + * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.UsageInner object. * - * @param jsonReader The JsonReader being read. - * @return An instance of Usage if the JsonReader was pointing to an instance of it, or null if it was pointing to - * JSON null. - * @throws IOException If an error occurs while reading the Usage. + * @return the inner object. */ - public static Usage fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - Usage deserializedUsage = new Usage(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("unit".equals(fieldName)) { - deserializedUsage.unit = UnitType.fromString(reader.getString()); - } else if ("name".equals(fieldName)) { - deserializedUsage.name = MetricName.fromJson(reader); - } else if ("quotaPeriod".equals(fieldName)) { - deserializedUsage.quotaPeriod = reader.getString(); - } else if ("limit".equals(fieldName)) { - deserializedUsage.limit = reader.getNullable(JsonReader::getDouble); - } else if ("currentValue".equals(fieldName)) { - deserializedUsage.currentValue = reader.getNullable(JsonReader::getDouble); - } else if ("nextResetTime".equals(fieldName)) { - deserializedUsage.nextResetTime = reader.getString(); - } else if ("status".equals(fieldName)) { - deserializedUsage.status = QuotaUsageStatus.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedUsage; - }); - } + UsageInner innerModel(); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UsageListResult.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UsageListResult.java index 37d30f5c458c..623496fcd4b7 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UsageListResult.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UsageListResult.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Usages.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Usages.java index ab64b5f76204..654c52be873b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Usages.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/Usages.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -14,7 +14,7 @@ public interface Usages { /** * Get usages for the requested subscription. * - * @param location Resource location. + * @param location The location name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -25,7 +25,7 @@ public interface Usages { /** * Get usages for the requested subscription. * - * @param location Resource location. + * @param location The location name. * @param filter An OData filter expression that describes a subset of usages to return. The supported parameter is * name.value (name of the metric, can have an or of multiple names). * @param context The context to associate with this operation. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserAssignedIdentity.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserAssignedIdentity.java index 9d2da7039fca..075f29630ef0 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserAssignedIdentity.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserAssignedIdentity.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -50,14 +50,6 @@ public String clientId() { return this.clientId; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserOwnedAmlWorkspace.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserOwnedAmlWorkspace.java index 71785704a4ef..0afebb4248e2 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserOwnedAmlWorkspace.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserOwnedAmlWorkspace.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -72,14 +72,6 @@ public UserOwnedAmlWorkspace withIdentityClientId(String identityClientId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserOwnedStorage.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserOwnedStorage.java index 3ce7fa60e8e0..9e44cf8b3880 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserOwnedStorage.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserOwnedStorage.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -72,14 +72,6 @@ public UserOwnedStorage withIdentityClientId(String identityClientId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UsernamePasswordAuthTypeConnectionProperties.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UsernamePasswordAuthTypeConnectionProperties.java index cd0e468a7f26..c01d84e90bee 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UsernamePasswordAuthTypeConnectionProperties.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/UsernamePasswordAuthTypeConnectionProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; @@ -157,18 +157,6 @@ public UsernamePasswordAuthTypeConnectionProperties withTarget(String target) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - if (credentials() != null) { - credentials().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/VersionedAgentReference.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/VersionedAgentReference.java new file mode 100644 index 000000000000..687cb226511c --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/VersionedAgentReference.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Type modeling a reference to a version of an agent definition. + */ +@Fluent +public final class VersionedAgentReference extends AgentReferenceProperties { + /* + * Gets the agent's version (unique for each agent lineage). + */ + private String agentVersion; + + /** + * Creates an instance of VersionedAgentReference class. + */ + public VersionedAgentReference() { + } + + /** + * Get the agentVersion property: Gets the agent's version (unique for each agent lineage). + * + * @return the agentVersion value. + */ + public String agentVersion() { + return this.agentVersion; + } + + /** + * Set the agentVersion property: Gets the agent's version (unique for each agent lineage). + * + * @param agentVersion the agentVersion value to set. + * @return the VersionedAgentReference object itself. + */ + public VersionedAgentReference withAgentVersion(String agentVersion) { + this.agentVersion = agentVersion; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VersionedAgentReference withAgentId(String agentId) { + super.withAgentId(agentId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public VersionedAgentReference withAgentName(String agentName) { + super.withAgentName(agentName); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("agentId", agentId()); + jsonWriter.writeStringField("agentName", agentName()); + jsonWriter.writeStringField("agentVersion", this.agentVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VersionedAgentReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VersionedAgentReference if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the VersionedAgentReference. + */ + public static VersionedAgentReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VersionedAgentReference deserializedVersionedAgentReference = new VersionedAgentReference(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("agentId".equals(fieldName)) { + deserializedVersionedAgentReference.withAgentId(reader.getString()); + } else if ("agentName".equals(fieldName)) { + deserializedVersionedAgentReference.withAgentName(reader.getString()); + } else if ("agentVersion".equals(fieldName)) { + deserializedVersionedAgentReference.agentVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedVersionedAgentReference; + }); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/VirtualNetworkRule.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/VirtualNetworkRule.java index 1f922ca22091..0c0559bffba5 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/VirtualNetworkRule.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/VirtualNetworkRule.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -101,20 +100,6 @@ public VirtualNetworkRule withIgnoreMissingVnetServiceEndpoint(Boolean ignoreMis return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (id() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property id in model VirtualNetworkRule")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(VirtualNetworkRule.class); - /** * {@inheritDoc} */ diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/package-info.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/package-info.java index 107047d542c8..4ecc9d5e0083 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/package-info.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the data models for CognitiveServicesManagementClient. + * Package containing the data models for CognitiveServices. * Cognitive Services Management Client. */ package com.azure.resourcemanager.cognitiveservices.models; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/package-info.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/package-info.java index 2ff5fa21e95f..95b4c2115c10 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/package-info.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the classes for CognitiveServicesManagementClient. + * Package containing the classes for CognitiveServices. * Cognitive Services Management Client. */ package com.azure.resourcemanager.cognitiveservices; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/module-info.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/module-info.java index 947d2ac2b4cf..57a185485cea 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/module-info.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/module-info.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. module com.azure.resourcemanager.cognitiveservices { requires transitive com.azure.core.management; @@ -12,4 +12,5 @@ opens com.azure.resourcemanager.cognitiveservices.fluent.models to com.azure.core; opens com.azure.resourcemanager.cognitiveservices.models to com.azure.core; + opens com.azure.resourcemanager.cognitiveservices.implementation.models to com.azure.core; } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/resources/META-INF/azure-resourcemanager-cognitiveservices_metadata.json b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/resources/META-INF/azure-resourcemanager-cognitiveservices_metadata.json new file mode 100644 index 000000000000..115723a0def6 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/resources/META-INF/azure-resourcemanager-cognitiveservices_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.CognitiveServices":"2026-01-15-preview"},"crossLanguageDefinitions":{"com.azure.resourcemanager.cognitiveservices.fluent.AccountCapabilityHostsClient":"Microsoft.CognitiveServices","com.azure.resourcemanager.cognitiveservices.fluent.AccountCapabilityHostsClient.beginCreateOrUpdate":"Microsoft.CognitiveServices.CapabilityHosts.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.AccountCapabilityHostsClient.beginDelete":"Microsoft.CognitiveServices.CapabilityHosts.delete","com.azure.resourcemanager.cognitiveservices.fluent.AccountCapabilityHostsClient.createOrUpdate":"Microsoft.CognitiveServices.CapabilityHosts.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.AccountCapabilityHostsClient.delete":"Microsoft.CognitiveServices.CapabilityHosts.delete","com.azure.resourcemanager.cognitiveservices.fluent.AccountCapabilityHostsClient.get":"Microsoft.CognitiveServices.CapabilityHosts.get","com.azure.resourcemanager.cognitiveservices.fluent.AccountCapabilityHostsClient.getWithResponse":"Microsoft.CognitiveServices.CapabilityHosts.get","com.azure.resourcemanager.cognitiveservices.fluent.AccountCapabilityHostsClient.list":"Microsoft.CognitiveServices.CapabilityHosts.list","com.azure.resourcemanager.cognitiveservices.fluent.AccountConnectionsClient":"Microsoft.CognitiveServices","com.azure.resourcemanager.cognitiveservices.fluent.AccountConnectionsClient.create":"Microsoft.CognitiveServices.ConnectionPropertiesV2BasicResources.create","com.azure.resourcemanager.cognitiveservices.fluent.AccountConnectionsClient.createWithResponse":"Microsoft.CognitiveServices.ConnectionPropertiesV2BasicResources.create","com.azure.resourcemanager.cognitiveservices.fluent.AccountConnectionsClient.delete":"Microsoft.CognitiveServices.ConnectionPropertiesV2BasicResources.delete","com.azure.resourcemanager.cognitiveservices.fluent.AccountConnectionsClient.deleteWithResponse":"Microsoft.CognitiveServices.ConnectionPropertiesV2BasicResources.delete","com.azure.resourcemanager.cognitiveservices.fluent.AccountConnectionsClient.get":"Microsoft.CognitiveServices.ConnectionPropertiesV2BasicResources.get","com.azure.resourcemanager.cognitiveservices.fluent.AccountConnectionsClient.getWithResponse":"Microsoft.CognitiveServices.ConnectionPropertiesV2BasicResources.get","com.azure.resourcemanager.cognitiveservices.fluent.AccountConnectionsClient.list":"Microsoft.CognitiveServices.ConnectionPropertiesV2BasicResources.list","com.azure.resourcemanager.cognitiveservices.fluent.AccountConnectionsClient.update":"Microsoft.CognitiveServices.ConnectionPropertiesV2BasicResources.update","com.azure.resourcemanager.cognitiveservices.fluent.AccountConnectionsClient.updateWithResponse":"Microsoft.CognitiveServices.ConnectionPropertiesV2BasicResources.update","com.azure.resourcemanager.cognitiveservices.fluent.AccountsClient":"Microsoft.CognitiveServices.Accounts","com.azure.resourcemanager.cognitiveservices.fluent.AccountsClient.beginCreate":"Microsoft.CognitiveServices.Accounts.create","com.azure.resourcemanager.cognitiveservices.fluent.AccountsClient.beginDelete":"Microsoft.CognitiveServices.Accounts.delete","com.azure.resourcemanager.cognitiveservices.fluent.AccountsClient.beginUpdate":"Microsoft.CognitiveServices.Accounts.update","com.azure.resourcemanager.cognitiveservices.fluent.AccountsClient.create":"Microsoft.CognitiveServices.Accounts.create","com.azure.resourcemanager.cognitiveservices.fluent.AccountsClient.delete":"Microsoft.CognitiveServices.Accounts.delete","com.azure.resourcemanager.cognitiveservices.fluent.AccountsClient.getByResourceGroup":"Microsoft.CognitiveServices.Accounts.get","com.azure.resourcemanager.cognitiveservices.fluent.AccountsClient.getByResourceGroupWithResponse":"Microsoft.CognitiveServices.Accounts.get","com.azure.resourcemanager.cognitiveservices.fluent.AccountsClient.list":"Microsoft.CognitiveServices.Accounts.list","com.azure.resourcemanager.cognitiveservices.fluent.AccountsClient.listByResourceGroup":"Microsoft.CognitiveServices.Accounts.listByResourceGroup","com.azure.resourcemanager.cognitiveservices.fluent.AccountsClient.listKeys":"Microsoft.CognitiveServices.Accounts.listKeys","com.azure.resourcemanager.cognitiveservices.fluent.AccountsClient.listKeysWithResponse":"Microsoft.CognitiveServices.Accounts.listKeys","com.azure.resourcemanager.cognitiveservices.fluent.AccountsClient.listModels":"Microsoft.CognitiveServices.Accounts.listModels","com.azure.resourcemanager.cognitiveservices.fluent.AccountsClient.listSkus":"Microsoft.CognitiveServices.Accounts.listSkus","com.azure.resourcemanager.cognitiveservices.fluent.AccountsClient.listSkusWithResponse":"Microsoft.CognitiveServices.Accounts.listSkus","com.azure.resourcemanager.cognitiveservices.fluent.AccountsClient.listUsages":"Microsoft.CognitiveServices.Accounts.listUsages","com.azure.resourcemanager.cognitiveservices.fluent.AccountsClient.listUsagesWithResponse":"Microsoft.CognitiveServices.Accounts.listUsages","com.azure.resourcemanager.cognitiveservices.fluent.AccountsClient.regenerateKey":"Microsoft.CognitiveServices.Accounts.regenerateKey","com.azure.resourcemanager.cognitiveservices.fluent.AccountsClient.regenerateKeyWithResponse":"Microsoft.CognitiveServices.Accounts.regenerateKey","com.azure.resourcemanager.cognitiveservices.fluent.AccountsClient.update":"Microsoft.CognitiveServices.Accounts.update","com.azure.resourcemanager.cognitiveservices.fluent.AgentApplicationsClient":"Microsoft.CognitiveServices.AgentApplications","com.azure.resourcemanager.cognitiveservices.fluent.AgentApplicationsClient.beginCreateOrUpdate":"Microsoft.CognitiveServices.AgentApplications.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.AgentApplicationsClient.beginDelete":"Microsoft.CognitiveServices.AgentApplications.delete","com.azure.resourcemanager.cognitiveservices.fluent.AgentApplicationsClient.createOrUpdate":"Microsoft.CognitiveServices.AgentApplications.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.AgentApplicationsClient.delete":"Microsoft.CognitiveServices.AgentApplications.delete","com.azure.resourcemanager.cognitiveservices.fluent.AgentApplicationsClient.disable":"Microsoft.CognitiveServices.AgentApplications.disable","com.azure.resourcemanager.cognitiveservices.fluent.AgentApplicationsClient.disableWithResponse":"Microsoft.CognitiveServices.AgentApplications.disable","com.azure.resourcemanager.cognitiveservices.fluent.AgentApplicationsClient.enable":"Microsoft.CognitiveServices.AgentApplications.enable","com.azure.resourcemanager.cognitiveservices.fluent.AgentApplicationsClient.enableWithResponse":"Microsoft.CognitiveServices.AgentApplications.enable","com.azure.resourcemanager.cognitiveservices.fluent.AgentApplicationsClient.get":"Microsoft.CognitiveServices.AgentApplications.get","com.azure.resourcemanager.cognitiveservices.fluent.AgentApplicationsClient.getWithResponse":"Microsoft.CognitiveServices.AgentApplications.get","com.azure.resourcemanager.cognitiveservices.fluent.AgentApplicationsClient.list":"Microsoft.CognitiveServices.AgentApplications.list","com.azure.resourcemanager.cognitiveservices.fluent.AgentApplicationsClient.listAgents":"Microsoft.CognitiveServices.AgentApplications.listAgents","com.azure.resourcemanager.cognitiveservices.fluent.AgentApplicationsClient.listAgentsWithResponse":"Microsoft.CognitiveServices.AgentApplications.listAgents","com.azure.resourcemanager.cognitiveservices.fluent.AgentDeploymentsClient":"Microsoft.CognitiveServices","com.azure.resourcemanager.cognitiveservices.fluent.AgentDeploymentsClient.beginCreateOrUpdate":"Microsoft.CognitiveServices.AgentDeploymentResources.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.AgentDeploymentsClient.beginDelete":"Microsoft.CognitiveServices.AgentDeploymentResources.delete","com.azure.resourcemanager.cognitiveservices.fluent.AgentDeploymentsClient.createOrUpdate":"Microsoft.CognitiveServices.AgentDeploymentResources.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.AgentDeploymentsClient.delete":"Microsoft.CognitiveServices.AgentDeploymentResources.delete","com.azure.resourcemanager.cognitiveservices.fluent.AgentDeploymentsClient.get":"Microsoft.CognitiveServices.AgentDeploymentResources.get","com.azure.resourcemanager.cognitiveservices.fluent.AgentDeploymentsClient.getWithResponse":"Microsoft.CognitiveServices.AgentDeploymentResources.get","com.azure.resourcemanager.cognitiveservices.fluent.AgentDeploymentsClient.list":"Microsoft.CognitiveServices.AgentDeploymentResources.list","com.azure.resourcemanager.cognitiveservices.fluent.AgentDeploymentsClient.start":"Microsoft.CognitiveServices.AgentDeploymentResources.start","com.azure.resourcemanager.cognitiveservices.fluent.AgentDeploymentsClient.startWithResponse":"Microsoft.CognitiveServices.AgentDeploymentResources.start","com.azure.resourcemanager.cognitiveservices.fluent.AgentDeploymentsClient.stop":"Microsoft.CognitiveServices.AgentDeploymentResources.stop","com.azure.resourcemanager.cognitiveservices.fluent.AgentDeploymentsClient.stopWithResponse":"Microsoft.CognitiveServices.AgentDeploymentResources.stop","com.azure.resourcemanager.cognitiveservices.fluent.CognitiveServicesManagementClient":"Microsoft.CognitiveServices","com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient":"Microsoft.CognitiveServices.CommitmentPlans","com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient.beginCreateOrUpdateAssociation":"Microsoft.CognitiveServices.CommitmentPlanAccountAssociations.createOrUpdateAssociation","com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient.beginCreateOrUpdatePlan":"Microsoft.CognitiveServices.CommitmentPlanOperationGroup.createOrUpdatePlan","com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient.beginDelete":"Microsoft.CognitiveServices.CommitmentPlans.delete","com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient.beginDeleteAssociation":"Microsoft.CognitiveServices.CommitmentPlanAccountAssociations.deleteAssociation","com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient.beginDeletePlan":"Microsoft.CognitiveServices.CommitmentPlanOperationGroup.deletePlan","com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient.beginUpdatePlan":"Microsoft.CognitiveServices.CommitmentPlanOperationGroup.updatePlan","com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient.createOrUpdate":"Microsoft.CognitiveServices.CommitmentPlans.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient.createOrUpdateAssociation":"Microsoft.CognitiveServices.CommitmentPlanAccountAssociations.createOrUpdateAssociation","com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient.createOrUpdatePlan":"Microsoft.CognitiveServices.CommitmentPlanOperationGroup.createOrUpdatePlan","com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient.createOrUpdateWithResponse":"Microsoft.CognitiveServices.CommitmentPlans.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient.delete":"Microsoft.CognitiveServices.CommitmentPlans.delete","com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient.deleteAssociation":"Microsoft.CognitiveServices.CommitmentPlanAccountAssociations.deleteAssociation","com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient.deletePlan":"Microsoft.CognitiveServices.CommitmentPlanOperationGroup.deletePlan","com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient.get":"Microsoft.CognitiveServices.CommitmentPlans.get","com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient.getAssociation":"Microsoft.CognitiveServices.CommitmentPlanAccountAssociations.getAssociation","com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient.getAssociationWithResponse":"Microsoft.CognitiveServices.CommitmentPlanAccountAssociations.getAssociation","com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient.getByResourceGroup":"Microsoft.CognitiveServices.CommitmentPlanOperationGroup.getPlan","com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient.getByResourceGroupWithResponse":"Microsoft.CognitiveServices.CommitmentPlanOperationGroup.getPlan","com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient.getWithResponse":"Microsoft.CognitiveServices.CommitmentPlans.get","com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient.list":"Microsoft.CognitiveServices.CommitmentPlans.list","com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient.listAssociations":"Microsoft.CognitiveServices.CommitmentPlanAccountAssociations.listAssociations","com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient.listByResourceGroup":"Microsoft.CognitiveServices.CommitmentPlanOperationGroup.listPlansByResourceGroup","com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient.listPlansBySubscription":"Microsoft.CognitiveServices.CommitmentPlanOperationGroup.listPlansBySubscription","com.azure.resourcemanager.cognitiveservices.fluent.CommitmentPlansClient.updatePlan":"Microsoft.CognitiveServices.CommitmentPlanOperationGroup.updatePlan","com.azure.resourcemanager.cognitiveservices.fluent.CommitmentTiersClient":"Microsoft.CognitiveServices","com.azure.resourcemanager.cognitiveservices.fluent.CommitmentTiersClient.list":"Microsoft.CognitiveServices.CommitmentTiersOperationGroup.list","com.azure.resourcemanager.cognitiveservices.fluent.ComputeOperationsClient":"Microsoft.CognitiveServices.ComputeOperations","com.azure.resourcemanager.cognitiveservices.fluent.ComputeOperationsClient.get":"Microsoft.CognitiveServices.ComputeOperations.get","com.azure.resourcemanager.cognitiveservices.fluent.ComputeOperationsClient.getWithResponse":"Microsoft.CognitiveServices.ComputeOperations.get","com.azure.resourcemanager.cognitiveservices.fluent.DefenderForAISettingsClient":"Microsoft.CognitiveServices.DefenderForAISettings","com.azure.resourcemanager.cognitiveservices.fluent.DefenderForAISettingsClient.createOrUpdate":"Microsoft.CognitiveServices.DefenderForAISettings.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.DefenderForAISettingsClient.createOrUpdateWithResponse":"Microsoft.CognitiveServices.DefenderForAISettings.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.DefenderForAISettingsClient.get":"Microsoft.CognitiveServices.DefenderForAISettings.get","com.azure.resourcemanager.cognitiveservices.fluent.DefenderForAISettingsClient.getWithResponse":"Microsoft.CognitiveServices.DefenderForAISettings.get","com.azure.resourcemanager.cognitiveservices.fluent.DefenderForAISettingsClient.list":"Microsoft.CognitiveServices.DefenderForAISettings.list","com.azure.resourcemanager.cognitiveservices.fluent.DefenderForAISettingsClient.update":"Microsoft.CognitiveServices.DefenderForAISettings.update","com.azure.resourcemanager.cognitiveservices.fluent.DefenderForAISettingsClient.updateWithResponse":"Microsoft.CognitiveServices.DefenderForAISettings.update","com.azure.resourcemanager.cognitiveservices.fluent.DeletedAccountsClient":"Microsoft.CognitiveServices.DeletedAccounts","com.azure.resourcemanager.cognitiveservices.fluent.DeletedAccountsClient.beginPurge":"Microsoft.CognitiveServices.DeletedAccounts.purge","com.azure.resourcemanager.cognitiveservices.fluent.DeletedAccountsClient.get":"Microsoft.CognitiveServices.DeletedAccounts.get","com.azure.resourcemanager.cognitiveservices.fluent.DeletedAccountsClient.getWithResponse":"Microsoft.CognitiveServices.DeletedAccounts.get","com.azure.resourcemanager.cognitiveservices.fluent.DeletedAccountsClient.list":"Microsoft.CognitiveServices.DeletedAccountsOperationGroup.list","com.azure.resourcemanager.cognitiveservices.fluent.DeletedAccountsClient.purge":"Microsoft.CognitiveServices.DeletedAccounts.purge","com.azure.resourcemanager.cognitiveservices.fluent.DeploymentsClient":"Microsoft.CognitiveServices.Deployments","com.azure.resourcemanager.cognitiveservices.fluent.DeploymentsClient.beginCreateOrUpdate":"Microsoft.CognitiveServices.Deployments.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.DeploymentsClient.beginDelete":"Microsoft.CognitiveServices.Deployments.delete","com.azure.resourcemanager.cognitiveservices.fluent.DeploymentsClient.beginUpdate":"Microsoft.CognitiveServices.Deployments.update","com.azure.resourcemanager.cognitiveservices.fluent.DeploymentsClient.createOrUpdate":"Microsoft.CognitiveServices.Deployments.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.DeploymentsClient.delete":"Microsoft.CognitiveServices.Deployments.delete","com.azure.resourcemanager.cognitiveservices.fluent.DeploymentsClient.get":"Microsoft.CognitiveServices.Deployments.get","com.azure.resourcemanager.cognitiveservices.fluent.DeploymentsClient.getWithResponse":"Microsoft.CognitiveServices.Deployments.get","com.azure.resourcemanager.cognitiveservices.fluent.DeploymentsClient.list":"Microsoft.CognitiveServices.Deployments.list","com.azure.resourcemanager.cognitiveservices.fluent.DeploymentsClient.listSkus":"Microsoft.CognitiveServices.Deployments.listSkus","com.azure.resourcemanager.cognitiveservices.fluent.DeploymentsClient.pause":"Microsoft.CognitiveServices.Deployments.pause","com.azure.resourcemanager.cognitiveservices.fluent.DeploymentsClient.pauseWithResponse":"Microsoft.CognitiveServices.Deployments.pause","com.azure.resourcemanager.cognitiveservices.fluent.DeploymentsClient.resume":"Microsoft.CognitiveServices.Deployments.resume","com.azure.resourcemanager.cognitiveservices.fluent.DeploymentsClient.resumeWithResponse":"Microsoft.CognitiveServices.Deployments.resume","com.azure.resourcemanager.cognitiveservices.fluent.DeploymentsClient.update":"Microsoft.CognitiveServices.Deployments.update","com.azure.resourcemanager.cognitiveservices.fluent.EncryptionScopesClient":"Microsoft.CognitiveServices.EncryptionScopes","com.azure.resourcemanager.cognitiveservices.fluent.EncryptionScopesClient.beginDelete":"Microsoft.CognitiveServices.EncryptionScopes.delete","com.azure.resourcemanager.cognitiveservices.fluent.EncryptionScopesClient.createOrUpdate":"Microsoft.CognitiveServices.EncryptionScopes.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.EncryptionScopesClient.createOrUpdateWithResponse":"Microsoft.CognitiveServices.EncryptionScopes.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.EncryptionScopesClient.delete":"Microsoft.CognitiveServices.EncryptionScopes.delete","com.azure.resourcemanager.cognitiveservices.fluent.EncryptionScopesClient.get":"Microsoft.CognitiveServices.EncryptionScopes.get","com.azure.resourcemanager.cognitiveservices.fluent.EncryptionScopesClient.getWithResponse":"Microsoft.CognitiveServices.EncryptionScopes.get","com.azure.resourcemanager.cognitiveservices.fluent.EncryptionScopesClient.list":"Microsoft.CognitiveServices.EncryptionScopes.list","com.azure.resourcemanager.cognitiveservices.fluent.LocationBasedModelCapacitiesClient":"Microsoft.CognitiveServices","com.azure.resourcemanager.cognitiveservices.fluent.LocationBasedModelCapacitiesClient.list":"Microsoft.CognitiveServices.LocationBasedModelCapacitiesOperationGroup.list","com.azure.resourcemanager.cognitiveservices.fluent.ManagedNetworkProvisionsClient":"Microsoft.CognitiveServices","com.azure.resourcemanager.cognitiveservices.fluent.ManagedNetworkProvisionsClient.beginProvisionManagedNetwork":"Microsoft.CognitiveServices.ManagedNetworkSettingsPropertiesBasicResources.provisionManagedNetwork","com.azure.resourcemanager.cognitiveservices.fluent.ManagedNetworkProvisionsClient.provisionManagedNetwork":"Microsoft.CognitiveServices.ManagedNetworkSettingsPropertiesBasicResources.provisionManagedNetwork","com.azure.resourcemanager.cognitiveservices.fluent.ManagedNetworkSettingsOperationsClient":"Microsoft.CognitiveServices","com.azure.resourcemanager.cognitiveservices.fluent.ManagedNetworkSettingsOperationsClient.beginDelete":"Microsoft.CognitiveServices.ManagedNetworkSettingsPropertiesBasicResources.delete","com.azure.resourcemanager.cognitiveservices.fluent.ManagedNetworkSettingsOperationsClient.beginPatch":"Microsoft.CognitiveServices.ManagedNetworkSettingsPropertiesBasicResources.patch","com.azure.resourcemanager.cognitiveservices.fluent.ManagedNetworkSettingsOperationsClient.beginPut":"Microsoft.CognitiveServices.ManagedNetworkSettingsPropertiesBasicResources.put","com.azure.resourcemanager.cognitiveservices.fluent.ManagedNetworkSettingsOperationsClient.delete":"Microsoft.CognitiveServices.ManagedNetworkSettingsPropertiesBasicResources.delete","com.azure.resourcemanager.cognitiveservices.fluent.ManagedNetworkSettingsOperationsClient.get":"Microsoft.CognitiveServices.ManagedNetworkSettingsPropertiesBasicResources.get","com.azure.resourcemanager.cognitiveservices.fluent.ManagedNetworkSettingsOperationsClient.getWithResponse":"Microsoft.CognitiveServices.ManagedNetworkSettingsPropertiesBasicResources.get","com.azure.resourcemanager.cognitiveservices.fluent.ManagedNetworkSettingsOperationsClient.list":"Microsoft.CognitiveServices.ManagedNetworkSettingsPropertiesBasicResources.list","com.azure.resourcemanager.cognitiveservices.fluent.ManagedNetworkSettingsOperationsClient.patch":"Microsoft.CognitiveServices.ManagedNetworkSettingsPropertiesBasicResources.patch","com.azure.resourcemanager.cognitiveservices.fluent.ManagedNetworkSettingsOperationsClient.put":"Microsoft.CognitiveServices.ManagedNetworkSettingsPropertiesBasicResources.put","com.azure.resourcemanager.cognitiveservices.fluent.ModelCapacitiesClient":"Microsoft.CognitiveServices","com.azure.resourcemanager.cognitiveservices.fluent.ModelCapacitiesClient.list":"Microsoft.CognitiveServices.ModelCapacitiesOperationGroup.list","com.azure.resourcemanager.cognitiveservices.fluent.ModelsClient":"Microsoft.CognitiveServices","com.azure.resourcemanager.cognitiveservices.fluent.ModelsClient.list":"Microsoft.CognitiveServices.ModelsOperationGroup.list","com.azure.resourcemanager.cognitiveservices.fluent.NetworkSecurityPerimeterConfigurationsClient":"Microsoft.CognitiveServices.NetworkSecurityPerimeterConfigurations","com.azure.resourcemanager.cognitiveservices.fluent.NetworkSecurityPerimeterConfigurationsClient.beginReconcile":"Microsoft.CognitiveServices.NetworkSecurityPerimeterConfigurations.reconcile","com.azure.resourcemanager.cognitiveservices.fluent.NetworkSecurityPerimeterConfigurationsClient.get":"Microsoft.CognitiveServices.NetworkSecurityPerimeterConfigurations.get","com.azure.resourcemanager.cognitiveservices.fluent.NetworkSecurityPerimeterConfigurationsClient.getWithResponse":"Microsoft.CognitiveServices.NetworkSecurityPerimeterConfigurations.get","com.azure.resourcemanager.cognitiveservices.fluent.NetworkSecurityPerimeterConfigurationsClient.list":"Microsoft.CognitiveServices.NetworkSecurityPerimeterConfigurations.list","com.azure.resourcemanager.cognitiveservices.fluent.NetworkSecurityPerimeterConfigurationsClient.reconcile":"Microsoft.CognitiveServices.NetworkSecurityPerimeterConfigurations.reconcile","com.azure.resourcemanager.cognitiveservices.fluent.OperationsClient":"Microsoft.CognitiveServices.Operations","com.azure.resourcemanager.cognitiveservices.fluent.OperationsClient.list":"Azure.ResourceManager.Operations.list","com.azure.resourcemanager.cognitiveservices.fluent.OutboundRulesClient":"Microsoft.CognitiveServices","com.azure.resourcemanager.cognitiveservices.fluent.OutboundRulesClient.beginCreateOrUpdate":"Microsoft.CognitiveServices.OutboundRuleBasicResources.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.OutboundRulesClient.beginDelete":"Microsoft.CognitiveServices.OutboundRuleBasicResources.delete","com.azure.resourcemanager.cognitiveservices.fluent.OutboundRulesClient.createOrUpdate":"Microsoft.CognitiveServices.OutboundRuleBasicResources.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.OutboundRulesClient.delete":"Microsoft.CognitiveServices.OutboundRuleBasicResources.delete","com.azure.resourcemanager.cognitiveservices.fluent.OutboundRulesClient.get":"Microsoft.CognitiveServices.OutboundRuleBasicResources.get","com.azure.resourcemanager.cognitiveservices.fluent.OutboundRulesClient.getWithResponse":"Microsoft.CognitiveServices.OutboundRuleBasicResources.get","com.azure.resourcemanager.cognitiveservices.fluent.OutboundRulesClient.list":"Microsoft.CognitiveServices.OutboundRuleBasicResources.list","com.azure.resourcemanager.cognitiveservices.fluent.OutboundRulesOperationsClient":"Microsoft.CognitiveServices","com.azure.resourcemanager.cognitiveservices.fluent.OutboundRulesOperationsClient.beginPost":"Microsoft.CognitiveServices.ManagedNetworkSettingsPropertiesBasicResources.post","com.azure.resourcemanager.cognitiveservices.fluent.OutboundRulesOperationsClient.post":"Microsoft.CognitiveServices.ManagedNetworkSettingsPropertiesBasicResources.post","com.azure.resourcemanager.cognitiveservices.fluent.PrivateEndpointConnectionsClient":"Microsoft.CognitiveServices.PrivateEndpointConnections","com.azure.resourcemanager.cognitiveservices.fluent.PrivateEndpointConnectionsClient.beginCreateOrUpdate":"Microsoft.CognitiveServices.PrivateEndpointConnections.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.PrivateEndpointConnectionsClient.beginDelete":"Microsoft.CognitiveServices.PrivateEndpointConnections.delete","com.azure.resourcemanager.cognitiveservices.fluent.PrivateEndpointConnectionsClient.createOrUpdate":"Microsoft.CognitiveServices.PrivateEndpointConnections.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.PrivateEndpointConnectionsClient.delete":"Microsoft.CognitiveServices.PrivateEndpointConnections.delete","com.azure.resourcemanager.cognitiveservices.fluent.PrivateEndpointConnectionsClient.get":"Microsoft.CognitiveServices.PrivateEndpointConnections.get","com.azure.resourcemanager.cognitiveservices.fluent.PrivateEndpointConnectionsClient.getWithResponse":"Microsoft.CognitiveServices.PrivateEndpointConnections.get","com.azure.resourcemanager.cognitiveservices.fluent.PrivateEndpointConnectionsClient.list":"Microsoft.CognitiveServices.PrivateEndpointConnections.list","com.azure.resourcemanager.cognitiveservices.fluent.PrivateEndpointConnectionsClient.listWithResponse":"Microsoft.CognitiveServices.PrivateEndpointConnections.list","com.azure.resourcemanager.cognitiveservices.fluent.PrivateLinkResourcesClient":"Microsoft.CognitiveServices","com.azure.resourcemanager.cognitiveservices.fluent.PrivateLinkResourcesClient.list":"Microsoft.CognitiveServices.Accounts.privateLinkResourcesList","com.azure.resourcemanager.cognitiveservices.fluent.PrivateLinkResourcesClient.listWithResponse":"Microsoft.CognitiveServices.Accounts.privateLinkResourcesList","com.azure.resourcemanager.cognitiveservices.fluent.ProjectCapabilityHostsClient":"Microsoft.CognitiveServices.ProjectCapabilityHosts","com.azure.resourcemanager.cognitiveservices.fluent.ProjectCapabilityHostsClient.beginCreateOrUpdate":"Microsoft.CognitiveServices.ProjectCapabilityHosts.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.ProjectCapabilityHostsClient.beginDelete":"Microsoft.CognitiveServices.ProjectCapabilityHosts.delete","com.azure.resourcemanager.cognitiveservices.fluent.ProjectCapabilityHostsClient.createOrUpdate":"Microsoft.CognitiveServices.ProjectCapabilityHosts.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.ProjectCapabilityHostsClient.delete":"Microsoft.CognitiveServices.ProjectCapabilityHosts.delete","com.azure.resourcemanager.cognitiveservices.fluent.ProjectCapabilityHostsClient.get":"Microsoft.CognitiveServices.ProjectCapabilityHosts.get","com.azure.resourcemanager.cognitiveservices.fluent.ProjectCapabilityHostsClient.getWithResponse":"Microsoft.CognitiveServices.ProjectCapabilityHosts.get","com.azure.resourcemanager.cognitiveservices.fluent.ProjectCapabilityHostsClient.list":"Microsoft.CognitiveServices.ProjectCapabilityHosts.list","com.azure.resourcemanager.cognitiveservices.fluent.ProjectConnectionsClient":"Microsoft.CognitiveServices.ProjectConnections","com.azure.resourcemanager.cognitiveservices.fluent.ProjectConnectionsClient.create":"Microsoft.CognitiveServices.ProjectConnections.create","com.azure.resourcemanager.cognitiveservices.fluent.ProjectConnectionsClient.createWithResponse":"Microsoft.CognitiveServices.ProjectConnections.create","com.azure.resourcemanager.cognitiveservices.fluent.ProjectConnectionsClient.delete":"Microsoft.CognitiveServices.ProjectConnections.delete","com.azure.resourcemanager.cognitiveservices.fluent.ProjectConnectionsClient.deleteWithResponse":"Microsoft.CognitiveServices.ProjectConnections.delete","com.azure.resourcemanager.cognitiveservices.fluent.ProjectConnectionsClient.get":"Microsoft.CognitiveServices.ProjectConnections.get","com.azure.resourcemanager.cognitiveservices.fluent.ProjectConnectionsClient.getWithResponse":"Microsoft.CognitiveServices.ProjectConnections.get","com.azure.resourcemanager.cognitiveservices.fluent.ProjectConnectionsClient.list":"Microsoft.CognitiveServices.ProjectConnections.list","com.azure.resourcemanager.cognitiveservices.fluent.ProjectConnectionsClient.update":"Microsoft.CognitiveServices.ProjectConnections.update","com.azure.resourcemanager.cognitiveservices.fluent.ProjectConnectionsClient.updateWithResponse":"Microsoft.CognitiveServices.ProjectConnections.update","com.azure.resourcemanager.cognitiveservices.fluent.ProjectsClient":"Microsoft.CognitiveServices.Projects","com.azure.resourcemanager.cognitiveservices.fluent.ProjectsClient.beginCreate":"Microsoft.CognitiveServices.Projects.create","com.azure.resourcemanager.cognitiveservices.fluent.ProjectsClient.beginDelete":"Microsoft.CognitiveServices.Projects.delete","com.azure.resourcemanager.cognitiveservices.fluent.ProjectsClient.beginUpdate":"Microsoft.CognitiveServices.Projects.update","com.azure.resourcemanager.cognitiveservices.fluent.ProjectsClient.create":"Microsoft.CognitiveServices.Projects.create","com.azure.resourcemanager.cognitiveservices.fluent.ProjectsClient.delete":"Microsoft.CognitiveServices.Projects.delete","com.azure.resourcemanager.cognitiveservices.fluent.ProjectsClient.get":"Microsoft.CognitiveServices.Projects.get","com.azure.resourcemanager.cognitiveservices.fluent.ProjectsClient.getWithResponse":"Microsoft.CognitiveServices.Projects.get","com.azure.resourcemanager.cognitiveservices.fluent.ProjectsClient.list":"Microsoft.CognitiveServices.Projects.list","com.azure.resourcemanager.cognitiveservices.fluent.ProjectsClient.update":"Microsoft.CognitiveServices.Projects.update","com.azure.resourcemanager.cognitiveservices.fluent.QuotaTiersClient":"Microsoft.CognitiveServices.QuotaTiers","com.azure.resourcemanager.cognitiveservices.fluent.QuotaTiersClient.createOrUpdate":"Microsoft.CognitiveServices.QuotaTiers.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.QuotaTiersClient.createOrUpdateWithResponse":"Microsoft.CognitiveServices.QuotaTiers.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.QuotaTiersClient.get":"Microsoft.CognitiveServices.QuotaTiers.get","com.azure.resourcemanager.cognitiveservices.fluent.QuotaTiersClient.getWithResponse":"Microsoft.CognitiveServices.QuotaTiers.get","com.azure.resourcemanager.cognitiveservices.fluent.QuotaTiersClient.list":"Microsoft.CognitiveServices.QuotaTiers.listBySubscription","com.azure.resourcemanager.cognitiveservices.fluent.QuotaTiersClient.update":"Microsoft.CognitiveServices.QuotaTiers.update","com.azure.resourcemanager.cognitiveservices.fluent.QuotaTiersClient.updateWithResponse":"Microsoft.CognitiveServices.QuotaTiers.update","com.azure.resourcemanager.cognitiveservices.fluent.RaiBlocklistItemsClient":"Microsoft.CognitiveServices.RaiBlocklistItems","com.azure.resourcemanager.cognitiveservices.fluent.RaiBlocklistItemsClient.batchAdd":"Microsoft.CognitiveServices.RaiBlocklists.batchAdd","com.azure.resourcemanager.cognitiveservices.fluent.RaiBlocklistItemsClient.batchAddWithResponse":"Microsoft.CognitiveServices.RaiBlocklists.batchAdd","com.azure.resourcemanager.cognitiveservices.fluent.RaiBlocklistItemsClient.batchDelete":"Microsoft.CognitiveServices.RaiBlocklists.batchDelete","com.azure.resourcemanager.cognitiveservices.fluent.RaiBlocklistItemsClient.batchDeleteWithResponse":"Microsoft.CognitiveServices.RaiBlocklists.batchDelete","com.azure.resourcemanager.cognitiveservices.fluent.RaiBlocklistItemsClient.beginDelete":"Microsoft.CognitiveServices.RaiBlocklistItems.delete","com.azure.resourcemanager.cognitiveservices.fluent.RaiBlocklistItemsClient.createOrUpdate":"Microsoft.CognitiveServices.RaiBlocklistItems.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.RaiBlocklistItemsClient.createOrUpdateWithResponse":"Microsoft.CognitiveServices.RaiBlocklistItems.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.RaiBlocklistItemsClient.delete":"Microsoft.CognitiveServices.RaiBlocklistItems.delete","com.azure.resourcemanager.cognitiveservices.fluent.RaiBlocklistItemsClient.get":"Microsoft.CognitiveServices.RaiBlocklistItems.get","com.azure.resourcemanager.cognitiveservices.fluent.RaiBlocklistItemsClient.getWithResponse":"Microsoft.CognitiveServices.RaiBlocklistItems.get","com.azure.resourcemanager.cognitiveservices.fluent.RaiBlocklistItemsClient.list":"Microsoft.CognitiveServices.RaiBlocklistItems.list","com.azure.resourcemanager.cognitiveservices.fluent.RaiBlocklistsClient":"Microsoft.CognitiveServices.RaiBlocklists","com.azure.resourcemanager.cognitiveservices.fluent.RaiBlocklistsClient.beginDelete":"Microsoft.CognitiveServices.RaiBlocklists.delete","com.azure.resourcemanager.cognitiveservices.fluent.RaiBlocklistsClient.createOrUpdate":"Microsoft.CognitiveServices.RaiBlocklists.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.RaiBlocklistsClient.createOrUpdateWithResponse":"Microsoft.CognitiveServices.RaiBlocklists.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.RaiBlocklistsClient.delete":"Microsoft.CognitiveServices.RaiBlocklists.delete","com.azure.resourcemanager.cognitiveservices.fluent.RaiBlocklistsClient.get":"Microsoft.CognitiveServices.RaiBlocklists.get","com.azure.resourcemanager.cognitiveservices.fluent.RaiBlocklistsClient.getWithResponse":"Microsoft.CognitiveServices.RaiBlocklists.get","com.azure.resourcemanager.cognitiveservices.fluent.RaiBlocklistsClient.list":"Microsoft.CognitiveServices.RaiBlocklists.list","com.azure.resourcemanager.cognitiveservices.fluent.RaiContentFiltersClient":"Microsoft.CognitiveServices.RaiContentFilters","com.azure.resourcemanager.cognitiveservices.fluent.RaiContentFiltersClient.get":"Microsoft.CognitiveServices.RaiContentFilters.get","com.azure.resourcemanager.cognitiveservices.fluent.RaiContentFiltersClient.getWithResponse":"Microsoft.CognitiveServices.RaiContentFilters.get","com.azure.resourcemanager.cognitiveservices.fluent.RaiContentFiltersClient.list":"Microsoft.CognitiveServices.RaiContentFilters.list","com.azure.resourcemanager.cognitiveservices.fluent.RaiExternalSafetyProvidersClient":"Microsoft.CognitiveServices","com.azure.resourcemanager.cognitiveservices.fluent.RaiExternalSafetyProvidersClient.beginDelete":"Microsoft.CognitiveServices.RaiExternalSafetyProviderSchemas.delete","com.azure.resourcemanager.cognitiveservices.fluent.RaiExternalSafetyProvidersClient.createOrUpdate":"Microsoft.CognitiveServices.RaiExternalSafetyProviderSchemas.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.RaiExternalSafetyProvidersClient.createOrUpdateWithResponse":"Microsoft.CognitiveServices.RaiExternalSafetyProviderSchemas.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.RaiExternalSafetyProvidersClient.delete":"Microsoft.CognitiveServices.RaiExternalSafetyProviderSchemas.delete","com.azure.resourcemanager.cognitiveservices.fluent.RaiExternalSafetyProvidersClient.get":"Microsoft.CognitiveServices.RaiExternalSafetyProviderSchemas.get","com.azure.resourcemanager.cognitiveservices.fluent.RaiExternalSafetyProvidersClient.getWithResponse":"Microsoft.CognitiveServices.RaiExternalSafetyProviderSchemas.get","com.azure.resourcemanager.cognitiveservices.fluent.RaiExternalSafetyProvidersOperationsClient":"Microsoft.CognitiveServices","com.azure.resourcemanager.cognitiveservices.fluent.RaiExternalSafetyProvidersOperationsClient.list":"Microsoft.CognitiveServices.RaiExternalSafetyProviderSchemas.list","com.azure.resourcemanager.cognitiveservices.fluent.RaiPoliciesClient":"Microsoft.CognitiveServices.RaiPolicies","com.azure.resourcemanager.cognitiveservices.fluent.RaiPoliciesClient.beginDelete":"Microsoft.CognitiveServices.RaiPolicies.delete","com.azure.resourcemanager.cognitiveservices.fluent.RaiPoliciesClient.createOrUpdate":"Microsoft.CognitiveServices.RaiPolicies.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.RaiPoliciesClient.createOrUpdateWithResponse":"Microsoft.CognitiveServices.RaiPolicies.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.RaiPoliciesClient.delete":"Microsoft.CognitiveServices.RaiPolicies.delete","com.azure.resourcemanager.cognitiveservices.fluent.RaiPoliciesClient.get":"Microsoft.CognitiveServices.RaiPolicies.get","com.azure.resourcemanager.cognitiveservices.fluent.RaiPoliciesClient.getWithResponse":"Microsoft.CognitiveServices.RaiPolicies.get","com.azure.resourcemanager.cognitiveservices.fluent.RaiPoliciesClient.list":"Microsoft.CognitiveServices.RaiPolicies.list","com.azure.resourcemanager.cognitiveservices.fluent.RaiToolLabelsClient":"Microsoft.CognitiveServices.RaiToolLabels","com.azure.resourcemanager.cognitiveservices.fluent.RaiToolLabelsClient.beginDelete":"Microsoft.CognitiveServices.RaiToolLabels.delete","com.azure.resourcemanager.cognitiveservices.fluent.RaiToolLabelsClient.createOrUpdate":"Microsoft.CognitiveServices.RaiToolLabels.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.RaiToolLabelsClient.createOrUpdateWithResponse":"Microsoft.CognitiveServices.RaiToolLabels.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.RaiToolLabelsClient.delete":"Microsoft.CognitiveServices.RaiToolLabels.delete","com.azure.resourcemanager.cognitiveservices.fluent.RaiToolLabelsClient.get":"Microsoft.CognitiveServices.RaiToolLabels.get","com.azure.resourcemanager.cognitiveservices.fluent.RaiToolLabelsClient.getWithResponse":"Microsoft.CognitiveServices.RaiToolLabels.get","com.azure.resourcemanager.cognitiveservices.fluent.RaiToolLabelsClient.list":"Microsoft.CognitiveServices.RaiToolLabels.list","com.azure.resourcemanager.cognitiveservices.fluent.RaiTopicsClient":"Microsoft.CognitiveServices.RaiTopics","com.azure.resourcemanager.cognitiveservices.fluent.RaiTopicsClient.beginDelete":"Microsoft.CognitiveServices.RaiTopics.delete","com.azure.resourcemanager.cognitiveservices.fluent.RaiTopicsClient.createOrUpdate":"Microsoft.CognitiveServices.RaiTopics.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.RaiTopicsClient.createOrUpdateWithResponse":"Microsoft.CognitiveServices.RaiTopics.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.RaiTopicsClient.delete":"Microsoft.CognitiveServices.RaiTopics.delete","com.azure.resourcemanager.cognitiveservices.fluent.RaiTopicsClient.get":"Microsoft.CognitiveServices.RaiTopics.get","com.azure.resourcemanager.cognitiveservices.fluent.RaiTopicsClient.getWithResponse":"Microsoft.CognitiveServices.RaiTopics.get","com.azure.resourcemanager.cognitiveservices.fluent.RaiTopicsClient.list":"Microsoft.CognitiveServices.RaiTopics.list","com.azure.resourcemanager.cognitiveservices.fluent.ResourceProvidersClient":"Microsoft.CognitiveServices","com.azure.resourcemanager.cognitiveservices.fluent.ResourceProvidersClient.calculateModelCapacity":"Microsoft.CognitiveServices.calculateModelCapacity","com.azure.resourcemanager.cognitiveservices.fluent.ResourceProvidersClient.calculateModelCapacityWithResponse":"Microsoft.CognitiveServices.calculateModelCapacity","com.azure.resourcemanager.cognitiveservices.fluent.ResourceProvidersClient.checkDomainAvailability":"Microsoft.CognitiveServices.checkDomainAvailability","com.azure.resourcemanager.cognitiveservices.fluent.ResourceProvidersClient.checkDomainAvailabilityWithResponse":"Microsoft.CognitiveServices.checkDomainAvailability","com.azure.resourcemanager.cognitiveservices.fluent.ResourceProvidersClient.checkSkuAvailability":"Microsoft.CognitiveServices.checkSkuAvailability","com.azure.resourcemanager.cognitiveservices.fluent.ResourceProvidersClient.checkSkuAvailabilityWithResponse":"Microsoft.CognitiveServices.checkSkuAvailability","com.azure.resourcemanager.cognitiveservices.fluent.ResourceSkusClient":"Microsoft.CognitiveServices","com.azure.resourcemanager.cognitiveservices.fluent.ResourceSkusClient.list":"Microsoft.CognitiveServices.ResourceSkusOperationGroup.list","com.azure.resourcemanager.cognitiveservices.fluent.SubscriptionRaiPoliciesClient":"Microsoft.CognitiveServices.SubscriptionRaiPolicy","com.azure.resourcemanager.cognitiveservices.fluent.SubscriptionRaiPoliciesClient.beginDelete":"Microsoft.CognitiveServices.SubscriptionRaiPolicy.delete","com.azure.resourcemanager.cognitiveservices.fluent.SubscriptionRaiPoliciesClient.createOrUpdate":"Microsoft.CognitiveServices.SubscriptionRaiPolicy.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.SubscriptionRaiPoliciesClient.createOrUpdateWithResponse":"Microsoft.CognitiveServices.SubscriptionRaiPolicy.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.SubscriptionRaiPoliciesClient.delete":"Microsoft.CognitiveServices.SubscriptionRaiPolicy.delete","com.azure.resourcemanager.cognitiveservices.fluent.SubscriptionRaiPoliciesClient.get":"Microsoft.CognitiveServices.SubscriptionRaiPolicy.get","com.azure.resourcemanager.cognitiveservices.fluent.SubscriptionRaiPoliciesClient.getWithResponse":"Microsoft.CognitiveServices.SubscriptionRaiPolicy.get","com.azure.resourcemanager.cognitiveservices.fluent.TestRaiExternalSafetyProvidersClient":"Microsoft.CognitiveServices","com.azure.resourcemanager.cognitiveservices.fluent.TestRaiExternalSafetyProvidersClient.createOrUpdate":"Microsoft.CognitiveServices.Accounts.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.TestRaiExternalSafetyProvidersClient.createOrUpdateWithResponse":"Microsoft.CognitiveServices.Accounts.createOrUpdate","com.azure.resourcemanager.cognitiveservices.fluent.UsagesClient":"Microsoft.CognitiveServices","com.azure.resourcemanager.cognitiveservices.fluent.UsagesClient.list":"Microsoft.CognitiveServices.UsagesOperationGroup.list","com.azure.resourcemanager.cognitiveservices.fluent.models.AccountInner":"Microsoft.CognitiveServices.Account","com.azure.resourcemanager.cognitiveservices.fluent.models.AccountModelInner":"Microsoft.CognitiveServices.AccountModel","com.azure.resourcemanager.cognitiveservices.fluent.models.AccountSkuListResultInner":"Microsoft.CognitiveServices.AccountSkuListResult","com.azure.resourcemanager.cognitiveservices.fluent.models.AgentApplicationInner":"Microsoft.CognitiveServices.AgentApplication","com.azure.resourcemanager.cognitiveservices.fluent.models.AgentDeploymentInner":"Microsoft.CognitiveServices.AgentDeployment","com.azure.resourcemanager.cognitiveservices.fluent.models.AgentReferenceResourceArmPaginatedResultInner":"Microsoft.CognitiveServices.AgentReferenceResourceArmPaginatedResult","com.azure.resourcemanager.cognitiveservices.fluent.models.ApiKeysInner":"Microsoft.CognitiveServices.ApiKeys","com.azure.resourcemanager.cognitiveservices.fluent.models.CalculateModelCapacityResultInner":"Microsoft.CognitiveServices.CalculateModelCapacityResult","com.azure.resourcemanager.cognitiveservices.fluent.models.CapabilityHostInner":"Microsoft.CognitiveServices.CapabilityHost","com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanAccountAssociationInner":"Microsoft.CognitiveServices.CommitmentPlanAccountAssociation","com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanAccountAssociationProperties":"Microsoft.CognitiveServices.CommitmentPlanAccountAssociationProperties","com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentPlanInner":"Microsoft.CognitiveServices.CommitmentPlan","com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentTierInner":"Microsoft.CognitiveServices.CommitmentTier","com.azure.resourcemanager.cognitiveservices.fluent.models.ComputeOperationStatusInner":"Microsoft.CognitiveServices.ComputeOperationStatus","com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner":"Microsoft.CognitiveServices.ConnectionPropertiesV2BasicResource","com.azure.resourcemanager.cognitiveservices.fluent.models.DefenderForAISettingInner":"Microsoft.CognitiveServices.DefenderForAISetting","com.azure.resourcemanager.cognitiveservices.fluent.models.DefenderForAISettingProperties":"Microsoft.CognitiveServices.DefenderForAISettingProperties","com.azure.resourcemanager.cognitiveservices.fluent.models.DeploymentInner":"Microsoft.CognitiveServices.Deployment","com.azure.resourcemanager.cognitiveservices.fluent.models.DomainAvailabilityInner":"Microsoft.CognitiveServices.DomainAvailability","com.azure.resourcemanager.cognitiveservices.fluent.models.EncryptionScopeInner":"Microsoft.CognitiveServices.EncryptionScope","com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkProvisionStatusInner":"Microsoft.CognitiveServices.ManagedNetworkProvisionStatus","com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsBasicResourceInner":"Microsoft.CognitiveServices.ManagedNetworkSettingsBasicResource","com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsInner":"Microsoft.CognitiveServices.ManagedNetworkSettings","com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsPropertiesBasicResourceInner":"Microsoft.CognitiveServices.ManagedNetworkSettingsPropertiesBasicResource","com.azure.resourcemanager.cognitiveservices.fluent.models.ModelCapacityListResultValueItemInner":"Microsoft.CognitiveServices.ModelCapacityListResultValueItem","com.azure.resourcemanager.cognitiveservices.fluent.models.ModelInner":"Microsoft.CognitiveServices.Model","com.azure.resourcemanager.cognitiveservices.fluent.models.NetworkSecurityPerimeterConfigurationInner":"Microsoft.CognitiveServices.NetworkSecurityPerimeterConfiguration","com.azure.resourcemanager.cognitiveservices.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.cognitiveservices.fluent.models.OutboundRuleBasicResourceInner":"Microsoft.CognitiveServices.OutboundRuleBasicResource","com.azure.resourcemanager.cognitiveservices.fluent.models.OutboundRuleListResultInner":"Microsoft.CognitiveServices.OutboundRuleListResult","com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateEndpointConnectionInner":"Microsoft.CognitiveServices.PrivateEndpointConnection","com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateEndpointConnectionListResultInner":"Microsoft.CognitiveServices.PrivateEndpointConnectionListResult","com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateLinkResourceListResultInner":"Microsoft.CognitiveServices.PrivateLinkResourceListResult","com.azure.resourcemanager.cognitiveservices.fluent.models.ProjectCapabilityHostInner":"Microsoft.CognitiveServices.ProjectCapabilityHost","com.azure.resourcemanager.cognitiveservices.fluent.models.ProjectInner":"Microsoft.CognitiveServices.Project","com.azure.resourcemanager.cognitiveservices.fluent.models.QuotaTierInner":"Microsoft.CognitiveServices.QuotaTier","com.azure.resourcemanager.cognitiveservices.fluent.models.RaiBlocklistInner":"Microsoft.CognitiveServices.RaiBlocklist","com.azure.resourcemanager.cognitiveservices.fluent.models.RaiBlocklistItemInner":"Microsoft.CognitiveServices.RaiBlocklistItem","com.azure.resourcemanager.cognitiveservices.fluent.models.RaiContentFilterInner":"Microsoft.CognitiveServices.RaiContentFilter","com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderInner":"Microsoft.CognitiveServices.RaiExternalSafetyProvider","com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderSchemaInner":"Microsoft.CognitiveServices.RaiExternalSafetyProviderSchema","com.azure.resourcemanager.cognitiveservices.fluent.models.RaiPolicyInner":"Microsoft.CognitiveServices.RaiPolicy","com.azure.resourcemanager.cognitiveservices.fluent.models.RaiToolLabelInner":"Microsoft.CognitiveServices.RaiToolLabel","com.azure.resourcemanager.cognitiveservices.fluent.models.RaiTopicInner":"Microsoft.CognitiveServices.RaiTopic","com.azure.resourcemanager.cognitiveservices.fluent.models.ResourceSkuInner":"Microsoft.CognitiveServices.ResourceSku","com.azure.resourcemanager.cognitiveservices.fluent.models.SkuAvailabilityListResultInner":"Microsoft.CognitiveServices.SkuAvailabilityListResult","com.azure.resourcemanager.cognitiveservices.fluent.models.SkuResourceInner":"Microsoft.CognitiveServices.SkuResource","com.azure.resourcemanager.cognitiveservices.fluent.models.UsageInner":"Microsoft.CognitiveServices.Usage","com.azure.resourcemanager.cognitiveservices.fluent.models.UsageListResultInner":"Microsoft.CognitiveServices.UsageListResult","com.azure.resourcemanager.cognitiveservices.implementation.CognitiveServicesManagementClientBuilder":"Microsoft.CognitiveServices","com.azure.resourcemanager.cognitiveservices.implementation.models.AccountListResult":"Microsoft.CognitiveServices.AccountListResult","com.azure.resourcemanager.cognitiveservices.implementation.models.AccountModelListResult":"Microsoft.CognitiveServices.AccountModelListResult","com.azure.resourcemanager.cognitiveservices.implementation.models.AgentApplicationResourceArmPaginatedResult":"Microsoft.CognitiveServices.AgentApplicationResourceArmPaginatedResult","com.azure.resourcemanager.cognitiveservices.implementation.models.AgentDeploymentResourceArmPaginatedResult":"Microsoft.CognitiveServices.AgentDeploymentResourceArmPaginatedResult","com.azure.resourcemanager.cognitiveservices.implementation.models.CapabilityHostResourceArmPaginatedResult":"Microsoft.CognitiveServices.CapabilityHostResourceArmPaginatedResult","com.azure.resourcemanager.cognitiveservices.implementation.models.CommitmentPlanAccountAssociationListResult":"Microsoft.CognitiveServices.CommitmentPlanAccountAssociationListResult","com.azure.resourcemanager.cognitiveservices.implementation.models.CommitmentPlanListResult":"Microsoft.CognitiveServices.CommitmentPlanListResult","com.azure.resourcemanager.cognitiveservices.implementation.models.CommitmentTierListResult":"Microsoft.CognitiveServices.CommitmentTierListResult","com.azure.resourcemanager.cognitiveservices.implementation.models.ConnectionPropertiesV2BasicResourceArmPaginatedResult":"Microsoft.CognitiveServices.ConnectionPropertiesV2BasicResourceArmPaginatedResult","com.azure.resourcemanager.cognitiveservices.implementation.models.DefenderForAISettingResult":"Microsoft.CognitiveServices.DefenderForAISettingResult","com.azure.resourcemanager.cognitiveservices.implementation.models.DeploymentListResult":"Microsoft.CognitiveServices.DeploymentListResult","com.azure.resourcemanager.cognitiveservices.implementation.models.DeploymentSkuListResult":"Microsoft.CognitiveServices.DeploymentSkuListResult","com.azure.resourcemanager.cognitiveservices.implementation.models.EncryptionScopeListResult":"Microsoft.CognitiveServices.EncryptionScopeListResult","com.azure.resourcemanager.cognitiveservices.implementation.models.ManagedNetworkListResult":"Microsoft.CognitiveServices.ManagedNetworkListResult","com.azure.resourcemanager.cognitiveservices.implementation.models.ModelCapacityListResult":"Microsoft.CognitiveServices.ModelCapacityListResult","com.azure.resourcemanager.cognitiveservices.implementation.models.ModelListResult":"Microsoft.CognitiveServices.ModelListResult","com.azure.resourcemanager.cognitiveservices.implementation.models.NetworkSecurityPerimeterConfigurationList":"Microsoft.CognitiveServices.NetworkSecurityPerimeterConfigurationList","com.azure.resourcemanager.cognitiveservices.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.cognitiveservices.implementation.models.ProjectCapabilityHostResourceArmPaginatedResult":"Microsoft.CognitiveServices.ProjectCapabilityHostResourceArmPaginatedResult","com.azure.resourcemanager.cognitiveservices.implementation.models.ProjectListResult":"Microsoft.CognitiveServices.ProjectListResult","com.azure.resourcemanager.cognitiveservices.implementation.models.QuotaTierListResult":"Microsoft.CognitiveServices.QuotaTierListResult","com.azure.resourcemanager.cognitiveservices.implementation.models.RaiBlockListItemsResult":"Microsoft.CognitiveServices.RaiBlockListItemsResult","com.azure.resourcemanager.cognitiveservices.implementation.models.RaiBlockListResult":"Microsoft.CognitiveServices.RaiBlockListResult","com.azure.resourcemanager.cognitiveservices.implementation.models.RaiContentFilterListResult":"Microsoft.CognitiveServices.RaiContentFilterListResult","com.azure.resourcemanager.cognitiveservices.implementation.models.RaiExternalSafetyProviderResult":"Microsoft.CognitiveServices.RaiExternalSafetyProviderResult","com.azure.resourcemanager.cognitiveservices.implementation.models.RaiPolicyListResult":"Microsoft.CognitiveServices.RaiPolicyListResult","com.azure.resourcemanager.cognitiveservices.implementation.models.RaiToolLabelResult":"Microsoft.CognitiveServices.RaiToolLabelResult","com.azure.resourcemanager.cognitiveservices.implementation.models.RaiTopicResult":"Microsoft.CognitiveServices.RaiTopicResult","com.azure.resourcemanager.cognitiveservices.implementation.models.ResourceSkuListResult":"Microsoft.CognitiveServices.ResourceSkuListResult","com.azure.resourcemanager.cognitiveservices.models.AadAuthTypeConnectionProperties":"Microsoft.CognitiveServices.AADAuthTypeConnectionProperties","com.azure.resourcemanager.cognitiveservices.models.AbusePenalty":"Microsoft.CognitiveServices.AbusePenalty","com.azure.resourcemanager.cognitiveservices.models.AbusePenaltyAction":"Microsoft.CognitiveServices.AbusePenaltyAction","com.azure.resourcemanager.cognitiveservices.models.AccessKeyAuthTypeConnectionProperties":"Microsoft.CognitiveServices.AccessKeyAuthTypeConnectionProperties","com.azure.resourcemanager.cognitiveservices.models.AccountKeyAuthTypeConnectionProperties":"Microsoft.CognitiveServices.AccountKeyAuthTypeConnectionProperties","com.azure.resourcemanager.cognitiveservices.models.AccountProperties":"Microsoft.CognitiveServices.AccountProperties","com.azure.resourcemanager.cognitiveservices.models.AccountSku":"Microsoft.CognitiveServices.AccountSku","com.azure.resourcemanager.cognitiveservices.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.cognitiveservices.models.AgentDeploymentProperties":"Microsoft.CognitiveServices.AgentDeploymentProperties","com.azure.resourcemanager.cognitiveservices.models.AgentDeploymentProvisioningState":"Microsoft.CognitiveServices.AgentDeploymentProvisioningState","com.azure.resourcemanager.cognitiveservices.models.AgentDeploymentState":"Microsoft.CognitiveServices.AgentDeploymentState","com.azure.resourcemanager.cognitiveservices.models.AgentDeploymentType":"Microsoft.CognitiveServices.AgentDeploymentType","com.azure.resourcemanager.cognitiveservices.models.AgentProtocol":"Microsoft.CognitiveServices.AgentProtocol","com.azure.resourcemanager.cognitiveservices.models.AgentProtocolVersion":"Microsoft.CognitiveServices.AgentProtocolVersion","com.azure.resourcemanager.cognitiveservices.models.AgentReference":"Microsoft.CognitiveServices.AgentReference","com.azure.resourcemanager.cognitiveservices.models.AgentReferenceProperties":"Microsoft.CognitiveServices.AgentReferenceProperties","com.azure.resourcemanager.cognitiveservices.models.AgenticApplicationProperties":"Microsoft.CognitiveServices.AgenticApplicationProperties","com.azure.resourcemanager.cognitiveservices.models.AgenticApplicationProvisioningState":"Microsoft.CognitiveServices.AgenticApplicationProvisioningState","com.azure.resourcemanager.cognitiveservices.models.ApiKeyAuthConnectionProperties":"Microsoft.CognitiveServices.ApiKeyAuthConnectionProperties","com.azure.resourcemanager.cognitiveservices.models.ApiProperties":"Microsoft.CognitiveServices.ApiProperties","com.azure.resourcemanager.cognitiveservices.models.ApplicationAuthorizationPolicy":"Microsoft.CognitiveServices.ApplicationAuthorizationPolicy","com.azure.resourcemanager.cognitiveservices.models.ApplicationTrafficRoutingPolicy":"Microsoft.CognitiveServices.ApplicationTrafficRoutingPolicy","com.azure.resourcemanager.cognitiveservices.models.AssignedIdentity":"Microsoft.CognitiveServices.AssignedIdentity","com.azure.resourcemanager.cognitiveservices.models.BillingMeterInfo":"Microsoft.CognitiveServices.BillingMeterInfo","com.azure.resourcemanager.cognitiveservices.models.BuiltInAuthorizationScheme":"Microsoft.CognitiveServices.BuiltInAuthorizationScheme","com.azure.resourcemanager.cognitiveservices.models.ByPassSelection":"Microsoft.CognitiveServices.ByPassSelection","com.azure.resourcemanager.cognitiveservices.models.CalculateModelCapacityParameter":"Microsoft.CognitiveServices.CalculateModelCapacityParameter","com.azure.resourcemanager.cognitiveservices.models.CalculateModelCapacityResultEstimatedCapacity":"Microsoft.CognitiveServices.CalculateModelCapacityResultEstimatedCapacity","com.azure.resourcemanager.cognitiveservices.models.CallRateLimit":"Microsoft.CognitiveServices.CallRateLimit","com.azure.resourcemanager.cognitiveservices.models.CapabilityHostKind":"Microsoft.CognitiveServices.CapabilityHostKind","com.azure.resourcemanager.cognitiveservices.models.CapabilityHostProperties":"Microsoft.CognitiveServices.CapabilityHostProperties","com.azure.resourcemanager.cognitiveservices.models.CapabilityHostProvisioningState":"Microsoft.CognitiveServices.CapabilityHostProvisioningState","com.azure.resourcemanager.cognitiveservices.models.CapacityConfig":"Microsoft.CognitiveServices.CapacityConfig","com.azure.resourcemanager.cognitiveservices.models.ChannelsBuiltInAuthorizationPolicy":"Microsoft.CognitiveServices.ChannelsBuiltInAuthorizationPolicy","com.azure.resourcemanager.cognitiveservices.models.CheckDomainAvailabilityParameter":"Microsoft.CognitiveServices.CheckDomainAvailabilityParameter","com.azure.resourcemanager.cognitiveservices.models.CheckSkuAvailabilityParameter":"Microsoft.CognitiveServices.CheckSkuAvailabilityParameter","com.azure.resourcemanager.cognitiveservices.models.CommitmentCost":"Microsoft.CognitiveServices.CommitmentCost","com.azure.resourcemanager.cognitiveservices.models.CommitmentPeriod":"Microsoft.CognitiveServices.CommitmentPeriod","com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanAssociation":"Microsoft.CognitiveServices.CommitmentPlanAssociation","com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanProperties":"Microsoft.CognitiveServices.CommitmentPlanProperties","com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanProvisioningState":"Microsoft.CognitiveServices.CommitmentPlanProvisioningState","com.azure.resourcemanager.cognitiveservices.models.CommitmentQuota":"Microsoft.CognitiveServices.CommitmentQuota","com.azure.resourcemanager.cognitiveservices.models.ComputeOperationStatusProperties":"Microsoft.CognitiveServices.ComputeOperationStatusProperties","com.azure.resourcemanager.cognitiveservices.models.ComputeOperationStatusType":"Microsoft.CognitiveServices.ComputeOperationStatusType","com.azure.resourcemanager.cognitiveservices.models.ConnectionAccessKey":"Microsoft.CognitiveServices.ConnectionAccessKey","com.azure.resourcemanager.cognitiveservices.models.ConnectionAccountKey":"Microsoft.CognitiveServices.ConnectionAccountKey","com.azure.resourcemanager.cognitiveservices.models.ConnectionApiKey":"Microsoft.CognitiveServices.ConnectionApiKey","com.azure.resourcemanager.cognitiveservices.models.ConnectionAuthType":"Microsoft.CognitiveServices.ConnectionAuthType","com.azure.resourcemanager.cognitiveservices.models.ConnectionCategory":"Microsoft.CognitiveServices.ConnectionCategory","com.azure.resourcemanager.cognitiveservices.models.ConnectionGroup":"Microsoft.CognitiveServices.ConnectionGroup","com.azure.resourcemanager.cognitiveservices.models.ConnectionManagedIdentity":"Microsoft.CognitiveServices.ConnectionManagedIdentity","com.azure.resourcemanager.cognitiveservices.models.ConnectionOAuth2":"Microsoft.CognitiveServices.ConnectionOAuth2","com.azure.resourcemanager.cognitiveservices.models.ConnectionPersonalAccessToken":"Microsoft.CognitiveServices.ConnectionPersonalAccessToken","com.azure.resourcemanager.cognitiveservices.models.ConnectionPropertiesV2":"Microsoft.CognitiveServices.ConnectionPropertiesV2","com.azure.resourcemanager.cognitiveservices.models.ConnectionServicePrincipal":"Microsoft.CognitiveServices.ConnectionServicePrincipal","com.azure.resourcemanager.cognitiveservices.models.ConnectionSharedAccessSignature":"Microsoft.CognitiveServices.ConnectionSharedAccessSignature","com.azure.resourcemanager.cognitiveservices.models.ConnectionUpdateContent":"Microsoft.CognitiveServices.ConnectionUpdateContent","com.azure.resourcemanager.cognitiveservices.models.ConnectionUsernamePassword":"Microsoft.CognitiveServices.ConnectionUsernamePassword","com.azure.resourcemanager.cognitiveservices.models.ContentLevel":"Microsoft.CognitiveServices.ContentLevel","com.azure.resourcemanager.cognitiveservices.models.CustomBlocklistConfig":"Microsoft.CognitiveServices.CustomBlocklistConfig","com.azure.resourcemanager.cognitiveservices.models.CustomKeys":"Microsoft.CognitiveServices.CustomKeys","com.azure.resourcemanager.cognitiveservices.models.CustomKeysConnectionProperties":"Microsoft.CognitiveServices.CustomKeysConnectionProperties","com.azure.resourcemanager.cognitiveservices.models.CustomTopicConfig":"Microsoft.CognitiveServices.CustomTopicConfig","com.azure.resourcemanager.cognitiveservices.models.DefenderForAISettingState":"Microsoft.CognitiveServices.DefenderForAISettingState","com.azure.resourcemanager.cognitiveservices.models.DeploymentCapacitySettings":"Microsoft.CognitiveServices.DeploymentCapacitySettings","com.azure.resourcemanager.cognitiveservices.models.DeploymentModel":"Microsoft.CognitiveServices.DeploymentModel","com.azure.resourcemanager.cognitiveservices.models.DeploymentModelVersionUpgradeOption":"Microsoft.CognitiveServices.DeploymentModelVersionUpgradeOption","com.azure.resourcemanager.cognitiveservices.models.DeploymentProperties":"Microsoft.CognitiveServices.DeploymentProperties","com.azure.resourcemanager.cognitiveservices.models.DeploymentProvisioningState":"Microsoft.CognitiveServices.DeploymentProvisioningState","com.azure.resourcemanager.cognitiveservices.models.DeploymentRouting":"Microsoft.CognitiveServices.DeploymentRouting","com.azure.resourcemanager.cognitiveservices.models.DeploymentScaleSettings":"Microsoft.CognitiveServices.DeploymentScaleSettings","com.azure.resourcemanager.cognitiveservices.models.DeploymentScaleType":"Microsoft.CognitiveServices.DeploymentScaleType","com.azure.resourcemanager.cognitiveservices.models.DeploymentState":"Microsoft.CognitiveServices.DeploymentState","com.azure.resourcemanager.cognitiveservices.models.DeprecationStatus":"Microsoft.CognitiveServices.DeprecationStatus","com.azure.resourcemanager.cognitiveservices.models.Encryption":"Microsoft.CognitiveServices.Encryption","com.azure.resourcemanager.cognitiveservices.models.EncryptionScopeProperties":"Microsoft.CognitiveServices.EncryptionScopeProperties","com.azure.resourcemanager.cognitiveservices.models.EncryptionScopeProvisioningState":"Microsoft.CognitiveServices.EncryptionScopeProvisioningState","com.azure.resourcemanager.cognitiveservices.models.EncryptionScopeState":"Microsoft.CognitiveServices.EncryptionScopeState","com.azure.resourcemanager.cognitiveservices.models.FirewallSku":"Microsoft.CognitiveServices.FirewallSku","com.azure.resourcemanager.cognitiveservices.models.FoundryAutoUpgrade":"Microsoft.CognitiveServices.FoundryAutoUpgrade","com.azure.resourcemanager.cognitiveservices.models.FoundryAutoUpgradeMode":"Microsoft.CognitiveServices.FoundryAutoUpgradeMode","com.azure.resourcemanager.cognitiveservices.models.FqdnOutboundRule":"Microsoft.CognitiveServices.FqdnOutboundRule","com.azure.resourcemanager.cognitiveservices.models.HostedAgentDeployment":"Microsoft.CognitiveServices.HostedAgentDeployment","com.azure.resourcemanager.cognitiveservices.models.HostingModel":"Microsoft.CognitiveServices.HostingModel","com.azure.resourcemanager.cognitiveservices.models.Identity":"Microsoft.CognitiveServices.Identity","com.azure.resourcemanager.cognitiveservices.models.IdentityKind":"Microsoft.CognitiveServices.IdentityKind","com.azure.resourcemanager.cognitiveservices.models.IdentityManagementType":"Microsoft.CognitiveServices.IdentityManagementType","com.azure.resourcemanager.cognitiveservices.models.IdentityProvisioningState":"Microsoft.CognitiveServices.IdentityProvisioningState","com.azure.resourcemanager.cognitiveservices.models.IpRule":"Microsoft.CognitiveServices.IpRule","com.azure.resourcemanager.cognitiveservices.models.IsolationMode":"Microsoft.CognitiveServices.IsolationMode","com.azure.resourcemanager.cognitiveservices.models.KeyName":"Microsoft.CognitiveServices.KeyName","com.azure.resourcemanager.cognitiveservices.models.KeySource":"Microsoft.CognitiveServices.KeySource","com.azure.resourcemanager.cognitiveservices.models.KeyVaultProperties":"Microsoft.CognitiveServices.KeyVaultProperties","com.azure.resourcemanager.cognitiveservices.models.ManagedAgentDeployment":"Microsoft.CognitiveServices.ManagedAgentDeployment","com.azure.resourcemanager.cognitiveservices.models.ManagedIdentityAuthTypeConnectionProperties":"Microsoft.CognitiveServices.ManagedIdentityAuthTypeConnectionProperties","com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkKind":"Microsoft.CognitiveServices.ManagedNetworkKind","com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkProvisionOptions":"Microsoft.CognitiveServices.ManagedNetworkProvisionOptions","com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkProvisioningState":"Microsoft.CognitiveServices.ManagedNetworkProvisioningState","com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsEx":"Microsoft.CognitiveServices.ManagedNetworkSettingsEx","com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsProperties":"Microsoft.CognitiveServices.ManagedNetworkSettingsProperties","com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkStatus":"Microsoft.CognitiveServices.ManagedNetworkStatus","com.azure.resourcemanager.cognitiveservices.models.ManagedPERequirement":"Microsoft.CognitiveServices.ManagedPERequirement","com.azure.resourcemanager.cognitiveservices.models.ManagedPEStatus":"Microsoft.CognitiveServices.ManagedPEStatus","com.azure.resourcemanager.cognitiveservices.models.MetricName":"Microsoft.CognitiveServices.MetricName","com.azure.resourcemanager.cognitiveservices.models.ModelCapacityCalculatorWorkload":"Microsoft.CognitiveServices.ModelCapacityCalculatorWorkload","com.azure.resourcemanager.cognitiveservices.models.ModelCapacityCalculatorWorkloadRequestParam":"Microsoft.CognitiveServices.ModelCapacityCalculatorWorkloadRequestParam","com.azure.resourcemanager.cognitiveservices.models.ModelDeprecationInfo":"Microsoft.CognitiveServices.ModelDeprecationInfo","com.azure.resourcemanager.cognitiveservices.models.ModelLifecycleStatus":"Microsoft.CognitiveServices.ModelLifecycleStatus","com.azure.resourcemanager.cognitiveservices.models.ModelSku":"Microsoft.CognitiveServices.ModelSku","com.azure.resourcemanager.cognitiveservices.models.ModelSkuCapacityProperties":"Microsoft.CognitiveServices.ModelSkuCapacityProperties","com.azure.resourcemanager.cognitiveservices.models.MultiRegionSettings":"Microsoft.CognitiveServices.MultiRegionSettings","com.azure.resourcemanager.cognitiveservices.models.NetworkInjection":"Microsoft.CognitiveServices.NetworkInjection","com.azure.resourcemanager.cognitiveservices.models.NetworkRuleAction":"Microsoft.CognitiveServices.NetworkRuleAction","com.azure.resourcemanager.cognitiveservices.models.NetworkRuleSet":"Microsoft.CognitiveServices.NetworkRuleSet","com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeter":"Microsoft.CognitiveServices.NetworkSecurityPerimeter","com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRule":"Microsoft.CognitiveServices.NetworkSecurityPerimeterAccessRule","com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRuleProperties":"Microsoft.CognitiveServices.NetworkSecurityPerimeterAccessRuleProperties","com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem":"Microsoft.CognitiveServices.NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem","com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterConfigurationAssociationInfo":"Microsoft.CognitiveServices.NetworkSecurityPerimeterConfigurationAssociationInfo","com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterConfigurationProperties":"Microsoft.CognitiveServices.NetworkSecurityPerimeterConfigurationProperties","com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterProfileInfo":"Microsoft.CognitiveServices.NetworkSecurityPerimeterProfileInfo","com.azure.resourcemanager.cognitiveservices.models.NoneAuthTypeConnectionProperties":"Microsoft.CognitiveServices.NoneAuthTypeConnectionProperties","com.azure.resourcemanager.cognitiveservices.models.NspAccessRuleDirection":"Microsoft.CognitiveServices.NspAccessRuleDirection","com.azure.resourcemanager.cognitiveservices.models.OAuth2AuthTypeConnectionProperties":"Microsoft.CognitiveServices.OAuth2AuthTypeConnectionProperties","com.azure.resourcemanager.cognitiveservices.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.cognitiveservices.models.OrganizationSharedBuiltInAuthorizationPolicy":"Microsoft.CognitiveServices.OrganizationSharedBuiltInAuthorizationPolicy","com.azure.resourcemanager.cognitiveservices.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.cognitiveservices.models.OutboundRule":"Microsoft.CognitiveServices.OutboundRule","com.azure.resourcemanager.cognitiveservices.models.PatAuthTypeConnectionProperties":"Microsoft.CognitiveServices.PATAuthTypeConnectionProperties","com.azure.resourcemanager.cognitiveservices.models.PatchResourceTags":"Microsoft.CognitiveServices.PatchResourceTags","com.azure.resourcemanager.cognitiveservices.models.PatchResourceTagsAndSku":"Microsoft.CognitiveServices.PatchResourceTagsAndSku","com.azure.resourcemanager.cognitiveservices.models.PrivateEndpoint":"Azure.ResourceManager.CommonTypes.PrivateEndpoint","com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointConnectionProperties":"Microsoft.CognitiveServices.PrivateEndpointConnectionProperties","com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointConnectionProvisioningState":"Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProvisioningState","com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointOutboundRule":"Microsoft.CognitiveServices.PrivateEndpointOutboundRule","com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointOutboundRuleDestination":"Microsoft.CognitiveServices.PrivateEndpointOutboundRuleDestination","com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointServiceConnectionStatus":"Azure.ResourceManager.CommonTypes.PrivateEndpointServiceConnectionStatus","com.azure.resourcemanager.cognitiveservices.models.PrivateLinkResource":"Microsoft.CognitiveServices.PrivateLinkResource","com.azure.resourcemanager.cognitiveservices.models.PrivateLinkResourceProperties":"Microsoft.CognitiveServices.PrivateLinkResourceProperties","com.azure.resourcemanager.cognitiveservices.models.PrivateLinkServiceConnectionState":"Azure.ResourceManager.CommonTypes.PrivateLinkServiceConnectionState","com.azure.resourcemanager.cognitiveservices.models.ProjectCapabilityHostProperties":"Microsoft.CognitiveServices.ProjectCapabilityHostProperties","com.azure.resourcemanager.cognitiveservices.models.ProjectProperties":"Microsoft.CognitiveServices.ProjectProperties","com.azure.resourcemanager.cognitiveservices.models.ProvisioningIssue":"Microsoft.CognitiveServices.ProvisioningIssue","com.azure.resourcemanager.cognitiveservices.models.ProvisioningIssueProperties":"Microsoft.CognitiveServices.ProvisioningIssueProperties","com.azure.resourcemanager.cognitiveservices.models.ProvisioningState":"Microsoft.CognitiveServices.ProvisioningState","com.azure.resourcemanager.cognitiveservices.models.PublicNetworkAccess":"Microsoft.CognitiveServices.PublicNetworkAccess","com.azure.resourcemanager.cognitiveservices.models.QuotaLimit":"Microsoft.CognitiveServices.QuotaLimit","com.azure.resourcemanager.cognitiveservices.models.QuotaScopeType":"Microsoft.CognitiveServices.QuotaScopeType","com.azure.resourcemanager.cognitiveservices.models.QuotaTierProperties":"Microsoft.CognitiveServices.QuotaTierProperties","com.azure.resourcemanager.cognitiveservices.models.QuotaTierUpgradeEligibilityInfo":"Microsoft.CognitiveServices.QuotaTierUpgradeEligibilityInfo","com.azure.resourcemanager.cognitiveservices.models.QuotaUsageStatus":"Microsoft.CognitiveServices.QuotaUsageStatus","com.azure.resourcemanager.cognitiveservices.models.RaiActionType":"Microsoft.CognitiveServices.RaiActionType","com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistConfig":"Microsoft.CognitiveServices.RaiBlocklistConfig","com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItemBulkRequest":"Microsoft.CognitiveServices.RaiBlocklistItemBulkRequest","com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItemProperties":"Microsoft.CognitiveServices.RaiBlocklistItemProperties","com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistProperties":"Microsoft.CognitiveServices.RaiBlocklistProperties","com.azure.resourcemanager.cognitiveservices.models.RaiContentFilterProperties":"Microsoft.CognitiveServices.RaiContentFilterProperties","com.azure.resourcemanager.cognitiveservices.models.RaiExternalSafetyProviderProperties":"Microsoft.CognitiveServices.RaiExternalSafetyProviderProperties","com.azure.resourcemanager.cognitiveservices.models.RaiExternalSafetyProviderSchemaProperties":"Microsoft.CognitiveServices.RaiExternalSafetyProviderSchemaProperties","com.azure.resourcemanager.cognitiveservices.models.RaiMonitorConfig":"Microsoft.CognitiveServices.RaiMonitorConfig","com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentFilter":"Microsoft.CognitiveServices.RaiPolicyContentFilter","com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentSource":"Microsoft.CognitiveServices.RaiPolicyContentSource","com.azure.resourcemanager.cognitiveservices.models.RaiPolicyMode":"Microsoft.CognitiveServices.RaiPolicyMode","com.azure.resourcemanager.cognitiveservices.models.RaiPolicyProperties":"Microsoft.CognitiveServices.RaiPolicyProperties","com.azure.resourcemanager.cognitiveservices.models.RaiPolicyType":"Microsoft.CognitiveServices.RaiPolicyType","com.azure.resourcemanager.cognitiveservices.models.RaiSafetyProviderConfig":"Microsoft.CognitiveServices.RaiSafetyProviderConfig","com.azure.resourcemanager.cognitiveservices.models.RaiToolLabelProperties":"Microsoft.CognitiveServices.RaiToolLabelProperties","com.azure.resourcemanager.cognitiveservices.models.RaiToolLabelPropertiesAccountScope":"Microsoft.CognitiveServices.RaiToolLabelPropertiesAccountScope","com.azure.resourcemanager.cognitiveservices.models.RaiToolLabelPropertiesProjectScopesItem":"Microsoft.CognitiveServices.RaiToolLabelPropertiesProjectScopesItem","com.azure.resourcemanager.cognitiveservices.models.RaiTopicConfig":"Microsoft.CognitiveServices.RaiTopicConfig","com.azure.resourcemanager.cognitiveservices.models.RaiTopicProperties":"Microsoft.CognitiveServices.RaiTopicProperties","com.azure.resourcemanager.cognitiveservices.models.RegenerateKeyParameters":"Microsoft.CognitiveServices.RegenerateKeyParameters","com.azure.resourcemanager.cognitiveservices.models.RegionSetting":"Microsoft.CognitiveServices.RegionSetting","com.azure.resourcemanager.cognitiveservices.models.ReplacementConfig":"Microsoft.CognitiveServices.ReplacementConfig","com.azure.resourcemanager.cognitiveservices.models.RequestMatchPattern":"Microsoft.CognitiveServices.RequestMatchPattern","com.azure.resourcemanager.cognitiveservices.models.ResourceBase":"Microsoft.CognitiveServices.ResourceBase","com.azure.resourcemanager.cognitiveservices.models.ResourceIdentityType":"Microsoft.CognitiveServices.ResourceIdentityType","com.azure.resourcemanager.cognitiveservices.models.ResourceSkuRestrictionInfo":"Microsoft.CognitiveServices.ResourceSkuRestrictionInfo","com.azure.resourcemanager.cognitiveservices.models.ResourceSkuRestrictions":"Microsoft.CognitiveServices.ResourceSkuRestrictions","com.azure.resourcemanager.cognitiveservices.models.ResourceSkuRestrictionsReasonCode":"Microsoft.CognitiveServices.ResourceSkuRestrictionsReasonCode","com.azure.resourcemanager.cognitiveservices.models.ResourceSkuRestrictionsType":"Microsoft.CognitiveServices.ResourceSkuRestrictionsType","com.azure.resourcemanager.cognitiveservices.models.RoleBasedBuiltInAuthorizationPolicy":"Microsoft.CognitiveServices.RoleBasedBuiltInAuthorizationPolicy","com.azure.resourcemanager.cognitiveservices.models.RoutingMethods":"Microsoft.CognitiveServices.RoutingMethods","com.azure.resourcemanager.cognitiveservices.models.RoutingMode":"Microsoft.CognitiveServices.RoutingMode","com.azure.resourcemanager.cognitiveservices.models.RuleAction":"Microsoft.CognitiveServices.RuleAction","com.azure.resourcemanager.cognitiveservices.models.RuleCategory":"Microsoft.CognitiveServices.RuleCategory","com.azure.resourcemanager.cognitiveservices.models.RuleStatus":"Microsoft.CognitiveServices.RuleStatus","com.azure.resourcemanager.cognitiveservices.models.RuleType":"Microsoft.CognitiveServices.RuleType","com.azure.resourcemanager.cognitiveservices.models.SafetyProviderConfig":"Microsoft.CognitiveServices.SafetyProviderConfig","com.azure.resourcemanager.cognitiveservices.models.SasAuthTypeConnectionProperties":"Microsoft.CognitiveServices.SASAuthTypeConnectionProperties","com.azure.resourcemanager.cognitiveservices.models.ScenarioType":"Microsoft.CognitiveServices.ScenarioType","com.azure.resourcemanager.cognitiveservices.models.ServicePrincipalAuthTypeConnectionProperties":"Microsoft.CognitiveServices.ServicePrincipalAuthTypeConnectionProperties","com.azure.resourcemanager.cognitiveservices.models.ServiceTagOutboundRule":"Microsoft.CognitiveServices.ServiceTagOutboundRule","com.azure.resourcemanager.cognitiveservices.models.ServiceTagOutboundRuleDestination":"Microsoft.CognitiveServices.ServiceTagOutboundRuleDestination","com.azure.resourcemanager.cognitiveservices.models.ServiceTier":"Microsoft.CognitiveServices.ServiceTier","com.azure.resourcemanager.cognitiveservices.models.Sku":"Microsoft.CognitiveServices.Sku","com.azure.resourcemanager.cognitiveservices.models.SkuAvailability":"Microsoft.CognitiveServices.SkuAvailability","com.azure.resourcemanager.cognitiveservices.models.SkuCapability":"Microsoft.CognitiveServices.SkuCapability","com.azure.resourcemanager.cognitiveservices.models.SkuChangeInfo":"Microsoft.CognitiveServices.SkuChangeInfo","com.azure.resourcemanager.cognitiveservices.models.SkuTier":"Microsoft.CognitiveServices.SkuTier","com.azure.resourcemanager.cognitiveservices.models.ThrottlingRule":"Microsoft.CognitiveServices.ThrottlingRule","com.azure.resourcemanager.cognitiveservices.models.TierUpgradePolicy":"Microsoft.CognitiveServices.TierUpgradePolicy","com.azure.resourcemanager.cognitiveservices.models.TrafficRoutingProtocol":"Microsoft.CognitiveServices.TrafficRoutingProtocol","com.azure.resourcemanager.cognitiveservices.models.TrafficRoutingRule":"Microsoft.CognitiveServices.TrafficRoutingRule","com.azure.resourcemanager.cognitiveservices.models.UnitType":"Microsoft.CognitiveServices.UnitType","com.azure.resourcemanager.cognitiveservices.models.UpgradeAvailabilityStatus":"Microsoft.CognitiveServices.UpgradeAvailabilityStatus","com.azure.resourcemanager.cognitiveservices.models.UserAssignedIdentity":"Microsoft.CognitiveServices.UserAssignedIdentity","com.azure.resourcemanager.cognitiveservices.models.UserOwnedAmlWorkspace":"Microsoft.CognitiveServices.UserOwnedAmlWorkspace","com.azure.resourcemanager.cognitiveservices.models.UserOwnedStorage":"Microsoft.CognitiveServices.UserOwnedStorage","com.azure.resourcemanager.cognitiveservices.models.UsernamePasswordAuthTypeConnectionProperties":"Microsoft.CognitiveServices.UsernamePasswordAuthTypeConnectionProperties","com.azure.resourcemanager.cognitiveservices.models.VersionedAgentReference":"Microsoft.CognitiveServices.VersionedAgentReference","com.azure.resourcemanager.cognitiveservices.models.VirtualNetworkRule":"Microsoft.CognitiveServices.VirtualNetworkRule"},"generatedFiles":["src/main/java/com/azure/resourcemanager/cognitiveservices/CognitiveServicesManager.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountCapabilityHostsClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountConnectionsClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AccountsClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AgentApplicationsClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/AgentDeploymentsClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CognitiveServicesManagementClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CommitmentPlansClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/CommitmentTiersClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ComputeOperationsClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/DefenderForAISettingsClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/DeletedAccountsClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/DeploymentsClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/EncryptionScopesClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/LocationBasedModelCapacitiesClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ManagedNetworkProvisionsClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ManagedNetworkSettingsOperationsClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ModelCapacitiesClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ModelsClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/NetworkSecurityPerimeterConfigurationsClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/OutboundRulesClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/OutboundRulesOperationsClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/PrivateEndpointConnectionsClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/PrivateLinkResourcesClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectCapabilityHostsClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectConnectionsClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ProjectsClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/QuotaTiersClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiBlocklistItemsClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiBlocklistsClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiContentFiltersClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiExternalSafetyProvidersClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiExternalSafetyProvidersOperationsClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiPoliciesClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiToolLabelsClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/RaiTopicsClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ResourceProvidersClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/ResourceSkusClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/SubscriptionRaiPoliciesClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/TestRaiExternalSafetyProvidersClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/UsagesClient.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountModelInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AccountSkuListResultInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AgentApplicationInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AgentDeploymentInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/AgentReferenceResourceArmPaginatedResultInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ApiKeysInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CalculateModelCapacityResultInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CapabilityHostInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanAccountAssociationInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanAccountAssociationProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentPlanInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/CommitmentTierInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ComputeOperationStatusInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ConnectionPropertiesV2BasicResourceInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DefenderForAISettingInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DefenderForAISettingProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DeploymentInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/DomainAvailabilityInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/EncryptionScopeInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkProvisionStatusInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkSettingsBasicResourceInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkSettingsInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ManagedNetworkSettingsPropertiesBasicResourceInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ModelCapacityListResultValueItemInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ModelInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/NetworkSecurityPerimeterConfigurationInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/OutboundRuleBasicResourceInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/OutboundRuleListResultInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/PrivateEndpointConnectionInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/PrivateEndpointConnectionListResultInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/PrivateLinkResourceListResultInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ProjectCapabilityHostInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ProjectInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/QuotaTierInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiBlocklistInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiBlocklistItemInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiContentFilterInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiExternalSafetyProviderInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiExternalSafetyProviderSchemaInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiPolicyInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiToolLabelInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/RaiTopicInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/ResourceSkuInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/SkuAvailabilityListResultInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/SkuResourceInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/UsageInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/UsageListResultInner.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/cognitiveservices/fluent/package-info.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountCapabilityHostsClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountCapabilityHostsImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountConnectionsClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountConnectionsImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountModelImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountSkuListResultImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountsClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountsImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentApplicationImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentApplicationsClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentApplicationsImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentDeploymentImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentDeploymentsClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentDeploymentsImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AgentReferenceResourceArmPaginatedResultImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ApiKeysImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CalculateModelCapacityResultImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CapabilityHostImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CognitiveServicesManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CognitiveServicesManagementClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlanAccountAssociationImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlanImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlansClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentPlansImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTierImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTiersClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/CommitmentTiersImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeOperationStatusImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ComputeOperationsImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ConnectionPropertiesV2BasicResourceImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DefenderForAISettingImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DefenderForAISettingsClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DefenderForAISettingsImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeletedAccountsClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeletedAccountsImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentsClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DeploymentsImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/DomainAvailabilityImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EncryptionScopeImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EncryptionScopesClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/EncryptionScopesImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/LocationBasedModelCapacitiesClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/LocationBasedModelCapacitiesImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkProvisionStatusImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkProvisionsClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkProvisionsImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsBasicResourceImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsOperationsImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ManagedNetworkSettingsPropertiesBasicResourceImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelCapacitiesClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelCapacitiesImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelCapacityListResultValueItemImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelsClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ModelsImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/NetworkSecurityPerimeterConfigurationImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/NetworkSecurityPerimeterConfigurationsClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/NetworkSecurityPerimeterConfigurationsImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRuleBasicResourceImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRuleListResultImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/OutboundRulesOperationsImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionListResultImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionsClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateEndpointConnectionsImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourceListResultImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/PrivateLinkResourcesImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostsClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectCapabilityHostsImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectConnectionsClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectConnectionsImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectsClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ProjectsImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/QuotaTierImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/QuotaTiersClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/QuotaTiersImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistItemImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistItemsClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistItemsImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistsClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiBlocklistsImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiContentFilterImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiContentFiltersClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiContentFiltersImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProviderImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProviderSchemaImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiExternalSafetyProvidersOperationsImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiPoliciesClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiPoliciesImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiPolicyImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiToolLabelImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiToolLabelsClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiToolLabelsImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiTopicImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiTopicsClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/RaiTopicsImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceProvidersClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceProvidersImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceSkuImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceSkusClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/ResourceSkusImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SkuAvailabilityListResultImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SkuResourceImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SubscriptionRaiPoliciesClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/SubscriptionRaiPoliciesImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/TestRaiExternalSafetyProvidersClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/TestRaiExternalSafetyProvidersImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsageImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsageListResultImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsagesClientImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/UsagesImpl.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AccountListResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AccountModelListResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AgentApplicationResourceArmPaginatedResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/AgentDeploymentResourceArmPaginatedResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CapabilityHostResourceArmPaginatedResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CommitmentPlanAccountAssociationListResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CommitmentPlanListResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/CommitmentTierListResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ConnectionPropertiesV2BasicResourceArmPaginatedResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/DefenderForAISettingResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/DeploymentListResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/DeploymentSkuListResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/EncryptionScopeListResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ManagedNetworkListResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ModelCapacityListResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ModelListResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/NetworkSecurityPerimeterConfigurationList.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ProjectCapabilityHostResourceArmPaginatedResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ProjectListResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/QuotaTierListResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiBlockListItemsResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiBlockListResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiContentFilterListResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiExternalSafetyProviderResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiPolicyListResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiToolLabelResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/RaiTopicResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/models/ResourceSkuListResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/package-info.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/AadAuthTypeConnectionProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/AbusePenalty.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/AbusePenaltyAction.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccessKeyAuthTypeConnectionProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/Account.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountCapabilityHosts.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountConnections.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountKeyAuthTypeConnectionProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountModel.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountSku.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/AccountSkuListResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/Accounts.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ActionType.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentApplication.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentApplications.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeployment.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentProvisioningState.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentState.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeploymentType.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentDeployments.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentProtocol.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentProtocolVersion.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentReference.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentReferenceProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgentReferenceResourceArmPaginatedResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgenticApplicationProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/AgenticApplicationProvisioningState.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApiKeyAuthConnectionProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApiKeys.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApiProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApplicationAuthorizationPolicy.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ApplicationTrafficRoutingPolicy.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/AssignedIdentity.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/BillingMeterInfo.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/BuiltInAuthorizationScheme.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ByPassSelection.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/CalculateModelCapacityParameter.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/CalculateModelCapacityResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/CalculateModelCapacityResultEstimatedCapacity.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/CallRateLimit.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHost.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostKind.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapabilityHostProvisioningState.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/CapacityConfig.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ChannelsBuiltInAuthorizationPolicy.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/CheckDomainAvailabilityParameter.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/CheckSkuAvailabilityParameter.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentCost.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPeriod.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlan.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAccountAssociation.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanAssociation.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlanProvisioningState.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentPlans.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentQuota.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentTier.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/CommitmentTiers.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperationStatus.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperationStatusProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperationStatusType.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ComputeOperations.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAccessKey.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAccountKey.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionApiKey.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionAuthType.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionCategory.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionGroup.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionManagedIdentity.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionOAuth2.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPersonalAccessToken.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPropertiesV2.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionPropertiesV2BasicResource.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionServicePrincipal.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionSharedAccessSignature.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionUpdateContent.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ConnectionUsernamePassword.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ContentLevel.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomBlocklistConfig.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomKeys.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomKeysConnectionProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/CustomTopicConfig.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/DefenderForAISetting.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/DefenderForAISettingState.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/DefenderForAISettings.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeletedAccounts.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/Deployment.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentCapacitySettings.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentModel.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentModelVersionUpgradeOption.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentProvisioningState.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentRouting.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentScaleSettings.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentScaleType.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeploymentState.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/Deployments.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/DeprecationStatus.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/DomainAvailability.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/Encryption.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScope.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopeProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopeProvisioningState.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopeState.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/EncryptionScopes.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/FirewallSku.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/FoundryAutoUpgrade.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/FoundryAutoUpgradeMode.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/FqdnOutboundRule.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/HostedAgentDeployment.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/HostingModel.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/Identity.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/IdentityKind.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/IdentityManagementType.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/IdentityProvisioningState.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/IpRule.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/IsolationMode.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/KeyName.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/KeySource.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/KeyVaultProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/LocationBasedModelCapacities.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedAgentDeployment.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedIdentityAuthTypeConnectionProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkKind.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisionOptions.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisionStatus.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisioningState.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkProvisions.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettings.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsBasicResource.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsEx.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsOperations.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkSettingsPropertiesBasicResource.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedNetworkStatus.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedPERequirement.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ManagedPEStatus.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/MetricName.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/Model.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacities.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacityCalculatorWorkload.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacityCalculatorWorkloadRequestParam.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelCapacityListResultValueItem.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelDeprecationInfo.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelLifecycleStatus.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelSku.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ModelSkuCapacityProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/Models.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/MultiRegionSettings.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkInjection.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkRuleAction.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkRuleSet.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeter.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterAccessRule.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterAccessRuleProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfiguration.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfigurationAssociationInfo.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfigurationProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterConfigurations.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/NetworkSecurityPerimeterProfileInfo.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/NoneAuthTypeConnectionProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/NspAccessRuleDirection.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/OAuth2AuthTypeConnectionProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/Operation.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/Operations.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/OrganizationSharedBuiltInAuthorizationPolicy.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/Origin.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRule.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRuleBasicResource.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRuleListResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRules.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/OutboundRulesOperations.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatAuthTypeConnectionProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatchResourceTags.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/PatchResourceTagsAndSku.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpoint.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnection.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnectionListResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnectionProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnectionProvisioningState.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointConnections.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointOutboundRule.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointOutboundRuleDestination.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateEndpointServiceConnectionStatus.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResource.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResourceListResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResourceProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkResources.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/PrivateLinkServiceConnectionState.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/Project.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectCapabilityHost.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectCapabilityHostProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectCapabilityHosts.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectConnections.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProjectProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/Projects.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProvisioningIssue.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProvisioningIssueProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ProvisioningState.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/PublicNetworkAccess.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaLimit.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaScopeType.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTier.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTierProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTierUpgradeEligibilityInfo.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaTiers.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/QuotaUsageStatus.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiActionType.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklist.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistConfig.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItem.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItemBulkRequest.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItemProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistItems.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklistProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiBlocklists.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiContentFilter.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiContentFilterProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiContentFilters.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProvider.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviderProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviderSchema.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviderSchemaProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProviders.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiExternalSafetyProvidersOperations.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiMonitorConfig.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicies.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicy.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyContentFilter.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyContentSource.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyMode.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiPolicyType.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiSafetyProviderConfig.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabel.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabelProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabelPropertiesAccountScope.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabelPropertiesProjectScopesItem.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiToolLabels.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopic.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopicConfig.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopicProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RaiTopics.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RegenerateKeyParameters.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RegionSetting.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ReplacementConfig.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RequestMatchPattern.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceBase.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceIdentityType.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceProviders.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSku.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictionInfo.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictions.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictionsReasonCode.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkuRestrictionsType.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ResourceSkus.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RoleBasedBuiltInAuthorizationPolicy.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RoutingMethods.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RoutingMode.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleAction.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleCategory.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleStatus.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/RuleType.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/SafetyProviderConfig.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/SasAuthTypeConnectionProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ScenarioType.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServicePrincipalAuthTypeConnectionProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServiceTagOutboundRule.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServiceTagOutboundRuleDestination.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ServiceTier.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/Sku.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuAvailability.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuAvailabilityListResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuCapability.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuChangeInfo.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuResource.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/SkuTier.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/SubscriptionRaiPolicies.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/TestRaiExternalSafetyProviders.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/ThrottlingRule.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/TierUpgradePolicy.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/TrafficRoutingProtocol.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/TrafficRoutingRule.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/UnitType.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/UpgradeAvailabilityStatus.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/Usage.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/UsageListResult.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/Usages.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserAssignedIdentity.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserOwnedAmlWorkspace.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/UserOwnedStorage.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/UsernamePasswordAuthTypeConnectionProperties.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/VersionedAgentReference.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/VirtualNetworkRule.java","src/main/java/com/azure/resourcemanager/cognitiveservices/models/package-info.java","src/main/java/com/azure/resourcemanager/cognitiveservices/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cognitiveservices/proxy-config.json b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cognitiveservices/proxy-config.json index ac5021ded0ae..2fb345002b5a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cognitiveservices/proxy-config.json +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cognitiveservices/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.cognitiveservices.implementation.AccountCapabilityHostsClientImpl$AccountCapabilityHostsService"],["com.azure.resourcemanager.cognitiveservices.implementation.AccountConnectionsClientImpl$AccountConnectionsService"],["com.azure.resourcemanager.cognitiveservices.implementation.AccountsClientImpl$AccountsService"],["com.azure.resourcemanager.cognitiveservices.implementation.CommitmentPlansClientImpl$CommitmentPlansService"],["com.azure.resourcemanager.cognitiveservices.implementation.CommitmentTiersClientImpl$CommitmentTiersService"],["com.azure.resourcemanager.cognitiveservices.implementation.DefenderForAISettingsClientImpl$DefenderForAISettingsService"],["com.azure.resourcemanager.cognitiveservices.implementation.DeletedAccountsClientImpl$DeletedAccountsService"],["com.azure.resourcemanager.cognitiveservices.implementation.DeploymentsClientImpl$DeploymentsService"],["com.azure.resourcemanager.cognitiveservices.implementation.EncryptionScopesClientImpl$EncryptionScopesService"],["com.azure.resourcemanager.cognitiveservices.implementation.LocationBasedModelCapacitiesClientImpl$LocationBasedModelCapacitiesService"],["com.azure.resourcemanager.cognitiveservices.implementation.ModelCapacitiesClientImpl$ModelCapacitiesService"],["com.azure.resourcemanager.cognitiveservices.implementation.ModelsClientImpl$ModelsService"],["com.azure.resourcemanager.cognitiveservices.implementation.NetworkSecurityPerimeterConfigurationsClientImpl$NetworkSecurityPerimeterConfigurationsService"],["com.azure.resourcemanager.cognitiveservices.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.cognitiveservices.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.cognitiveservices.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService"],["com.azure.resourcemanager.cognitiveservices.implementation.ProjectCapabilityHostsClientImpl$ProjectCapabilityHostsService"],["com.azure.resourcemanager.cognitiveservices.implementation.ProjectConnectionsClientImpl$ProjectConnectionsService"],["com.azure.resourcemanager.cognitiveservices.implementation.ProjectsClientImpl$ProjectsService"],["com.azure.resourcemanager.cognitiveservices.implementation.QuotaTiersClientImpl$QuotaTiersService"],["com.azure.resourcemanager.cognitiveservices.implementation.RaiBlocklistItemsClientImpl$RaiBlocklistItemsService"],["com.azure.resourcemanager.cognitiveservices.implementation.RaiBlocklistsClientImpl$RaiBlocklistsService"],["com.azure.resourcemanager.cognitiveservices.implementation.RaiContentFiltersClientImpl$RaiContentFiltersService"],["com.azure.resourcemanager.cognitiveservices.implementation.RaiPoliciesClientImpl$RaiPoliciesService"],["com.azure.resourcemanager.cognitiveservices.implementation.RaiTopicsClientImpl$RaiTopicsService"],["com.azure.resourcemanager.cognitiveservices.implementation.ResourceProvidersClientImpl$ResourceProvidersService"],["com.azure.resourcemanager.cognitiveservices.implementation.ResourceSkusClientImpl$ResourceSkusService"],["com.azure.resourcemanager.cognitiveservices.implementation.UsagesClientImpl$UsagesService"]] \ No newline at end of file +[["com.azure.resourcemanager.cognitiveservices.implementation.AccountCapabilityHostsClientImpl$AccountCapabilityHostsService"],["com.azure.resourcemanager.cognitiveservices.implementation.AccountConnectionsClientImpl$AccountConnectionsService"],["com.azure.resourcemanager.cognitiveservices.implementation.AccountsClientImpl$AccountsService"],["com.azure.resourcemanager.cognitiveservices.implementation.AgentApplicationsClientImpl$AgentApplicationsService"],["com.azure.resourcemanager.cognitiveservices.implementation.AgentDeploymentsClientImpl$AgentDeploymentsService"],["com.azure.resourcemanager.cognitiveservices.implementation.CommitmentPlansClientImpl$CommitmentPlansService"],["com.azure.resourcemanager.cognitiveservices.implementation.CommitmentTiersClientImpl$CommitmentTiersService"],["com.azure.resourcemanager.cognitiveservices.implementation.ComputeOperationsClientImpl$ComputeOperationsService"],["com.azure.resourcemanager.cognitiveservices.implementation.DefenderForAISettingsClientImpl$DefenderForAISettingsService"],["com.azure.resourcemanager.cognitiveservices.implementation.DeletedAccountsClientImpl$DeletedAccountsService"],["com.azure.resourcemanager.cognitiveservices.implementation.DeploymentsClientImpl$DeploymentsService"],["com.azure.resourcemanager.cognitiveservices.implementation.EncryptionScopesClientImpl$EncryptionScopesService"],["com.azure.resourcemanager.cognitiveservices.implementation.LocationBasedModelCapacitiesClientImpl$LocationBasedModelCapacitiesService"],["com.azure.resourcemanager.cognitiveservices.implementation.ManagedNetworkProvisionsClientImpl$ManagedNetworkProvisionsService"],["com.azure.resourcemanager.cognitiveservices.implementation.ManagedNetworkSettingsOperationsClientImpl$ManagedNetworkSettingsOperationsService"],["com.azure.resourcemanager.cognitiveservices.implementation.ModelCapacitiesClientImpl$ModelCapacitiesService"],["com.azure.resourcemanager.cognitiveservices.implementation.ModelsClientImpl$ModelsService"],["com.azure.resourcemanager.cognitiveservices.implementation.NetworkSecurityPerimeterConfigurationsClientImpl$NetworkSecurityPerimeterConfigurationsService"],["com.azure.resourcemanager.cognitiveservices.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.cognitiveservices.implementation.OutboundRulesClientImpl$OutboundRulesService"],["com.azure.resourcemanager.cognitiveservices.implementation.OutboundRulesOperationsClientImpl$OutboundRulesOperationsService"],["com.azure.resourcemanager.cognitiveservices.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.cognitiveservices.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService"],["com.azure.resourcemanager.cognitiveservices.implementation.ProjectCapabilityHostsClientImpl$ProjectCapabilityHostsService"],["com.azure.resourcemanager.cognitiveservices.implementation.ProjectConnectionsClientImpl$ProjectConnectionsService"],["com.azure.resourcemanager.cognitiveservices.implementation.ProjectsClientImpl$ProjectsService"],["com.azure.resourcemanager.cognitiveservices.implementation.QuotaTiersClientImpl$QuotaTiersService"],["com.azure.resourcemanager.cognitiveservices.implementation.RaiBlocklistItemsClientImpl$RaiBlocklistItemsService"],["com.azure.resourcemanager.cognitiveservices.implementation.RaiBlocklistsClientImpl$RaiBlocklistsService"],["com.azure.resourcemanager.cognitiveservices.implementation.RaiContentFiltersClientImpl$RaiContentFiltersService"],["com.azure.resourcemanager.cognitiveservices.implementation.RaiExternalSafetyProvidersClientImpl$RaiExternalSafetyProvidersService"],["com.azure.resourcemanager.cognitiveservices.implementation.RaiExternalSafetyProvidersOperationsClientImpl$RaiExternalSafetyProvidersOperationsService"],["com.azure.resourcemanager.cognitiveservices.implementation.RaiPoliciesClientImpl$RaiPoliciesService"],["com.azure.resourcemanager.cognitiveservices.implementation.RaiToolLabelsClientImpl$RaiToolLabelsService"],["com.azure.resourcemanager.cognitiveservices.implementation.RaiTopicsClientImpl$RaiTopicsService"],["com.azure.resourcemanager.cognitiveservices.implementation.ResourceProvidersClientImpl$ResourceProvidersService"],["com.azure.resourcemanager.cognitiveservices.implementation.ResourceSkusClientImpl$ResourceSkusService"],["com.azure.resourcemanager.cognitiveservices.implementation.SubscriptionRaiPoliciesClientImpl$SubscriptionRaiPoliciesService"],["com.azure.resourcemanager.cognitiveservices.implementation.TestRaiExternalSafetyProvidersClientImpl$TestRaiExternalSafetyProvidersService"],["com.azure.resourcemanager.cognitiveservices.implementation.UsagesClientImpl$UsagesService"]] \ No newline at end of file diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsCreateOrUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsCreateOrUpdateSamples.java index b62db7b3ad1d..bde9ed898a36 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsCreateOrUpdateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -11,9 +11,7 @@ */ public final class AccountCapabilityHostsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * AccountCapabilityHost/createOrUpdate.json + * x-ms-original-file: 2026-01-15-preview/AccountCapabilityHost/createOrUpdate.json */ /** * Sample code: CreateOrUpdate Account CapabilityHost. @@ -26,7 +24,8 @@ public static void createOrUpdateAccountCapabilityHost( .define("capabilityHostName") .withExistingAccount("test-rg", "account-1") .withProperties(new CapabilityHostProperties().withCustomerSubnet( - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroups/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet")) + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroups/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet") + .withEnablePublicHostingEnvironment(true)) .create(); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsDeleteSamples.java index ab0469040a53..dac1b11569ee 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsDeleteSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class AccountCapabilityHostsDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * AccountCapabilityHost/delete.json + * x-ms-original-file: 2026-01-15-preview/AccountCapabilityHost/delete.json */ /** * Sample code: Delete Account CapabilityHost. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsGetSamples.java index 5c051db6e8ac..b9bde272dbee 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsGetSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class AccountCapabilityHostsGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * AccountCapabilityHost/get.json + * x-ms-original-file: 2026-01-15-preview/AccountCapabilityHost/get.json */ /** * Sample code: Get Account CapabilityHost. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsListSamples.java new file mode 100644 index 000000000000..7aeeea75a69a --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for AccountCapabilityHosts List. + */ +public final class AccountCapabilityHostsListSamples { + /* + * x-ms-original-file: 2026-01-15-preview/AccountCapabilityHost/list.json + */ + /** + * Sample code: List Account CapabilityHosts. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + listAccountCapabilityHosts(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accountCapabilityHosts().list("test-rg", "account-1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsCreateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsCreateSamples.java index c34e4992c4bb..22a096078cb7 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsCreateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsCreateSamples.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; import com.azure.resourcemanager.cognitiveservices.models.ConnectionCategory; import com.azure.resourcemanager.cognitiveservices.models.NoneAuthTypeConnectionProperties; import java.time.OffsetDateTime; @@ -13,9 +14,7 @@ */ public final class AccountConnectionsCreateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * AccountConnection/create.json + * x-ms-original-file: 2026-01-15-preview/AccountConnection/create.json */ /** * Sample code: CreateAccountConnection. @@ -25,11 +24,11 @@ public final class AccountConnectionsCreateSamples { public static void createAccountConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { manager.accountConnections() - .define("connection-1") - .withExistingAccount("resourceGroup-1", "account-1") - .withProperties(new NoneAuthTypeConnectionProperties().withCategory(ConnectionCategory.CONTAINER_REGISTRY) - .withExpiryTime(OffsetDateTime.parse("2024-03-15T14:30:00Z")) - .withTarget("[tartget url]")) - .create(); + .createWithResponse("resourceGroup-1", "account-1", "connection-1", + new ConnectionPropertiesV2BasicResourceInner().withProperties( + new NoneAuthTypeConnectionProperties().withCategory(ConnectionCategory.CONTAINER_REGISTRY) + .withExpiryTime(OffsetDateTime.parse("2024-03-15T14:30:00Z")) + .withTarget("[target url]")), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsDeleteSamples.java index 75b914f62deb..0a3be2e44014 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsDeleteSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class AccountConnectionsDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * AccountConnection/delete.json + * x-ms-original-file: 2026-01-15-preview/AccountConnection/delete.json */ /** * Sample code: DeleteAccountConnection. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsGetSamples.java index c36ccd48935a..67da15c90ad9 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsGetSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class AccountConnectionsGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * AccountConnection/get.json + * x-ms-original-file: 2026-01-15-preview/AccountConnection/get.json */ /** * Sample code: GetAccountConnection. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsListSamples.java index 7a38143ae1c0..ec12cce99565 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class AccountConnectionsListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * AccountConnection/list.json + * x-ms-original-file: 2026-01-15-preview/AccountConnection/list.json */ /** * Sample code: ListAccountConnections. @@ -21,7 +19,7 @@ public final class AccountConnectionsListSamples { public static void listAccountConnections(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { manager.accountConnections() - .list("resourceGroup-1", "account-1", "[tartget url]", "ContainerRegistry", null, + .list("resourceGroup-1", "account-1", "[target url]", "ContainerRegistry", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsUpdateSamples.java index d578524c2e9c..014e5cdccbfd 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsUpdateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsUpdateSamples.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.resourcemanager.cognitiveservices.models.AccessKeyAuthTypeConnectionProperties; import com.azure.resourcemanager.cognitiveservices.models.ConnectionAccessKey; import com.azure.resourcemanager.cognitiveservices.models.ConnectionCategory; -import com.azure.resourcemanager.cognitiveservices.models.ConnectionPropertiesV2BasicResource; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionUpdateContent; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; @@ -17,9 +17,7 @@ */ public final class AccountConnectionsUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * AccountConnection/update.json + * x-ms-original-file: 2026-01-15-preview/AccountConnection/update.json */ /** * Sample code: UpdateAccountConnection. @@ -28,17 +26,16 @@ public final class AccountConnectionsUpdateSamples { */ public static void updateAccountConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - ConnectionPropertiesV2BasicResource resource = manager.accountConnections() - .getWithResponse("test-rg", "account-1", "connection-1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .withProperties(new AccessKeyAuthTypeConnectionProperties().withCategory(ConnectionCategory.ADLSGEN2) - .withExpiryTime(OffsetDateTime.parse("2020-01-01T00:00:00Z")) - .withMetadata(mapOf()) - .withTarget("some_string") - .withCredentials(new ConnectionAccessKey().withAccessKeyId("fakeTokenPlaceholder") - .withSecretAccessKey("fakeTokenPlaceholder"))) - .apply(); + manager.accountConnections() + .updateWithResponse("test-rg", "account-1", "connection-1", + new ConnectionUpdateContent().withProperties( + new AccessKeyAuthTypeConnectionProperties().withCategory(ConnectionCategory.ADLSGEN2) + .withExpiryTime(OffsetDateTime.parse("2020-01-01T00:00:00Z")) + .withMetadata(mapOf()) + .withTarget("some_string") + .withCredentials(new ConnectionAccessKey().withAccessKeyId("fakeTokenPlaceholder") + .withSecretAccessKey("fakeTokenPlaceholder"))), + com.azure.core.util.Context.NONE); } // Use "Map.of" if available diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsCreateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsCreateSamples.java index 3a2d1ac54336..6f126015592d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsCreateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsCreateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -19,9 +19,7 @@ */ public final class AccountsCreateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * CreateAccountMin.json + * x-ms-original-file: 2026-01-15-preview/CreateAccountMin.json */ /** * Sample code: Create Account Min. @@ -33,17 +31,15 @@ public static void createAccountMin(com.azure.resourcemanager.cognitiveservices. .define("testCreate1") .withExistingResourceGroup("myResourceGroup") .withRegion("West US") + .withProperties(new AccountProperties()) .withKind("CognitiveServices") .withSku(new Sku().withName("S0")) .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withProperties(new AccountProperties()) .create(); } /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * CreateAccount.json + * x-ms-original-file: 2026-01-15-preview/CreateAccount.json */ /** * Sample code: Create Account. @@ -55,9 +51,6 @@ public static void createAccount(com.azure.resourcemanager.cognitiveservices.Cog .define("testCreate1") .withExistingResourceGroup("myResourceGroup") .withRegion("West US") - .withKind("Emotion") - .withSku(new Sku().withName("S0")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) .withProperties(new AccountProperties() .withEncryption( new Encryption().withKeyVaultProperties(new KeyVaultProperties().withKeyName("fakeTokenPlaceholder") @@ -65,6 +58,9 @@ public static void createAccount(com.azure.resourcemanager.cognitiveservices.Cog .withKeyVaultUri("fakeTokenPlaceholder")).withKeySource(KeySource.MICROSOFT_KEY_VAULT)) .withUserOwnedStorage(Arrays.asList(new UserOwnedStorage().withResourceId( "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount")))) + .withKind("Emotion") + .withSku(new Sku().withName("S0")) + .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) .create(); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsDeleteSamples.java index 03a051d448a4..34df66fa135c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsDeleteSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class AccountsDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * DeleteAccount.json + * x-ms-original-file: 2026-01-15-preview/DeleteAccount.json */ /** * Sample code: Delete Account. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsGetByResourceGroupSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsGetByResourceGroupSamples.java index e5b664eb6117..924f56c806e5 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsGetByResourceGroupSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsGetByResourceGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class AccountsGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetAccount.json + * x-ms-original-file: 2026-01-15-preview/GetAccount.json */ /** * Sample code: Get Account. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListByResourceGroupSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListByResourceGroupSamples.java index c34f348a1aa7..e158af59a299 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListByResourceGroupSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListByResourceGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class AccountsListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListAccountsByResourceGroup.json + * x-ms-original-file: 2026-01-15-preview/ListAccountsByResourceGroup.json */ /** * Sample code: List Accounts by Resource Group. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListKeysSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListKeysSamples.java index aefe38b46bd5..1d077a1177a1 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListKeysSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListKeysSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class AccountsListKeysSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ListKeys. - * json + * x-ms-original-file: 2026-01-15-preview/ListKeys.json */ /** * Sample code: List Keys. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListModelsSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListModelsSamples.java index a14729e66517..57cc71a2e9f3 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListModelsSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListModelsSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class AccountsListModelsSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListAccountModels.json + * x-ms-original-file: 2026-01-15-preview/ListAccountModels.json */ /** * Sample code: List AccountModels. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListSamples.java index a3a7a77b9e3d..eac03d97434b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class AccountsListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListAccountsBySubscription.json + * x-ms-original-file: 2026-01-15-preview/ListAccountsBySubscription.json */ /** * Sample code: List Accounts by Subscription. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListSkusSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListSkusSamples.java index 48ac5672b260..ffcd25d455be 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListSkusSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListSkusSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class AccountsListSkusSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ListSkus. - * json + * x-ms-original-file: 2026-01-15-preview/ListSkus.json */ /** * Sample code: List SKUs. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListUsagesSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListUsagesSamples.java index 894e53459ec7..65757c3b8ef4 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListUsagesSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListUsagesSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class AccountsListUsagesSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/GetUsages - * .json + * x-ms-original-file: 2026-01-15-preview/GetUsages.json */ /** * Sample code: Get Usages. @@ -22,4 +20,46 @@ public static void getUsages(com.azure.resourcemanager.cognitiveservices.Cogniti manager.accounts() .listUsagesWithResponse("myResourceGroup", "TestUsage02", null, com.azure.core.util.Context.NONE); } + + /* + * x-ms-original-file: 2026-01-15-preview/GetUsagesClassicScope.json + */ + /** + * Sample code: Get Usages Classic Scope. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + getUsagesClassicScope(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accounts() + .listUsagesWithResponse("myResourceGroup", "TestUsage02", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-01-15-preview/GetUsagesDataZoneScope.json + */ + /** + * Sample code: Get Usages DataZone Scope. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + getUsagesDataZoneScope(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accounts() + .listUsagesWithResponse("myResourceGroup", "TestUsage02", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-01-15-preview/GetUsagesGlobalScope.json + */ + /** + * Sample code: Get Usages Global Scope. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + getUsagesGlobalScope(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.accounts() + .listUsagesWithResponse("myResourceGroup", "TestUsage02", null, com.azure.core.util.Context.NONE); + } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsRegenerateKeySamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsRegenerateKeySamples.java index bee5172599fb..7db917862220 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsRegenerateKeySamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsRegenerateKeySamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,9 +12,7 @@ */ public final class AccountsRegenerateKeySamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * RegenerateKey.json + * x-ms-original-file: 2026-01-15-preview/RegenerateKey.json */ /** * Sample code: Regenerate Keys. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsUpdateSamples.java index 44c36086cc99..3b9e279904d6 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsUpdateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,9 +12,7 @@ */ public final class AccountsUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * UpdateAccount.json + * x-ms-original-file: 2026-01-15-preview/UpdateAccount.json */ /** * Sample code: Update Account. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsCreateOrUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..15e43d9bd040 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsCreateOrUpdateSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.resourcemanager.cognitiveservices.models.AgenticApplicationProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AgentApplications CreateOrUpdate. + */ +public final class AgentApplicationsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-15-preview/AgentApplication/createOrUpdate.json + */ + /** + * Sample code: Create or Update Account Agent Application. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void createOrUpdateAccountAgentApplication( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.agentApplications() + .define("agent-app-1") + .withExistingProject("test-rg", "my-cognitive-services-account", "my-project") + .withProperties( + new AgenticApplicationProperties().withDescription("Sample agent application for customer support") + .withTags(mapOf("environment", "production", "team", "ai-platform")) + .withDisplayName("Customer Support Agent")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsDeleteSamples.java new file mode 100644 index 000000000000..b762a4fb1375 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for AgentApplications Delete. + */ +public final class AgentApplicationsDeleteSamples { + /* + * x-ms-original-file: 2026-01-15-preview/AgentApplication/delete.json + */ + /** + * Sample code: Delete Account Agent Application. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + deleteAccountAgentApplication(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.agentApplications() + .delete("test-rg", "my-cognitive-services-account", "my-project", "agent-app-1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsDisableSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsDisableSamples.java new file mode 100644 index 000000000000..6ea7ea76dac0 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsDisableSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for AgentApplications Disable. + */ +public final class AgentApplicationsDisableSamples { + /* + * x-ms-original-file: 2026-01-15-preview/AgentApplication/disable.json + */ + /** + * Sample code: Disable Agent Application. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + disableAgentApplication(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.agentApplications() + .disableWithResponse("test-rg", "my-cognitive-services-account", "my-project", "agent-app-1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsEnableSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsEnableSamples.java new file mode 100644 index 000000000000..58c4ed77c8ad --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsEnableSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for AgentApplications Enable. + */ +public final class AgentApplicationsEnableSamples { + /* + * x-ms-original-file: 2026-01-15-preview/AgentApplication/enable.json + */ + /** + * Sample code: Enable Agent Application. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + enableAgentApplication(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.agentApplications() + .enableWithResponse("test-rg", "my-cognitive-services-account", "my-project", "agent-app-1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsGetSamples.java new file mode 100644 index 000000000000..a7a6b47340fb --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for AgentApplications Get. + */ +public final class AgentApplicationsGetSamples { + /* + * x-ms-original-file: 2026-01-15-preview/AgentApplication/get.json + */ + /** + * Sample code: Get Account Agent Application. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + getAccountAgentApplication(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.agentApplications() + .getWithResponse("test-rg", "my-cognitive-services-account", "my-project", "agent-app-1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsListAgentsSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsListAgentsSamples.java new file mode 100644 index 000000000000..9537c720a0ec --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsListAgentsSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for AgentApplications ListAgents. + */ +public final class AgentApplicationsListAgentsSamples { + /* + * x-ms-original-file: 2026-01-15-preview/AgentApplication/listAgents.json + */ + /** + * Sample code: List Agents for Agent Application. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + listAgentsForAgentApplication(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.agentApplications() + .listAgentsWithResponse("test-rg", "my-cognitive-services-account", "my-project", "agent-app-1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsListSamples.java new file mode 100644 index 000000000000..cca51e47301b --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsListSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import java.util.Arrays; + +/** + * Samples for AgentApplications List. + */ +public final class AgentApplicationsListSamples { + /* + * x-ms-original-file: 2026-01-15-preview/AgentApplication/list.json + */ + /** + * Sample code: List Account Agent Applications. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + listAccountAgentApplications(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.agentApplications() + .list("test-rg", "my-cognitive-services-account", "my-project", 30, null, "string", + Arrays.asList("agent-app-1", "agent-app-2"), "test", "name", true, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsCreateOrUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..8cb41f9931a2 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsCreateOrUpdateSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.resourcemanager.cognitiveservices.models.AgentDeploymentState; +import com.azure.resourcemanager.cognitiveservices.models.AgentProtocol; +import com.azure.resourcemanager.cognitiveservices.models.AgentProtocolVersion; +import com.azure.resourcemanager.cognitiveservices.models.ManagedAgentDeployment; +import com.azure.resourcemanager.cognitiveservices.models.VersionedAgentReference; +import java.util.Arrays; + +/** + * Samples for AgentDeployments CreateOrUpdate. + */ +public final class AgentDeploymentsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-15-preview/AgentDeployment/createOrUpdate.json + */ + /** + * Sample code: Create or Update Agent Deployment. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + createOrUpdateAgentDeployment(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.agentDeployments() + .define("deployment-1") + .withExistingApplication("test-rg", "my-cognitive-services-account", "my-project", "agent-app-1") + .withProperties(new ManagedAgentDeployment().withDisplayName("Production Deployment") + .withState(AgentDeploymentState.STARTING) + .withProtocols( + Arrays.asList(new AgentProtocolVersion().withProtocol(AgentProtocol.AGENT).withVersion("1.0"))) + .withAgents(Arrays.asList(new VersionedAgentReference().withAgentId("agent-123") + .withAgentName("support-agent") + .withAgentVersion("1.0.0")))) + .create(); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsDeleteSamples.java new file mode 100644 index 000000000000..4de25a38dafa --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for AgentDeployments Delete. + */ +public final class AgentDeploymentsDeleteSamples { + /* + * x-ms-original-file: 2026-01-15-preview/AgentDeployment/delete.json + */ + /** + * Sample code: Delete Agent Deployment. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + deleteAgentDeployment(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.agentDeployments() + .delete("test-rg", "my-cognitive-services-account", "my-project", "agent-app-1", "deployment-1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsGetSamples.java new file mode 100644 index 000000000000..ea54d16e6099 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for AgentDeployments Get. + */ +public final class AgentDeploymentsGetSamples { + /* + * x-ms-original-file: 2026-01-15-preview/AgentDeployment/get.json + */ + /** + * Sample code: Get Agent Deployment. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + getAgentDeployment(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.agentDeployments() + .getWithResponse("test-rg", "my-cognitive-services-account", "my-project", "agent-app-1", "deployment-1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsListSamples.java new file mode 100644 index 000000000000..610d7c6bde7e --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for AgentDeployments List. + */ +public final class AgentDeploymentsListSamples { + /* + * x-ms-original-file: 2026-01-15-preview/AgentDeployment/list.json + */ + /** + * Sample code: List Agent Deployments. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + listAgentDeployments(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.agentDeployments() + .list("test-rg", "my-cognitive-services-account", "my-project", "agent-app-1", null, null, null, null, null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsStartSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsStartSamples.java new file mode 100644 index 000000000000..1536d1e1c83e --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsStartSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for AgentDeployments Start. + */ +public final class AgentDeploymentsStartSamples { + /* + * x-ms-original-file: 2026-01-15-preview/AgentDeployment/start.json + */ + /** + * Sample code: Start Agent Deployment. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + startAgentDeployment(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.agentDeployments() + .startWithResponse("test-rg", "my-cognitive-services-account", "my-project", "agent-app-1", "deployment-1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsStopSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsStopSamples.java new file mode 100644 index 000000000000..c030e21e8511 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsStopSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for AgentDeployments Stop. + */ +public final class AgentDeploymentsStopSamples { + /* + * x-ms-original-file: 2026-01-15-preview/AgentDeployment/stop.json + */ + /** + * Sample code: Stop Agent Deployment. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + stopAgentDeployment(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.agentDeployments() + .stopWithResponse("test-rg", "my-cognitive-services-account", "my-project", "agent-app-1", "deployment-1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateAssociationSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateAssociationSamples.java index ade535913864..06b9e3290d15 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateAssociationSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateAssociationSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class CommitmentPlansCreateOrUpdateAssociationSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * CreateSharedCommitmentPlanAssociation.json + * x-ms-original-file: 2026-01-15-preview/CreateSharedCommitmentPlanAssociation.json */ /** * Sample code: PutCommitmentPlan. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdatePlanSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdatePlanSamples.java index e658637144a6..1fe87fcb7b48 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdatePlanSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdatePlanSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -14,9 +14,7 @@ */ public final class CommitmentPlansCreateOrUpdatePlanSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * CreateSharedCommitmentPlan.json + * x-ms-original-file: 2026-01-15-preview/CreateSharedCommitmentPlan.json */ /** * Sample code: Create Commitment Plan. @@ -29,12 +27,12 @@ public final class CommitmentPlansCreateOrUpdatePlanSamples { .definePlan("commitmentPlanName") .withExistingResourceGroup("resourceGroupName") .withRegion("West US") - .withKind("SpeechServices") - .withSku(new Sku().withName("S0")) .withProperties(new CommitmentPlanProperties().withHostingModel(HostingModel.WEB) .withPlanType("STT") .withCurrent(new CommitmentPeriod().withTier("T1")) .withAutoRenew(true)) + .withKind("SpeechServices") + .withSku(new Sku().withName("S0")) .create(); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateSamples.java index db8f79e6b108..8a8da0749fb3 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -14,9 +14,7 @@ */ public final class CommitmentPlansCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * PutCommitmentPlan.json + * x-ms-original-file: 2026-01-15-preview/PutCommitmentPlan.json */ /** * Sample code: PutCommitmentPlan. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteAssociationSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteAssociationSamples.java index 7c445c3e78bf..3fa824ab2a9b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteAssociationSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteAssociationSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class CommitmentPlansDeleteAssociationSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * DeleteSharedCommitmentPlanAssociation.json + * x-ms-original-file: 2026-01-15-preview/DeleteSharedCommitmentPlanAssociation.json */ /** * Sample code: DeleteCommitmentPlan. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeletePlanSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeletePlanSamples.java index b6dc329fa48e..17cebe1ce05f 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeletePlanSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeletePlanSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class CommitmentPlansDeletePlanSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * DeleteSharedCommitmentPlan.json + * x-ms-original-file: 2026-01-15-preview/DeleteSharedCommitmentPlan.json */ /** * Sample code: Delete Commitment Plan. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteSamples.java index 8cd647b8026d..b76efef292d8 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class CommitmentPlansDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * DeleteCommitmentPlan.json + * x-ms-original-file: 2026-01-15-preview/DeleteCommitmentPlan.json */ /** * Sample code: DeleteCommitmentPlan. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetAssociationSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetAssociationSamples.java index 5f6c646ea255..bcdd0ad95604 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetAssociationSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetAssociationSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class CommitmentPlansGetAssociationSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetSharedCommitmentPlanAssociation.json + * x-ms-original-file: 2026-01-15-preview/GetSharedCommitmentPlanAssociation.json */ /** * Sample code: GetCommitmentPlan. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetByResourceGroupSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetByResourceGroupSamples.java index 2d6e30007568..001093c1efb6 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetByResourceGroupSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetByResourceGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class CommitmentPlansGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetSharedCommitmentPlan.json + * x-ms-original-file: 2026-01-15-preview/GetSharedCommitmentPlan.json */ /** * Sample code: Get Commitment Plan. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetSamples.java index 2ff15af27a17..cea5515c0d82 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class CommitmentPlansGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetCommitmentPlan.json + * x-ms-original-file: 2026-01-15-preview/GetCommitmentPlan.json */ /** * Sample code: GetCommitmentPlan. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListAssociationsSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListAssociationsSamples.java index 127bb2a8699e..59512cbd41c4 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListAssociationsSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListAssociationsSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class CommitmentPlansListAssociationsSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListSharedCommitmentPlanAssociations.json + * x-ms-original-file: 2026-01-15-preview/ListSharedCommitmentPlanAssociations.json */ /** * Sample code: ListCommitmentPlans. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListByResourceGroupSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListByResourceGroupSamples.java index 80e29a5e7137..f73e9fc1b65f 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListByResourceGroupSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListByResourceGroupSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class CommitmentPlansListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListSharedCommitmentPlansByResourceGroup.json + * x-ms-original-file: 2026-01-15-preview/ListSharedCommitmentPlansByResourceGroup.json */ /** * Sample code: List Commitment Plans by Resource Group. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListPlansBySubscriptionSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListPlansBySubscriptionSamples.java index 3f9b68a06ea9..09f8354fbbe8 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListPlansBySubscriptionSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListPlansBySubscriptionSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class CommitmentPlansListPlansBySubscriptionSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListSharedCommitmentPlansBySubscription.json + * x-ms-original-file: 2026-01-15-preview/ListSharedCommitmentPlansBySubscription.json */ /** * Sample code: List Accounts by Subscription. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListSamples.java index cde20e063f57..48e563ce0377 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class CommitmentPlansListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListCommitmentPlans.json + * x-ms-original-file: 2026-01-15-preview/ListCommitmentPlans.json */ /** * Sample code: ListCommitmentPlans. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansUpdatePlanSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansUpdatePlanSamples.java index dcbc5fa64bfb..0c6d557df4bc 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansUpdatePlanSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansUpdatePlanSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -13,9 +13,7 @@ */ public final class CommitmentPlansUpdatePlanSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * UpdateSharedCommitmentPlan.json + * x-ms-original-file: 2026-01-15-preview/UpdateSharedCommitmentPlan.json */ /** * Sample code: Create Commitment Plan. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTiersListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTiersListSamples.java index f2890937a65e..8a32242e05ae 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTiersListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTiersListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class CommitmentTiersListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListCommitmentTiers.json + * x-ms-original-file: 2026-01-15-preview/ListCommitmentTiers.json */ /** * Sample code: ListCommitmentTiers. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ComputeOperationsGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ComputeOperationsGetSamples.java new file mode 100644 index 000000000000..e928505f5e1c --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ComputeOperationsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for ComputeOperations Get. + */ +public final class ComputeOperationsGetSamples { + /* + * x-ms-original-file: 2026-01-15-preview/GetComputeOperationStatus.json + */ + /** + * Sample code: GetComputeOperationStatus. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + getComputeOperationStatus(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.computeOperations() + .getWithResponse("eastus", "00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsCreateOrUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsCreateOrUpdateSamples.java index b4ccaf85bf67..5b904f963a4f 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsCreateOrUpdateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -11,9 +11,7 @@ */ public final class DefenderForAISettingsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * PutDefenderForAISetting.json + * x-ms-original-file: 2026-01-15-preview/PutDefenderForAISetting.json */ /** * Sample code: PutDefenderForAISetting. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsGetSamples.java index 1ec2420be757..1ee010c45b07 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsGetSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class DefenderForAISettingsGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetDefenderForAISetting.json + * x-ms-original-file: 2026-01-15-preview/GetDefenderForAISetting.json */ /** * Sample code: GetDefenderForAISetting. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsListSamples.java index de55835689c4..982cf05de5fc 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class DefenderForAISettingsListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListDefenderForAISetting.json + * x-ms-original-file: 2026-01-15-preview/ListDefenderForAISetting.json */ /** * Sample code: ListDefenderForAISetting. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsUpdateSamples.java index 44be8eee4d5f..08046fa80f8b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsUpdateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,9 +12,7 @@ */ public final class DefenderForAISettingsUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * UpdateDefenderForAISetting.json + * x-ms-original-file: 2026-01-15-preview/UpdateDefenderForAISetting.json */ /** * Sample code: UpdateDefenderForAISetting. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsGetSamples.java index 85f9e42565f8..7ce33ba2f6b3 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsGetSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class DeletedAccountsGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetDeletedAccount.json + * x-ms-original-file: 2026-01-15-preview/GetDeletedAccount.json */ /** * Sample code: Get Account. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsListSamples.java index 358e0402c279..83f0cf491162 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class DeletedAccountsListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListDeletedAccountsBySubscription.json + * x-ms-original-file: 2026-01-15-preview/ListDeletedAccountsBySubscription.json */ /** * Sample code: List Deleted Accounts by Subscription. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsPurgeSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsPurgeSamples.java index 468c85ab511f..6354c30d9e3e 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsPurgeSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsPurgeSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class DeletedAccountsPurgeSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * PurgeDeletedAccount.json + * x-ms-original-file: 2026-01-15-preview/PurgeDeletedAccount.json */ /** * Sample code: Delete Account. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsCreateOrUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsCreateOrUpdateSamples.java index a3ba8715071a..c81c9db6579b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsCreateOrUpdateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsCreateOrUpdateSamples.java @@ -1,11 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.resourcemanager.cognitiveservices.models.DeploymentModel; import com.azure.resourcemanager.cognitiveservices.models.DeploymentProperties; +import com.azure.resourcemanager.cognitiveservices.models.DeploymentState; +import com.azure.resourcemanager.cognitiveservices.models.ServiceTier; import com.azure.resourcemanager.cognitiveservices.models.Sku; /** @@ -13,9 +15,7 @@ */ public final class DeploymentsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * PutDeployment.json + * x-ms-original-file: 2026-01-15-preview/PutDeployment.json */ /** * Sample code: PutDeployment. @@ -26,9 +26,11 @@ public static void putDeployment(com.azure.resourcemanager.cognitiveservices.Cog manager.deployments() .define("deploymentName") .withExistingAccount("resourceGroupName", "accountName") - .withSku(new Sku().withName("Standard").withCapacity(1)) .withProperties(new DeploymentProperties() - .withModel(new DeploymentModel().withFormat("OpenAI").withName("ada").withVersion("1"))) + .withModel(new DeploymentModel().withFormat("OpenAI").withName("ada").withVersion("1")) + .withServiceTier(ServiceTier.PRIORITY) + .withDeploymentState(DeploymentState.RUNNING)) + .withSku(new Sku().withName("Standard").withCapacity(1)) .create(); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsDeleteSamples.java index 604a87387286..763d67854164 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsDeleteSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class DeploymentsDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * DeleteDeployment.json + * x-ms-original-file: 2026-01-15-preview/DeleteDeployment.json */ /** * Sample code: DeleteDeployment. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsGetSamples.java index 603b3b19281e..8a478b2eabc5 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsGetSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class DeploymentsGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetDeployment.json + * x-ms-original-file: 2026-01-15-preview/GetDeployment.json */ /** * Sample code: GetDeployment. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsListSamples.java index 16be8eef2892..a9a2c2cd9362 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class DeploymentsListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListDeployments.json + * x-ms-original-file: 2026-01-15-preview/ListDeployments.json */ /** * Sample code: ListDeployments. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsListSkusSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsListSkusSamples.java index 138b55ea6e84..8337c26e7001 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsListSkusSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsListSkusSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class DeploymentsListSkusSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListDeploymentSkus.json + * x-ms-original-file: 2026-01-15-preview/ListDeploymentSkus.json */ /** * Sample code: ListDeploymentSkus. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsPauseSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsPauseSamples.java new file mode 100644 index 000000000000..1ad71fcb9b58 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsPauseSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for Deployments Pause. + */ +public final class DeploymentsPauseSamples { + /* + * x-ms-original-file: 2026-01-15-preview/PauseDeployment.json + */ + /** + * Sample code: PauseDeployment. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void pauseDeployment(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.deployments() + .pauseWithResponse("resourceGroupName", "accountName", "deploymentName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsResumeSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsResumeSamples.java new file mode 100644 index 000000000000..8f60467a166e --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsResumeSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for Deployments Resume. + */ +public final class DeploymentsResumeSamples { + /* + * x-ms-original-file: 2026-01-15-preview/ResumeDeployment.json + */ + /** + * Sample code: ResumeDeployment. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void resumeDeployment(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.deployments() + .resumeWithResponse("resourceGroupName", "accountName", "deploymentName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsUpdateSamples.java index c89c30efd51c..0a27ee282707 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsUpdateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,9 +12,7 @@ */ public final class DeploymentsUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * UpdateDeployment.json + * x-ms-original-file: 2026-01-15-preview/UpdateDeployment.json */ /** * Sample code: UpdateDeployment. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesCreateOrUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesCreateOrUpdateSamples.java index 3fc59d58cd73..cd3033f222e9 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesCreateOrUpdateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -14,9 +14,7 @@ */ public final class EncryptionScopesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * PutEncryptionScope.json + * x-ms-original-file: 2026-01-15-preview/PutEncryptionScope.json */ /** * Sample code: PutEncryptionScope. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesDeleteSamples.java index 10ecfa0d534d..53958f9bcfa5 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesDeleteSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class EncryptionScopesDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * DeleteEncryptionScope.json + * x-ms-original-file: 2026-01-15-preview/DeleteEncryptionScope.json */ /** * Sample code: DeleteEncryptionScope. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesGetSamples.java index ffab27146fc9..709a9abd9768 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesGetSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class EncryptionScopesGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetEncryptionScope.json + * x-ms-original-file: 2026-01-15-preview/GetEncryptionScope.json */ /** * Sample code: GetEncryptionScope. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesListSamples.java index da5cdeb7e97c..a30e0ad98f77 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/EncryptionScopesListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class EncryptionScopesListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListEncryptionScopes.json + * x-ms-original-file: 2026-01-15-preview/ListEncryptionScopes.json */ /** * Sample code: ListEncryptionScopes. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/LocationBasedModelCapacitiesListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/LocationBasedModelCapacitiesListSamples.java index 9ebd745c7278..5c4186a8ca2c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/LocationBasedModelCapacitiesListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/LocationBasedModelCapacitiesListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,46 @@ */ public final class LocationBasedModelCapacitiesListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListLocationBasedModelCapacities.json + * x-ms-original-file: 2026-01-15-preview/ListLocationBasedModelCapacitiesGlobalScope.json + */ + /** + * Sample code: ListLocationBasedModelCapacities Global Scope. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void listLocationBasedModelCapacitiesGlobalScope( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.locationBasedModelCapacities().list("WestUS", "OpenAI", "ada", "1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-01-15-preview/ListLocationBasedModelCapacitiesClassicScope.json + */ + /** + * Sample code: ListLocationBasedModelCapacities Classic Scope. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void listLocationBasedModelCapacitiesClassicScope( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.locationBasedModelCapacities().list("WestUS", "OpenAI", "ada", "1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-01-15-preview/ListLocationBasedModelCapacitiesDataZoneScope.json + */ + /** + * Sample code: ListLocationBasedModelCapacities DataZone Scope. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void listLocationBasedModelCapacitiesDataZoneScope( + com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.locationBasedModelCapacities().list("WestUS", "OpenAI", "ada", "1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-01-15-preview/ListLocationBasedModelCapacities.json */ /** * Sample code: ListLocationBasedModelCapacities. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkProvisionsProvisionManagedNetworkSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkProvisionsProvisionManagedNetworkSamples.java new file mode 100644 index 000000000000..02f83a4b5f57 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkProvisionsProvisionManagedNetworkSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkProvisionOptions; + +/** + * Samples for ManagedNetworkProvisions ProvisionManagedNetwork. + */ +public final class ManagedNetworkProvisionsProvisionManagedNetworkSamples { + /* + * x-ms-original-file: 2026-01-15-preview/ManagedNetwork/provisionManagedNetwork.json + */ + /** + * Sample code: Provision ManagedNetwork. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + provisionManagedNetwork(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.managedNetworkProvisions() + .provisionManagedNetwork("test-rg", "cognitive-account-name", "default", + new ManagedNetworkProvisionOptions(), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationDeleteSamples.java new file mode 100644 index 000000000000..b140a3ee6895 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for ManagedNetworkSettingsOperation Delete. + */ +public final class ManagedNetworkSettingsOperationDeleteSamples { + /* + * x-ms-original-file: 2026-01-15-preview/ManagedNetwork/deleteManagedNetworkV2.json + */ + /** + * Sample code: Delete ManagedNetworkSettings. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + deleteManagedNetworkSettings(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.managedNetworkSettingsOperations() + .delete("test-rg", "cognitive-account-name", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationGetSamples.java new file mode 100644 index 000000000000..d2a48645f879 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for ManagedNetworkSettingsOperation Get. + */ +public final class ManagedNetworkSettingsOperationGetSamples { + /* + * x-ms-original-file: 2026-01-15-preview/ManagedNetwork/getManagedNetworkV2.json + */ + /** + * Sample code: Get ManagedNetworkSettings. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + getManagedNetworkSettings(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.managedNetworkSettingsOperations() + .getWithResponse("test-rg", "cognitive-account-name", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationListSamples.java new file mode 100644 index 000000000000..e59b8e492f5b --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for ManagedNetworkSettingsOperation List. + */ +public final class ManagedNetworkSettingsOperationListSamples { + /* + * x-ms-original-file: 2026-01-15-preview/ManagedNetwork/listManagedNetworkV2.json + */ + /** + * Sample code: List ManagedNetworkSettings. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + listManagedNetworkSettings(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.managedNetworkSettingsOperations() + .list("test-rg", "cognitive-account-name", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationPatchSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationPatchSamples.java new file mode 100644 index 000000000000..32f34ddfdd06 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationPatchSamples.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.resourcemanager.cognitiveservices.models.FirewallSku; +import com.azure.resourcemanager.cognitiveservices.models.FqdnOutboundRule; +import com.azure.resourcemanager.cognitiveservices.models.IsolationMode; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsEx; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsProperties; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsPropertiesBasicResource; +import com.azure.resourcemanager.cognitiveservices.models.RuleCategory; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ManagedNetworkSettingsOperation Patch. + */ +public final class ManagedNetworkSettingsOperationPatchSamples { + /* + * x-ms-original-file: 2026-01-15-preview/ManagedNetwork/patchManagedNetworkV2.json + */ + /** + * Sample code: Patch ManagedNetworkSettings. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + patchManagedNetworkSettings(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + ManagedNetworkSettingsPropertiesBasicResource resource = manager.managedNetworkSettingsOperations() + .getWithResponse("test-rg", "cognitive-account-name", "default", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new ManagedNetworkSettingsProperties().withManagedNetwork( + new ManagedNetworkSettingsEx().withIsolationMode(IsolationMode.ALLOW_ONLY_APPROVED_OUTBOUND) + .withOutboundRules(mapOf("rule_name_1", + new FqdnOutboundRule().withCategory(RuleCategory.USER_DEFINED) + .withDestination("destination_endpoint"))) + .withFirewallSku(FirewallSku.STANDARD))) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationPutSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationPutSamples.java new file mode 100644 index 000000000000..52190a05178e --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationPutSamples.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.resourcemanager.cognitiveservices.models.FirewallSku; +import com.azure.resourcemanager.cognitiveservices.models.FqdnOutboundRule; +import com.azure.resourcemanager.cognitiveservices.models.IsolationMode; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsEx; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsProperties; +import com.azure.resourcemanager.cognitiveservices.models.RuleCategory; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ManagedNetworkSettingsOperation Put. + */ +public final class ManagedNetworkSettingsOperationPutSamples { + /* + * x-ms-original-file: 2026-01-15-preview/ManagedNetwork/createOrUpdateManagedNetworkV2.json + */ + /** + * Sample code: Put ManagedNetworkSettings. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + putManagedNetworkSettings(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.managedNetworkSettingsOperations() + .define("default") + .withExistingAccount("test-rg", "cognitive-account-name") + .withProperties(new ManagedNetworkSettingsProperties().withManagedNetwork( + new ManagedNetworkSettingsEx().withIsolationMode(IsolationMode.ALLOW_ONLY_APPROVED_OUTBOUND) + .withOutboundRules(mapOf("rule_name_1", + new FqdnOutboundRule().withCategory(RuleCategory.USER_DEFINED) + .withDestination("destination_endpoint"))) + .withFirewallSku(FirewallSku.STANDARD))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ModelCapacitiesListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ModelCapacitiesListSamples.java index 8a5c57280efa..a66ce313fdb0 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ModelCapacitiesListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ModelCapacitiesListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class ModelCapacitiesListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListModelCapacities.json + * x-ms-original-file: 2026-01-15-preview/ListModelCapacities.json */ /** * Sample code: ListModelCapacities. @@ -22,4 +20,43 @@ public final class ModelCapacitiesListSamples { listModelCapacities(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { manager.modelCapacities().list("OpenAI", "ada", "1", com.azure.core.util.Context.NONE); } + + /* + * x-ms-original-file: 2026-01-15-preview/ListModelCapacitiesDataZoneScope.json + */ + /** + * Sample code: ListModelCapacities DataZone Scope. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + listModelCapacitiesDataZoneScope(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.modelCapacities().list("OpenAI", "ada", "1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-01-15-preview/ListModelCapacitiesGlobalScope.json + */ + /** + * Sample code: ListModelCapacities Global Scope. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + listModelCapacitiesGlobalScope(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.modelCapacities().list("OpenAI", "ada", "1", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-01-15-preview/ListModelCapacitiesClassicScope.json + */ + /** + * Sample code: ListModelCapacities Classic Scope. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + listModelCapacitiesClassicScope(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.modelCapacities().list("OpenAI", "ada", "1", com.azure.core.util.Context.NONE); + } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ModelsListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ModelsListSamples.java index 9cac761faaab..9432e676e9a0 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ModelsListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ModelsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class ModelsListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListLocationModels.json + * x-ms-original-file: 2026-01-15-preview/ListLocationModels.json */ /** * Sample code: ListLocationModels. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsGetSamples.java index 5e1aea384af0..3a68a548c5a7 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsGetSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class NetworkSecurityPerimeterConfigurationsGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetNetworkSecurityPerimeterConfigurations.json + * x-ms-original-file: 2026-01-15-preview/GetNetworkSecurityPerimeterConfigurations.json */ /** * Sample code: GetNetworkSecurityPerimeterConfigurations. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsListSamples.java index 9252b9f41a87..0ead2d42a215 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class NetworkSecurityPerimeterConfigurationsListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListNetworkSecurityPerimeterConfigurations.json + * x-ms-original-file: 2026-01-15-preview/ListNetworkSecurityPerimeterConfigurations.json */ /** * Sample code: ListNetworkSecurityPerimeterConfigurations. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsReconcileSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsReconcileSamples.java index 7320f0975d21..a361562402b2 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsReconcileSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsReconcileSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class NetworkSecurityPerimeterConfigurationsReconcileSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ReconcileNetworkSecurityPerimeterConfigurations.json + * x-ms-original-file: 2026-01-15-preview/ReconcileNetworkSecurityPerimeterConfigurations.json */ /** * Sample code: ReconcileNetworkSecurityPerimeterConfigurations. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/OperationsListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/OperationsListSamples.java index 594fb9cfb3ad..75c05f0d5fff 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/OperationsListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/OperationsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetOperations.json + * x-ms-original-file: 2026-01-15-preview/GetOperations.json */ /** * Sample code: Get Operations. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRuleCreateOrUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRuleCreateOrUpdateSamples.java new file mode 100644 index 000000000000..50205a3f0336 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRuleCreateOrUpdateSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.resourcemanager.cognitiveservices.models.FqdnOutboundRule; +import com.azure.resourcemanager.cognitiveservices.models.RuleCategory; +import com.azure.resourcemanager.cognitiveservices.models.RuleStatus; + +/** + * Samples for OutboundRule CreateOrUpdate. + */ +public final class OutboundRuleCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-15-preview/ManagedNetwork/createOrUpdateRuleV2.json + */ + /** + * Sample code: CreateOrUpdate OutboundRule. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + createOrUpdateOutboundRule(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.outboundRules() + .define("rule_name_1") + .withExistingManagedNetwork("test-rg", "cognitive-account-name", "default") + .withProperties(new FqdnOutboundRule().withCategory(RuleCategory.USER_DEFINED) + .withStatus(RuleStatus.ACTIVE) + .withDestination("destination_endpoint")) + .create(); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRuleDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRuleDeleteSamples.java new file mode 100644 index 000000000000..e01bb2c4226e --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRuleDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for OutboundRule Delete. + */ +public final class OutboundRuleDeleteSamples { + /* + * x-ms-original-file: 2026-01-15-preview/ManagedNetwork/deleteRuleV2.json + */ + /** + * Sample code: Delete OutboundRule. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + deleteOutboundRule(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.outboundRules() + .delete("test-rg", "cognitive-account-name", "default", "rule-name", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRuleGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRuleGetSamples.java new file mode 100644 index 000000000000..cc07015fa54d --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRuleGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for OutboundRule Get. + */ +public final class OutboundRuleGetSamples { + /* + * x-ms-original-file: 2026-01-15-preview/ManagedNetwork/getRuleV2.json + */ + /** + * Sample code: Get OutboundRule. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void getOutboundRule(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.outboundRules() + .getWithResponse("test-rg", "cognitive-account-name", "default", "name_of_the_fqdn_rule", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRuleListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRuleListSamples.java new file mode 100644 index 000000000000..c045c744b3c4 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRuleListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for OutboundRule List. + */ +public final class OutboundRuleListSamples { + /* + * x-ms-original-file: 2026-01-15-preview/ManagedNetwork/listRuleV2.json + */ + /** + * Sample code: List OutboundRules. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void listOutboundRules(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.outboundRules().list("test-rg", "cognitive-account-name", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRulesOperationPostSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRulesOperationPostSamples.java new file mode 100644 index 000000000000..feb829a004f5 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRulesOperationPostSamples.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsBasicResourceInner; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsInner; +import com.azure.resourcemanager.cognitiveservices.models.FirewallSku; +import com.azure.resourcemanager.cognitiveservices.models.FqdnOutboundRule; +import com.azure.resourcemanager.cognitiveservices.models.IsolationMode; +import com.azure.resourcemanager.cognitiveservices.models.RuleCategory; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for OutboundRulesOperation Post. + */ +public final class OutboundRulesOperationPostSamples { + /* + * x-ms-original-file: 2026-01-15-preview/ManagedNetwork/postOutboundRulesV2.json + */ + /** + * Sample code: Post OutboundRules. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void postOutboundRules(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.outboundRulesOperations() + .post("test-rg", "cognitive-account-name", "default", + new ManagedNetworkSettingsBasicResourceInner().withProperties( + new ManagedNetworkSettingsInner().withIsolationMode(IsolationMode.ALLOW_ONLY_APPROVED_OUTBOUND) + .withOutboundRules(mapOf("rule_name_1", + new FqdnOutboundRule().withCategory(RuleCategory.USER_DEFINED) + .withDestination("destination_endpoint"))) + .withFirewallSku(FirewallSku.STANDARD)), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java index 6c8ac2cbe7d6..2824447e7c32 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -13,9 +13,7 @@ */ public final class PrivateEndpointConnectionsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * PutPrivateEndpointConnection.json + * x-ms-original-file: 2026-01-15-preview/PutPrivateEndpointConnection.json */ /** * Sample code: PutPrivateEndpointConnection. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsDeleteSamples.java index cd95e7f0b298..02dcfb385ddc 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsDeleteSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class PrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * DeletePrivateEndpointConnection.json + * x-ms-original-file: 2026-01-15-preview/DeletePrivateEndpointConnection.json */ /** * Sample code: DeletePrivateEndpointConnection. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsGetSamples.java index c5c994a43d35..1f4e2f6bc28c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsGetSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class PrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetPrivateEndpointConnection.json + * x-ms-original-file: 2026-01-15-preview/GetPrivateEndpointConnection.json */ /** * Sample code: GetPrivateEndpointConnection. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsListSamples.java index f17e36218d46..d1de03a41256 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class PrivateEndpointConnectionsListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListPrivateEndpointConnections.json + * x-ms-original-file: 2026-01-15-preview/ListPrivateEndpointConnections.json */ /** * Sample code: GetPrivateEndpointConnection. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourcesListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourcesListSamples.java index 0c84e31f1283..f49ba0ea7bd1 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourcesListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourcesListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class PrivateLinkResourcesListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListPrivateLinkResources.json + * x-ms-original-file: 2026-01-15-preview/ListPrivateLinkResources.json */ /** * Sample code: ListPrivateLinkResources. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsCreateOrUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsCreateOrUpdateSamples.java index 831c15d2b55b..3c4272e28c7f 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsCreateOrUpdateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsCreateOrUpdateSamples.java @@ -1,20 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CapabilityHostInner; -import com.azure.resourcemanager.cognitiveservices.models.CapabilityHostProperties; +import com.azure.resourcemanager.cognitiveservices.models.ProjectCapabilityHostProperties; +import java.util.Arrays; /** * Samples for ProjectCapabilityHosts CreateOrUpdate. */ public final class ProjectCapabilityHostsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ProjectCapabilityHost/createOrUpdate.json + * x-ms-original-file: 2026-01-15-preview/ProjectCapabilityHost/createOrUpdate.json */ /** * Sample code: CreateOrUpdate Project CapabilityHost. @@ -24,9 +22,13 @@ public final class ProjectCapabilityHostsCreateOrUpdateSamples { public static void createOrUpdateProjectCapabilityHost( com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { manager.projectCapabilityHosts() - .createOrUpdate("test-rg", "account-1", "project-1", "capabilityHostName", - new CapabilityHostInner().withProperties(new CapabilityHostProperties().withCustomerSubnet( - "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myResourceGroups/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet")), - com.azure.core.util.Context.NONE); + .define("capabilityHostName") + .withExistingProject("test-rg", "account-1", "project-1") + .withProperties( + new ProjectCapabilityHostProperties().withAiServicesConnections(Arrays.asList("aoai_connection")) + .withVectorStoreConnections(Arrays.asList("acs_connection")) + .withStorageConnections(Arrays.asList("blob_connection")) + .withThreadStorageConnections(Arrays.asList("aca_connection"))) + .create(); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsDeleteSamples.java index 07e4ccdad912..295230c2460c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsDeleteSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class ProjectCapabilityHostsDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ProjectCapabilityHost/delete.json + * x-ms-original-file: 2026-01-15-preview/ProjectCapabilityHost/delete.json */ /** * Sample code: Delete Project CapabilityHost. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsGetSamples.java index 73d0835a18ef..ddffcc8c0b16 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsGetSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class ProjectCapabilityHostsGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ProjectCapabilityHost/get.json + * x-ms-original-file: 2026-01-15-preview/ProjectCapabilityHost/get.json */ /** * Sample code: Get Project CapabilityHost. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsListSamples.java new file mode 100644 index 000000000000..e45788a3ee09 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for ProjectCapabilityHosts List. + */ +public final class ProjectCapabilityHostsListSamples { + /* + * x-ms-original-file: 2026-01-15-preview/ProjectCapabilityHost/list.json + */ + /** + * Sample code: List Project CapabilityHosts. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + listProjectCapabilityHosts(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.projectCapabilityHosts().list("test-rg", "account-1", "project-1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsCreateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsCreateSamples.java index 1e2fa6651c8c..067e660d965d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsCreateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsCreateSamples.java @@ -1,10 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; import com.azure.resourcemanager.cognitiveservices.models.ConnectionCategory; import com.azure.resourcemanager.cognitiveservices.models.NoneAuthTypeConnectionProperties; import java.time.OffsetDateTime; @@ -14,9 +13,7 @@ */ public final class ProjectConnectionsCreateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ProjectConnection/create.json + * x-ms-original-file: 2026-01-15-preview/ProjectConnection/create.json */ /** * Sample code: CreateProjectConnection. @@ -26,11 +23,11 @@ public final class ProjectConnectionsCreateSamples { public static void createProjectConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { manager.projectConnections() - .createWithResponse("resourceGroup-1", "account-1", "project-1", "connection-1", - new ConnectionPropertiesV2BasicResourceInner().withProperties( - new NoneAuthTypeConnectionProperties().withCategory(ConnectionCategory.CONTAINER_REGISTRY) - .withExpiryTime(OffsetDateTime.parse("2024-03-15T14:30:00Z")) - .withTarget("[tartget url]")), - com.azure.core.util.Context.NONE); + .define("connection-1") + .withExistingProject("resourceGroup-1", "account-1", "project-1") + .withProperties(new NoneAuthTypeConnectionProperties().withCategory(ConnectionCategory.CONTAINER_REGISTRY) + .withExpiryTime(OffsetDateTime.parse("2024-03-15T14:30:00Z")) + .withTarget("[target url]")) + .create(); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsDeleteSamples.java index f135fce24aad..6c392ef1a052 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsDeleteSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class ProjectConnectionsDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ProjectConnection/delete.json + * x-ms-original-file: 2026-01-15-preview/ProjectConnection/delete.json */ /** * Sample code: DeleteProjectConnection. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsGetSamples.java index 092c83f6d980..c69e3005754c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsGetSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class ProjectConnectionsGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ProjectConnection/get.json + * x-ms-original-file: 2026-01-15-preview/ProjectConnection/get.json */ /** * Sample code: GetProjectConnection. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsListSamples.java index 9535c85164fd..2ff41cac87a0 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class ProjectConnectionsListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ProjectConnection/list.json + * x-ms-original-file: 2026-01-15-preview/ProjectConnection/list.json */ /** * Sample code: ListProjectConnection. @@ -21,7 +19,7 @@ public final class ProjectConnectionsListSamples { public static void listProjectConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { manager.projectConnections() - .list("resourceGroup-1", "account-1", "project-1", "[tartget url]", "ContainerRegistry", null, + .list("resourceGroup-1", "account-1", "project-1", "[target url]", "ContainerRegistry", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsUpdateSamples.java index ecffce68cadb..91d9d35957f9 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsUpdateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsUpdateSamples.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.resourcemanager.cognitiveservices.models.AccessKeyAuthTypeConnectionProperties; import com.azure.resourcemanager.cognitiveservices.models.ConnectionAccessKey; import com.azure.resourcemanager.cognitiveservices.models.ConnectionCategory; -import com.azure.resourcemanager.cognitiveservices.models.ConnectionUpdateContent; +import com.azure.resourcemanager.cognitiveservices.models.ConnectionPropertiesV2BasicResource; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; @@ -17,9 +17,7 @@ */ public final class ProjectConnectionsUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ProjectConnection/update.json + * x-ms-original-file: 2026-01-15-preview/ProjectConnection/update.json */ /** * Sample code: UpdateProjectConnection. @@ -28,16 +26,17 @@ public final class ProjectConnectionsUpdateSamples { */ public static void updateProjectConnection(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { - manager.projectConnections() - .updateWithResponse("test-rg", "account-1", "project-1", "connection-1", - new ConnectionUpdateContent().withProperties( - new AccessKeyAuthTypeConnectionProperties().withCategory(ConnectionCategory.ADLSGEN2) - .withExpiryTime(OffsetDateTime.parse("2020-01-01T00:00:00Z")) - .withMetadata(mapOf()) - .withTarget("some_string") - .withCredentials(new ConnectionAccessKey().withAccessKeyId("fakeTokenPlaceholder") - .withSecretAccessKey("fakeTokenPlaceholder"))), - com.azure.core.util.Context.NONE); + ConnectionPropertiesV2BasicResource resource = manager.projectConnections() + .getWithResponse("test-rg", "account-1", "project-1", "connection-1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new AccessKeyAuthTypeConnectionProperties().withCategory(ConnectionCategory.ADLSGEN2) + .withExpiryTime(OffsetDateTime.parse("2020-01-01T00:00:00Z")) + .withMetadata(mapOf()) + .withTarget("some_string") + .withCredentials(new ConnectionAccessKey().withAccessKeyId("fakeTokenPlaceholder") + .withSecretAccessKey("fakeTokenPlaceholder"))) + .apply(); } // Use "Map.of" if available diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsCreateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsCreateSamples.java index 13de0df8bd76..60ebf69bcab3 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsCreateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsCreateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -13,9 +13,7 @@ */ public final class ProjectsCreateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * CreateProjectMin.json + * x-ms-original-file: 2026-01-15-preview/CreateProjectMin.json */ /** * Sample code: Create Project Min. @@ -27,15 +25,13 @@ public static void createProjectMin(com.azure.resourcemanager.cognitiveservices. .define("testProject1") .withExistingAccount("myResourceGroup", "testCreate1") .withRegion("West US") - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) .withProperties(new ProjectProperties()) + .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) .create(); } /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * CreateProject.json + * x-ms-original-file: 2026-01-15-preview/CreateProject.json */ /** * Sample code: Create Project. @@ -47,9 +43,9 @@ public static void createProject(com.azure.resourcemanager.cognitiveservices.Cog .define("testProject1") .withExistingAccount("myResourceGroup", "testCreate1") .withRegion("West US") - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) .withProperties( new ProjectProperties().withDisplayName("p1").withDescription("Description of this project")) + .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) .create(); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsDeleteSamples.java index ae4c112c7a5a..e6212c070bbe 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsDeleteSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class ProjectsDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * DeleteProject.json + * x-ms-original-file: 2026-01-15-preview/DeleteProject.json */ /** * Sample code: Delete Project. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsGetSamples.java index c5b1cab7f3f7..ea16edb22c37 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsGetSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class ProjectsGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetProject.json + * x-ms-original-file: 2026-01-15-preview/GetProject.json */ /** * Sample code: Get Project. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsListSamples.java index e3ac60f59416..95d490442b3f 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class ProjectsListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListProjects.json + * x-ms-original-file: 2026-01-15-preview/ListProjects.json */ /** * Sample code: List Project. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsUpdateSamples.java index cefd174e5aeb..808f511def3b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsUpdateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,9 +12,7 @@ */ public final class ProjectsUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * UpdateProjects.json + * x-ms-original-file: 2026-01-15-preview/UpdateProjects.json */ /** * Sample code: Update Project. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTiersCreateOrUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTiersCreateOrUpdateSamples.java index 89664021168c..5f5485849639 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTiersCreateOrUpdateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTiersCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,9 +12,7 @@ */ public final class QuotaTiersCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * CreateOrUpdateQuotaTier.json + * x-ms-original-file: 2026-01-15-preview/CreateOrUpdateQuotaTier.json */ /** * Sample code: Update the quota tier resource for a subscription. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTiersGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTiersGetSamples.java index ec02b5f025ea..7c0518f29cbd 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTiersGetSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTiersGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class QuotaTiersGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetQuotaTier.json + * x-ms-original-file: 2026-01-15-preview/GetQuotaTier.json */ /** * Sample code: Get the Quota Tier information for a subscription. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTiersListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTiersListSamples.java index f69527c63f8c..f12a3ca4373b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTiersListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTiersListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class QuotaTiersListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListQuotaTiers.json + * x-ms-original-file: 2026-01-15-preview/ListQuotaTiers.json */ /** * Sample code: List the Quota Tier for a subscription. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTiersUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTiersUpdateSamples.java index b4ac1a30973c..2e390d253c85 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTiersUpdateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTiersUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -13,9 +13,7 @@ */ public final class QuotaTiersUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * UpdateQuotaTier.json + * x-ms-original-file: 2026-01-15-preview/UpdateQuotaTier.json */ /** * Sample code: Update the quota tier resource for a subscription. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsBatchAddSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsBatchAddSamples.java index edb06c75552b..11b14486cc2b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsBatchAddSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsBatchAddSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -13,9 +13,7 @@ */ public final class RaiBlocklistItemsBatchAddSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * AddRaiBlocklistItems.json + * x-ms-original-file: 2026-01-15-preview/AddRaiBlocklistItems.json */ /** * Sample code: AddRaiBlocklistItems. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsBatchDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsBatchDeleteSamples.java index 01c34a0afa59..dbe1c9114f30 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsBatchDeleteSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsBatchDeleteSamples.java @@ -1,33 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import java.io.IOException; +import java.util.Arrays; /** * Samples for RaiBlocklistItems BatchDelete. */ public final class RaiBlocklistItemsBatchDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * DeleteRaiBlocklistItems.json + * x-ms-original-file: 2026-01-15-preview/DeleteRaiBlocklistItems.json */ /** * Sample code: DeleteRaiBlocklistItems. * * @param manager Entry point to CognitiveServicesManager. */ - public static void deleteRaiBlocklistItems( - com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) throws IOException { + public static void + deleteRaiBlocklistItems(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { manager.raiBlocklistItems() .batchDeleteWithResponse("resourceGroupName", "accountName", "raiBlocklistName", - SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize("[\"myblocklistitem1\",\"myblocklistitem2\"]", Object.class, SerializerEncoding.JSON), - com.azure.core.util.Context.NONE); + Arrays.asList("myblocklistitem1", "myblocklistitem2"), com.azure.core.util.Context.NONE); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsCreateOrUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsCreateOrUpdateSamples.java index 761df057b902..3e8ddd5d6d12 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsCreateOrUpdateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -11,9 +11,7 @@ */ public final class RaiBlocklistItemsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * PutRaiBlocklistItem.json + * x-ms-original-file: 2026-01-15-preview/PutRaiBlocklistItem.json */ /** * Sample code: PutRaiBlocklistItem. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsDeleteSamples.java index 118978a0209a..56ee3bc81b2d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsDeleteSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class RaiBlocklistItemsDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * DeleteRaiBlocklistItem.json + * x-ms-original-file: 2026-01-15-preview/DeleteRaiBlocklistItem.json */ /** * Sample code: DeleteRaiBlocklistItem. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsGetSamples.java index d0d2fc1bcd28..c63e37ca90f4 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsGetSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class RaiBlocklistItemsGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetRaiBlocklistItem.json + * x-ms-original-file: 2026-01-15-preview/GetRaiBlocklistItem.json */ /** * Sample code: GetRaiBlocklistItem. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsListSamples.java index 82b4d5428c37..f9a33af4729f 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class RaiBlocklistItemsListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListBlocklistItems.json + * x-ms-original-file: 2026-01-15-preview/ListBlocklistItems.json */ /** * Sample code: ListBlocklistItems. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsCreateOrUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsCreateOrUpdateSamples.java index 06bcda4915ea..d4cc25b3d581 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsCreateOrUpdateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -11,9 +11,7 @@ */ public final class RaiBlocklistsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * PutRaiBlocklist.json + * x-ms-original-file: 2026-01-15-preview/PutRaiBlocklist.json */ /** * Sample code: PutRaiBlocklist. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsDeleteSamples.java index 0f2dba02abd4..5b318c6a9c54 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsDeleteSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class RaiBlocklistsDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * DeleteRaiBlocklist.json + * x-ms-original-file: 2026-01-15-preview/DeleteRaiBlocklist.json */ /** * Sample code: DeleteRaiBlocklist. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsGetSamples.java index 58dd0746525b..818e72087040 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsGetSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class RaiBlocklistsGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetRaiBlocklist.json + * x-ms-original-file: 2026-01-15-preview/GetRaiBlocklist.json */ /** * Sample code: GetRaiBlocklist. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsListSamples.java index 061089284958..5b8505fdf345 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class RaiBlocklistsListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListBlocklists.json + * x-ms-original-file: 2026-01-15-preview/ListBlocklists.json */ /** * Sample code: ListBlocklists. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFiltersGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFiltersGetSamples.java index 6cfc29ee6b6b..535487dc6e29 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFiltersGetSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFiltersGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class RaiContentFiltersGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetRaiContentFilter.json + * x-ms-original-file: 2026-01-15-preview/GetRaiContentFilter.json */ /** * Sample code: GetRaiContentFilters. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFiltersListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFiltersListSamples.java index 5f5f2f2aa3fc..7d32fcb2711b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFiltersListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFiltersListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class RaiContentFiltersListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListRaiContentFilters.json + * x-ms-original-file: 2026-01-15-preview/ListRaiContentFilters.json */ /** * Sample code: ListRaiContentFilters. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiExternalSafetyProviderCreateOrUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiExternalSafetyProviderCreateOrUpdateSamples.java new file mode 100644 index 000000000000..80026dd928b5 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiExternalSafetyProviderCreateOrUpdateSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderSchemaInner; +import com.azure.resourcemanager.cognitiveservices.models.RaiExternalSafetyProviderSchemaProperties; + +/** + * Samples for RaiExternalSafetyProvider CreateOrUpdate. + */ +public final class RaiExternalSafetyProviderCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-15-preview/PutRaiExternalSafetyProvider.json + */ + /** + * Sample code: PutRaiExternalSafetyProvider. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + putRaiExternalSafetyProvider(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiExternalSafetyProviders() + .createOrUpdateWithResponse("safetyProviderName", new RaiExternalSafetyProviderSchemaInner().withProperties( + new RaiExternalSafetyProviderSchemaProperties().withProviderId("00000000-0000-0000-0000-000000000000") + .withProviderName("safetyProviderName") + .withMode("sync") + .withUrl("https://example.webhook.endpoint") + .withSecretName("fakeTokenPlaceholder") + .withManagedIdentity("00000000-0000-0000-0000-000000000000") + .withKeyVaultUri("fakeTokenPlaceholder")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiExternalSafetyProviderDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiExternalSafetyProviderDeleteSamples.java new file mode 100644 index 000000000000..8c38b62d6092 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiExternalSafetyProviderDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for RaiExternalSafetyProvider Delete. + */ +public final class RaiExternalSafetyProviderDeleteSamples { + /* + * x-ms-original-file: 2026-01-15-preview/DeleteRaiExternalSafetyProvider.json + */ + /** + * Sample code: DeleteRaiTopic. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void deleteRaiTopic(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiExternalSafetyProviders().delete("safetyProviderName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiExternalSafetyProviderGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiExternalSafetyProviderGetSamples.java new file mode 100644 index 000000000000..46e253f4b936 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiExternalSafetyProviderGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for RaiExternalSafetyProvider Get. + */ +public final class RaiExternalSafetyProviderGetSamples { + /* + * x-ms-original-file: 2026-01-15-preview/GetRaiExternalSafetyProvider.json + */ + /** + * Sample code: GetRaiExternalSafetyProvider. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + getRaiExternalSafetyProvider(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiExternalSafetyProviders().getWithResponse("safetyProviderName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiExternalSafetyProvidersOperationListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiExternalSafetyProvidersOperationListSamples.java new file mode 100644 index 000000000000..e966944351ad --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiExternalSafetyProvidersOperationListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for RaiExternalSafetyProvidersOperation List. + */ +public final class RaiExternalSafetyProvidersOperationListSamples { + /* + * x-ms-original-file: 2026-01-15-preview/ListRaiExternalSafetyProviders.json + */ + /** + * Sample code: ListRaiExternalSafetyProviders. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + listRaiExternalSafetyProviders(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiExternalSafetyProvidersOperations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesCreateOrUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesCreateOrUpdateSamples.java index cb3fb2105536..73c53ac7866c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesCreateOrUpdateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -16,9 +16,7 @@ */ public final class RaiPoliciesCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * PutRaiPolicy.json + * x-ms-original-file: 2026-01-15-preview/PutRaiPolicy.json */ /** * Sample code: PutRaiPolicy. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesDeleteSamples.java index fe0c16dad9b8..ec19731b5acf 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesDeleteSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class RaiPoliciesDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * DeleteRaiPolicy.json + * x-ms-original-file: 2026-01-15-preview/DeleteRaiPolicy.json */ /** * Sample code: DeleteRaiPolicy. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesGetSamples.java index 1bec2f348c1d..7ad6d67e98d8 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesGetSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class RaiPoliciesGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetRaiPolicy.json + * x-ms-original-file: 2026-01-15-preview/GetRaiPolicy.json */ /** * Sample code: GetRaiPolicy. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesListSamples.java index ccb9644cb74d..04d977b2cbd5 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class RaiPoliciesListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListRaiPolicies.json + * x-ms-original-file: 2026-01-15-preview/ListRaiPolicies.json */ /** * Sample code: ListRaiPolicies. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelsCreateOrUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..b41fc7f4533a --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelsCreateOrUpdateSamples.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.resourcemanager.cognitiveservices.models.RaiToolLabelProperties; +import com.azure.resourcemanager.cognitiveservices.models.RaiToolLabelPropertiesAccountScope; +import com.azure.resourcemanager.cognitiveservices.models.RaiToolLabelPropertiesProjectScopesItem; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for RaiToolLabels CreateOrUpdate. + */ +public final class RaiToolLabelsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-15-preview/PutRaiToolLabel.json + */ + /** + * Sample code: PutRaiToolLabel. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void putRaiToolLabel(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiToolLabels() + .define("Web_Search") + .withExistingAccount("resourceGroupName", "accountName") + .withProperties(new RaiToolLabelProperties().withToolConnectionName("Web_Search") + .withAccountScope( + new RaiToolLabelPropertiesAccountScope().withLabelValues(mapOf("confidentiality", "low"))) + .withProjectScopes(Arrays.asList( + new RaiToolLabelPropertiesProjectScopesItem().withProject("test-project") + .withLabelValues(mapOf("confidentiality", "low")), + new RaiToolLabelPropertiesProjectScopesItem().withProject("sample-project") + .withLabelValues(mapOf("confidentiality", "low"))))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelsDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelsDeleteSamples.java new file mode 100644 index 000000000000..4da695f395a7 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for RaiToolLabels Delete. + */ +public final class RaiToolLabelsDeleteSamples { + /* + * x-ms-original-file: 2026-01-15-preview/DeleteRaiToolLabel.json + */ + /** + * Sample code: DeleteRaiToolLabel. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + deleteRaiToolLabel(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiToolLabels() + .delete("resourceGroupName", "accountName", "Web_Search", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelsGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelsGetSamples.java new file mode 100644 index 000000000000..8112ad619b29 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for RaiToolLabels Get. + */ +public final class RaiToolLabelsGetSamples { + /* + * x-ms-original-file: 2026-01-15-preview/GetRaiToolLabel.json + */ + /** + * Sample code: GetRaiToolLabel. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void getRaiToolLabel(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiToolLabels() + .getWithResponse("resourceGroupName", "accountName", "ToolLabelName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelsListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelsListSamples.java new file mode 100644 index 000000000000..e163469c1eb0 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for RaiToolLabels List. + */ +public final class RaiToolLabelsListSamples { + /* + * x-ms-original-file: 2026-01-15-preview/ListRaiToolLabels.json + */ + /** + * Sample code: ListRaiToolLabels. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void listRaiToolLabels(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.raiToolLabels().list("resourceGroupName", "accountName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicsCreateOrUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicsCreateOrUpdateSamples.java index 3cf96118fa8e..5384e80cf3d0 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicsCreateOrUpdateSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -11,9 +11,7 @@ */ public final class RaiTopicsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * PutRaiTopic.json + * x-ms-original-file: 2026-01-15-preview/PutRaiTopic.json */ /** * Sample code: PutRaiTopic. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicsDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicsDeleteSamples.java index d86f43e7ec97..fdf7ba205843 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicsDeleteSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class RaiTopicsDeleteSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * DeleteRaiTopic.json + * x-ms-original-file: 2026-01-15-preview/DeleteRaiTopic.json */ /** * Sample code: DeleteRaiTopic. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicsGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicsGetSamples.java index 58f41e672e4a..b01e7c133f36 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicsGetSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class RaiTopicsGetSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * GetRaiTopic.json + * x-ms-original-file: 2026-01-15-preview/GetRaiTopic.json */ /** * Sample code: GetRaiTopic. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicsListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicsListSamples.java index 2e9d58037a6f..4a08b245d9c3 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicsListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class RaiTopicsListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListRaiTopics.json + * x-ms-original-file: 2026-01-15-preview/ListRaiTopics.json */ /** * Sample code: ListRaiTopics. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProviderCalculateModelCapacitySamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProviderCalculateModelCapacitySamples.java index d985b01b9002..f831def021a3 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProviderCalculateModelCapacitySamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProviderCalculateModelCapacitySamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -15,9 +15,7 @@ */ public final class ResourceProviderCalculateModelCapacitySamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * CalculateModelCapacity.json + * x-ms-original-file: 2026-01-15-preview/CalculateModelCapacity.json */ /** * Sample code: Calculate Model Capacity. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProviderCheckDomainAvailabilitySamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProviderCheckDomainAvailabilitySamples.java index f626b532c54d..4f9cfcb80778 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProviderCheckDomainAvailabilitySamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProviderCheckDomainAvailabilitySamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -11,9 +11,7 @@ */ public final class ResourceProviderCheckDomainAvailabilitySamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * CheckDomainAvailability.json + * x-ms-original-file: 2026-01-15-preview/CheckDomainAvailability.json */ /** * Sample code: Check SKU Availability. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProviderCheckSkuAvailabilitySamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProviderCheckSkuAvailabilitySamples.java index 427fd0a6ee93..a51f0e47422e 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProviderCheckSkuAvailabilitySamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProviderCheckSkuAvailabilitySamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,9 +12,7 @@ */ public final class ResourceProviderCheckSkuAvailabilitySamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * CheckSkuAvailability.json + * x-ms-original-file: 2026-01-15-preview/CheckSkuAvailability.json */ /** * Sample code: Check SKU Availability. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceSkusListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceSkusListSamples.java index 89ad2631871a..88bef5248258 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceSkusListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceSkusListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class ResourceSkusListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/GetSkus. - * json + * x-ms-original-file: 2026-01-15-preview/GetSkus.json */ /** * Sample code: Regenerate Keys. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/SubscriptionRaiPolicyCreateOrUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/SubscriptionRaiPolicyCreateOrUpdateSamples.java new file mode 100644 index 000000000000..dbc94b939ac5 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/SubscriptionRaiPolicyCreateOrUpdateSamples.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiPolicyInner; +import com.azure.resourcemanager.cognitiveservices.models.ContentLevel; +import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentFilter; +import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentSource; +import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyMode; +import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyProperties; +import java.util.Arrays; + +/** + * Samples for SubscriptionRaiPolicy CreateOrUpdate. + */ +public final class SubscriptionRaiPolicyCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-15-preview/PutSubscriptionRaiPolicy.json + */ + /** + * Sample code: PutRaiPolicy. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void putRaiPolicy(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.subscriptionRaiPolicies() + .createOrUpdateWithResponse("raiPolicyName", + new RaiPolicyInner() + .withProperties(new RaiPolicyProperties().withMode(RaiPolicyMode.ASYNCHRONOUS_FILTER) + .withBasePolicyName("Microsoft.Default") + .withContentFilters(Arrays.asList( + new RaiPolicyContentFilter().withName("Hate") + .withEnabled(false) + .withSeverityThreshold(ContentLevel.HIGH) + .withBlocking(false) + .withSource(RaiPolicyContentSource.PROMPT), + new RaiPolicyContentFilter().withName("Hate") + .withEnabled(true) + .withSeverityThreshold(ContentLevel.MEDIUM) + .withBlocking(true) + .withSource(RaiPolicyContentSource.COMPLETION), + new RaiPolicyContentFilter().withName("Sexual") + .withEnabled(true) + .withSeverityThreshold(ContentLevel.HIGH) + .withBlocking(true) + .withSource(RaiPolicyContentSource.PROMPT), + new RaiPolicyContentFilter().withName("Sexual") + .withEnabled(true) + .withSeverityThreshold(ContentLevel.MEDIUM) + .withBlocking(true) + .withSource(RaiPolicyContentSource.COMPLETION), + new RaiPolicyContentFilter().withName("Selfharm") + .withEnabled(true) + .withSeverityThreshold(ContentLevel.HIGH) + .withBlocking(true) + .withSource(RaiPolicyContentSource.PROMPT), + new RaiPolicyContentFilter().withName("Selfharm") + .withEnabled(true) + .withSeverityThreshold(ContentLevel.MEDIUM) + .withBlocking(true) + .withSource(RaiPolicyContentSource.COMPLETION), + new RaiPolicyContentFilter().withName("Violence") + .withEnabled(true) + .withSeverityThreshold(ContentLevel.MEDIUM) + .withBlocking(true) + .withSource(RaiPolicyContentSource.PROMPT), + new RaiPolicyContentFilter().withName("Violence") + .withEnabled(true) + .withSeverityThreshold(ContentLevel.MEDIUM) + .withBlocking(true) + .withSource(RaiPolicyContentSource.COMPLETION), + new RaiPolicyContentFilter().withName("Jailbreak") + .withEnabled(true) + .withBlocking(true) + .withSource(RaiPolicyContentSource.PROMPT), + new RaiPolicyContentFilter().withName("Protected Material Text") + .withEnabled(true) + .withBlocking(true) + .withSource(RaiPolicyContentSource.COMPLETION), + new RaiPolicyContentFilter().withName("Protected Material Code") + .withEnabled(true) + .withBlocking(true) + .withSource(RaiPolicyContentSource.COMPLETION), + new RaiPolicyContentFilter().withName("Profanity") + .withEnabled(true) + .withBlocking(true) + .withSource(RaiPolicyContentSource.PROMPT)))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/SubscriptionRaiPolicyDeleteSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/SubscriptionRaiPolicyDeleteSamples.java new file mode 100644 index 000000000000..183f4a17abdd --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/SubscriptionRaiPolicyDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for SubscriptionRaiPolicy Delete. + */ +public final class SubscriptionRaiPolicyDeleteSamples { + /* + * x-ms-original-file: 2026-01-15-preview/DeleteSubscriptionRaiPolicy.json + */ + /** + * Sample code: DeleteRaiPolicy. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void deleteRaiPolicy(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.subscriptionRaiPolicies().delete("raiPolicyName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/SubscriptionRaiPolicyGetSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/SubscriptionRaiPolicyGetSamples.java new file mode 100644 index 000000000000..81246aa9f229 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/SubscriptionRaiPolicyGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +/** + * Samples for SubscriptionRaiPolicy Get. + */ +public final class SubscriptionRaiPolicyGetSamples { + /* + * x-ms-original-file: 2026-01-15-preview/GetSubscriptionRaiPolicy.json + */ + /** + * Sample code: GetRaiPolicy. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void getRaiPolicy(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.subscriptionRaiPolicies().getWithResponse("raiPolicyName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/TestRaiExternalSafetyProviderCreateOrUpdateSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/TestRaiExternalSafetyProviderCreateOrUpdateSamples.java new file mode 100644 index 000000000000..1bb83a77322c --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/TestRaiExternalSafetyProviderCreateOrUpdateSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.resourcemanager.cognitiveservices.models.RaiExternalSafetyProviderSchemaProperties; + +/** + * Samples for TestRaiExternalSafetyProvider CreateOrUpdate. + */ +public final class TestRaiExternalSafetyProviderCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-15-preview/TestRaiExternalSafetyProvider.json + */ + /** + * Sample code: TestRaiExternalSafetyProvider. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + testRaiExternalSafetyProvider(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.testRaiExternalSafetyProviders() + .define("mySafetyProvider") + .withExistingAccount("myResourceGroup", "myCognitiveAccount") + .withProperties( + new RaiExternalSafetyProviderSchemaProperties().withProviderId("00000000-0000-0000-0000-000000000000") + .withProviderName("safetyProviderName") + .withMode("sync") + .withUrl("https://example-safety-provider.contoso.com/webhook") + .withSecretName("fakeTokenPlaceholder") + .withManagedIdentity("f3b9c2e7-4aad-4b1f-9d9c-9e9b1e9b1f9b") + .withKeyVaultUri("fakeTokenPlaceholder")) + .create(); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/UsagesListSamples.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/UsagesListSamples.java index fd5b28e0083c..6eb9d6ce3a50 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/UsagesListSamples.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/samples/java/com/azure/resourcemanager/cognitiveservices/generated/UsagesListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,9 +9,7 @@ */ public final class UsagesListSamples { /* - * x-ms-original-file: - * specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2025-09-01/examples/ - * ListUsages.json + * x-ms-original-file: 2026-01-15-preview/ListUsages.json */ /** * Sample code: Get Usages. @@ -21,4 +19,43 @@ public final class UsagesListSamples { public static void getUsages(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { manager.usages().list("WestUS", null, com.azure.core.util.Context.NONE); } + + /* + * x-ms-original-file: 2026-01-15-preview/ListUsagesClassicScope.json + */ + /** + * Sample code: Get Usages Classic Scope. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + getUsagesClassicScope(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.usages().list("WestUS", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-01-15-preview/ListUsagesDataZoneScope.json + */ + /** + * Sample code: Get Usages DataZone Scope. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + getUsagesDataZoneScope(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.usages().list("WestUS", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-01-15-preview/ListUsagesGlobalScope.json + */ + /** + * Sample code: Get Usages Global Scope. + * + * @param manager Entry point to CognitiveServicesManager. + */ + public static void + getUsagesGlobalScope(com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager) { + manager.usages().list("WestUS", null, com.azure.core.util.Context.NONE); + } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AadAuthTypeConnectionPropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AadAuthTypeConnectionPropertiesTests.java index af3ec61e9695..bca321873749 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AadAuthTypeConnectionPropertiesTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AadAuthTypeConnectionPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -19,44 +19,44 @@ public final class AadAuthTypeConnectionPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AadAuthTypeConnectionProperties model = BinaryData.fromString( - "{\"authType\":\"AAD\",\"category\":\"Salesforce\",\"createdByWorkspaceArmId\":\"htmoqqtlffhzbkr\",\"error\":\"jjavfq\",\"expiryTime\":\"2021-05-30T20:28:39Z\",\"group\":\"File\",\"isSharedToAll\":true,\"metadata\":{\"pvidbz\":\"ogiyetes\",\"b\":\"jhqt\",\"etnjuhpsprkz\":\"vnynkb\"},\"peRequirement\":\"Required\",\"peStatus\":\"Inactive\",\"sharedUserList\":[\"cxnafbwqrooh\",\"uovmaonurjt\",\"mghihp\",\"ecmslclbl\"],\"target\":\"xltbsjuscvsf\",\"useWorkspaceManagedIdentity\":true}") + "{\"authType\":\"AAD\",\"category\":\"CosmosDb\",\"createdByWorkspaceArmId\":\"fcsserxhtvsox\",\"error\":\"wntsjgqrsxy\",\"expiryTime\":\"2021-04-15T06:58:45Z\",\"group\":\"GenericProtocol\",\"isSharedToAll\":true,\"metadata\":{\"oyuelyetn\":\"hrszi\",\"qyggagfl\":\"nb\"},\"peRequirement\":\"Required\",\"peStatus\":\"NotApplicable\",\"sharedUserList\":[\"ahzjmucftb\",\"r\",\"lrohkpig\",\"fusuckzmkwklsno\"],\"target\":\"xmqeqalh\",\"useWorkspaceManagedIdentity\":false}") .toObject(AadAuthTypeConnectionProperties.class); - Assertions.assertEquals(ConnectionCategory.SALESFORCE, model.category()); - Assertions.assertEquals("jjavfq", model.error()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-30T20:28:39Z"), model.expiryTime()); + Assertions.assertEquals(ConnectionCategory.COSMOS_DB, model.category()); + Assertions.assertEquals("wntsjgqrsxy", model.error()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-15T06:58:45Z"), model.expiryTime()); Assertions.assertTrue(model.isSharedToAll()); - Assertions.assertEquals("ogiyetes", model.metadata().get("pvidbz")); + Assertions.assertEquals("hrszi", model.metadata().get("oyuelyetn")); Assertions.assertEquals(ManagedPERequirement.REQUIRED, model.peRequirement()); - Assertions.assertEquals(ManagedPEStatus.INACTIVE, model.peStatus()); - Assertions.assertEquals("cxnafbwqrooh", model.sharedUserList().get(0)); - Assertions.assertEquals("xltbsjuscvsf", model.target()); - Assertions.assertTrue(model.useWorkspaceManagedIdentity()); + Assertions.assertEquals(ManagedPEStatus.NOT_APPLICABLE, model.peStatus()); + Assertions.assertEquals("ahzjmucftb", model.sharedUserList().get(0)); + Assertions.assertEquals("xmqeqalh", model.target()); + Assertions.assertFalse(model.useWorkspaceManagedIdentity()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { AadAuthTypeConnectionProperties model - = new AadAuthTypeConnectionProperties().withCategory(ConnectionCategory.SALESFORCE) - .withError("jjavfq") - .withExpiryTime(OffsetDateTime.parse("2021-05-30T20:28:39Z")) + = new AadAuthTypeConnectionProperties().withCategory(ConnectionCategory.COSMOS_DB) + .withError("wntsjgqrsxy") + .withExpiryTime(OffsetDateTime.parse("2021-04-15T06:58:45Z")) .withIsSharedToAll(true) - .withMetadata(mapOf("pvidbz", "ogiyetes", "b", "jhqt", "etnjuhpsprkz", "vnynkb")) + .withMetadata(mapOf("oyuelyetn", "hrszi", "qyggagfl", "nb")) .withPeRequirement(ManagedPERequirement.REQUIRED) - .withPeStatus(ManagedPEStatus.INACTIVE) - .withSharedUserList(Arrays.asList("cxnafbwqrooh", "uovmaonurjt", "mghihp", "ecmslclbl")) - .withTarget("xltbsjuscvsf") - .withUseWorkspaceManagedIdentity(true); + .withPeStatus(ManagedPEStatus.NOT_APPLICABLE) + .withSharedUserList(Arrays.asList("ahzjmucftb", "r", "lrohkpig", "fusuckzmkwklsno")) + .withTarget("xmqeqalh") + .withUseWorkspaceManagedIdentity(false); model = BinaryData.fromObject(model).toObject(AadAuthTypeConnectionProperties.class); - Assertions.assertEquals(ConnectionCategory.SALESFORCE, model.category()); - Assertions.assertEquals("jjavfq", model.error()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-30T20:28:39Z"), model.expiryTime()); + Assertions.assertEquals(ConnectionCategory.COSMOS_DB, model.category()); + Assertions.assertEquals("wntsjgqrsxy", model.error()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-15T06:58:45Z"), model.expiryTime()); Assertions.assertTrue(model.isSharedToAll()); - Assertions.assertEquals("ogiyetes", model.metadata().get("pvidbz")); + Assertions.assertEquals("hrszi", model.metadata().get("oyuelyetn")); Assertions.assertEquals(ManagedPERequirement.REQUIRED, model.peRequirement()); - Assertions.assertEquals(ManagedPEStatus.INACTIVE, model.peStatus()); - Assertions.assertEquals("cxnafbwqrooh", model.sharedUserList().get(0)); - Assertions.assertEquals("xltbsjuscvsf", model.target()); - Assertions.assertTrue(model.useWorkspaceManagedIdentity()); + Assertions.assertEquals(ManagedPEStatus.NOT_APPLICABLE, model.peStatus()); + Assertions.assertEquals("ahzjmucftb", model.sharedUserList().get(0)); + Assertions.assertEquals("xmqeqalh", model.target()); + Assertions.assertFalse(model.useWorkspaceManagedIdentity()); } // Use "Map.of" if available diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AbusePenaltyTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AbusePenaltyTests.java index aed802d8563c..d9e318300cc1 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AbusePenaltyTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AbusePenaltyTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -15,21 +15,10 @@ public final class AbusePenaltyTests { public void testDeserialize() throws Exception { AbusePenalty model = BinaryData .fromString( - "{\"action\":\"Throttle\",\"rateLimitPercentage\":54.34138,\"expiration\":\"2021-10-06T03:29:57Z\"}") + "{\"action\":\"Block\",\"rateLimitPercentage\":71.42319,\"expiration\":\"2021-03-17T23:59:37Z\"}") .toObject(AbusePenalty.class); - Assertions.assertEquals(AbusePenaltyAction.THROTTLE, model.action()); - Assertions.assertEquals(54.34138F, model.rateLimitPercentage()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-06T03:29:57Z"), model.expiration()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AbusePenalty model = new AbusePenalty().withAction(AbusePenaltyAction.THROTTLE) - .withRateLimitPercentage(54.34138F) - .withExpiration(OffsetDateTime.parse("2021-10-06T03:29:57Z")); - model = BinaryData.fromObject(model).toObject(AbusePenalty.class); - Assertions.assertEquals(AbusePenaltyAction.THROTTLE, model.action()); - Assertions.assertEquals(54.34138F, model.rateLimitPercentage()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-06T03:29:57Z"), model.expiration()); + Assertions.assertEquals(AbusePenaltyAction.BLOCK, model.action()); + Assertions.assertEquals(71.42319F, model.rateLimitPercentage()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-17T23:59:37Z"), model.expiration()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsCreateOrUpdateMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsCreateOrUpdateMockTests.java index 53011e5789cc..22a566c811c4 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsCreateOrUpdateMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsCreateOrUpdateMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -26,7 +26,7 @@ public final class AccountCapabilityHostsCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"aiServicesConnections\":[\"lztpziizevjykof\",\"ezefkhkqtwqlepjj\"],\"capabilityHostKind\":\"Agents\",\"customerSubnet\":\"sf\",\"provisioningState\":\"Succeeded\",\"storageConnections\":[\"o\",\"ffjwajnr\",\"wzvaqkifmxaw\",\"stfzknhrkmjq\"],\"threadStorageConnections\":[\"vdscnhemv\",\"fnqqwyp\",\"ndrw\"],\"vectorStoreConnections\":[\"dtggrssg\"],\"description\":\"fk\",\"tags\":{\"mvecvztscbgmusai\":\"jmu\"}},\"id\":\"dscnkzzo\",\"name\":\"nrddclzeqoz\",\"type\":\"ehlbzqixbnjrqvzy\"}"; + = "{\"properties\":{\"aiServicesConnections\":[\"hqtwv\",\"azekdzdzffzjwzts\",\"pchggryelgfy\",\"tig\"],\"capabilityHostKind\":\"Agents\",\"customerSubnet\":\"r\",\"provisioningState\":\"Succeeded\",\"storageConnections\":[\"zgoryw\",\"vojtvmdevdlhqv\",\"ka\"],\"threadStorageConnections\":[\"yhssrlvkpkpkocm\",\"ccebxxopyicyvspe\",\"lhwyykgvrccpumd\",\"hgajkrdy\"],\"vectorStoreConnections\":[\"pfcudvafnbf\",\"qvenqnxhgk\",\"rdw\",\"ejpec\"],\"enablePublicHostingEnvironment\":true,\"description\":\"mbpwdludayp\",\"tags\":{\"f\":\"idwmt\",\"zuvigvl\":\"vtzldzchubagwn\",\"q\":\"hfrbzakpjt\",\"qxynqj\":\"aqpojpsucmximc\"}},\"id\":\"atkyvscbgngcr\",\"name\":\"sxhircpgc\",\"type\":\"svkkjbjolpyokl\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -36,27 +36,29 @@ public void testCreateOrUpdate() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); CapabilityHost response = manager.accountCapabilityHosts() - .define("ursuivuxcjk") - .withExistingAccount("vekmkwjfbotloggd", "s") - .withProperties(new CapabilityHostProperties().withDescription("elsy") - .withTags( - mapOf("rugjqyckgtx", "fnkwmygjjekrknf", "b", "rdtulcrcjdklotcs", "bch", "zoonsv", "sl", "xfpwhd")) - .withAiServicesConnections(Arrays.asList("w", "z")) + .define("cmlae") + .withExistingAccount("peswyhhmifjuajx", "wvcmmpeglyuq") + .withProperties(new CapabilityHostProperties().withDescription("eywetkrhlolmcn") + .withTags(mapOf("rnrdetawevx", "fgsvbbvaqdljnpet", "blerlpr", "huekdxljzvdovb", "jccxwbp", + "aqccddcbnyg", "zlrz", "yykdig")) + .withAiServicesConnections(Arrays.asList("bqufpnezsjzayml", "rorh", "ogzmsimehtcuuwdh")) .withCapabilityHostKind(CapabilityHostKind.AGENTS) - .withCustomerSubnet("rizfwihvaang") - .withStorageConnections(Arrays.asList("rfdmfdvbbaexx")) - .withThreadStorageConnections(Arrays.asList("tgdf", "kauigvm", "a")) - .withVectorStoreConnections(Arrays.asList("zfedyuepsvplti", "ajjvywe", "cfkumcfjxo"))) + .withCustomerSubnet("yhn") + .withStorageConnections(Arrays.asList("sugisn", "mwnwnghojovkey")) + .withThreadStorageConnections(Arrays.asList("cjixxf")) + .withVectorStoreConnections(Arrays.asList("crtnuguefxxi", "t")) + .withEnablePublicHostingEnvironment(true)) .create(); - Assertions.assertEquals("fk", response.properties().description()); - Assertions.assertEquals("jmu", response.properties().tags().get("mvecvztscbgmusai")); - Assertions.assertEquals("lztpziizevjykof", response.properties().aiServicesConnections().get(0)); + Assertions.assertEquals("mbpwdludayp", response.properties().description()); + Assertions.assertEquals("idwmt", response.properties().tags().get("f")); + Assertions.assertEquals("hqtwv", response.properties().aiServicesConnections().get(0)); Assertions.assertEquals(CapabilityHostKind.AGENTS, response.properties().capabilityHostKind()); - Assertions.assertEquals("sf", response.properties().customerSubnet()); - Assertions.assertEquals("o", response.properties().storageConnections().get(0)); - Assertions.assertEquals("vdscnhemv", response.properties().threadStorageConnections().get(0)); - Assertions.assertEquals("dtggrssg", response.properties().vectorStoreConnections().get(0)); + Assertions.assertEquals("r", response.properties().customerSubnet()); + Assertions.assertEquals("zgoryw", response.properties().storageConnections().get(0)); + Assertions.assertEquals("yhssrlvkpkpkocm", response.properties().threadStorageConnections().get(0)); + Assertions.assertEquals("pfcudvafnbf", response.properties().vectorStoreConnections().get(0)); + Assertions.assertTrue(response.properties().enablePublicHostingEnvironment()); } // Use "Map.of" if available diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsGetWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsGetWithResponseMockTests.java index ba8086036c86..3f6ef9a062e5 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsGetWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsGetWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -22,7 +22,7 @@ public final class AccountCapabilityHostsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"aiServicesConnections\":[\"foioyidoxzn\"],\"capabilityHostKind\":\"Agents\",\"customerSubnet\":\"tmuuvdawsx\",\"provisioningState\":\"Failed\",\"storageConnections\":[\"knimxlp\",\"erxrzutylcurza\"],\"threadStorageConnections\":[\"b\",\"qaeht\"],\"vectorStoreConnections\":[\"mbnvynfaooeacted\",\"glskakddi\"],\"description\":\"hzllrqmtlpbyxro\",\"tags\":{\"ypffmnoiicsudyh\":\"y\",\"uqwg\":\"rjjtalxrdsjrho\"}},\"id\":\"xxhdodpjwybl\",\"name\":\"tbdmvsbyidae\",\"type\":\"q\"}"; + = "{\"properties\":{\"aiServicesConnections\":[\"fb\",\"ampqocl\"],\"capabilityHostKind\":\"Agents\",\"customerSubnet\":\"xynlsuqb\",\"provisioningState\":\"Failed\",\"storageConnections\":[\"k\",\"gvp\"],\"threadStorageConnections\":[\"gjjktfinfhoksmm\",\"ulwkq\",\"cru\",\"okr\"],\"vectorStoreConnections\":[\"sgaojbtqpqsdoctp\",\"pujzfl\",\"cdsgxceluji\"],\"enablePublicHostingEnvironment\":false,\"description\":\"uunxh\",\"tags\":{\"u\":\"fxzf\",\"psjdmng\":\"eupcknecexkgrv\",\"pdz\":\"yt\"}},\"id\":\"xcn\",\"name\":\"awoxcgzbe\",\"type\":\"qfbifo\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,16 +32,17 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); CapabilityHost response = manager.accountCapabilityHosts() - .getWithResponse("qojbxao", "cgbzxm", "t", com.azure.core.util.Context.NONE) + .getWithResponse("volefcj", "se", "kdb", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("hzllrqmtlpbyxro", response.properties().description()); - Assertions.assertEquals("y", response.properties().tags().get("ypffmnoiicsudyh")); - Assertions.assertEquals("foioyidoxzn", response.properties().aiServicesConnections().get(0)); + Assertions.assertEquals("uunxh", response.properties().description()); + Assertions.assertEquals("fxzf", response.properties().tags().get("u")); + Assertions.assertEquals("fb", response.properties().aiServicesConnections().get(0)); Assertions.assertEquals(CapabilityHostKind.AGENTS, response.properties().capabilityHostKind()); - Assertions.assertEquals("tmuuvdawsx", response.properties().customerSubnet()); - Assertions.assertEquals("knimxlp", response.properties().storageConnections().get(0)); - Assertions.assertEquals("b", response.properties().threadStorageConnections().get(0)); - Assertions.assertEquals("mbnvynfaooeacted", response.properties().vectorStoreConnections().get(0)); + Assertions.assertEquals("xynlsuqb", response.properties().customerSubnet()); + Assertions.assertEquals("k", response.properties().storageConnections().get(0)); + Assertions.assertEquals("gjjktfinfhoksmm", response.properties().threadStorageConnections().get(0)); + Assertions.assertEquals("sgaojbtqpqsdoctp", response.properties().vectorStoreConnections().get(0)); + Assertions.assertFalse(response.properties().enablePublicHostingEnvironment()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsListMockTests.java new file mode 100644 index 000000000000..30e3fd2729ef --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountCapabilityHostsListMockTests.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; +import com.azure.resourcemanager.cognitiveservices.models.CapabilityHost; +import com.azure.resourcemanager.cognitiveservices.models.CapabilityHostKind; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class AccountCapabilityHostsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"aiServicesConnections\":[\"otfcuuugtjigpg\",\"yiawohfmhnnz\"],\"capabilityHostKind\":\"Agents\",\"customerSubnet\":\"jkmqenhaidzrpv\",\"provisioningState\":\"Updating\",\"storageConnections\":[\"ovslvivqsuvwtenb\",\"pijpkhc\",\"oa\",\"xukuicjuftekio\"],\"threadStorageConnections\":[\"duewfhvpxjhxzu\"],\"vectorStoreConnections\":[\"zabbwzgv\",\"uaixcdckix\"],\"enablePublicHostingEnvironment\":true,\"description\":\"igavk\",\"tags\":{\"kpzjbyetjxryopt\":\"xzerej\",\"z\":\"eitwhlbecgi\"}},\"id\":\"emnrrabovrwwxy\",\"name\":\"pjhspb\",\"type\":\"xhifpps\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CognitiveServicesManager manager = CognitiveServicesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.accountCapabilityHosts().list("fjxdwdrp", "zqjkrf", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("igavk", response.iterator().next().properties().description()); + Assertions.assertEquals("xzerej", response.iterator().next().properties().tags().get("kpzjbyetjxryopt")); + Assertions.assertEquals("otfcuuugtjigpg", + response.iterator().next().properties().aiServicesConnections().get(0)); + Assertions.assertEquals(CapabilityHostKind.AGENTS, + response.iterator().next().properties().capabilityHostKind()); + Assertions.assertEquals("jkmqenhaidzrpv", response.iterator().next().properties().customerSubnet()); + Assertions.assertEquals("ovslvivqsuvwtenb", + response.iterator().next().properties().storageConnections().get(0)); + Assertions.assertEquals("duewfhvpxjhxzu", + response.iterator().next().properties().threadStorageConnections().get(0)); + Assertions.assertEquals("zabbwzgv", response.iterator().next().properties().vectorStoreConnections().get(0)); + Assertions.assertTrue(response.iterator().next().properties().enablePublicHostingEnvironment()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsCreateWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsCreateWithResponseMockTests.java index b436f9f8039e..1aecff7e9abe 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsCreateWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsCreateWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -10,6 +10,7 @@ import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; import com.azure.resourcemanager.cognitiveservices.models.ConnectionCategory; import com.azure.resourcemanager.cognitiveservices.models.ConnectionPropertiesV2; import com.azure.resourcemanager.cognitiveservices.models.ConnectionPropertiesV2BasicResource; @@ -28,7 +29,7 @@ public final class AccountConnectionsCreateWithResponseMockTests { @Test public void testCreateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"authType\":\"ConnectionPropertiesV2\",\"category\":\"PythonFeed\",\"createdByWorkspaceArmId\":\"ujsqycm\",\"error\":\"xfabl\",\"expiryTime\":\"2021-09-23T07:48:54Z\",\"group\":\"Azure\",\"isSharedToAll\":true,\"metadata\":{\"gnwplrrb\":\"ialiwry\"},\"peRequirement\":\"Required\",\"peStatus\":\"Active\",\"sharedUserList\":[\"ibticuhqv\",\"mspbfs\",\"eqbbewfcuqfpy\"],\"target\":\"mzrmtmvw\",\"useWorkspaceManagedIdentity\":true},\"id\":\"eyyjshcybwfuppox\",\"name\":\"rcmvouujx\",\"type\":\"iikmoxrezsvavlrx\"}"; + = "{\"properties\":{\"authType\":\"ConnectionPropertiesV2\",\"category\":\"Odbc\",\"createdByWorkspaceArmId\":\"dywjflobhahqmom\",\"error\":\"corkfrocgbmxl\",\"expiryTime\":\"2021-11-29T06:49:01Z\",\"group\":\"GenericProtocol\",\"isSharedToAll\":true,\"metadata\":{\"dzuqscag\":\"sylslurbqfygpnyh\",\"ss\":\"yvouprsytq\"},\"peRequirement\":\"NotRequired\",\"peStatus\":\"Active\",\"sharedUserList\":[\"ivrxpfduiol\",\"gyqvpbfjpoqzuc\",\"zluczdq\"],\"target\":\"rbormvhvzie\",\"useWorkspaceManagedIdentity\":false},\"id\":\"nqujywz\",\"name\":\"qyggmnwsvhb\",\"type\":\"gqiwy\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -38,31 +39,32 @@ public void testCreateWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ConnectionPropertiesV2BasicResource response = manager.accountConnections() - .define("alec") - .withExistingAccount("cmyc", "ajqzj") - .withProperties(new ConnectionPropertiesV2().withCategory(ConnectionCategory.ORACLE) - .withError("sd") - .withExpiryTime(OffsetDateTime.parse("2021-04-21T11:10:30Z")) - .withIsSharedToAll(true) - .withMetadata( - mapOf("wushlcxpbl", "voikvntwczf", "zpfkis", "lhh", "xjqfiafcnlrtbfi", "aidqzsaaoqdsgpto")) - .withPeRequirement(ManagedPERequirement.REQUIRED) - .withPeStatus(ManagedPEStatus.ACTIVE) - .withSharedUserList(Arrays.asList("jolb", "a", "ktwieope", "e")) - .withTarget("qd") - .withUseWorkspaceManagedIdentity(true)) - .create(); + .createWithResponse("zl", "ynjpchamkaepl", "ajubo", + new ConnectionPropertiesV2BasicResourceInner() + .withProperties(new ConnectionPropertiesV2().withCategory(ConnectionCategory.API_MANAGEMENT) + .withError("jrieikm") + .withExpiryTime(OffsetDateTime.parse("2021-07-13T17:45:27Z")) + .withIsSharedToAll(false) + .withMetadata(mapOf("ucb", "syx", "yuvtz", "tredscnnstjc", "wtzqzcloyhy", "xzhclec", + "wbyorjplbchych", "pgidhzgyresgzsdt")) + .withPeRequirement(ManagedPERequirement.NOT_REQUIRED) + .withPeStatus(ManagedPEStatus.ACTIVE) + .withSharedUserList(Arrays.asList("qvumk", "qj")) + .withTarget("uepm") + .withUseWorkspaceManagedIdentity(false)), + com.azure.core.util.Context.NONE) + .getValue(); - Assertions.assertEquals(ConnectionCategory.PYTHON_FEED, response.properties().category()); - Assertions.assertEquals("xfabl", response.properties().error()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-23T07:48:54Z"), response.properties().expiryTime()); + Assertions.assertEquals(ConnectionCategory.ODBC, response.properties().category()); + Assertions.assertEquals("corkfrocgbmxl", response.properties().error()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-29T06:49:01Z"), response.properties().expiryTime()); Assertions.assertTrue(response.properties().isSharedToAll()); - Assertions.assertEquals("ialiwry", response.properties().metadata().get("gnwplrrb")); - Assertions.assertEquals(ManagedPERequirement.REQUIRED, response.properties().peRequirement()); + Assertions.assertEquals("sylslurbqfygpnyh", response.properties().metadata().get("dzuqscag")); + Assertions.assertEquals(ManagedPERequirement.NOT_REQUIRED, response.properties().peRequirement()); Assertions.assertEquals(ManagedPEStatus.ACTIVE, response.properties().peStatus()); - Assertions.assertEquals("ibticuhqv", response.properties().sharedUserList().get(0)); - Assertions.assertEquals("mzrmtmvw", response.properties().target()); - Assertions.assertTrue(response.properties().useWorkspaceManagedIdentity()); + Assertions.assertEquals("ivrxpfduiol", response.properties().sharedUserList().get(0)); + Assertions.assertEquals("rbormvhvzie", response.properties().target()); + Assertions.assertFalse(response.properties().useWorkspaceManagedIdentity()); } // Use "Map.of" if available diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsDeleteWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsDeleteWithResponseMockTests.java index 3b8c4837ccbe..a3a45f377eb0 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsDeleteWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsDeleteWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -28,7 +28,7 @@ public void testDeleteWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.accountConnections() - .deleteWithResponse("drpizfulgyctsdb", "qgkujds", "oxrqw", com.azure.core.util.Context.NONE); + .deleteWithResponse("rmuhcuhtuzlx", "wyopgarpfctwrapc", "dojq", com.azure.core.util.Context.NONE); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsGetWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsGetWithResponseMockTests.java index 1cd4829e8721..57abfa2a3b59 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsGetWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsGetWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -24,7 +24,7 @@ public final class AccountConnectionsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"authType\":\"ConnectionPropertiesV2\",\"category\":\"AzureTableStorage\",\"createdByWorkspaceArmId\":\"qkvyhzokpoyuohu\",\"error\":\"snaajph\",\"expiryTime\":\"2021-10-19T14:02:39Z\",\"group\":\"File\",\"isSharedToAll\":false,\"metadata\":{\"ioyjr\":\"wsadaxjsumxpezc\",\"nwmywxfqzkvemy\":\"fqzwqdnxkeed\",\"m\":\"dpczaqpqifd\",\"natnizexroqsqjg\":\"trwtxzuisam\"},\"peRequirement\":\"NotApplicable\",\"peStatus\":\"Active\",\"sharedUserList\":[\"lwsttxsrgxfqpan\",\"ceov\",\"gzwhsxyrujmtik\",\"s\"],\"target\":\"kyohzix\",\"useWorkspaceManagedIdentity\":true},\"id\":\"nkvycqqqdseipnqu\",\"name\":\"zxhrptyodlhkfktl\",\"type\":\"ddsobjopnouhbqez\"}"; + = "{\"properties\":{\"authType\":\"ConnectionPropertiesV2\",\"category\":\"SapTable\",\"createdByWorkspaceArmId\":\"zsclefyrletn\",\"error\":\"lmfdg\",\"expiryTime\":\"2021-08-19T08:57:05Z\",\"group\":\"Database\",\"isSharedToAll\":true,\"metadata\":{\"fleev\":\"vvv\",\"pxrl\":\"oqayrehjuqwv\"},\"peRequirement\":\"NotRequired\",\"peStatus\":\"NotApplicable\",\"sharedUserList\":[\"c\"],\"target\":\"qqzlxnqzubfo\",\"useWorkspaceManagedIdentity\":true},\"id\":\"gmkfw\",\"name\":\"jcw\",\"type\":\"ewfhxwyrkbre\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -34,18 +34,18 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ConnectionPropertiesV2BasicResource response = manager.accountConnections() - .getWithResponse("eurbtigapdyarik", "ejdpdfhtwm", "kfqbriqulwwt", com.azure.core.util.Context.NONE) + .getWithResponse("nnx", "mvynuqqko", "auratni", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(ConnectionCategory.AZURE_TABLE_STORAGE, response.properties().category()); - Assertions.assertEquals("snaajph", response.properties().error()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-19T14:02:39Z"), response.properties().expiryTime()); - Assertions.assertFalse(response.properties().isSharedToAll()); - Assertions.assertEquals("wsadaxjsumxpezc", response.properties().metadata().get("ioyjr")); - Assertions.assertEquals(ManagedPERequirement.NOT_APPLICABLE, response.properties().peRequirement()); - Assertions.assertEquals(ManagedPEStatus.ACTIVE, response.properties().peStatus()); - Assertions.assertEquals("lwsttxsrgxfqpan", response.properties().sharedUserList().get(0)); - Assertions.assertEquals("kyohzix", response.properties().target()); + Assertions.assertEquals(ConnectionCategory.SAP_TABLE, response.properties().category()); + Assertions.assertEquals("lmfdg", response.properties().error()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-19T08:57:05Z"), response.properties().expiryTime()); + Assertions.assertTrue(response.properties().isSharedToAll()); + Assertions.assertEquals("vvv", response.properties().metadata().get("fleev")); + Assertions.assertEquals(ManagedPERequirement.NOT_REQUIRED, response.properties().peRequirement()); + Assertions.assertEquals(ManagedPEStatus.NOT_APPLICABLE, response.properties().peStatus()); + Assertions.assertEquals("c", response.properties().sharedUserList().get(0)); + Assertions.assertEquals("qqzlxnqzubfo", response.properties().target()); Assertions.assertTrue(response.properties().useWorkspaceManagedIdentity()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsListMockTests.java index bbb93f442931..3c441f72789d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsListMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsListMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -25,7 +25,7 @@ public final class AccountConnectionsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"authType\":\"ConnectionPropertiesV2\",\"category\":\"BingLLMSearch\",\"createdByWorkspaceArmId\":\"jparnpvgrszrbwt\",\"error\":\"cwgzwllxzl\",\"expiryTime\":\"2021-11-16T13:56:23Z\",\"group\":\"AzureAI\",\"isSharedToAll\":false,\"metadata\":{\"rmhpf\":\"ulz\"},\"peRequirement\":\"Required\",\"peStatus\":\"NotApplicable\",\"sharedUserList\":[\"pzfzxsoxinunjlz\",\"drocqsxytq\",\"tcmiwd\"],\"target\":\"svnmeylajamcajy\",\"useWorkspaceManagedIdentity\":false},\"id\":\"zcrryklleynqa\",\"name\":\"hkigglclwalhvub\",\"type\":\"gzphetxd\"}]}"; + = "{\"value\":[{\"properties\":{\"authType\":\"ConnectionPropertiesV2\",\"category\":\"SapCloudForCustomer\",\"createdByWorkspaceArmId\":\"mgjl\",\"error\":\"vdorsirx\",\"expiryTime\":\"2021-11-30T01:12:07Z\",\"group\":\"Azure\",\"isSharedToAll\":true,\"metadata\":{\"wteyrqshixbcejo\":\"fajfreprfvmki\",\"cspimtcvvfxrdy\":\"ylblfsprr\",\"iqemcdiiisklbon\":\"zfslxizhqikmgob\",\"jxvtrkfkgenjqnnp\":\"xu\"},\"peRequirement\":\"NotRequired\",\"peStatus\":\"NotApplicable\",\"sharedUserList\":[\"xigfoujjc\",\"gdqmrlhnzkwop\"],\"target\":\"nyinxuprrxyxw\",\"useWorkspaceManagedIdentity\":false},\"id\":\"fqployuek\",\"name\":\"cpvuft\",\"type\":\"svjmnsvujnjk\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -35,18 +35,21 @@ public void testList() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.accountConnections() - .list("qxsaluzyig", "cvcewb", "qhdgsjsatmrn", "mazdfsqxh", false, com.azure.core.util.Context.NONE); + .list("vzesipiys", "jqyowaadc", "dazabundtse", "kaupwhlz", true, com.azure.core.util.Context.NONE); - Assertions.assertEquals(ConnectionCategory.BING_LLMSEARCH, response.iterator().next().properties().category()); - Assertions.assertEquals("cwgzwllxzl", response.iterator().next().properties().error()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-16T13:56:23Z"), + Assertions.assertEquals(ConnectionCategory.SAP_CLOUD_FOR_CUSTOMER, + response.iterator().next().properties().category()); + Assertions.assertEquals("vdorsirx", response.iterator().next().properties().error()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-30T01:12:07Z"), response.iterator().next().properties().expiryTime()); - Assertions.assertFalse(response.iterator().next().properties().isSharedToAll()); - Assertions.assertEquals("ulz", response.iterator().next().properties().metadata().get("rmhpf")); - Assertions.assertEquals(ManagedPERequirement.REQUIRED, response.iterator().next().properties().peRequirement()); + Assertions.assertTrue(response.iterator().next().properties().isSharedToAll()); + Assertions.assertEquals("fajfreprfvmki", + response.iterator().next().properties().metadata().get("wteyrqshixbcejo")); + Assertions.assertEquals(ManagedPERequirement.NOT_REQUIRED, + response.iterator().next().properties().peRequirement()); Assertions.assertEquals(ManagedPEStatus.NOT_APPLICABLE, response.iterator().next().properties().peStatus()); - Assertions.assertEquals("pzfzxsoxinunjlz", response.iterator().next().properties().sharedUserList().get(0)); - Assertions.assertEquals("svnmeylajamcajy", response.iterator().next().properties().target()); + Assertions.assertEquals("xigfoujjc", response.iterator().next().properties().sharedUserList().get(0)); + Assertions.assertEquals("nyinxuprrxyxw", response.iterator().next().properties().target()); Assertions.assertFalse(response.iterator().next().properties().useWorkspaceManagedIdentity()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsUpdateWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsUpdateWithResponseMockTests.java similarity index 59% rename from sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsUpdateWithResponseMockTests.java rename to sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsUpdateWithResponseMockTests.java index 0aac0e72b6b0..45d82c949d98 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsUpdateWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountConnectionsUpdateWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -25,11 +25,11 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class ProjectConnectionsUpdateWithResponseMockTests { +public final class AccountConnectionsUpdateWithResponseMockTests { @Test public void testUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"authType\":\"ConnectionPropertiesV2\",\"category\":\"MySql\",\"createdByWorkspaceArmId\":\"lniibncg\",\"error\":\"dvcdq\",\"expiryTime\":\"2021-02-10T14:42:39Z\",\"group\":\"ServicesAndApps\",\"isSharedToAll\":false,\"metadata\":{\"htncwmhjobzrfp\":\"ofdf\"},\"peRequirement\":\"NotRequired\",\"peStatus\":\"Active\",\"sharedUserList\":[\"yftcvbzwgwhg\"],\"target\":\"soauoorssatfyb\",\"useWorkspaceManagedIdentity\":false},\"id\":\"dm\",\"name\":\"uqbdq\",\"type\":\"as\"}"; + = "{\"properties\":{\"authType\":\"ConnectionPropertiesV2\",\"category\":\"Dynamics\",\"createdByWorkspaceArmId\":\"whcukvbos\",\"error\":\"fdizhrjq\",\"expiryTime\":\"2021-01-11T16:53:18Z\",\"group\":\"File\",\"isSharedToAll\":false,\"metadata\":{\"gsxf\":\"ekcgniuarlcji\",\"nfgrzxbarcbpaefz\":\"iocwdgujj\",\"w\":\"sym\",\"hua\":\"njcytesmfucrtfod\"},\"peRequirement\":\"NotRequired\",\"peStatus\":\"NotApplicable\",\"sharedUserList\":[\"trfzhhezvh\",\"udxdyyrudmahswt\"],\"target\":\"kxbqssgfenffd\",\"useWorkspaceManagedIdentity\":false},\"id\":\"fqjchivdrij\",\"name\":\"nxndmuvardlmzjo\",\"type\":\"p\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -39,31 +39,32 @@ public void testUpdateWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ConnectionPropertiesV2BasicResource response - = manager.projectConnections() - .updateWithResponse("bhtleberpy", "jeknfqnw", "j", "xowkdnj", + = manager.accountConnections() + .updateWithResponse("jtobdrrp", "rehkunsbfjhh", "w", new ConnectionUpdateContent().withProperties(new ConnectionPropertiesV2() - .withCategory(ConnectionCategory.GOOGLE_CLOUD_STORAGE) - .withError("r") - .withExpiryTime(OffsetDateTime.parse("2021-06-16T04:12:26Z")) - .withIsSharedToAll(false) - .withMetadata(mapOf("yrguyfazbk", "bjzm", "bc", "cbygvthrmx")) + .withCategory(ConnectionCategory.ODBC) + .withError("qnwqstt") + .withExpiryTime(OffsetDateTime.parse("2021-12-03T01:55:12Z")) + .withIsSharedToAll(true) + .withMetadata(mapOf("p", "ufjxflpditfno", "wonleqflvtlr", "yuxlvrhprrv", "phuykun", "bs", + "zdbuzici", "nttlnrjd")) .withPeRequirement(ManagedPERequirement.NOT_APPLICABLE) - .withPeStatus(ManagedPEStatus.NOT_APPLICABLE) - .withSharedUserList(Arrays.asList("rawppkeboozf", "yacagae", "aoiqclmgdt", "gabdxfkuzbwjeco")) - .withTarget("vh") + .withPeStatus(ManagedPEStatus.ACTIVE) + .withSharedUserList(Arrays.asList("pnewuhwfwjno", "uoxtfnressfepgck", "cjmgvsnvbtqdxfm", "ym")) + .withTarget("hjluqllbsupubdx") .withUseWorkspaceManagedIdentity(false)), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(ConnectionCategory.MY_SQL, response.properties().category()); - Assertions.assertEquals("dvcdq", response.properties().error()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-10T14:42:39Z"), response.properties().expiryTime()); + Assertions.assertEquals(ConnectionCategory.DYNAMICS, response.properties().category()); + Assertions.assertEquals("fdizhrjq", response.properties().error()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-11T16:53:18Z"), response.properties().expiryTime()); Assertions.assertFalse(response.properties().isSharedToAll()); - Assertions.assertEquals("ofdf", response.properties().metadata().get("htncwmhjobzrfp")); + Assertions.assertEquals("ekcgniuarlcji", response.properties().metadata().get("gsxf")); Assertions.assertEquals(ManagedPERequirement.NOT_REQUIRED, response.properties().peRequirement()); - Assertions.assertEquals(ManagedPEStatus.ACTIVE, response.properties().peStatus()); - Assertions.assertEquals("yftcvbzwgwhg", response.properties().sharedUserList().get(0)); - Assertions.assertEquals("soauoorssatfyb", response.properties().target()); + Assertions.assertEquals(ManagedPEStatus.NOT_APPLICABLE, response.properties().peStatus()); + Assertions.assertEquals("trfzhhezvh", response.properties().sharedUserList().get(0)); + Assertions.assertEquals("kxbqssgfenffd", response.properties().target()); Assertions.assertFalse(response.properties().useWorkspaceManagedIdentity()); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountSkuListResultInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountSkuListResultInnerTests.java index b5f975a08072..75032e5addd1 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountSkuListResultInnerTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountSkuListResultInnerTests.java @@ -1,64 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.cognitiveservices.fluent.models.AccountSkuListResultInner; -import com.azure.resourcemanager.cognitiveservices.models.AccountSku; -import com.azure.resourcemanager.cognitiveservices.models.Sku; import com.azure.resourcemanager.cognitiveservices.models.SkuTier; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class AccountSkuListResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AccountSkuListResultInner model = BinaryData.fromString( - "{\"value\":[{\"resourceType\":\"mpmngnzscxaqwoo\",\"sku\":{\"name\":\"cbonqvpk\",\"tier\":\"Premium\",\"size\":\"njeaseipheofloke\",\"family\":\"ienjbdlwtgr\",\"capacity\":1420069098}},{\"resourceType\":\"pj\",\"sku\":{\"name\":\"asxazjpqyegualhb\",\"tier\":\"Free\",\"size\":\"jj\",\"family\":\"v\",\"capacity\":303390013}},{\"resourceType\":\"wdslfhotwmcy\",\"sku\":{\"name\":\"wlbjnpgacftade\",\"tier\":\"Basic\",\"size\":\"tyfsoppusuesn\",\"family\":\"dejbavo\",\"capacity\":669466066}},{\"resourceType\":\"mohctb\",\"sku\":{\"name\":\"udwxdndnvowguj\",\"tier\":\"Enterprise\",\"size\":\"dkcglhsl\",\"family\":\"jdyggdtji\",\"capacity\":165344831}}]}") + "{\"value\":[{\"resourceType\":\"qgtz\",\"sku\":{\"name\":\"pnqbqqwxrjfe\",\"tier\":\"Basic\",\"size\":\"wsubisnja\",\"family\":\"mngnzscxaqw\",\"capacity\":2024300309}},{\"resourceType\":\"cbonqvpk\",\"sku\":{\"name\":\"rxnjeaseipheofl\",\"tier\":\"Basic\",\"size\":\"y\",\"family\":\"nj\",\"capacity\":147839675}},{\"resourceType\":\"tgrhpdjpjumas\",\"sku\":{\"name\":\"zj\",\"tier\":\"Premium\",\"size\":\"gual\",\"family\":\"xxhejjzzvd\",\"capacity\":572482803}}]}") .toObject(AccountSkuListResultInner.class); - Assertions.assertEquals("mpmngnzscxaqwoo", model.value().get(0).resourceType()); - Assertions.assertEquals("cbonqvpk", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.value().get(0).sku().tier()); - Assertions.assertEquals("njeaseipheofloke", model.value().get(0).sku().size()); - Assertions.assertEquals("ienjbdlwtgr", model.value().get(0).sku().family()); - Assertions.assertEquals(1420069098, model.value().get(0).sku().capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccountSkuListResultInner model = new AccountSkuListResultInner().withValue(Arrays.asList( - new AccountSku().withResourceType("mpmngnzscxaqwoo") - .withSku(new Sku().withName("cbonqvpk") - .withTier(SkuTier.PREMIUM) - .withSize("njeaseipheofloke") - .withFamily("ienjbdlwtgr") - .withCapacity(1420069098)), - new AccountSku().withResourceType("pj") - .withSku(new Sku().withName("asxazjpqyegualhb") - .withTier(SkuTier.FREE) - .withSize("jj") - .withFamily("v") - .withCapacity(303390013)), - new AccountSku().withResourceType("wdslfhotwmcy") - .withSku(new Sku().withName("wlbjnpgacftade") - .withTier(SkuTier.BASIC) - .withSize("tyfsoppusuesn") - .withFamily("dejbavo") - .withCapacity(669466066)), - new AccountSku().withResourceType("mohctb") - .withSku(new Sku().withName("udwxdndnvowguj") - .withTier(SkuTier.ENTERPRISE) - .withSize("dkcglhsl") - .withFamily("jdyggdtji") - .withCapacity(165344831)))); - model = BinaryData.fromObject(model).toObject(AccountSkuListResultInner.class); - Assertions.assertEquals("mpmngnzscxaqwoo", model.value().get(0).resourceType()); - Assertions.assertEquals("cbonqvpk", model.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, model.value().get(0).sku().tier()); - Assertions.assertEquals("njeaseipheofloke", model.value().get(0).sku().size()); - Assertions.assertEquals("ienjbdlwtgr", model.value().get(0).sku().family()); - Assertions.assertEquals(1420069098, model.value().get(0).sku().capacity()); + Assertions.assertEquals("qgtz", model.value().get(0).resourceType()); + Assertions.assertEquals("pnqbqqwxrjfe", model.value().get(0).sku().name()); + Assertions.assertEquals(SkuTier.BASIC, model.value().get(0).sku().tier()); + Assertions.assertEquals("wsubisnja", model.value().get(0).sku().size()); + Assertions.assertEquals("mngnzscxaqw", model.value().get(0).sku().family()); + Assertions.assertEquals(2024300309, model.value().get(0).sku().capacity()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountSkuTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountSkuTests.java index 0f226d85b1d4..81db6c9f35c1 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountSkuTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountSkuTests.java @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.cognitiveservices.models.AccountSku; -import com.azure.resourcemanager.cognitiveservices.models.Sku; import com.azure.resourcemanager.cognitiveservices.models.SkuTier; import org.junit.jupiter.api.Assertions; @@ -14,30 +13,13 @@ public final class AccountSkuTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AccountSku model = BinaryData.fromString( - "{\"resourceType\":\"uofqwe\",\"sku\":{\"name\":\"hmenevfyexfwhybc\",\"tier\":\"Enterprise\",\"size\":\"vdcsitynn\",\"family\":\"mdectehfiqscjey\",\"capacity\":1797610507}}") + "{\"resourceType\":\"dslfhotwmcy\",\"sku\":{\"name\":\"wlbjnpgacftade\",\"tier\":\"Basic\",\"size\":\"tyfsoppusuesn\",\"family\":\"dejbavo\",\"capacity\":669466066}}") .toObject(AccountSku.class); - Assertions.assertEquals("uofqwe", model.resourceType()); - Assertions.assertEquals("hmenevfyexfwhybc", model.sku().name()); - Assertions.assertEquals(SkuTier.ENTERPRISE, model.sku().tier()); - Assertions.assertEquals("vdcsitynn", model.sku().size()); - Assertions.assertEquals("mdectehfiqscjey", model.sku().family()); - Assertions.assertEquals(1797610507, model.sku().capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccountSku model = new AccountSku().withResourceType("uofqwe") - .withSku(new Sku().withName("hmenevfyexfwhybc") - .withTier(SkuTier.ENTERPRISE) - .withSize("vdcsitynn") - .withFamily("mdectehfiqscjey") - .withCapacity(1797610507)); - model = BinaryData.fromObject(model).toObject(AccountSku.class); - Assertions.assertEquals("uofqwe", model.resourceType()); - Assertions.assertEquals("hmenevfyexfwhybc", model.sku().name()); - Assertions.assertEquals(SkuTier.ENTERPRISE, model.sku().tier()); - Assertions.assertEquals("vdcsitynn", model.sku().size()); - Assertions.assertEquals("mdectehfiqscjey", model.sku().family()); - Assertions.assertEquals(1797610507, model.sku().capacity()); + Assertions.assertEquals("dslfhotwmcy", model.resourceType()); + Assertions.assertEquals("wlbjnpgacftade", model.sku().name()); + Assertions.assertEquals(SkuTier.BASIC, model.sku().tier()); + Assertions.assertEquals("tyfsoppusuesn", model.sku().size()); + Assertions.assertEquals("dejbavo", model.sku().family()); + Assertions.assertEquals(669466066, model.sku().capacity()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsDeleteMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsDeleteMockTests.java index 3258f77abb95..fe31de0239db 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsDeleteMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsDeleteMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -27,7 +27,7 @@ public void testDelete() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.accounts().delete("ctmgxuupbezqccy", "rtceukdqkkyihzt", com.azure.core.util.Context.NONE); + manager.accounts().delete("bc", "ndtsnxawqytll", com.azure.core.util.Context.NONE); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListSkusWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListSkusWithResponseMockTests.java index ff13b8c4e5f6..f7bfd8db8d10 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListSkusWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListSkusWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -22,7 +22,7 @@ public final class AccountsListSkusWithResponseMockTests { @Test public void testListSkusWithResponse() throws Exception { String responseStr - = "{\"value\":[{\"resourceType\":\"fdqwowftpt\",\"sku\":{\"name\":\"wjtkschgcgqyhl\",\"tier\":\"Standard\",\"size\":\"q\",\"family\":\"vyeldot\",\"capacity\":1476629274}}]}"; + = "{\"value\":[{\"resourceType\":\"aqaj\",\"sku\":{\"name\":\"ehzptdmk\",\"tier\":\"Free\",\"size\":\"mpfu\",\"family\":\"be\",\"capacity\":1220487852}},{\"resourceType\":\"pmfbfununmpzkr\",\"sku\":{\"name\":\"yifkdschlzvf\",\"tier\":\"Standard\",\"size\":\"kjjwgcwn\",\"family\":\"bkgfyrtogmhmjpjs\",\"capacity\":329267906}},{\"resourceType\":\"dqwty\",\"sku\":{\"name\":\"vgwmseharxifvqnr\",\"tier\":\"Free\",\"size\":\"pjptn\",\"family\":\"jhrsidqpxlb\",\"capacity\":1527759822}},{\"resourceType\":\"f\",\"sku\":{\"name\":\"gatwmykyu\",\"tier\":\"Free\",\"size\":\"dwmf\",\"family\":\"pycvjqdvdwkqpldr\",\"capacity\":1402026480}}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,14 +32,14 @@ public void testListSkusWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); AccountSkuListResult response = manager.accounts() - .listSkusWithResponse("kzzltafhbzf", "ovwmbjlzqsczpgvd", com.azure.core.util.Context.NONE) + .listSkusWithResponse("ygleexa", "vmywhsbrcarycsjj", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("fdqwowftpt", response.value().get(0).resourceType()); - Assertions.assertEquals("wjtkschgcgqyhl", response.value().get(0).sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, response.value().get(0).sku().tier()); - Assertions.assertEquals("q", response.value().get(0).sku().size()); - Assertions.assertEquals("vyeldot", response.value().get(0).sku().family()); - Assertions.assertEquals(1476629274, response.value().get(0).sku().capacity()); + Assertions.assertEquals("aqaj", response.value().get(0).resourceType()); + Assertions.assertEquals("ehzptdmk", response.value().get(0).sku().name()); + Assertions.assertEquals(SkuTier.FREE, response.value().get(0).sku().tier()); + Assertions.assertEquals("mpfu", response.value().get(0).sku().size()); + Assertions.assertEquals("be", response.value().get(0).sku().family()); + Assertions.assertEquals(1220487852, response.value().get(0).sku().capacity()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListUsagesWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListUsagesWithResponseMockTests.java index eed6e857f220..87b77e5e96e8 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListUsagesWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AccountsListUsagesWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -10,6 +10,7 @@ import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; +import com.azure.resourcemanager.cognitiveservices.models.QuotaScopeType; import com.azure.resourcemanager.cognitiveservices.models.QuotaUsageStatus; import com.azure.resourcemanager.cognitiveservices.models.UnitType; import com.azure.resourcemanager.cognitiveservices.models.UsageListResult; @@ -23,7 +24,7 @@ public final class AccountsListUsagesWithResponseMockTests { @Test public void testListUsagesWithResponse() throws Exception { String responseStr - = "{\"nextLink\":\"mmbugtywatmqaq\",\"value\":[{\"unit\":\"Percent\",\"name\":{\"value\":\"oeshoygzcbyfq\",\"localizedValue\":\"faoytehqpuv\"},\"quotaPeriod\":\"vqmtdwckygroejn\",\"limit\":76.49773710610344,\"currentValue\":67.05490418254814,\"nextResetTime\":\"kb\",\"status\":\"Included\"},{\"unit\":\"Bytes\",\"name\":{\"value\":\"ceysfaqeg\",\"localizedValue\":\"wryshwd\"},\"quotaPeriod\":\"vbxgkqusyb\",\"limit\":63.81647101579004,\"currentValue\":90.05665099395556,\"nextResetTime\":\"vvlfntymtp\",\"status\":\"Blocked\"},{\"unit\":\"CountPerSecond\",\"name\":{\"value\":\"erohzrsqalsxkdn\",\"localizedValue\":\"apfgsdpcvessm\"},\"quotaPeriod\":\"h\",\"limit\":39.5785601199793,\"currentValue\":51.17838108548566,\"nextResetTime\":\"qctekvalb\",\"status\":\"InOverage\"}]}"; + = "{\"nextLink\":\"uyeuyl\",\"value\":[{\"unit\":\"BytesPerSecond\",\"name\":{\"value\":\"kcgsuthhl\",\"localizedValue\":\"mwynefxexlfciatx\"},\"quotaPeriod\":\"rrlkmdskjhhx\",\"limit\":37.141854771604166,\"currentValue\":56.354635440517484,\"nextResetTime\":\"xscvslxlhua\",\"status\":\"Unknown\",\"scopeType\":\"DataZone\",\"scopeId\":\"myjmkxettcslojfk\"},{\"unit\":\"Milliseconds\",\"name\":{\"value\":\"toqxjh\",\"localizedValue\":\"csqhtkbtnqlrng\"},\"quotaPeriod\":\"mbiipsnawwlqk\",\"limit\":65.56321704269217,\"currentValue\":39.63416396960236,\"nextResetTime\":\"ricctkwmuqqoa\",\"status\":\"Unknown\",\"scopeType\":\"Regional\",\"scopeId\":\"lesrwva\"},{\"unit\":\"CountPerSecond\",\"name\":{\"value\":\"trceqnkbrupob\",\"localizedValue\":\"dmljzacvumepjp\"},\"quotaPeriod\":\"bn\",\"limit\":85.16103349191285,\"currentValue\":19.70370989655825,\"nextResetTime\":\"exleqirccjcl\",\"status\":\"Blocked\",\"scopeType\":\"Regional\",\"scopeId\":\"rpjl\"},{\"unit\":\"Milliseconds\",\"name\":{\"value\":\"da\",\"localizedValue\":\"u\"},\"quotaPeriod\":\"ttepdjxqe\",\"limit\":7.422502582516111,\"currentValue\":34.8202382234068,\"nextResetTime\":\"lpckaewsedves\",\"status\":\"Blocked\",\"scopeType\":\"Classic\",\"scopeId\":\"phrgfnzhctm\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,17 +34,19 @@ public void testListUsagesWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); UsageListResult response = manager.accounts() - .listUsagesWithResponse("kwiswskukjtas", "vwisp", "xkdtxfkndlqvtwkn", com.azure.core.util.Context.NONE) + .listUsagesWithResponse("gnaavu", "gnteta", "utnpdctuhspfefyi", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("mmbugtywatmqaq", response.nextLink()); - Assertions.assertEquals(UnitType.PERCENT, response.value().get(0).unit()); - Assertions.assertEquals("oeshoygzcbyfq", response.value().get(0).name().value()); - Assertions.assertEquals("faoytehqpuv", response.value().get(0).name().localizedValue()); - Assertions.assertEquals("vqmtdwckygroejn", response.value().get(0).quotaPeriod()); - Assertions.assertEquals(76.49773710610344D, response.value().get(0).limit()); - Assertions.assertEquals(67.05490418254814D, response.value().get(0).currentValue()); - Assertions.assertEquals("kb", response.value().get(0).nextResetTime()); - Assertions.assertEquals(QuotaUsageStatus.INCLUDED, response.value().get(0).status()); + Assertions.assertEquals("uyeuyl", response.nextLink()); + Assertions.assertEquals(UnitType.BYTES_PER_SECOND, response.value().get(0).unit()); + Assertions.assertEquals("kcgsuthhl", response.value().get(0).name().value()); + Assertions.assertEquals("mwynefxexlfciatx", response.value().get(0).name().localizedValue()); + Assertions.assertEquals("rrlkmdskjhhx", response.value().get(0).quotaPeriod()); + Assertions.assertEquals(37.141854771604166D, response.value().get(0).limit()); + Assertions.assertEquals(56.354635440517484D, response.value().get(0).currentValue()); + Assertions.assertEquals("xscvslxlhua", response.value().get(0).nextResetTime()); + Assertions.assertEquals(QuotaUsageStatus.UNKNOWN, response.value().get(0).status()); + Assertions.assertEquals(QuotaScopeType.DATA_ZONE, response.value().get(0).scopeType()); + Assertions.assertEquals("myjmkxettcslojfk", response.value().get(0).scopeId()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsDisableWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsDisableWithResponseMockTests.java new file mode 100644 index 000000000000..5220afac35ce --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsDisableWithResponseMockTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class AgentApplicationsDisableWithResponseMockTests { + @Test + public void testDisableWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CognitiveServicesManager manager = CognitiveServicesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.agentApplications() + .disableWithResponse("px", "jjtpdyzoutxfptof", "gnuywezygva", "gaaqw", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsDeleteMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsEnableWithResponseMockTests.java similarity index 76% rename from sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsDeleteMockTests.java rename to sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsEnableWithResponseMockTests.java index 7e05e8e5d25e..879f207f0980 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsDeleteMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsEnableWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -15,9 +15,9 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class ProjectsDeleteMockTests { +public final class AgentApplicationsEnableWithResponseMockTests { @Test - public void testDelete() throws Exception { + public void testEnableWithResponse() throws Exception { String responseStr = "{}"; HttpClient httpClient @@ -27,7 +27,8 @@ public void testDelete() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.projects().delete("etwilyrzoxpd", "qlf", "olqownki", com.azure.core.util.Context.NONE); + manager.agentApplications() + .enableWithResponse("e", "eunokakz", "hpjlwyxedznmxrf", "mckewvmyif", com.azure.core.util.Context.NONE); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsListAgentsWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsListAgentsWithResponseMockTests.java new file mode 100644 index 000000000000..465756290fa9 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentApplicationsListAgentsWithResponseMockTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; +import com.azure.resourcemanager.cognitiveservices.models.AgentReferenceResourceArmPaginatedResult; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class AgentApplicationsListAgentsWithResponseMockTests { + @Test + public void testListAgentsWithResponse() throws Exception { + String responseStr + = "{\"nextLink\":\"iyxfwkztsmsfbevy\",\"value\":[{\"properties\":{\"agentId\":\"fhkqytkzta\",\"agentName\":\"pgfzdgjfcyc\"},\"id\":\"vlo\",\"name\":\"yhigqkzjuqwqaj\",\"type\":\"uzxp\"},{\"properties\":{\"agentId\":\"hyoipnfdbgso\",\"agentName\":\"ienezf\"},\"id\":\"ennmf\",\"name\":\"bpjnrtekwwnt\",\"type\":\"ro\"},{\"properties\":{\"agentId\":\"dudsyiurztvktj\",\"agentName\":\"fecqkoqyouerga\"},\"id\":\"puzxkpyehhfdyldh\",\"name\":\"yedzfzq\",\"type\":\"yuqht\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CognitiveServicesManager manager = CognitiveServicesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + AgentReferenceResourceArmPaginatedResult response = manager.agentApplications() + .listAgentsWithResponse("bqvknmpecqxgiq", "sifubns", "stlpwqp", "nxjkhtupsvyouw", + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("iyxfwkztsmsfbevy", response.nextLink()); + Assertions.assertEquals("fhkqytkzta", response.value().get(0).properties().agentId()); + Assertions.assertEquals("pgfzdgjfcyc", response.value().get(0).properties().agentName()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentInnerTests.java new file mode 100644 index 000000000000..6296de2b7d01 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentInnerTests.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentDeploymentInner; +import com.azure.resourcemanager.cognitiveservices.models.AgentDeploymentProperties; +import com.azure.resourcemanager.cognitiveservices.models.AgentDeploymentState; +import com.azure.resourcemanager.cognitiveservices.models.AgentProtocol; +import com.azure.resourcemanager.cognitiveservices.models.AgentProtocolVersion; +import com.azure.resourcemanager.cognitiveservices.models.VersionedAgentReference; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class AgentDeploymentInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AgentDeploymentInner model = BinaryData.fromString( + "{\"properties\":{\"deploymentType\":\"AgentDeploymentProperties\",\"displayName\":\"cgzpraoxnyu\",\"deploymentId\":\"a\",\"state\":\"Stopped\",\"protocols\":[{\"protocol\":\"Agent\",\"version\":\"cxb\"},{\"protocol\":\"Responses\",\"version\":\"iqdxyurnpnuh\"},{\"protocol\":\"Responses\",\"version\":\"cnuhiigbylbuigv\"},{\"protocol\":\"A2A\",\"version\":\"vcrk\"}],\"agents\":[{\"agentVersion\":\"bqxvhcsyhzlwxae\",\"agentId\":\"vurex\",\"agentName\":\"d\"}],\"provisioningState\":\"Creating\",\"description\":\"ead\",\"tags\":{\"oaq\":\"mwntopagttmvmma\",\"mxitpfinzcpd\":\"lkjztjiuazjc\",\"vcqguefzh\":\"tkrlgjmtbd\"}},\"id\":\"p\",\"name\":\"eqdurelyujlfyoum\",\"type\":\"ckyeclcdigpta\"}") + .toObject(AgentDeploymentInner.class); + Assertions.assertEquals("ead", model.properties().description()); + Assertions.assertEquals("mwntopagttmvmma", model.properties().tags().get("oaq")); + Assertions.assertEquals("cgzpraoxnyu", model.properties().displayName()); + Assertions.assertEquals("a", model.properties().deploymentId()); + Assertions.assertEquals(AgentDeploymentState.STOPPED, model.properties().state()); + Assertions.assertEquals(AgentProtocol.AGENT, model.properties().protocols().get(0).protocol()); + Assertions.assertEquals("cxb", model.properties().protocols().get(0).version()); + Assertions.assertEquals("vurex", model.properties().agents().get(0).agentId()); + Assertions.assertEquals("d", model.properties().agents().get(0).agentName()); + Assertions.assertEquals("bqxvhcsyhzlwxae", model.properties().agents().get(0).agentVersion()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AgentDeploymentInner model + = new AgentDeploymentInner().withProperties(new AgentDeploymentProperties().withDescription("ead") + .withTags(mapOf("oaq", "mwntopagttmvmma", "mxitpfinzcpd", "lkjztjiuazjc", "vcqguefzh", "tkrlgjmtbd")) + .withDisplayName("cgzpraoxnyu") + .withDeploymentId("a") + .withState(AgentDeploymentState.STOPPED) + .withProtocols( + Arrays.asList(new AgentProtocolVersion().withProtocol(AgentProtocol.AGENT).withVersion("cxb"), + new AgentProtocolVersion().withProtocol(AgentProtocol.RESPONSES).withVersion("iqdxyurnpnuh"), + new AgentProtocolVersion().withProtocol(AgentProtocol.RESPONSES).withVersion("cnuhiigbylbuigv"), + new AgentProtocolVersion().withProtocol(AgentProtocol.A2A).withVersion("vcrk"))) + .withAgents(Arrays.asList(new VersionedAgentReference().withAgentId("vurex") + .withAgentName("d") + .withAgentVersion("bqxvhcsyhzlwxae")))); + model = BinaryData.fromObject(model).toObject(AgentDeploymentInner.class); + Assertions.assertEquals("ead", model.properties().description()); + Assertions.assertEquals("mwntopagttmvmma", model.properties().tags().get("oaq")); + Assertions.assertEquals("cgzpraoxnyu", model.properties().displayName()); + Assertions.assertEquals("a", model.properties().deploymentId()); + Assertions.assertEquals(AgentDeploymentState.STOPPED, model.properties().state()); + Assertions.assertEquals(AgentProtocol.AGENT, model.properties().protocols().get(0).protocol()); + Assertions.assertEquals("cxb", model.properties().protocols().get(0).version()); + Assertions.assertEquals("vurex", model.properties().agents().get(0).agentId()); + Assertions.assertEquals("d", model.properties().agents().get(0).agentName()); + Assertions.assertEquals("bqxvhcsyhzlwxae", model.properties().agents().get(0).agentVersion()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentPropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentPropertiesTests.java new file mode 100644 index 000000000000..5cdf66052490 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentPropertiesTests.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.models.AgentDeploymentProperties; +import com.azure.resourcemanager.cognitiveservices.models.AgentDeploymentState; +import com.azure.resourcemanager.cognitiveservices.models.AgentProtocol; +import com.azure.resourcemanager.cognitiveservices.models.AgentProtocolVersion; +import com.azure.resourcemanager.cognitiveservices.models.VersionedAgentReference; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class AgentDeploymentPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AgentDeploymentProperties model = BinaryData.fromString( + "{\"deploymentType\":\"AgentDeploymentProperties\",\"displayName\":\"rzmq\",\"deploymentId\":\"cycijoclxiut\",\"state\":\"Deleted\",\"protocols\":[{\"protocol\":\"Agent\",\"version\":\"dnrqjbtxj\"}],\"agents\":[{\"agentVersion\":\"aqbzgyhfwwvuatbw\",\"agentId\":\"amteuliyslpkc\",\"agentName\":\"w\"}],\"provisioningState\":\"Canceled\",\"description\":\"xe\",\"tags\":{\"iijq\":\"wbormcqmi\"}}") + .toObject(AgentDeploymentProperties.class); + Assertions.assertEquals("xe", model.description()); + Assertions.assertEquals("wbormcqmi", model.tags().get("iijq")); + Assertions.assertEquals("rzmq", model.displayName()); + Assertions.assertEquals("cycijoclxiut", model.deploymentId()); + Assertions.assertEquals(AgentDeploymentState.DELETED, model.state()); + Assertions.assertEquals(AgentProtocol.AGENT, model.protocols().get(0).protocol()); + Assertions.assertEquals("dnrqjbtxj", model.protocols().get(0).version()); + Assertions.assertEquals("amteuliyslpkc", model.agents().get(0).agentId()); + Assertions.assertEquals("w", model.agents().get(0).agentName()); + Assertions.assertEquals("aqbzgyhfwwvuatbw", model.agents().get(0).agentVersion()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AgentDeploymentProperties model = new AgentDeploymentProperties().withDescription("xe") + .withTags(mapOf("iijq", "wbormcqmi")) + .withDisplayName("rzmq") + .withDeploymentId("cycijoclxiut") + .withState(AgentDeploymentState.DELETED) + .withProtocols( + Arrays.asList(new AgentProtocolVersion().withProtocol(AgentProtocol.AGENT).withVersion("dnrqjbtxj"))) + .withAgents(Arrays.asList(new VersionedAgentReference().withAgentId("amteuliyslpkc") + .withAgentName("w") + .withAgentVersion("aqbzgyhfwwvuatbw"))); + model = BinaryData.fromObject(model).toObject(AgentDeploymentProperties.class); + Assertions.assertEquals("xe", model.description()); + Assertions.assertEquals("wbormcqmi", model.tags().get("iijq")); + Assertions.assertEquals("rzmq", model.displayName()); + Assertions.assertEquals("cycijoclxiut", model.deploymentId()); + Assertions.assertEquals(AgentDeploymentState.DELETED, model.state()); + Assertions.assertEquals(AgentProtocol.AGENT, model.protocols().get(0).protocol()); + Assertions.assertEquals("dnrqjbtxj", model.protocols().get(0).version()); + Assertions.assertEquals("amteuliyslpkc", model.agents().get(0).agentId()); + Assertions.assertEquals("w", model.agents().get(0).agentName()); + Assertions.assertEquals("aqbzgyhfwwvuatbw", model.agents().get(0).agentVersion()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentResourceArmPaginatedResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentResourceArmPaginatedResultTests.java new file mode 100644 index 000000000000..9c9ac048d856 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentResourceArmPaginatedResultTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.implementation.models.AgentDeploymentResourceArmPaginatedResult; +import com.azure.resourcemanager.cognitiveservices.models.AgentDeploymentState; +import com.azure.resourcemanager.cognitiveservices.models.AgentProtocol; +import org.junit.jupiter.api.Assertions; + +public final class AgentDeploymentResourceArmPaginatedResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AgentDeploymentResourceArmPaginatedResult model = BinaryData.fromString( + "{\"nextLink\":\"dnaienhqhskndnel\",\"value\":[{\"properties\":{\"deploymentType\":\"AgentDeploymentProperties\",\"displayName\":\"dlknwfoanniyop\",\"deploymentId\":\"xivcnrlyxnu\",\"state\":\"Updating\",\"protocols\":[{\"protocol\":\"A2A\",\"version\":\"wqpatvbqsdtcj\"},{\"protocol\":\"Responses\",\"version\":\"i\"},{\"protocol\":\"Agent\",\"version\":\"y\"}],\"agents\":[{\"agentVersion\":\"wogtgitsq\",\"agentId\":\"vbrzcdb\",\"agentName\":\"fzndscxmxeatkd\"}],\"provisioningState\":\"Succeeded\",\"description\":\"rdjyibqb\",\"tags\":{\"u\":\"mhjrm\",\"obcancdexxqcw\":\"maxljalfihcj\",\"fgvaknokzwj\":\"a\"}},\"id\":\"r\",\"name\":\"tixldzyyfytpqs\",\"type\":\"x\"}]}") + .toObject(AgentDeploymentResourceArmPaginatedResult.class); + Assertions.assertEquals("dnaienhqhskndnel", model.nextLink()); + Assertions.assertEquals("rdjyibqb", model.value().get(0).properties().description()); + Assertions.assertEquals("mhjrm", model.value().get(0).properties().tags().get("u")); + Assertions.assertEquals("dlknwfoanniyop", model.value().get(0).properties().displayName()); + Assertions.assertEquals("xivcnrlyxnu", model.value().get(0).properties().deploymentId()); + Assertions.assertEquals(AgentDeploymentState.UPDATING, model.value().get(0).properties().state()); + Assertions.assertEquals(AgentProtocol.A2A, model.value().get(0).properties().protocols().get(0).protocol()); + Assertions.assertEquals("wqpatvbqsdtcj", model.value().get(0).properties().protocols().get(0).version()); + Assertions.assertEquals("vbrzcdb", model.value().get(0).properties().agents().get(0).agentId()); + Assertions.assertEquals("fzndscxmxeatkd", model.value().get(0).properties().agents().get(0).agentName()); + Assertions.assertEquals("wogtgitsq", model.value().get(0).properties().agents().get(0).agentVersion()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsCreateOrUpdateMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsCreateOrUpdateMockTests.java new file mode 100644 index 000000000000..449f41655ad5 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsCreateOrUpdateMockTests.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; +import com.azure.resourcemanager.cognitiveservices.models.AgentDeployment; +import com.azure.resourcemanager.cognitiveservices.models.AgentDeploymentProperties; +import com.azure.resourcemanager.cognitiveservices.models.AgentDeploymentState; +import com.azure.resourcemanager.cognitiveservices.models.AgentProtocol; +import com.azure.resourcemanager.cognitiveservices.models.AgentProtocolVersion; +import com.azure.resourcemanager.cognitiveservices.models.VersionedAgentReference; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class AgentDeploymentsCreateOrUpdateMockTests { + @Test + public void testCreateOrUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"deploymentType\":\"AgentDeploymentProperties\",\"displayName\":\"kjunzxezriwgoew\",\"deploymentId\":\"cqksaaapxjh\",\"state\":\"Stopped\",\"protocols\":[{\"protocol\":\"Agent\",\"version\":\"sdfpvdaahlf\"},{\"protocol\":\"Agent\",\"version\":\"lpmvz\"}],\"agents\":[{\"agentVersion\":\"szyaqgomlbmfgge\",\"agentId\":\"fekcjjlwkye\",\"agentName\":\"hhutpuln\"},{\"agentVersion\":\"cq\",\"agentId\":\"m\",\"agentName\":\"hpi\"},{\"agentVersion\":\"wrerj\",\"agentId\":\"ptchdwyq\",\"agentName\":\"dqimlgbbfjm\"}],\"provisioningState\":\"Succeeded\",\"description\":\"xlhmpmhef\",\"tags\":{\"lsn\":\"phqeofy\",\"mcqixuanccqvjf\":\"owm\",\"xpjhcfaaradci\":\"gfqpmq\"}},\"id\":\"mufzgugrbl\",\"name\":\"alaoss\",\"type\":\"qebaotbptgcsm\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CognitiveServicesManager manager = CognitiveServicesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + AgentDeployment response = manager.agentDeployments() + .define("amyqso") + .withExistingApplication("zmxojzsvmai", "bqk", "hyejt", "geecbpergwlckih") + .withProperties(new AgentDeploymentProperties().withDescription("pkmixwewzl") + .withTags(mapOf("xgvohdbthhxmoe", "smepnq", "hgannvwxqhpjhub", "vudeep", "rhhogalgxnw", "hxvzgayb", + "qxfcssanybzzgh", "mzvztauebpa")) + .withDisplayName("npu") + .withDeploymentId("jwdizcrjixiujz") + .withState(AgentDeploymentState.UPDATING) + .withProtocols( + Arrays.asList(new AgentProtocolVersion().withProtocol(AgentProtocol.A2A).withVersion("sw"), + new AgentProtocolVersion().withProtocol(AgentProtocol.RESPONSES).withVersion("kbxktxbbwl"), + new AgentProtocolVersion().withProtocol(AgentProtocol.RESPONSES).withVersion("okn"), + new AgentProtocolVersion().withProtocol(AgentProtocol.A2A).withVersion("d"))) + .withAgents(Arrays.asList(new VersionedAgentReference().withAgentId("lgzubak") + .withAgentName("kvggcmfns") + .withAgentVersion("q")))) + .create(); + + Assertions.assertEquals("xlhmpmhef", response.properties().description()); + Assertions.assertEquals("phqeofy", response.properties().tags().get("lsn")); + Assertions.assertEquals("kjunzxezriwgoew", response.properties().displayName()); + Assertions.assertEquals("cqksaaapxjh", response.properties().deploymentId()); + Assertions.assertEquals(AgentDeploymentState.STOPPED, response.properties().state()); + Assertions.assertEquals(AgentProtocol.AGENT, response.properties().protocols().get(0).protocol()); + Assertions.assertEquals("sdfpvdaahlf", response.properties().protocols().get(0).version()); + Assertions.assertEquals("fekcjjlwkye", response.properties().agents().get(0).agentId()); + Assertions.assertEquals("hhutpuln", response.properties().agents().get(0).agentName()); + Assertions.assertEquals("szyaqgomlbmfgge", response.properties().agents().get(0).agentVersion()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsGetWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsGetWithResponseMockTests.java new file mode 100644 index 000000000000..b29f1794f95c --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsGetWithResponseMockTests.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; +import com.azure.resourcemanager.cognitiveservices.models.AgentDeployment; +import com.azure.resourcemanager.cognitiveservices.models.AgentDeploymentState; +import com.azure.resourcemanager.cognitiveservices.models.AgentProtocol; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class AgentDeploymentsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"deploymentType\":\"AgentDeploymentProperties\",\"displayName\":\"hpwbuklvsmfasgt\",\"deploymentId\":\"hqpoilosja\",\"state\":\"Running\",\"protocols\":[{\"protocol\":\"Agent\",\"version\":\"tmhllp\"},{\"protocol\":\"A2A\",\"version\":\"ghztmsmiwtpcfl\"},{\"protocol\":\"Agent\",\"version\":\"wwvwiftdjtv\"}],\"agents\":[{\"agentVersion\":\"hruptsyq\",\"agentId\":\"nqswxdowumxquk\",\"agentName\":\"diohclqddn\"},{\"agentVersion\":\"k\",\"agentId\":\"bweddpnyzc\",\"agentName\":\"jsmka\"}],\"provisioningState\":\"Failed\",\"description\":\"abnwvpa\",\"tags\":{\"bigcfddofxnfbm\":\"xf\",\"cytjgoea\":\"yyrqaedwov\",\"adhed\":\"okrwfmihw\",\"hjaozvbwfcn\":\"fobdczvothm\"}},\"id\":\"bpoelhscmyhrhjv\",\"name\":\"zfq\",\"type\":\"okndwpppqwojoevz\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CognitiveServicesManager manager = CognitiveServicesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + AgentDeployment response = manager.agentDeployments() + .getWithResponse("zrbvgw", "hlx", "mxvmdrwynbgovazo", "mdvhhplkhwwdkatv", "qmgkcswzeyxryea", + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("abnwvpa", response.properties().description()); + Assertions.assertEquals("xf", response.properties().tags().get("bigcfddofxnfbm")); + Assertions.assertEquals("hpwbuklvsmfasgt", response.properties().displayName()); + Assertions.assertEquals("hqpoilosja", response.properties().deploymentId()); + Assertions.assertEquals(AgentDeploymentState.RUNNING, response.properties().state()); + Assertions.assertEquals(AgentProtocol.AGENT, response.properties().protocols().get(0).protocol()); + Assertions.assertEquals("tmhllp", response.properties().protocols().get(0).version()); + Assertions.assertEquals("nqswxdowumxquk", response.properties().agents().get(0).agentId()); + Assertions.assertEquals("diohclqddn", response.properties().agents().get(0).agentName()); + Assertions.assertEquals("hruptsyq", response.properties().agents().get(0).agentVersion()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsListMockTests.java new file mode 100644 index 000000000000..a93e4e0332de --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsListMockTests.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; +import com.azure.resourcemanager.cognitiveservices.models.AgentDeployment; +import com.azure.resourcemanager.cognitiveservices.models.AgentDeploymentState; +import com.azure.resourcemanager.cognitiveservices.models.AgentProtocol; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class AgentDeploymentsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"deploymentType\":\"AgentDeploymentProperties\",\"displayName\":\"wacycsyotctkhf\",\"deploymentId\":\"satvcs\",\"state\":\"Deleted\",\"protocols\":[{\"protocol\":\"Responses\",\"version\":\"hvprhqqw\"},{\"protocol\":\"Responses\",\"version\":\"eh\"}],\"agents\":[{\"agentVersion\":\"obzgott\",\"agentId\":\"sadzighmmtb\",\"agentName\":\"vucfvvraab\"},{\"agentVersion\":\"rdeewl\",\"agentId\":\"xpcbwkdwjyjizn\",\"agentName\":\"roo\"},{\"agentVersion\":\"ftaspmcr\",\"agentId\":\"huf\",\"agentName\":\"n\"}],\"provisioningState\":\"Updating\",\"description\":\"inuwqxungrob\",\"tags\":{\"zjow\":\"msxjwdylwxm\",\"yeurjwmv\":\"ugeerclbltbhpwac\"}},\"id\":\"yvdifkiikgprucc\",\"name\":\"mecbtxsytrtexeg\",\"type\":\"mrqjywi\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CognitiveServicesManager manager = CognitiveServicesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.agentDeployments() + .list("ufytdxmly", "zlyvapbkrbuog", "tdlt", "cuhaizijv", 997710769, "lz", + Arrays.asList("hlpsftqkrvmhv", "vvcpwtqsuspn", "mzy"), "ffetevrnt", false, + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("inuwqxungrob", response.iterator().next().properties().description()); + Assertions.assertEquals("msxjwdylwxm", response.iterator().next().properties().tags().get("zjow")); + Assertions.assertEquals("wacycsyotctkhf", response.iterator().next().properties().displayName()); + Assertions.assertEquals("satvcs", response.iterator().next().properties().deploymentId()); + Assertions.assertEquals(AgentDeploymentState.DELETED, response.iterator().next().properties().state()); + Assertions.assertEquals(AgentProtocol.RESPONSES, + response.iterator().next().properties().protocols().get(0).protocol()); + Assertions.assertEquals("hvprhqqw", response.iterator().next().properties().protocols().get(0).version()); + Assertions.assertEquals("sadzighmmtb", response.iterator().next().properties().agents().get(0).agentId()); + Assertions.assertEquals("vucfvvraab", response.iterator().next().properties().agents().get(0).agentName()); + Assertions.assertEquals("obzgott", response.iterator().next().properties().agents().get(0).agentVersion()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsStartWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsStartWithResponseMockTests.java new file mode 100644 index 000000000000..bdbab6e857fc --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsStartWithResponseMockTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class AgentDeploymentsStartWithResponseMockTests { + @Test + public void testStartWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CognitiveServicesManager manager = CognitiveServicesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.agentDeployments() + .startWithResponse("hvycfjncindi", "oqkajwjuriarsbc", "lanhzcknjxizba", "dygzkztxfexwac", "yjmlxppdndzkfe", + com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsStopWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsStopWithResponseMockTests.java new file mode 100644 index 000000000000..2d77fb6e00a2 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentDeploymentsStopWithResponseMockTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class AgentDeploymentsStopWithResponseMockTests { + @Test + public void testStopWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CognitiveServicesManager manager = CognitiveServicesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.agentDeployments() + .stopWithResponse("uiiu", "ibfkcjytq", "cizeqqfopvnopm", "tdsfh", "xqlyoazyfbkmvl", + com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentProtocolVersionTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentProtocolVersionTests.java new file mode 100644 index 000000000000..386991f1c00e --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentProtocolVersionTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.models.AgentProtocol; +import com.azure.resourcemanager.cognitiveservices.models.AgentProtocolVersion; +import org.junit.jupiter.api.Assertions; + +public final class AgentProtocolVersionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AgentProtocolVersion model = BinaryData.fromString("{\"protocol\":\"Responses\",\"version\":\"fltgvdiho\"}") + .toObject(AgentProtocolVersion.class); + Assertions.assertEquals(AgentProtocol.RESPONSES, model.protocol()); + Assertions.assertEquals("fltgvdiho", model.version()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AgentProtocolVersion model + = new AgentProtocolVersion().withProtocol(AgentProtocol.RESPONSES).withVersion("fltgvdiho"); + model = BinaryData.fromObject(model).toObject(AgentProtocolVersion.class); + Assertions.assertEquals(AgentProtocol.RESPONSES, model.protocol()); + Assertions.assertEquals("fltgvdiho", model.version()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentReferencePropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentReferencePropertiesTests.java new file mode 100644 index 000000000000..1ea733367946 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentReferencePropertiesTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.models.AgentReferenceProperties; +import org.junit.jupiter.api.Assertions; + +public final class AgentReferencePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AgentReferenceProperties model = BinaryData.fromString("{\"agentId\":\"i\",\"agentName\":\"pwpgddei\"}") + .toObject(AgentReferenceProperties.class); + Assertions.assertEquals("i", model.agentId()); + Assertions.assertEquals("pwpgddei", model.agentName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AgentReferenceProperties model = new AgentReferenceProperties().withAgentId("i").withAgentName("pwpgddei"); + model = BinaryData.fromObject(model).toObject(AgentReferenceProperties.class); + Assertions.assertEquals("i", model.agentId()); + Assertions.assertEquals("pwpgddei", model.agentName()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentReferenceResourceArmPaginatedResultInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentReferenceResourceArmPaginatedResultInnerTests.java new file mode 100644 index 000000000000..f98278a40dfa --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentReferenceResourceArmPaginatedResultInnerTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.fluent.models.AgentReferenceResourceArmPaginatedResultInner; +import org.junit.jupiter.api.Assertions; + +public final class AgentReferenceResourceArmPaginatedResultInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AgentReferenceResourceArmPaginatedResultInner model = BinaryData.fromString( + "{\"nextLink\":\"tiowlx\",\"value\":[{\"properties\":{\"agentId\":\"ptjgwdt\",\"agentName\":\"kranblwphqlkcc\"},\"id\":\"gygqwah\",\"name\":\"iul\",\"type\":\"gniiprglvaw\"}]}") + .toObject(AgentReferenceResourceArmPaginatedResultInner.class); + Assertions.assertEquals("tiowlx", model.nextLink()); + Assertions.assertEquals("ptjgwdt", model.value().get(0).properties().agentId()); + Assertions.assertEquals("kranblwphqlkcc", model.value().get(0).properties().agentName()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentReferenceTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentReferenceTests.java new file mode 100644 index 000000000000..ae56225a116a --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AgentReferenceTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.models.AgentReference; +import org.junit.jupiter.api.Assertions; + +public final class AgentReferenceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AgentReference model = BinaryData.fromString( + "{\"properties\":{\"agentId\":\"z\",\"agentName\":\"fypiv\"},\"id\":\"bbjpmcubkmif\",\"name\":\"xxkubvphavp\",\"type\":\"h\"}") + .toObject(AgentReference.class); + Assertions.assertEquals("z", model.properties().agentId()); + Assertions.assertEquals("fypiv", model.properties().agentName()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ApplicationAuthorizationPolicyTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ApplicationAuthorizationPolicyTests.java new file mode 100644 index 000000000000..4a3420345283 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ApplicationAuthorizationPolicyTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.models.ApplicationAuthorizationPolicy; + +public final class ApplicationAuthorizationPolicyTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ApplicationAuthorizationPolicy model = BinaryData.fromString("{\"type\":\"ApplicationAuthorizationPolicy\"}") + .toObject(ApplicationAuthorizationPolicy.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ApplicationAuthorizationPolicy model = new ApplicationAuthorizationPolicy(); + model = BinaryData.fromObject(model).toObject(ApplicationAuthorizationPolicy.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ApplicationTrafficRoutingPolicyTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ApplicationTrafficRoutingPolicyTests.java new file mode 100644 index 000000000000..43e0802cffd9 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ApplicationTrafficRoutingPolicyTests.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.models.ApplicationTrafficRoutingPolicy; +import com.azure.resourcemanager.cognitiveservices.models.TrafficRoutingProtocol; +import com.azure.resourcemanager.cognitiveservices.models.TrafficRoutingRule; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ApplicationTrafficRoutingPolicyTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ApplicationTrafficRoutingPolicy model = BinaryData.fromString( + "{\"protocol\":\"FixedRatio\",\"rules\":[{\"ruleId\":\"wka\",\"description\":\"ejyfdvlvhbwrnfx\",\"deploymentId\":\"ddpqt\",\"trafficPercentage\":277353032},{\"ruleId\":\"mnaoy\",\"description\":\"kcoeqswank\",\"deploymentId\":\"ytmhdroznnhdrlkt\",\"trafficPercentage\":772860135},{\"ruleId\":\"gguxhemlwyw\",\"description\":\"eczgfb\",\"deploymentId\":\"klelssxb\",\"trafficPercentage\":254990993}]}") + .toObject(ApplicationTrafficRoutingPolicy.class); + Assertions.assertEquals(TrafficRoutingProtocol.FIXED_RATIO, model.protocol()); + Assertions.assertEquals("wka", model.rules().get(0).ruleId()); + Assertions.assertEquals("ejyfdvlvhbwrnfx", model.rules().get(0).description()); + Assertions.assertEquals("ddpqt", model.rules().get(0).deploymentId()); + Assertions.assertEquals(277353032, model.rules().get(0).trafficPercentage()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ApplicationTrafficRoutingPolicy model + = new ApplicationTrafficRoutingPolicy().withProtocol(TrafficRoutingProtocol.FIXED_RATIO) + .withRules(Arrays.asList( + new TrafficRoutingRule().withRuleId("wka") + .withDescription("ejyfdvlvhbwrnfx") + .withDeploymentId("ddpqt") + .withTrafficPercentage(277353032), + new TrafficRoutingRule().withRuleId("mnaoy") + .withDescription("kcoeqswank") + .withDeploymentId("ytmhdroznnhdrlkt") + .withTrafficPercentage(772860135), + new TrafficRoutingRule().withRuleId("gguxhemlwyw") + .withDescription("eczgfb") + .withDeploymentId("klelssxb") + .withTrafficPercentage(254990993))); + model = BinaryData.fromObject(model).toObject(ApplicationTrafficRoutingPolicy.class); + Assertions.assertEquals(TrafficRoutingProtocol.FIXED_RATIO, model.protocol()); + Assertions.assertEquals("wka", model.rules().get(0).ruleId()); + Assertions.assertEquals("ejyfdvlvhbwrnfx", model.rules().get(0).description()); + Assertions.assertEquals("ddpqt", model.rules().get(0).deploymentId()); + Assertions.assertEquals(277353032, model.rules().get(0).trafficPercentage()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AssignedIdentityTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AssignedIdentityTests.java new file mode 100644 index 000000000000..d532a1ad1191 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AssignedIdentityTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.models.AssignedIdentity; +import com.azure.resourcemanager.cognitiveservices.models.IdentityKind; +import com.azure.resourcemanager.cognitiveservices.models.IdentityManagementType; +import org.junit.jupiter.api.Assertions; + +public final class AssignedIdentityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AssignedIdentity model = BinaryData.fromString( + "{\"kind\":\"AgentBlueprint\",\"type\":\"System\",\"clientId\":\"zovgkkumuikj\",\"principalId\":\"jcazt\",\"tenantId\":\"wsnsqowx\",\"subject\":\"omlik\",\"provisioningState\":\"Deleting\"}") + .toObject(AssignedIdentity.class); + Assertions.assertEquals(IdentityKind.AGENT_BLUEPRINT, model.kind()); + Assertions.assertEquals(IdentityManagementType.SYSTEM, model.type()); + Assertions.assertEquals("zovgkkumuikj", model.clientId()); + Assertions.assertEquals("jcazt", model.principalId()); + Assertions.assertEquals("wsnsqowx", model.tenantId()); + Assertions.assertEquals("omlik", model.subject()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AssignedIdentity model = new AssignedIdentity().withKind(IdentityKind.AGENT_BLUEPRINT) + .withType(IdentityManagementType.SYSTEM) + .withClientId("zovgkkumuikj") + .withPrincipalId("jcazt") + .withTenantId("wsnsqowx") + .withSubject("omlik"); + model = BinaryData.fromObject(model).toObject(AssignedIdentity.class); + Assertions.assertEquals(IdentityKind.AGENT_BLUEPRINT, model.kind()); + Assertions.assertEquals(IdentityManagementType.SYSTEM, model.type()); + Assertions.assertEquals("zovgkkumuikj", model.clientId()); + Assertions.assertEquals("jcazt", model.principalId()); + Assertions.assertEquals("wsnsqowx", model.tenantId()); + Assertions.assertEquals("omlik", model.subject()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AzureEntityResourceTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AzureEntityResourceTests.java deleted file mode 100644 index 4fb23cf14add..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/AzureEntityResourceTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.AzureEntityResource; - -public final class AzureEntityResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureEntityResource model = BinaryData - .fromString("{\"etag\":\"kvwrwjfeu\",\"id\":\"hutje\",\"name\":\"tmrldhugjzzdatq\",\"type\":\"hocdgeab\"}") - .toObject(AzureEntityResource.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureEntityResource model = new AzureEntityResource(); - model = BinaryData.fromObject(model).toObject(AzureEntityResource.class); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/BillingMeterInfoTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/BillingMeterInfoTests.java index 9be6f8262825..6cc8ab533cad 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/BillingMeterInfoTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/BillingMeterInfoTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,20 +12,10 @@ public final class BillingMeterInfoTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { BillingMeterInfo model - = BinaryData.fromString("{\"name\":\"skpbhenbtkcxywn\",\"meterId\":\"nrs\",\"unit\":\"lqidyby\"}") + = BinaryData.fromString("{\"name\":\"jljyoxgv\",\"meterId\":\"tbgsncghkj\",\"unit\":\"zz\"}") .toObject(BillingMeterInfo.class); - Assertions.assertEquals("skpbhenbtkcxywn", model.name()); - Assertions.assertEquals("nrs", model.meterId()); - Assertions.assertEquals("lqidyby", model.unit()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingMeterInfo model - = new BillingMeterInfo().withName("skpbhenbtkcxywn").withMeterId("nrs").withUnit("lqidyby"); - model = BinaryData.fromObject(model).toObject(BillingMeterInfo.class); - Assertions.assertEquals("skpbhenbtkcxywn", model.name()); - Assertions.assertEquals("nrs", model.meterId()); - Assertions.assertEquals("lqidyby", model.unit()); + Assertions.assertEquals("jljyoxgv", model.name()); + Assertions.assertEquals("tbgsncghkj", model.meterId()); + Assertions.assertEquals("zz", model.unit()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CalculateModelCapacityResultEstimatedCapacityTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CalculateModelCapacityResultEstimatedCapacityTests.java index 8aa9b9a3c481..69eca335f1f4 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CalculateModelCapacityResultEstimatedCapacityTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CalculateModelCapacityResultEstimatedCapacityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,18 +12,9 @@ public final class CalculateModelCapacityResultEstimatedCapacityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CalculateModelCapacityResultEstimatedCapacity model - = BinaryData.fromString("{\"value\":96926313,\"deployableValue\":1505256116}") + = BinaryData.fromString("{\"value\":1743197151,\"deployableValue\":375105800}") .toObject(CalculateModelCapacityResultEstimatedCapacity.class); - Assertions.assertEquals(96926313, model.value()); - Assertions.assertEquals(1505256116, model.deployableValue()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CalculateModelCapacityResultEstimatedCapacity model - = new CalculateModelCapacityResultEstimatedCapacity().withValue(96926313).withDeployableValue(1505256116); - model = BinaryData.fromObject(model).toObject(CalculateModelCapacityResultEstimatedCapacity.class); - Assertions.assertEquals(96926313, model.value()); - Assertions.assertEquals(1505256116, model.deployableValue()); + Assertions.assertEquals(1743197151, model.value()); + Assertions.assertEquals(375105800, model.deployableValue()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CapabilityHostInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CapabilityHostInnerTests.java index eb44ccf76654..b34f091e5a3e 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CapabilityHostInnerTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CapabilityHostInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -17,39 +17,41 @@ public final class CapabilityHostInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CapabilityHostInner model = BinaryData.fromString( - "{\"properties\":{\"aiServicesConnections\":[\"abaobnslujdjltym\",\"mvguihywart\",\"pphkixkykxds\"],\"capabilityHostKind\":\"Agents\",\"customerSubnet\":\"mmuc\",\"provisioningState\":\"Deleting\",\"storageConnections\":[\"kflrmymy\",\"nc\",\"lhrisw\",\"lmiiiovg\"],\"threadStorageConnections\":[\"xuugqkc\",\"otiowlxteqd\",\"tjgwdtguk\",\"anblwphqlkccu\"],\"vectorStoreConnections\":[\"gqwa\",\"oiulwgniipr\",\"lvawuwzdufypivls\"],\"description\":\"jpmcub\",\"tags\":{\"ubvphavpmhbrbqgv\":\"foxx\",\"zqedikdfrdbi\":\"ovpbbttefjoknssq\",\"zcxmjpbyep\":\"mrjgeihfqlggwfi\",\"rc\":\"mgtvlj\"}},\"id\":\"fqip\",\"name\":\"xhnpo\",\"type\":\"yqwcabvnuil\"}") + "{\"properties\":{\"aiServicesConnections\":[\"grebwggahttzlsw\",\"ajqfutlx\"],\"capabilityHostKind\":\"Agents\",\"customerSubnet\":\"asunwqrjzfrgq\",\"provisioningState\":\"Updating\",\"storageConnections\":[\"mbuocnjrohmbp\",\"ryxameblydyvkfkm\",\"ocxnehvsmtodl\",\"pyapucygvoav\"],\"threadStorageConnections\":[\"ssxlghieegjlg\",\"vpaseksgbu\"],\"vectorStoreConnections\":[\"tu\",\"gdhg\",\"qipir\",\"iwrqofulopmjnl\"],\"enablePublicHostingEnvironment\":false,\"description\":\"cbjpibkephuu\",\"tags\":{\"duczkgof\":\"ctatoyintqpbrlcy\",\"srucvcrrpcjtt\":\"y\"}},\"id\":\"t\",\"name\":\"jeaq\",\"type\":\"rmvvfkoxmlghktui\"}") .toObject(CapabilityHostInner.class); - Assertions.assertEquals("jpmcub", model.properties().description()); - Assertions.assertEquals("foxx", model.properties().tags().get("ubvphavpmhbrbqgv")); - Assertions.assertEquals("abaobnslujdjltym", model.properties().aiServicesConnections().get(0)); + Assertions.assertEquals("cbjpibkephuu", model.properties().description()); + Assertions.assertEquals("ctatoyintqpbrlcy", model.properties().tags().get("duczkgof")); + Assertions.assertEquals("grebwggahttzlsw", model.properties().aiServicesConnections().get(0)); Assertions.assertEquals(CapabilityHostKind.AGENTS, model.properties().capabilityHostKind()); - Assertions.assertEquals("mmuc", model.properties().customerSubnet()); - Assertions.assertEquals("kflrmymy", model.properties().storageConnections().get(0)); - Assertions.assertEquals("xuugqkc", model.properties().threadStorageConnections().get(0)); - Assertions.assertEquals("gqwa", model.properties().vectorStoreConnections().get(0)); + Assertions.assertEquals("asunwqrjzfrgq", model.properties().customerSubnet()); + Assertions.assertEquals("mbuocnjrohmbp", model.properties().storageConnections().get(0)); + Assertions.assertEquals("ssxlghieegjlg", model.properties().threadStorageConnections().get(0)); + Assertions.assertEquals("tu", model.properties().vectorStoreConnections().get(0)); + Assertions.assertFalse(model.properties().enablePublicHostingEnvironment()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CapabilityHostInner model - = new CapabilityHostInner().withProperties(new CapabilityHostProperties().withDescription("jpmcub") - .withTags(mapOf("ubvphavpmhbrbqgv", "foxx", "zqedikdfrdbi", "ovpbbttefjoknssq", "zcxmjpbyep", - "mrjgeihfqlggwfi", "rc", "mgtvlj")) - .withAiServicesConnections(Arrays.asList("abaobnslujdjltym", "mvguihywart", "pphkixkykxds")) - .withCapabilityHostKind(CapabilityHostKind.AGENTS) - .withCustomerSubnet("mmuc") - .withStorageConnections(Arrays.asList("kflrmymy", "nc", "lhrisw", "lmiiiovg")) - .withThreadStorageConnections(Arrays.asList("xuugqkc", "otiowlxteqd", "tjgwdtguk", "anblwphqlkccu")) - .withVectorStoreConnections(Arrays.asList("gqwa", "oiulwgniipr", "lvawuwzdufypivls"))); + CapabilityHostInner model = new CapabilityHostInner().withProperties(new CapabilityHostProperties() + .withDescription("cbjpibkephuu") + .withTags(mapOf("duczkgof", "ctatoyintqpbrlcy", "srucvcrrpcjtt", "y")) + .withAiServicesConnections(Arrays.asList("grebwggahttzlsw", "ajqfutlx")) + .withCapabilityHostKind(CapabilityHostKind.AGENTS) + .withCustomerSubnet("asunwqrjzfrgq") + .withStorageConnections(Arrays.asList("mbuocnjrohmbp", "ryxameblydyvkfkm", "ocxnehvsmtodl", "pyapucygvoav")) + .withThreadStorageConnections(Arrays.asList("ssxlghieegjlg", "vpaseksgbu")) + .withVectorStoreConnections(Arrays.asList("tu", "gdhg", "qipir", "iwrqofulopmjnl")) + .withEnablePublicHostingEnvironment(false)); model = BinaryData.fromObject(model).toObject(CapabilityHostInner.class); - Assertions.assertEquals("jpmcub", model.properties().description()); - Assertions.assertEquals("foxx", model.properties().tags().get("ubvphavpmhbrbqgv")); - Assertions.assertEquals("abaobnslujdjltym", model.properties().aiServicesConnections().get(0)); + Assertions.assertEquals("cbjpibkephuu", model.properties().description()); + Assertions.assertEquals("ctatoyintqpbrlcy", model.properties().tags().get("duczkgof")); + Assertions.assertEquals("grebwggahttzlsw", model.properties().aiServicesConnections().get(0)); Assertions.assertEquals(CapabilityHostKind.AGENTS, model.properties().capabilityHostKind()); - Assertions.assertEquals("mmuc", model.properties().customerSubnet()); - Assertions.assertEquals("kflrmymy", model.properties().storageConnections().get(0)); - Assertions.assertEquals("xuugqkc", model.properties().threadStorageConnections().get(0)); - Assertions.assertEquals("gqwa", model.properties().vectorStoreConnections().get(0)); + Assertions.assertEquals("asunwqrjzfrgq", model.properties().customerSubnet()); + Assertions.assertEquals("mbuocnjrohmbp", model.properties().storageConnections().get(0)); + Assertions.assertEquals("ssxlghieegjlg", model.properties().threadStorageConnections().get(0)); + Assertions.assertEquals("tu", model.properties().vectorStoreConnections().get(0)); + Assertions.assertFalse(model.properties().enablePublicHostingEnvironment()); } // Use "Map.of" if available diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CapabilityHostPropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CapabilityHostPropertiesTests.java index 26baba2d28c7..4eef5672f294 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CapabilityHostPropertiesTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CapabilityHostPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -16,38 +16,40 @@ public final class CapabilityHostPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CapabilityHostProperties model = BinaryData.fromString( - "{\"aiServicesConnections\":[\"aswlp\",\"ugmrmf\",\"lrxw\"],\"capabilityHostKind\":\"Agents\",\"customerSubnet\":\"khfkvcisi\",\"provisioningState\":\"Succeeded\",\"storageConnections\":[\"dsxjwuivedw\"],\"threadStorageConnections\":[\"eewxeiqbpsmg\"],\"vectorStoreConnections\":[\"u\",\"mljdlrgmsplzga\"],\"description\":\"cshhv\",\"tags\":{\"rjkixtw\":\"gnxkympqan\",\"lhkgmnsghp\":\"taoypnyghshxc\",\"ac\":\"ycphdrwjjkhvyo\",\"vxnqmhrpqpd\":\"u\"}}") + "{\"aiServicesConnections\":[\"ma\"],\"capabilityHostKind\":\"Agents\",\"customerSubnet\":\"wwexymzvlazipbh\",\"provisioningState\":\"Succeeded\",\"storageConnections\":[\"gnyyuuzivens\",\"pmeyyvpkpatlbijp\",\"gsksrfhf\",\"olmk\"],\"threadStorageConnections\":[\"xwcdomm\",\"vfqawzfgbrttuiac\",\"kiexhajlfnthiq\"],\"vectorStoreConnections\":[\"t\",\"diygbpvnwswmtxky\",\"twwgzwx\"],\"enablePublicHostingEnvironment\":true,\"description\":\"cvogygzyvne\",\"tags\":{\"moqqtlffhzbk\":\"ifgh\",\"avfqnvhnqoewdogi\":\"kjj\",\"b\":\"etesypvidbztjhqt\"}}") .toObject(CapabilityHostProperties.class); - Assertions.assertEquals("cshhv", model.description()); - Assertions.assertEquals("gnxkympqan", model.tags().get("rjkixtw")); - Assertions.assertEquals("aswlp", model.aiServicesConnections().get(0)); + Assertions.assertEquals("cvogygzyvne", model.description()); + Assertions.assertEquals("ifgh", model.tags().get("moqqtlffhzbk")); + Assertions.assertEquals("ma", model.aiServicesConnections().get(0)); Assertions.assertEquals(CapabilityHostKind.AGENTS, model.capabilityHostKind()); - Assertions.assertEquals("khfkvcisi", model.customerSubnet()); - Assertions.assertEquals("dsxjwuivedw", model.storageConnections().get(0)); - Assertions.assertEquals("eewxeiqbpsmg", model.threadStorageConnections().get(0)); - Assertions.assertEquals("u", model.vectorStoreConnections().get(0)); + Assertions.assertEquals("wwexymzvlazipbh", model.customerSubnet()); + Assertions.assertEquals("gnyyuuzivens", model.storageConnections().get(0)); + Assertions.assertEquals("xwcdomm", model.threadStorageConnections().get(0)); + Assertions.assertEquals("t", model.vectorStoreConnections().get(0)); + Assertions.assertTrue(model.enablePublicHostingEnvironment()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CapabilityHostProperties model = new CapabilityHostProperties().withDescription("cshhv") - .withTags(mapOf("rjkixtw", "gnxkympqan", "lhkgmnsghp", "taoypnyghshxc", "ac", "ycphdrwjjkhvyo", - "vxnqmhrpqpd", "u")) - .withAiServicesConnections(Arrays.asList("aswlp", "ugmrmf", "lrxw")) + CapabilityHostProperties model = new CapabilityHostProperties().withDescription("cvogygzyvne") + .withTags(mapOf("moqqtlffhzbk", "ifgh", "avfqnvhnqoewdogi", "kjj", "b", "etesypvidbztjhqt")) + .withAiServicesConnections(Arrays.asList("ma")) .withCapabilityHostKind(CapabilityHostKind.AGENTS) - .withCustomerSubnet("khfkvcisi") - .withStorageConnections(Arrays.asList("dsxjwuivedw")) - .withThreadStorageConnections(Arrays.asList("eewxeiqbpsmg")) - .withVectorStoreConnections(Arrays.asList("u", "mljdlrgmsplzga")); + .withCustomerSubnet("wwexymzvlazipbh") + .withStorageConnections(Arrays.asList("gnyyuuzivens", "pmeyyvpkpatlbijp", "gsksrfhf", "olmk")) + .withThreadStorageConnections(Arrays.asList("xwcdomm", "vfqawzfgbrttuiac", "kiexhajlfnthiq")) + .withVectorStoreConnections(Arrays.asList("t", "diygbpvnwswmtxky", "twwgzwx")) + .withEnablePublicHostingEnvironment(true); model = BinaryData.fromObject(model).toObject(CapabilityHostProperties.class); - Assertions.assertEquals("cshhv", model.description()); - Assertions.assertEquals("gnxkympqan", model.tags().get("rjkixtw")); - Assertions.assertEquals("aswlp", model.aiServicesConnections().get(0)); + Assertions.assertEquals("cvogygzyvne", model.description()); + Assertions.assertEquals("ifgh", model.tags().get("moqqtlffhzbk")); + Assertions.assertEquals("ma", model.aiServicesConnections().get(0)); Assertions.assertEquals(CapabilityHostKind.AGENTS, model.capabilityHostKind()); - Assertions.assertEquals("khfkvcisi", model.customerSubnet()); - Assertions.assertEquals("dsxjwuivedw", model.storageConnections().get(0)); - Assertions.assertEquals("eewxeiqbpsmg", model.threadStorageConnections().get(0)); - Assertions.assertEquals("u", model.vectorStoreConnections().get(0)); + Assertions.assertEquals("wwexymzvlazipbh", model.customerSubnet()); + Assertions.assertEquals("gnyyuuzivens", model.storageConnections().get(0)); + Assertions.assertEquals("xwcdomm", model.threadStorageConnections().get(0)); + Assertions.assertEquals("t", model.vectorStoreConnections().get(0)); + Assertions.assertTrue(model.enablePublicHostingEnvironment()); } // Use "Map.of" if available diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CapabilityHostResourceArmPaginatedResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CapabilityHostResourceArmPaginatedResultTests.java new file mode 100644 index 000000000000..1b8202f1587a --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CapabilityHostResourceArmPaginatedResultTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.implementation.models.CapabilityHostResourceArmPaginatedResult; +import com.azure.resourcemanager.cognitiveservices.models.CapabilityHostKind; +import org.junit.jupiter.api.Assertions; + +public final class CapabilityHostResourceArmPaginatedResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CapabilityHostResourceArmPaginatedResult model = BinaryData.fromString( + "{\"nextLink\":\"nynkbwet\",\"value\":[{\"properties\":{\"aiServicesConnections\":[\"sprkzyaupiac\"],\"capabilityHostKind\":\"Agents\",\"customerSubnet\":\"fbwqrooht\",\"provisioningState\":\"Succeeded\",\"storageConnections\":[\"onurjtumghihpv\",\"cmslclblyjxltbs\",\"uscv\"],\"threadStorageConnections\":[\"igctmgxuupbezq\"],\"vectorStoreConnections\":[\"drtc\",\"ukdqkkyihztg\"],\"enablePublicHostingEnvironment\":true,\"description\":\"qzgwldoychil\",\"tags\":{\"icq\":\"cfehuwaoagu\",\"csjvhrwef\":\"lizst\"}},\"id\":\"wqejpmvsse\",\"name\":\"aepwamcxtcz\",\"type\":\"upeuknijduyye\"},{\"properties\":{\"aiServicesConnections\":[\"djfbocyv\",\"hulrtywikdmhla\"],\"capabilityHostKind\":\"Agents\",\"customerSubnet\":\"gbhgau\",\"provisioningState\":\"Canceled\",\"storageConnections\":[\"mxu\",\"rs\",\"yjq\",\"dkfnozoeoqbvj\"],\"threadStorageConnections\":[\"f\",\"wbmqjchntas\",\"ay\"],\"vectorStoreConnections\":[\"ulpzealb\"],\"enablePublicHostingEnvironment\":true,\"description\":\"ojwyvf\",\"tags\":{\"hxsgxj\":\"tsu\",\"wsdrnpxqwodif\":\"mmzrrscub\"}},\"id\":\"xcjr\",\"name\":\"muabwibvjogjonmc\",\"type\":\"e\"},{\"properties\":{\"aiServicesConnections\":[\"zbamwine\"],\"capabilityHostKind\":\"Agents\",\"customerSubnet\":\"kak\",\"provisioningState\":\"Canceled\",\"storageConnections\":[\"vevboclzh\"],\"threadStorageConnections\":[\"n\",\"uxgvttxpnr\",\"pzaamrdixtreki\"],\"vectorStoreConnections\":[\"yskbruff\",\"l\",\"ukkutvl\"],\"enablePublicHostingEnvironment\":false,\"description\":\"qhvmblcouqe\",\"tags\":{\"blto\":\"bcdsziryrandoyp\",\"g\":\"rmkfqlwxldykals\",\"sjjx\":\"olnjpnnbmjksibj\"}},\"id\":\"hmrnadzyqegxy\",\"name\":\"vpinbmhwbj\",\"type\":\"jkgqxnhmbkez\"},{\"properties\":{\"aiServicesConnections\":[\"ujvaannggi\",\"cwkdtaaw\"],\"capabilityHostKind\":\"Agents\",\"customerSubnet\":\"ka\",\"provisioningState\":\"Succeeded\",\"storageConnections\":[\"mbzmqk\",\"atbnxwbj\"],\"threadStorageConnections\":[\"birkfpksokdg\",\"gewi\",\"ym\",\"hbguzo\"],\"vectorStoreConnections\":[\"ewnf\",\"zhhh\",\"o\",\"mffjkutycyarn\"],\"enablePublicHostingEnvironment\":false,\"description\":\"g\",\"tags\":{\"eocnhzqrottj\":\"zoghktdpyczhc\"}},\"id\":\"fyjzptwr\",\"name\":\"ohapqinfsz\",\"type\":\"yglqdhmrjzral\"}]}") + .toObject(CapabilityHostResourceArmPaginatedResult.class); + Assertions.assertEquals("nynkbwet", model.nextLink()); + Assertions.assertEquals("qzgwldoychil", model.value().get(0).properties().description()); + Assertions.assertEquals("cfehuwaoagu", model.value().get(0).properties().tags().get("icq")); + Assertions.assertEquals("sprkzyaupiac", model.value().get(0).properties().aiServicesConnections().get(0)); + Assertions.assertEquals(CapabilityHostKind.AGENTS, model.value().get(0).properties().capabilityHostKind()); + Assertions.assertEquals("fbwqrooht", model.value().get(0).properties().customerSubnet()); + Assertions.assertEquals("onurjtumghihpv", model.value().get(0).properties().storageConnections().get(0)); + Assertions.assertEquals("igctmgxuupbezq", model.value().get(0).properties().threadStorageConnections().get(0)); + Assertions.assertEquals("drtc", model.value().get(0).properties().vectorStoreConnections().get(0)); + Assertions.assertTrue(model.value().get(0).properties().enablePublicHostingEnvironment()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CapacityConfigTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CapacityConfigTests.java index d06ee5a79d2f..90312f8e4e52 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CapacityConfigTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CapacityConfigTests.java @@ -1,39 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.cognitiveservices.models.CapacityConfig; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class CapacityConfigTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CapacityConfig model = BinaryData.fromString( - "{\"minimum\":18555434,\"maximum\":480744947,\"step\":1333512274,\"default\":826548714,\"allowedValues\":[1771770705,307935551,1373205517,1850668583]}") + "{\"minimum\":1238878906,\"maximum\":1975532924,\"step\":1054022835,\"default\":2065726481,\"allowedValues\":[552165564]}") .toObject(CapacityConfig.class); - Assertions.assertEquals(18555434, model.minimum()); - Assertions.assertEquals(480744947, model.maximum()); - Assertions.assertEquals(1333512274, model.step()); - Assertions.assertEquals(826548714, model.defaultProperty()); - Assertions.assertEquals(1771770705, model.allowedValues().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CapacityConfig model = new CapacityConfig().withMinimum(18555434) - .withMaximum(480744947) - .withStep(1333512274) - .withDefaultProperty(826548714) - .withAllowedValues(Arrays.asList(1771770705, 307935551, 1373205517, 1850668583)); - model = BinaryData.fromObject(model).toObject(CapacityConfig.class); - Assertions.assertEquals(18555434, model.minimum()); - Assertions.assertEquals(480744947, model.maximum()); - Assertions.assertEquals(1333512274, model.step()); - Assertions.assertEquals(826548714, model.defaultProperty()); - Assertions.assertEquals(1771770705, model.allowedValues().get(0)); + Assertions.assertEquals(1238878906, model.minimum()); + Assertions.assertEquals(1975532924, model.maximum()); + Assertions.assertEquals(1054022835, model.step()); + Assertions.assertEquals(2065726481, model.defaultProperty()); + Assertions.assertEquals(552165564, model.allowedValues().get(0)); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ChannelsBuiltInAuthorizationPolicyTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ChannelsBuiltInAuthorizationPolicyTests.java new file mode 100644 index 000000000000..dc28b1920025 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ChannelsBuiltInAuthorizationPolicyTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.models.ChannelsBuiltInAuthorizationPolicy; + +public final class ChannelsBuiltInAuthorizationPolicyTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ChannelsBuiltInAuthorizationPolicy model + = BinaryData.fromString("{\"type\":\"Channels\"}").toObject(ChannelsBuiltInAuthorizationPolicy.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ChannelsBuiltInAuthorizationPolicy model = new ChannelsBuiltInAuthorizationPolicy(); + model = BinaryData.fromObject(model).toObject(ChannelsBuiltInAuthorizationPolicy.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CheckDomainAvailabilityParameterTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CheckDomainAvailabilityParameterTests.java index 3741851bfbf3..1cc0bc2dc584 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CheckDomainAvailabilityParameterTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CheckDomainAvailabilityParameterTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,22 +12,22 @@ public final class CheckDomainAvailabilityParameterTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CheckDomainAvailabilityParameter model = BinaryData - .fromString("{\"subdomainName\":\"nynfsynljphuo\",\"type\":\"xodlqiyntorzih\",\"kind\":\"osjswsr\"}") + .fromString("{\"subdomainName\":\"xrifkwmrvkts\",\"type\":\"zntocipaouajps\",\"kind\":\"cmpoyfdkfogkny\"}") .toObject(CheckDomainAvailabilityParameter.class); - Assertions.assertEquals("nynfsynljphuo", model.subdomainName()); - Assertions.assertEquals("xodlqiyntorzih", model.type()); - Assertions.assertEquals("osjswsr", model.kind()); + Assertions.assertEquals("xrifkwmrvkts", model.subdomainName()); + Assertions.assertEquals("zntocipaouajps", model.type()); + Assertions.assertEquals("cmpoyfdkfogkny", model.kind()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { CheckDomainAvailabilityParameter model - = new CheckDomainAvailabilityParameter().withSubdomainName("nynfsynljphuo") - .withType("xodlqiyntorzih") - .withKind("osjswsr"); + = new CheckDomainAvailabilityParameter().withSubdomainName("xrifkwmrvkts") + .withType("zntocipaouajps") + .withKind("cmpoyfdkfogkny"); model = BinaryData.fromObject(model).toObject(CheckDomainAvailabilityParameter.class); - Assertions.assertEquals("nynfsynljphuo", model.subdomainName()); - Assertions.assertEquals("xodlqiyntorzih", model.type()); - Assertions.assertEquals("osjswsr", model.kind()); + Assertions.assertEquals("xrifkwmrvkts", model.subdomainName()); + Assertions.assertEquals("zntocipaouajps", model.type()); + Assertions.assertEquals("cmpoyfdkfogkny", model.kind()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CheckSkuAvailabilityParameterTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CheckSkuAvailabilityParameterTests.java index 9f2fcb1a69f1..fde6db5856db 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CheckSkuAvailabilityParameterTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CheckSkuAvailabilityParameterTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,23 +12,23 @@ public final class CheckSkuAvailabilityParameterTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - CheckSkuAvailabilityParameter model - = BinaryData.fromString("{\"skus\":[\"cwsvlxotog\",\"wrupqsxvnmicykvc\"],\"kind\":\"o\",\"type\":\"eil\"}") - .toObject(CheckSkuAvailabilityParameter.class); - Assertions.assertEquals("cwsvlxotog", model.skus().get(0)); - Assertions.assertEquals("o", model.kind()); - Assertions.assertEquals("eil", model.type()); + CheckSkuAvailabilityParameter model = BinaryData.fromString( + "{\"skus\":[\"mhquvgjxp\",\"bczmeh\",\"tzopbsphrupidgsy\"],\"kind\":\"bejhphoycmsxa\",\"type\":\"bhdxbm\"}") + .toObject(CheckSkuAvailabilityParameter.class); + Assertions.assertEquals("mhquvgjxp", model.skus().get(0)); + Assertions.assertEquals("bejhphoycmsxa", model.kind()); + Assertions.assertEquals("bhdxbm", model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { CheckSkuAvailabilityParameter model - = new CheckSkuAvailabilityParameter().withSkus(Arrays.asList("cwsvlxotog", "wrupqsxvnmicykvc")) - .withKind("o") - .withType("eil"); + = new CheckSkuAvailabilityParameter().withSkus(Arrays.asList("mhquvgjxp", "bczmeh", "tzopbsphrupidgsy")) + .withKind("bejhphoycmsxa") + .withType("bhdxbm"); model = BinaryData.fromObject(model).toObject(CheckSkuAvailabilityParameter.class); - Assertions.assertEquals("cwsvlxotog", model.skus().get(0)); - Assertions.assertEquals("o", model.kind()); - Assertions.assertEquals("eil", model.type()); + Assertions.assertEquals("mhquvgjxp", model.skus().get(0)); + Assertions.assertEquals("bejhphoycmsxa", model.kind()); + Assertions.assertEquals("bhdxbm", model.type()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentCostTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentCostTests.java index 4938d8fd1d69..9ffe4bc97f67 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentCostTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentCostTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,17 +12,9 @@ public final class CommitmentCostTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CommitmentCost model - = BinaryData.fromString("{\"commitmentMeterId\":\"alupjm\",\"overageMeterId\":\"fxobbcsws\"}") + = BinaryData.fromString("{\"commitmentMeterId\":\"gryfqiuasig\",\"overageMeterId\":\"wsocnequygdjbo\"}") .toObject(CommitmentCost.class); - Assertions.assertEquals("alupjm", model.commitmentMeterId()); - Assertions.assertEquals("fxobbcsws", model.overageMeterId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommitmentCost model = new CommitmentCost().withCommitmentMeterId("alupjm").withOverageMeterId("fxobbcsws"); - model = BinaryData.fromObject(model).toObject(CommitmentCost.class); - Assertions.assertEquals("alupjm", model.commitmentMeterId()); - Assertions.assertEquals("fxobbcsws", model.overageMeterId()); + Assertions.assertEquals("gryfqiuasig", model.commitmentMeterId()); + Assertions.assertEquals("wsocnequygdjbo", model.overageMeterId()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPeriodTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPeriodTests.java index 340cf59d67dd..28ddccd563f1 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPeriodTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPeriodTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,17 +12,17 @@ public final class CommitmentPeriodTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CommitmentPeriod model = BinaryData.fromString( - "{\"tier\":\"vxurisjnhnytxifq\",\"count\":351855115,\"quota\":{\"quantity\":6352328391564368443,\"unit\":\"blwpcesutrgj\"},\"startDate\":\"auutpwoqhihe\",\"endDate\":\"g\"}") + "{\"tier\":\"vtcqaqtdo\",\"count\":1086916273,\"quota\":{\"quantity\":4624012103607353815,\"unit\":\"xyslqbh\"},\"startDate\":\"xoblytkbl\",\"endDate\":\"ewwwfbkrvrnsv\"}") .toObject(CommitmentPeriod.class); - Assertions.assertEquals("vxurisjnhnytxifq", model.tier()); - Assertions.assertEquals(351855115, model.count()); + Assertions.assertEquals("vtcqaqtdo", model.tier()); + Assertions.assertEquals(1086916273, model.count()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CommitmentPeriod model = new CommitmentPeriod().withTier("vxurisjnhnytxifq").withCount(351855115); + CommitmentPeriod model = new CommitmentPeriod().withTier("vtcqaqtdo").withCount(1086916273); model = BinaryData.fromObject(model).toObject(CommitmentPeriod.class); - Assertions.assertEquals("vxurisjnhnytxifq", model.tier()); - Assertions.assertEquals(351855115, model.count()); + Assertions.assertEquals("vtcqaqtdo", model.tier()); + Assertions.assertEquals(1086916273, model.count()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAccountAssociationInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAccountAssociationInnerTests.java index 8c20dce7c6b2..c88c804daaca 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAccountAssociationInnerTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAccountAssociationInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -14,20 +14,21 @@ public final class CommitmentPlanAccountAssociationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CommitmentPlanAccountAssociationInner model = BinaryData.fromString( - "{\"etag\":\"fwqzdz\",\"tags\":{\"hnfhqlyvijouwi\":\"la\",\"ikvcpwp\":\"kxoyzunbixxr\"},\"properties\":{\"accountId\":\"rc\"},\"id\":\"tso\",\"name\":\"frkenxpmyyefrp\",\"type\":\"pdnqqskawaoqvmmb\"}") + "{\"properties\":{\"accountId\":\"xmubyyntwlrbq\"},\"etag\":\"oievseotgqrlltm\",\"tags\":{\"efuzmuvpbttd\":\"auwzizxbmpgc\",\"pglkf\":\"morppxebmnzbtbh\",\"phsdyhto\":\"ohdneuel\",\"v\":\"fikdowwqu\"},\"id\":\"xclvit\",\"name\":\"hqzonosggbhcoh\",\"type\":\"wdsjnkalju\"}") .toObject(CommitmentPlanAccountAssociationInner.class); - Assertions.assertEquals("la", model.tags().get("hnfhqlyvijouwi")); - Assertions.assertEquals("rc", model.accountId()); + Assertions.assertEquals("auwzizxbmpgc", model.tags().get("efuzmuvpbttd")); + Assertions.assertEquals("xmubyyntwlrbq", model.accountId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { CommitmentPlanAccountAssociationInner model = new CommitmentPlanAccountAssociationInner() - .withTags(mapOf("hnfhqlyvijouwi", "la", "ikvcpwp", "kxoyzunbixxr")) - .withAccountId("rc"); + .withTags(mapOf("efuzmuvpbttd", "auwzizxbmpgc", "pglkf", "morppxebmnzbtbh", "phsdyhto", "ohdneuel", "v", + "fikdowwqu")) + .withAccountId("xmubyyntwlrbq"); model = BinaryData.fromObject(model).toObject(CommitmentPlanAccountAssociationInner.class); - Assertions.assertEquals("la", model.tags().get("hnfhqlyvijouwi")); - Assertions.assertEquals("rc", model.accountId()); + Assertions.assertEquals("auwzizxbmpgc", model.tags().get("efuzmuvpbttd")); + Assertions.assertEquals("xmubyyntwlrbq", model.accountId()); } // Use "Map.of" if available diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAccountAssociationListResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAccountAssociationListResultTests.java index 6637f1d4b0c4..a0161e522302 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAccountAssociationListResultTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAccountAssociationListResultTests.java @@ -1,27 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanAccountAssociationListResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.CommitmentPlanAccountAssociationListResult; import org.junit.jupiter.api.Assertions; public final class CommitmentPlanAccountAssociationListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CommitmentPlanAccountAssociationListResult model = BinaryData.fromString( - "{\"nextLink\":\"mxzrpoa\",\"value\":[{\"etag\":\"wiaaomylweaz\",\"tags\":{\"jhlfzswpchwahf\":\"sethwwn\"},\"properties\":{\"accountId\":\"snfepgfewetwlyx\"},\"id\":\"cxy\",\"name\":\"xhdjhl\",\"type\":\"mmbcxfhbcp\"},{\"etag\":\"xvxcjzhq\",\"tags\":{\"scjavftju\":\"fpxtg\",\"civmmg\":\"dqazkmtgguwpijra\",\"fiwrxgkn\":\"f\"},\"properties\":{\"accountId\":\"yinzqodfvpgs\"},\"id\":\"xgsg\",\"name\":\"p\",\"type\":\"gzdjtxvzf\"},{\"etag\":\"q\",\"tags\":{\"sdtutnwlduyc\":\"qvlgafcqusrdvetn\",\"kuqgsjjxundxgket\":\"uzhyrmewipmvekdx\",\"gpmuneqsxvmhfbuz\":\"zhhzjhfjmhvvmu\"},\"properties\":{\"accountId\":\"hsasbhu\"},\"id\":\"pohyuemslynsqyr\",\"name\":\"foobrlttyms\",\"type\":\"nygq\"}]}") + "{\"nextLink\":\"gdkz\",\"value\":[{\"properties\":{\"accountId\":\"vhqcrail\"},\"etag\":\"n\",\"tags\":{\"hdlxyjrxsagafcn\":\"uflrwd\",\"apnedgfbcvkc\":\"hgw\",\"pkeqdcvdrhvoo\":\"q\"},\"id\":\"otbobzdopcj\",\"name\":\"vnhdldwmgxcxr\",\"type\":\"lpmutwuoegrpkhj\"},{\"properties\":{\"accountId\":\"yqsluic\"},\"etag\":\"ggkzzlvmbmpa\",\"tags\":{\"yw\":\"dfvue\",\"yhrfouyftaakcpw\":\"bpfvm\",\"nubexk\":\"yzvqt\"},\"id\":\"ksmond\",\"name\":\"mquxvypo\",\"type\":\"gkopkwhojvpajqgx\"},{\"properties\":{\"accountId\":\"ocmbqfqvmkcxoza\"},\"etag\":\"helxprglya\",\"tags\":{\"uejrjxgc\":\"ckcb\",\"i\":\"qibrhosxsdqrhzoy\"},\"id\":\"rq\",\"name\":\"ibahwflus\",\"type\":\"dtmhrkwofyyvoqa\"},{\"properties\":{\"accountId\":\"expbtg\"},\"etag\":\"bwoenwashrt\",\"tags\":{\"jwaa\":\"cnqxwbpokulpi\",\"pqwcciuqgbdbutau\":\"ipqiiobyuqerpq\",\"joxafnndlpi\":\"fbtkuwhhmhyk\"},\"id\":\"koymkcd\",\"name\":\"h\",\"type\":\"pkkpw\"}]}") .toObject(CommitmentPlanAccountAssociationListResult.class); - Assertions.assertEquals("mxzrpoa", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommitmentPlanAccountAssociationListResult model - = new CommitmentPlanAccountAssociationListResult().withNextLink("mxzrpoa"); - model = BinaryData.fromObject(model).toObject(CommitmentPlanAccountAssociationListResult.class); - Assertions.assertEquals("mxzrpoa", model.nextLink()); + Assertions.assertEquals("gdkz", model.nextLink()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAccountAssociationPropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAccountAssociationPropertiesTests.java index 6d2272421e2c..6b874e278059 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAccountAssociationPropertiesTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAccountAssociationPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -11,16 +11,16 @@ public final class CommitmentPlanAccountAssociationPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - CommitmentPlanAccountAssociationProperties model = BinaryData.fromString("{\"accountId\":\"qfr\"}") + CommitmentPlanAccountAssociationProperties model = BinaryData.fromString("{\"accountId\":\"iswac\"}") .toObject(CommitmentPlanAccountAssociationProperties.class); - Assertions.assertEquals("qfr", model.accountId()); + Assertions.assertEquals("iswac", model.accountId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { CommitmentPlanAccountAssociationProperties model - = new CommitmentPlanAccountAssociationProperties().withAccountId("qfr"); + = new CommitmentPlanAccountAssociationProperties().withAccountId("iswac"); model = BinaryData.fromObject(model).toObject(CommitmentPlanAccountAssociationProperties.class); - Assertions.assertEquals("qfr", model.accountId()); + Assertions.assertEquals("iswac", model.accountId()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAssociationTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAssociationTests.java index 59e29d342996..088b77fa64aa 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAssociationTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanAssociationTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,18 +12,9 @@ public final class CommitmentPlanAssociationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CommitmentPlanAssociation model - = BinaryData.fromString("{\"commitmentPlanId\":\"bciqfouflm\",\"commitmentPlanLocation\":\"kzsmodm\"}") + = BinaryData.fromString("{\"commitmentPlanId\":\"k\",\"commitmentPlanLocation\":\"xo\"}") .toObject(CommitmentPlanAssociation.class); - Assertions.assertEquals("bciqfouflm", model.commitmentPlanId()); - Assertions.assertEquals("kzsmodm", model.commitmentPlanLocation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommitmentPlanAssociation model - = new CommitmentPlanAssociation().withCommitmentPlanId("bciqfouflm").withCommitmentPlanLocation("kzsmodm"); - model = BinaryData.fromObject(model).toObject(CommitmentPlanAssociation.class); - Assertions.assertEquals("bciqfouflm", model.commitmentPlanId()); - Assertions.assertEquals("kzsmodm", model.commitmentPlanLocation()); + Assertions.assertEquals("k", model.commitmentPlanId()); + Assertions.assertEquals("xo", model.commitmentPlanLocation()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanInnerTests.java index 0100398c348a..adf55a3a16ae 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanInnerTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -19,60 +19,60 @@ public final class CommitmentPlanInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CommitmentPlanInner model = BinaryData.fromString( - "{\"etag\":\"kbnujr\",\"kind\":\"vtylbfpncu\",\"sku\":{\"name\":\"oiwiithtywub\",\"tier\":\"Premium\",\"size\":\"h\",\"family\":\"knfd\",\"capacity\":1640142335},\"tags\":{\"dzjlu\":\"hrdgoihxumwcto\",\"wtovvtgsein\":\"dfdlwggyts\",\"knpirgnepttwq\":\"fiufx\",\"mqnrojlpijnkr\":\"sniffc\"},\"location\":\"rddh\",\"properties\":{\"provisioningState\":\"Moving\",\"commitmentPlanGuid\":\"zzronasx\",\"hostingModel\":\"ProvisionedWeb\",\"planType\":\"zq\",\"current\":{\"tier\":\"f\",\"count\":1523928061,\"quota\":{\"quantity\":4980833303843944532,\"unit\":\"zhonnxkrlgnyhmo\"},\"startDate\":\"xkk\",\"endDate\":\"h\"},\"autoRenew\":false,\"next\":{\"tier\":\"jbdhqxvc\",\"count\":1249979629,\"quota\":{\"quantity\":2016469052831170319,\"unit\":\"fbshrnsvbuswd\"},\"startDate\":\"yybyc\",\"endDate\":\"nvjsrtkfa\"},\"last\":{\"tier\":\"pqgik\",\"count\":828801062,\"quota\":{\"quantity\":1446220970457190394,\"unit\":\"uxzejntpsew\"},\"startDate\":\"oi\",\"endDate\":\"ukry\"},\"provisioningIssues\":[\"qmi\",\"ox\"]},\"id\":\"ggufhyaomtb\",\"name\":\"hhavgrvkffovjz\",\"type\":\"pjbi\"}") + "{\"properties\":{\"provisioningState\":\"Failed\",\"commitmentPlanGuid\":\"bm\",\"hostingModel\":\"DisconnectedContainer\",\"planType\":\"wpr\",\"current\":{\"tier\":\"veual\",\"count\":194224762,\"quota\":{\"quantity\":5663355853068180050,\"unit\":\"obbc\"},\"startDate\":\"s\",\"endDate\":\"jriplrbpbewtghf\"},\"autoRenew\":true,\"next\":{\"tier\":\"wxzvlvqhjkb\",\"count\":2125596553,\"quota\":{\"quantity\":7757966335492850327,\"unit\":\"iebwwaloayqcgwrt\"},\"startDate\":\"uzgwyzmhtx\",\"endDate\":\"gmtsavjcbpwxqpsr\"},\"last\":{\"tier\":\"tguvriuhp\",\"count\":835302956,\"quota\":{\"quantity\":8091606100814503434,\"unit\":\"tayriwwroyqbex\"},\"startDate\":\"cqibycnojv\",\"endDate\":\"mefqsgzvahapjyzh\"},\"provisioningIssues\":[\"qzcjrvxdj\",\"lmwlxkvugfhzo\"]},\"tags\":{\"nxipeil\":\"jvzunluthnnp\",\"dzumveekg\":\"jzuaejxdultskzbb\",\"bsjyofdx\":\"wozuhkf\"},\"location\":\"us\",\"etag\":\"touwaboekqv\",\"kind\":\"lns\",\"sku\":{\"name\":\"bxwyjsflhhcaa\",\"tier\":\"Premium\",\"size\":\"xisxyawjoyaqcsl\",\"family\":\"pkii\",\"capacity\":983085062},\"id\":\"xznelixhnrztf\",\"name\":\"lhbnxkna\",\"type\":\"aulppggd\"}") .toObject(CommitmentPlanInner.class); - Assertions.assertEquals("vtylbfpncu", model.kind()); - Assertions.assertEquals("oiwiithtywub", model.sku().name()); + Assertions.assertEquals("bm", model.properties().commitmentPlanGuid()); + Assertions.assertEquals(HostingModel.DISCONNECTED_CONTAINER, model.properties().hostingModel()); + Assertions.assertEquals("wpr", model.properties().planType()); + Assertions.assertEquals("veual", model.properties().current().tier()); + Assertions.assertEquals(194224762, model.properties().current().count()); + Assertions.assertTrue(model.properties().autoRenew()); + Assertions.assertEquals("wxzvlvqhjkb", model.properties().next().tier()); + Assertions.assertEquals(2125596553, model.properties().next().count()); + Assertions.assertEquals("jvzunluthnnp", model.tags().get("nxipeil")); + Assertions.assertEquals("us", model.location()); + Assertions.assertEquals("lns", model.kind()); + Assertions.assertEquals("bxwyjsflhhcaa", model.sku().name()); Assertions.assertEquals(SkuTier.PREMIUM, model.sku().tier()); - Assertions.assertEquals("h", model.sku().size()); - Assertions.assertEquals("knfd", model.sku().family()); - Assertions.assertEquals(1640142335, model.sku().capacity()); - Assertions.assertEquals("hrdgoihxumwcto", model.tags().get("dzjlu")); - Assertions.assertEquals("rddh", model.location()); - Assertions.assertEquals("zzronasx", model.properties().commitmentPlanGuid()); - Assertions.assertEquals(HostingModel.PROVISIONED_WEB, model.properties().hostingModel()); - Assertions.assertEquals("zq", model.properties().planType()); - Assertions.assertEquals("f", model.properties().current().tier()); - Assertions.assertEquals(1523928061, model.properties().current().count()); - Assertions.assertFalse(model.properties().autoRenew()); - Assertions.assertEquals("jbdhqxvc", model.properties().next().tier()); - Assertions.assertEquals(1249979629, model.properties().next().count()); + Assertions.assertEquals("xisxyawjoyaqcsl", model.sku().size()); + Assertions.assertEquals("pkii", model.sku().family()); + Assertions.assertEquals(983085062, model.sku().capacity()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CommitmentPlanInner model = new CommitmentPlanInner().withKind("vtylbfpncu") - .withSku(new Sku().withName("oiwiithtywub") + CommitmentPlanInner model = new CommitmentPlanInner() + .withProperties(new CommitmentPlanProperties().withCommitmentPlanGuid("bm") + .withHostingModel(HostingModel.DISCONNECTED_CONTAINER) + .withPlanType("wpr") + .withCurrent(new CommitmentPeriod().withTier("veual").withCount(194224762)) + .withAutoRenew(true) + .withNext(new CommitmentPeriod().withTier("wxzvlvqhjkb").withCount(2125596553))) + .withTags(mapOf("nxipeil", "jvzunluthnnp", "dzumveekg", "jzuaejxdultskzbb", "bsjyofdx", "wozuhkf")) + .withLocation("us") + .withKind("lns") + .withSku(new Sku().withName("bxwyjsflhhcaa") .withTier(SkuTier.PREMIUM) - .withSize("h") - .withFamily("knfd") - .withCapacity(1640142335)) - .withTags(mapOf("dzjlu", "hrdgoihxumwcto", "wtovvtgsein", "dfdlwggyts", "knpirgnepttwq", "fiufx", - "mqnrojlpijnkr", "sniffc")) - .withLocation("rddh") - .withProperties(new CommitmentPlanProperties().withCommitmentPlanGuid("zzronasx") - .withHostingModel(HostingModel.PROVISIONED_WEB) - .withPlanType("zq") - .withCurrent(new CommitmentPeriod().withTier("f").withCount(1523928061)) - .withAutoRenew(false) - .withNext(new CommitmentPeriod().withTier("jbdhqxvc").withCount(1249979629))); + .withSize("xisxyawjoyaqcsl") + .withFamily("pkii") + .withCapacity(983085062)); model = BinaryData.fromObject(model).toObject(CommitmentPlanInner.class); - Assertions.assertEquals("vtylbfpncu", model.kind()); - Assertions.assertEquals("oiwiithtywub", model.sku().name()); + Assertions.assertEquals("bm", model.properties().commitmentPlanGuid()); + Assertions.assertEquals(HostingModel.DISCONNECTED_CONTAINER, model.properties().hostingModel()); + Assertions.assertEquals("wpr", model.properties().planType()); + Assertions.assertEquals("veual", model.properties().current().tier()); + Assertions.assertEquals(194224762, model.properties().current().count()); + Assertions.assertTrue(model.properties().autoRenew()); + Assertions.assertEquals("wxzvlvqhjkb", model.properties().next().tier()); + Assertions.assertEquals(2125596553, model.properties().next().count()); + Assertions.assertEquals("jvzunluthnnp", model.tags().get("nxipeil")); + Assertions.assertEquals("us", model.location()); + Assertions.assertEquals("lns", model.kind()); + Assertions.assertEquals("bxwyjsflhhcaa", model.sku().name()); Assertions.assertEquals(SkuTier.PREMIUM, model.sku().tier()); - Assertions.assertEquals("h", model.sku().size()); - Assertions.assertEquals("knfd", model.sku().family()); - Assertions.assertEquals(1640142335, model.sku().capacity()); - Assertions.assertEquals("hrdgoihxumwcto", model.tags().get("dzjlu")); - Assertions.assertEquals("rddh", model.location()); - Assertions.assertEquals("zzronasx", model.properties().commitmentPlanGuid()); - Assertions.assertEquals(HostingModel.PROVISIONED_WEB, model.properties().hostingModel()); - Assertions.assertEquals("zq", model.properties().planType()); - Assertions.assertEquals("f", model.properties().current().tier()); - Assertions.assertEquals(1523928061, model.properties().current().count()); - Assertions.assertFalse(model.properties().autoRenew()); - Assertions.assertEquals("jbdhqxvc", model.properties().next().tier()); - Assertions.assertEquals(1249979629, model.properties().next().count()); + Assertions.assertEquals("xisxyawjoyaqcsl", model.sku().size()); + Assertions.assertEquals("pkii", model.sku().family()); + Assertions.assertEquals(983085062, model.sku().capacity()); } // Use "Map.of" if available diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanListResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanListResultTests.java index 426a58a79307..7df414a61496 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanListResultTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanListResultTests.java @@ -1,26 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentPlanListResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.CommitmentPlanListResult; import org.junit.jupiter.api.Assertions; public final class CommitmentPlanListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CommitmentPlanListResult model = BinaryData.fromString( - "{\"nextLink\":\"zwmk\",\"value\":[{\"etag\":\"jpjorwkqnyhgb\",\"kind\":\"tjivfxzsjabib\",\"sku\":{\"name\":\"stawfsdjpvkv\",\"tier\":\"Enterprise\",\"size\":\"bkzbzkd\",\"family\":\"cjabudurgkakmo\",\"capacity\":1698371946},\"tags\":{\"mouwqlgzrfzeey\":\"klff\"},\"location\":\"izikayuhq\",\"properties\":{\"provisioningState\":\"Deleting\",\"commitmentPlanGuid\":\"ybbqwrv\",\"hostingModel\":\"ProvisionedWeb\",\"planType\":\"mfpgv\",\"current\":{\"tier\":\"paslthaqfxssmwu\",\"count\":1363759065,\"quota\":{\"quantity\":6086907725327334723,\"unit\":\"pdrhne\"},\"startDate\":\"owqkdwytisi\",\"endDate\":\"rcgp\"},\"autoRenew\":true,\"next\":{\"tier\":\"mejzanlfzxia\",\"count\":187576491,\"quota\":{\"quantity\":4058438356546187313,\"unit\":\"kixrj\"},\"startDate\":\"irgzp\",\"endDate\":\"lazszrn\"},\"last\":{\"tier\":\"indfpwpjyl\",\"count\":1108840022,\"quota\":{\"quantity\":5073664426821636107,\"unit\":\"jcdh\"},\"startDate\":\"fjvfbgofeljagr\",\"endDate\":\"qhl\"},\"provisioningIssues\":[\"iiiojnalghf\",\"vtvsexsowueluq\",\"hahhxvrhmzkwpj\",\"wws\"]},\"id\":\"ghftqsxhqxujxuk\",\"name\":\"dxdigr\",\"type\":\"guufzd\"},{\"etag\":\"yqtfihwh\",\"kind\":\"tzingamvpph\",\"sku\":{\"name\":\"zqzudph\",\"tier\":\"Free\",\"size\":\"dkfw\",\"family\":\"wcvtbvkayhmtnvyq\",\"capacity\":686807657},\"tags\":{\"npwzcjaes\":\"wp\",\"hwyg\":\"vvsccyajguq\",\"semdwzrmu\":\"lvdnkfx\",\"qvpsvuoymg\":\"apfcqdpsq\"},\"location\":\"elvezrypq\",\"properties\":{\"provisioningState\":\"Moving\",\"commitmentPlanGuid\":\"kerqwkyh\",\"hostingModel\":\"ProvisionedWeb\",\"planType\":\"pg\",\"current\":{\"tier\":\"k\",\"count\":615107136,\"quota\":{\"quantity\":5074641707512401409,\"unit\":\"rfkbwccsnjvcdwxl\"},\"startDate\":\"ekftnkhtj\",\"endDate\":\"i\"},\"autoRenew\":false,\"next\":{\"tier\":\"atmtdhtmdvy\",\"count\":932898449,\"quota\":{\"quantity\":6469861763062162700,\"unit\":\"ywkbirryuzhlhkjo\"},\"startDate\":\"vqqaatjinrvgo\",\"endDate\":\"mfiibfggj\"},\"last\":{\"tier\":\"lvrwxkvtkk\",\"count\":1409023771,\"quota\":{\"quantity\":1471495737284359378,\"unit\":\"vjayvblmhvkzu\"},\"startDate\":\"xvvy\",\"endDate\":\"s\"},\"provisioningIssues\":[\"yrqufegxuvwz\",\"bnhlmc\"]},\"id\":\"p\",\"name\":\"ngitvgbmhrixkwm\",\"type\":\"ijejvegrhbpn\"},{\"etag\":\"xexccbdreaxhcexd\",\"kind\":\"vqahqkghtpwi\",\"sku\":{\"name\":\"hyjsvfycx\",\"tier\":\"Free\",\"size\":\"oowvrv\",\"family\":\"gjqppy\",\"capacity\":768184156},\"tags\":{\"hgfipnsxkmcw\":\"nzm\"},\"location\":\"krrjrea\",\"properties\":{\"provisioningState\":\"Accepted\",\"commitmentPlanGuid\":\"umh\",\"hostingModel\":\"Web\",\"planType\":\"kkxwslol\",\"current\":{\"tier\":\"vuzlm\",\"count\":1023850423,\"quota\":{\"quantity\":7439617895559455713,\"unit\":\"plcrpwjxeznoig\"},\"startDate\":\"njwmwkpnbsazejj\",\"endDate\":\"kagfhsxtt\"},\"autoRenew\":true,\"next\":{\"tier\":\"nfaazpxdtnkdmkq\",\"count\":135595246,\"quota\":{\"quantity\":8158175845812387505,\"unit\":\"rkpyouaibrebqaay\"},\"startDate\":\"kixqtnqtt\",\"endDate\":\"lwfffi\"},\"last\":{\"tier\":\"jpqqmted\",\"count\":1028485886,\"quota\":{\"quantity\":2185926262396381637,\"unit\":\"eozphv\"},\"startDate\":\"uyqncygupkvipmd\",\"endDate\":\"wx\"},\"provisioningIssues\":[\"evzhfsto\",\"xhojuj\"]},\"id\":\"pelmcuvhixbjxyf\",\"name\":\"n\",\"type\":\"lrcoolsttpki\"}]}") + "{\"nextLink\":\"fovasr\",\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"commitmentPlanGuid\":\"qfsubcgjbirx\",\"hostingModel\":\"ProvisionedWeb\",\"planType\":\"srfbjfdtwss\",\"current\":{\"tier\":\"tpvjzbexilzznfqq\",\"count\":1331345486,\"quota\":{\"quantity\":7094978039469356489,\"unit\":\"ruoujmk\"},\"startDate\":\"hwqytj\",\"endDate\":\"bnw\"},\"autoRenew\":true,\"next\":{\"tier\":\"rjerv\",\"count\":662265241,\"quota\":{\"quantity\":1213698298627967983,\"unit\":\"indoygmifthnzd\"},\"startDate\":\"sl\",\"endDate\":\"ayqigynduhav\"},\"last\":{\"tier\":\"kthumaqolbgycdui\",\"count\":1108910411,\"quota\":{\"quantity\":2689162209131114224,\"unit\":\"vaolpsslqlf\"},\"startDate\":\"dnbbglzps\",\"endDate\":\"ydmcwyhzdxssa\"},\"provisioningIssues\":[\"mnvdfzn\",\"daodvxzbncblyl\",\"stdbhhxsrzdzu\",\"erscdntne\"]},\"tags\":{\"tdss\":\"wjmy\",\"tmweriofzpyq\":\"s\",\"hhszh\":\"emwabnet\"},\"location\":\"plvwiwubmwmbes\",\"etag\":\"nkww\",\"kind\":\"pjflcxogao\",\"sku\":{\"name\":\"nzmnsikvm\",\"tier\":\"Premium\",\"size\":\"qqkdltfzxmhhvhgu\",\"family\":\"odkwobd\",\"capacity\":1615373904},\"id\":\"ibqdxbxwakbogqx\",\"name\":\"dlkzgxhuri\",\"type\":\"lbpodxunk\"}]}") .toObject(CommitmentPlanListResult.class); - Assertions.assertEquals("zwmk", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommitmentPlanListResult model = new CommitmentPlanListResult().withNextLink("zwmk"); - model = BinaryData.fromObject(model).toObject(CommitmentPlanListResult.class); - Assertions.assertEquals("zwmk", model.nextLink()); + Assertions.assertEquals("fovasr", model.nextLink()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanPropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanPropertiesTests.java index eeb7f8cac30c..0c399fc42edf 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanPropertiesTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlanPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -14,34 +14,34 @@ public final class CommitmentPlanPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CommitmentPlanProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Creating\",\"commitmentPlanGuid\":\"fxumv\",\"hostingModel\":\"ProvisionedWeb\",\"planType\":\"yo\",\"current\":{\"tier\":\"nbkfezzxscy\",\"count\":1673017156,\"quota\":{\"quantity\":6708773468856771696,\"unit\":\"jbzbomvzzbtdcq\"},\"startDate\":\"niyujv\",\"endDate\":\"l\"},\"autoRenew\":true,\"next\":{\"tier\":\"ssnrbgye\",\"count\":934099618,\"quota\":{\"quantity\":5292739962971005712,\"unit\":\"j\"},\"startDate\":\"wncot\",\"endDate\":\"fhir\"},\"last\":{\"tier\":\"moxoftpi\",\"count\":828485961,\"quota\":{\"quantity\":3781366448513204027,\"unit\":\"xacpqjli\"},\"startDate\":\"yuspskas\",\"endDate\":\"lmfwdgzx\"},\"provisioningIssues\":[\"cvpa\",\"rsre\"]}") + "{\"provisioningState\":\"Accepted\",\"commitmentPlanGuid\":\"pnyiropuhp\",\"hostingModel\":\"ProvisionedWeb\",\"planType\":\"gylgqgitxmedjvcs\",\"current\":{\"tier\":\"qwwncw\",\"count\":538641166,\"quota\":{\"quantity\":4093757027555713253,\"unit\":\"mgucna\"},\"startDate\":\"t\",\"endDate\":\"ellwptfdy\"},\"autoRenew\":true,\"next\":{\"tier\":\"uaceopzfqrhhu\",\"count\":90973381,\"quota\":{\"quantity\":2153963582414311236,\"unit\":\"qxolzdahzx\"},\"startDate\":\"obgbkdmoizp\",\"endDate\":\"tmgrcfbun\"},\"last\":{\"tier\":\"qjhhkxbpv\",\"count\":685095993,\"quota\":{\"quantity\":7625908079442390330,\"unit\":\"yngudivk\"},\"startDate\":\"swbxqz\",\"endDate\":\"zjf\"},\"provisioningIssues\":[\"j\",\"dxxiv\"]}") .toObject(CommitmentPlanProperties.class); - Assertions.assertEquals("fxumv", model.commitmentPlanGuid()); + Assertions.assertEquals("pnyiropuhp", model.commitmentPlanGuid()); Assertions.assertEquals(HostingModel.PROVISIONED_WEB, model.hostingModel()); - Assertions.assertEquals("yo", model.planType()); - Assertions.assertEquals("nbkfezzxscy", model.current().tier()); - Assertions.assertEquals(1673017156, model.current().count()); + Assertions.assertEquals("gylgqgitxmedjvcs", model.planType()); + Assertions.assertEquals("qwwncw", model.current().tier()); + Assertions.assertEquals(538641166, model.current().count()); Assertions.assertTrue(model.autoRenew()); - Assertions.assertEquals("ssnrbgye", model.next().tier()); - Assertions.assertEquals(934099618, model.next().count()); + Assertions.assertEquals("uaceopzfqrhhu", model.next().tier()); + Assertions.assertEquals(90973381, model.next().count()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CommitmentPlanProperties model = new CommitmentPlanProperties().withCommitmentPlanGuid("fxumv") + CommitmentPlanProperties model = new CommitmentPlanProperties().withCommitmentPlanGuid("pnyiropuhp") .withHostingModel(HostingModel.PROVISIONED_WEB) - .withPlanType("yo") - .withCurrent(new CommitmentPeriod().withTier("nbkfezzxscy").withCount(1673017156)) + .withPlanType("gylgqgitxmedjvcs") + .withCurrent(new CommitmentPeriod().withTier("qwwncw").withCount(538641166)) .withAutoRenew(true) - .withNext(new CommitmentPeriod().withTier("ssnrbgye").withCount(934099618)); + .withNext(new CommitmentPeriod().withTier("uaceopzfqrhhu").withCount(90973381)); model = BinaryData.fromObject(model).toObject(CommitmentPlanProperties.class); - Assertions.assertEquals("fxumv", model.commitmentPlanGuid()); + Assertions.assertEquals("pnyiropuhp", model.commitmentPlanGuid()); Assertions.assertEquals(HostingModel.PROVISIONED_WEB, model.hostingModel()); - Assertions.assertEquals("yo", model.planType()); - Assertions.assertEquals("nbkfezzxscy", model.current().tier()); - Assertions.assertEquals(1673017156, model.current().count()); + Assertions.assertEquals("gylgqgitxmedjvcs", model.planType()); + Assertions.assertEquals("qwwncw", model.current().tier()); + Assertions.assertEquals(538641166, model.current().count()); Assertions.assertTrue(model.autoRenew()); - Assertions.assertEquals("ssnrbgye", model.next().tier()); - Assertions.assertEquals(934099618, model.next().count()); + Assertions.assertEquals("uaceopzfqrhhu", model.next().tier()); + Assertions.assertEquals(90973381, model.next().count()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateAssociationMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateAssociationMockTests.java index fc78f9c97607..95510701d43c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateAssociationMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateAssociationMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -23,7 +23,7 @@ public final class CommitmentPlansCreateOrUpdateAssociationMockTests { @Test public void testCreateOrUpdateAssociation() throws Exception { String responseStr - = "{\"etag\":\"cvbiiftksdw\",\"tags\":{\"uvczldbgl\":\"kefgmwdhce\",\"clyzgs\":\"outbaaqgzeka\",\"nzjotvmr\":\"orbjg\",\"ayfluiyuosnu\":\"khlobvvjbhvhdi\"},\"properties\":{\"accountId\":\"elvhyibdrqrswh\"},\"id\":\"ubpyrow\",\"name\":\"joxztfwfqchvczev\",\"type\":\"nnctagfyvrt\"}"; + = "{\"properties\":{\"accountId\":\"byfg\"},\"etag\":\"wqkjvx\",\"tags\":{\"xlcskltez\":\"pxsoohu\",\"srtmdylperpiltt\":\"ugggzlfbgrdcgu\"},\"id\":\"gczfc\",\"name\":\"fpfbodetres\",\"type\":\"gvtshu\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,15 +33,15 @@ public void testCreateOrUpdateAssociation() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); CommitmentPlanAccountAssociation response = manager.commitmentPlans() - .defineAssociation("qrgxf") - .withExistingCommitmentPlan("bdgzpagsecnad", "u") - .withTags(mapOf("vmtumxpym", "ellnkkii", "canlduwzorxs", "jfuaxroqvqpilrgu", "kqv", "mxaqklxym", "ltuubw", - "qepdx")) - .withAccountId("jbowcpj") + .defineAssociation("dylytcovq") + .withExistingCommitmentPlan("koj", "zbbgspftesubzpvp") + .withTags(mapOf("whbwzjnufzrf", "swkjmdihdcyyyz", "qgnnbz", "m", "ubjtvgjsxmtyjjv", "tftedz", + "sffofwanmhksca", "vdpwwobtdphti")) + .withAccountId("srfjbdxzfxnx") .create(); - Assertions.assertEquals("kefgmwdhce", response.tags().get("uvczldbgl")); - Assertions.assertEquals("elvhyibdrqrswh", response.accountId()); + Assertions.assertEquals("pxsoohu", response.tags().get("xlcskltez")); + Assertions.assertEquals("byfg", response.accountId()); } // Use "Map.of" if available diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdatePlanMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdatePlanMockTests.java index 7e7b9e34f20d..d2473fa44810 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdatePlanMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdatePlanMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -28,7 +28,7 @@ public final class CommitmentPlansCreateOrUpdatePlanMockTests { @Test public void testCreateOrUpdatePlan() throws Exception { String responseStr - = "{\"etag\":\"hgjtnhtukfaci\",\"kind\":\"bfntumeezbxvq\",\"sku\":{\"name\":\"nuvwcgasgomtmjzw\",\"tier\":\"Enterprise\",\"size\":\"ovsxp\",\"family\":\"zt\",\"capacity\":933500866},\"tags\":{\"ls\":\"htgfred\",\"aovjow\":\"grllcc\",\"mlyotg\":\"zhpabac\",\"genmvceb\":\"wsxnsrqor\"},\"location\":\"etqujxcxxq\",\"properties\":{\"provisioningState\":\"Succeeded\",\"commitmentPlanGuid\":\"kedwqurcgojmrv\",\"hostingModel\":\"ConnectedContainer\",\"planType\":\"ongzsehqqrsil\",\"current\":{\"tier\":\"skx\",\"count\":470051968,\"quota\":{\"quantity\":9131082794009166335,\"unit\":\"ia\"},\"startDate\":\"vtojrulfuctejr\",\"endDate\":\"cfjzhxl\"},\"autoRenew\":false,\"next\":{\"tier\":\"rostvrjeqmtzz\",\"count\":2146803784,\"quota\":{\"quantity\":2994538891343392483,\"unit\":\"alx\"},\"startDate\":\"habsrwrsnrh\",\"endDate\":\"a\"},\"last\":{\"tier\":\"kkvyanxk\",\"count\":5095655,\"quota\":{\"quantity\":4624282179192376776,\"unit\":\"uvdjkqxetqm\"},\"startDate\":\"ivrjjxnwxdc\",\"endDate\":\"ojxl\"},\"provisioningIssues\":[\"lx\"]},\"id\":\"fquwzpwiibel\",\"name\":\"cerwkwbpjxljtxbu\",\"type\":\"qtbxxniuisdzh\"}"; + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"commitmentPlanGuid\":\"qyvliqiipsejbsvs\",\"hostingModel\":\"ProvisionedWeb\",\"planType\":\"swhddzydisnuep\",\"current\":{\"tier\":\"jlnldpxottdiiaoc\",\"count\":1704325965,\"quota\":{\"quantity\":6092102281772543548,\"unit\":\"ee\"},\"startDate\":\"ph\",\"endDate\":\"vcjwqwoqsratj\"},\"autoRenew\":true,\"next\":{\"tier\":\"b\",\"count\":684965923,\"quota\":{\"quantity\":7508681822030551347,\"unit\":\"gdkkagvwukh\"},\"startDate\":\"s\",\"endDate\":\"orfmzhwilzz\"},\"last\":{\"tier\":\"jmriprlkdneyttlr\",\"count\":1604828651,\"quota\":{\"quantity\":3847930866000246883,\"unit\":\"tpumltwjfluxynb\"},\"startDate\":\"zlqywauyqn\",\"endDate\":\"khmocgjs\"},\"provisioningIssues\":[\"u\",\"rhwv\",\"xqqggljky\",\"sjrclrvtzq\"]},\"tags\":{\"y\":\"ctbhpjhxpcvrd\",\"n\":\"it\"},\"location\":\"ad\",\"etag\":\"zjahwriuomz\",\"kind\":\"fki\",\"sku\":{\"name\":\"evsaa\",\"tier\":\"Standard\",\"size\":\"caxikhfjqebgl\",\"family\":\"kxgzzromvygysem\",\"capacity\":1696976425},\"id\":\"rf\",\"name\":\"vpinkzpatqt\",\"type\":\"iswxspv\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -38,41 +38,40 @@ public void testCreateOrUpdatePlan() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); CommitmentPlan response = manager.commitmentPlans() - .definePlan("ohaitranizerwgud") - .withExistingResourceGroup("tneemmjauwcgxef") - .withRegion("lzmijajwolxfsv") - .withTags( - mapOf("kcfazzw", "lp", "rransyb", "cayer", "nkfscjfn", "lpolwzrghsrle", "qwtltngvmreupt", "jwvuag")) - .withKind("priylfmp") - .withSku(new Sku().withName("raudsvhlcdcul") - .withTier(SkuTier.PREMIUM) - .withSize("qtmojhvrztnvgy") - .withFamily("qrdgrtw") - .withCapacity(906399424)) - .withProperties(new CommitmentPlanProperties().withCommitmentPlanGuid("ynwlslrcigtzjcv") - .withHostingModel(HostingModel.DISCONNECTED_CONTAINER) - .withPlanType("a") - .withCurrent(new CommitmentPeriod().withTier("ssov").withCount(1215763715)) + .definePlan("d") + .withExistingResourceGroup("ycqsxr") + .withRegion("n") + .withTags(mapOf("vzm", "eimseobfsxstcyil", "okjxebjvb", "xcjzlquze")) + .withProperties(new CommitmentPlanProperties().withCommitmentPlanGuid("qaeo") + .withHostingModel(HostingModel.WEB) + .withPlanType("gejkbvhh") + .withCurrent(new CommitmentPeriod().withTier("rgh").withCount(1069326313)) .withAutoRenew(false) - .withNext(new CommitmentPeriod().withTier("wtrkx").withCount(891433638))) + .withNext(new CommitmentPeriod().withTier("amicbigwcdgz").withCount(1932799009))) + .withKind("idnwceha") + .withSku(new Sku().withName("do") + .withTier(SkuTier.ENTERPRISE) + .withSize("giomqo") + .withFamily("epiaeapfsergd") + .withCapacity(585851582)) .create(); - Assertions.assertEquals("bfntumeezbxvq", response.kind()); - Assertions.assertEquals("nuvwcgasgomtmjzw", response.sku().name()); - Assertions.assertEquals(SkuTier.ENTERPRISE, response.sku().tier()); - Assertions.assertEquals("ovsxp", response.sku().size()); - Assertions.assertEquals("zt", response.sku().family()); - Assertions.assertEquals(933500866, response.sku().capacity()); - Assertions.assertEquals("htgfred", response.tags().get("ls")); - Assertions.assertEquals("etqujxcxxq", response.location()); - Assertions.assertEquals("kedwqurcgojmrv", response.properties().commitmentPlanGuid()); - Assertions.assertEquals(HostingModel.CONNECTED_CONTAINER, response.properties().hostingModel()); - Assertions.assertEquals("ongzsehqqrsil", response.properties().planType()); - Assertions.assertEquals("skx", response.properties().current().tier()); - Assertions.assertEquals(470051968, response.properties().current().count()); - Assertions.assertFalse(response.properties().autoRenew()); - Assertions.assertEquals("rostvrjeqmtzz", response.properties().next().tier()); - Assertions.assertEquals(2146803784, response.properties().next().count()); + Assertions.assertEquals("qyvliqiipsejbsvs", response.properties().commitmentPlanGuid()); + Assertions.assertEquals(HostingModel.PROVISIONED_WEB, response.properties().hostingModel()); + Assertions.assertEquals("swhddzydisnuep", response.properties().planType()); + Assertions.assertEquals("jlnldpxottdiiaoc", response.properties().current().tier()); + Assertions.assertEquals(1704325965, response.properties().current().count()); + Assertions.assertTrue(response.properties().autoRenew()); + Assertions.assertEquals("b", response.properties().next().tier()); + Assertions.assertEquals(684965923, response.properties().next().count()); + Assertions.assertEquals("ctbhpjhxpcvrd", response.tags().get("y")); + Assertions.assertEquals("ad", response.location()); + Assertions.assertEquals("fki", response.kind()); + Assertions.assertEquals("evsaa", response.sku().name()); + Assertions.assertEquals(SkuTier.STANDARD, response.sku().tier()); + Assertions.assertEquals("caxikhfjqebgl", response.sku().size()); + Assertions.assertEquals("kxgzzromvygysem", response.sku().family()); + Assertions.assertEquals(1696976425, response.sku().capacity()); } // Use "Map.of" if available diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateWithResponseMockTests.java index 7f549ba58908..b3546bc05c16 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansCreateOrUpdateWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -29,7 +29,7 @@ public final class CommitmentPlansCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"etag\":\"hvmaxgnuyeamcmhu\",\"kind\":\"jecehokwc\",\"sku\":{\"name\":\"twloesqr\",\"tier\":\"Standard\",\"size\":\"bnyrukoila\",\"family\":\"duwjleipjlhwy\",\"capacity\":400227130},\"tags\":{\"thqkkwhbgxvellv\":\"z\",\"mnitmujd\":\"lnx\",\"lyymffhmjpddny\":\"vm\",\"mzjqrbr\":\"fzuvrzmz\"},\"location\":\"nmdyfoebo\",\"properties\":{\"provisioningState\":\"Deleting\",\"commitmentPlanGuid\":\"g\",\"hostingModel\":\"ProvisionedWeb\",\"planType\":\"o\",\"current\":{\"tier\":\"jtnqjil\",\"count\":2083894224,\"quota\":{\"quantity\":3143981507699087100,\"unit\":\"qsyrilmhxdqao\"},\"startDate\":\"ylnkkbjpjvlywltm\",\"endDate\":\"obbjwhlwy\"},\"autoRenew\":true,\"next\":{\"tier\":\"ocrdzgczeunt\",\"count\":747096318,\"quota\":{\"quantity\":7913165411093776533,\"unit\":\"tiekoifuvnyttz\"},\"startDate\":\"xgyrihlgmgbehlqt\",\"endDate\":\"rflknd\"},\"last\":{\"tier\":\"pgfjo\",\"count\":1968957759,\"quota\":{\"quantity\":5021380682185029133,\"unit\":\"fhipx\"},\"startDate\":\"sabvcip\",\"endDate\":\"zafczuumljci\"},\"provisioningIssues\":[\"efy\",\"dvei\"]},\"id\":\"tjnsx\",\"name\":\"ajlnsjhwjuyxx\",\"type\":\"xqvmvuay\"}"; + = "{\"properties\":{\"provisioningState\":\"Deleting\",\"commitmentPlanGuid\":\"ossscyva\",\"hostingModel\":\"DisconnectedContainer\",\"planType\":\"uacvfy\",\"current\":{\"tier\":\"psfx\",\"count\":149702899,\"quota\":{\"quantity\":1399808457572828825,\"unit\":\"hpvtyqftteh\"},\"startDate\":\"boujstkfvv\",\"endDate\":\"hxcd\"},\"autoRenew\":false,\"next\":{\"tier\":\"nygnxcgjtfrnquk\",\"count\":638995302,\"quota\":{\"quantity\":9166686594418471130,\"unit\":\"rxsmyltrw\"},\"startDate\":\"fmtbgwjdxwn\",\"endDate\":\"kurrdreyzjwh\"},\"last\":{\"tier\":\"wwj\",\"count\":768856971,\"quota\":{\"quantity\":1001624633753072909,\"unit\":\"uukykcyqh\"},\"startDate\":\"qzzdcykeyste\",\"endDate\":\"opazdazgbs\"},\"provisioningIssues\":[\"ewqcfu\"]},\"tags\":{\"ctzeyowmndc\":\"pvozglqjbknlzc\",\"wzqauxzanhmkvf\":\"v\",\"txudqyeme\":\"uwkudrbcp\"},\"location\":\"naucmcirtnee\",\"etag\":\"jauwcgxefnohaitr\",\"kind\":\"izerw\",\"sku\":{\"name\":\"dasmxu\",\"tier\":\"Enterprise\",\"size\":\"ngfcocefhpriyl\",\"family\":\"pztraudsvhl\",\"capacity\":60020047},\"id\":\"lregpq\",\"name\":\"moj\",\"type\":\"vr\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -39,40 +39,42 @@ public void testCreateOrUpdateWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); CommitmentPlan response = manager.commitmentPlans() - .createOrUpdateWithResponse("yoeojhtollhs", "idmytzln", "lxpnovyoanf", - new CommitmentPlanInner().withKind("gaeukyawohpm") - .withSku(new Sku().withName("qnucs") - .withTier(SkuTier.BASIC) - .withSize("i") - .withFamily("jtdlp") - .withCapacity(2047376191)) - .withTags(mapOf("cpuo", "gazlsvbz", "wjcciklhsy", "e")) - .withLocation("rdrenxo") - .withProperties(new CommitmentPlanProperties().withCommitmentPlanGuid("h") - .withHostingModel(HostingModel.CONNECTED_CONTAINER) - .withPlanType("vdlhydwbdbfgr") - .withCurrent(new CommitmentPeriod().withTier("nytjlk").withCount(1788916673)) + .createOrUpdateWithResponse("hoadhrsxqvzv", "pabdsrg", "ajglzrsubklr", + new CommitmentPlanInner() + .withProperties(new CommitmentPlanProperties().withCommitmentPlanGuid("tcetjdv") + .withHostingModel(HostingModel.WEB) + .withPlanType("eqq") + .withCurrent(new CommitmentPeriod().withTier("ruwdxvqzxoebwgj").withCount(1086603858)) .withAutoRenew(true) - .withNext(new CommitmentPeriod().withTier("gravaqogfkbebauz").withCount(1334524940))), + .withNext(new CommitmentPeriod().withTier("tttk").withCount(2089957309))) + .withTags(mapOf("bsgzl", "xdbdljzgdyrcvu", "x", "qhbjnqogdxwbsfpy", "ecominxojjluxxd", "jlf", + "dzzqjmu", "ilz")) + .withLocation("ay") + .withKind("wtaznkcqw") + .withSku(new Sku().withName("wjyofgwhnkbtl") + .withTier(SkuTier.BASIC) + .withSize("smctsn") + .withFamily("kpwolg") + .withCapacity(1781275613)), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("jecehokwc", response.kind()); - Assertions.assertEquals("twloesqr", response.sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, response.sku().tier()); - Assertions.assertEquals("bnyrukoila", response.sku().size()); - Assertions.assertEquals("duwjleipjlhwy", response.sku().family()); - Assertions.assertEquals(400227130, response.sku().capacity()); - Assertions.assertEquals("z", response.tags().get("thqkkwhbgxvellv")); - Assertions.assertEquals("nmdyfoebo", response.location()); - Assertions.assertEquals("g", response.properties().commitmentPlanGuid()); - Assertions.assertEquals(HostingModel.PROVISIONED_WEB, response.properties().hostingModel()); - Assertions.assertEquals("o", response.properties().planType()); - Assertions.assertEquals("jtnqjil", response.properties().current().tier()); - Assertions.assertEquals(2083894224, response.properties().current().count()); - Assertions.assertTrue(response.properties().autoRenew()); - Assertions.assertEquals("ocrdzgczeunt", response.properties().next().tier()); - Assertions.assertEquals(747096318, response.properties().next().count()); + Assertions.assertEquals("ossscyva", response.properties().commitmentPlanGuid()); + Assertions.assertEquals(HostingModel.DISCONNECTED_CONTAINER, response.properties().hostingModel()); + Assertions.assertEquals("uacvfy", response.properties().planType()); + Assertions.assertEquals("psfx", response.properties().current().tier()); + Assertions.assertEquals(149702899, response.properties().current().count()); + Assertions.assertFalse(response.properties().autoRenew()); + Assertions.assertEquals("nygnxcgjtfrnquk", response.properties().next().tier()); + Assertions.assertEquals(638995302, response.properties().next().count()); + Assertions.assertEquals("pvozglqjbknlzc", response.tags().get("ctzeyowmndc")); + Assertions.assertEquals("naucmcirtnee", response.location()); + Assertions.assertEquals("izerw", response.kind()); + Assertions.assertEquals("dasmxu", response.sku().name()); + Assertions.assertEquals(SkuTier.ENTERPRISE, response.sku().tier()); + Assertions.assertEquals("ngfcocefhpriyl", response.sku().size()); + Assertions.assertEquals("pztraudsvhl", response.sku().family()); + Assertions.assertEquals(60020047, response.sku().capacity()); } // Use "Map.of" if available diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteAssociationMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteAssociationMockTests.java index 2b2a90ed05f2..6e5b2973fb12 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteAssociationMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteAssociationMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -28,7 +28,7 @@ public void testDeleteAssociation() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.commitmentPlans() - .deleteAssociation("fruwkud", "bcpftxudqyemebun", "ucmci", com.azure.core.util.Context.NONE); + .deleteAssociation("gyykyalug", "kd", "qnhttwdowrczfj", com.azure.core.util.Context.NONE); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteMockTests.java index 23f73cee5c3c..321471361fc6 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeleteMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -27,7 +27,7 @@ public void testDelete() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.commitmentPlans().delete("uadx", "xeqbwp", "tghyksarcdr", com.azure.core.util.Context.NONE); + manager.commitmentPlans().delete("tnvgyshqrdgrt", "mewjzlpyk", "fa", com.azure.core.util.Context.NONE); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeletePlanMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeletePlanMockTests.java index 38896e7aadc3..b66da9e9f40a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeletePlanMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansDeletePlanMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -27,7 +27,7 @@ public void testDeletePlan() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.commitmentPlans().deletePlan("xsl", "vlzladl", com.azure.core.util.Context.NONE); + manager.commitmentPlans().deletePlan("vhuerkjddvrglieg", "tcvbiiftk", com.azure.core.util.Context.NONE); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetAssociationWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetAssociationWithResponseMockTests.java index fd54ea480da2..9217ae188800 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetAssociationWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetAssociationWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -21,7 +21,7 @@ public final class CommitmentPlansGetAssociationWithResponseMockTests { @Test public void testGetAssociationWithResponse() throws Exception { String responseStr - = "{\"etag\":\"zzdcykeys\",\"tags\":{\"z\":\"fop\",\"q\":\"azgbsqgpe\",\"dpvozglqj\":\"fut\"},\"properties\":{\"accountId\":\"l\"},\"id\":\"lctzeyowmndcovd\",\"name\":\"zqauxzan\",\"type\":\"mk\"}"; + = "{\"properties\":{\"accountId\":\"lcfn\"},\"etag\":\"mhsurlgwqkpmm\",\"tags\":{\"gvvjhvvlr\":\"tauolawiubmom\",\"ajnkdflqionswae\":\"ohewjj\",\"totryegpkhxrme\":\"kzfzqxjosho\"},\"id\":\"nlwkbfokxkhupz\",\"name\":\"rufgjblcdrmyfcem\",\"type\":\"t\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,11 +31,10 @@ public void testGetAssociationWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); CommitmentPlanAccountAssociation response = manager.commitmentPlans() - .getAssociationWithResponse("jdxwnazkurrdre", "zjwhsetwwjwz", "qseuzuukykcyqhy", - com.azure.core.util.Context.NONE) + .getAssociationWithResponse("htdm", "wjekptycaydbj", "c", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("fop", response.tags().get("z")); - Assertions.assertEquals("l", response.accountId()); + Assertions.assertEquals("tauolawiubmom", response.tags().get("gvvjhvvlr")); + Assertions.assertEquals("lcfn", response.accountId()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetByResourceGroupWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetByResourceGroupWithResponseMockTests.java index d1b5cd5f64bd..1dc6fd880a59 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetByResourceGroupWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetByResourceGroupWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -23,7 +23,7 @@ public final class CommitmentPlansGetByResourceGroupWithResponseMockTests { @Test public void testGetByResourceGroupWithResponse() throws Exception { String responseStr - = "{\"etag\":\"zdanojis\",\"kind\":\"lmvokat\",\"sku\":{\"name\":\"tjctibpvbkaeh\",\"tier\":\"Standard\",\"size\":\"ygdfwakwseiv\",\"family\":\"kxh\",\"capacity\":1956746441},\"tags\":{\"kdch\":\"juxlkbectvtfjm\",\"kzaz\":\"aiubavlzwpvgmfa\"},\"location\":\"oke\",\"properties\":{\"provisioningState\":\"Moving\",\"commitmentPlanGuid\":\"fkmkrokz\",\"hostingModel\":\"Web\",\"planType\":\"etw\",\"current\":{\"tier\":\"tvaoznqn\",\"count\":1833808282,\"quota\":{\"quantity\":2753944703636782565,\"unit\":\"mceituugedhfpjs\"},\"startDate\":\"zmblsyjdeol\",\"endDate\":\"aebfsyrled\"},\"autoRenew\":true,\"next\":{\"tier\":\"bvt\",\"count\":1892398136,\"quota\":{\"quantity\":8239410931209541214,\"unit\":\"geafgfosehxlzsxe\"},\"startDate\":\"p\",\"endDate\":\"waaeskyfjl\"},\"last\":{\"tier\":\"qtoyrpl\",\"count\":1825702886,\"quota\":{\"quantity\":8039534643491119965,\"unit\":\"pq\"},\"startDate\":\"vh\",\"endDate\":\"fowgwbtmkekx\"},\"provisioningIssues\":[\"waqxofqovc\",\"iqbplvfidusz\",\"ekxbyjg\"]},\"id\":\"fepxyihpqadag\",\"name\":\"hrdicxdwyjfo\",\"type\":\"xwyovcxjsgbip\"}"; + = "{\"properties\":{\"provisioningState\":\"Moving\",\"commitmentPlanGuid\":\"ujxcxxqn\",\"hostingModel\":\"DisconnectedContainer\",\"planType\":\"kedwqurcgojmrv\",\"current\":{\"tier\":\"jongzsehq\",\"count\":890510695,\"quota\":{\"quantity\":1893126074717530452,\"unit\":\"skx\"},\"startDate\":\"ansbvriaqg\",\"endDate\":\"ojrulfuctejrt\"},\"autoRenew\":false,\"next\":{\"tier\":\"hxlyubqjrostvrje\",\"count\":1351085708,\"quota\":{\"quantity\":8285877028609401950,\"unit\":\"rztrxalxrdhabsr\"},\"startDate\":\"sn\",\"endDate\":\"pqatiwkkvyanxkv\"},\"last\":{\"tier\":\"ems\",\"count\":84399472,\"quota\":{\"quantity\":3304737017213162224,\"unit\":\"etqmmli\"},\"startDate\":\"jjxnwxdchpoj\",\"endDate\":\"ehzl\"},\"provisioningIssues\":[\"fquwzpwiibel\",\"cerwkwbpjxljtxbu\"]},\"tags\":{\"uisdzhgbdgz\":\"bxxn\",\"r\":\"agsecnadbuw\",\"zoellnkkiiwvmtum\":\"xfllmqiyn\"},\"location\":\"ymdjfua\",\"etag\":\"oqvqpilr\",\"kind\":\"ncanlduwzor\",\"sku\":{\"name\":\"bm\",\"tier\":\"Basic\",\"size\":\"lxymxkqvfqe\",\"family\":\"xcltuubwyvp\",\"capacity\":2136648935},\"id\":\"cpj\",\"name\":\"du\",\"type\":\"gixexkydfbwlj\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,24 +33,24 @@ public void testGetByResourceGroupWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); CommitmentPlan response = manager.commitmentPlans() - .getByResourceGroupWithResponse("x", "pbqhvfdqqjwkr", com.azure.core.util.Context.NONE) + .getByResourceGroupWithResponse("wsxnsrqor", "genmvceb", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("lmvokat", response.kind()); - Assertions.assertEquals("tjctibpvbkaeh", response.sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, response.sku().tier()); - Assertions.assertEquals("ygdfwakwseiv", response.sku().size()); - Assertions.assertEquals("kxh", response.sku().family()); - Assertions.assertEquals(1956746441, response.sku().capacity()); - Assertions.assertEquals("juxlkbectvtfjm", response.tags().get("kdch")); - Assertions.assertEquals("oke", response.location()); - Assertions.assertEquals("fkmkrokz", response.properties().commitmentPlanGuid()); - Assertions.assertEquals(HostingModel.WEB, response.properties().hostingModel()); - Assertions.assertEquals("etw", response.properties().planType()); - Assertions.assertEquals("tvaoznqn", response.properties().current().tier()); - Assertions.assertEquals(1833808282, response.properties().current().count()); - Assertions.assertTrue(response.properties().autoRenew()); - Assertions.assertEquals("bvt", response.properties().next().tier()); - Assertions.assertEquals(1892398136, response.properties().next().count()); + Assertions.assertEquals("ujxcxxqn", response.properties().commitmentPlanGuid()); + Assertions.assertEquals(HostingModel.DISCONNECTED_CONTAINER, response.properties().hostingModel()); + Assertions.assertEquals("kedwqurcgojmrv", response.properties().planType()); + Assertions.assertEquals("jongzsehq", response.properties().current().tier()); + Assertions.assertEquals(890510695, response.properties().current().count()); + Assertions.assertFalse(response.properties().autoRenew()); + Assertions.assertEquals("hxlyubqjrostvrje", response.properties().next().tier()); + Assertions.assertEquals(1351085708, response.properties().next().count()); + Assertions.assertEquals("bxxn", response.tags().get("uisdzhgbdgz")); + Assertions.assertEquals("ymdjfua", response.location()); + Assertions.assertEquals("ncanlduwzor", response.kind()); + Assertions.assertEquals("bm", response.sku().name()); + Assertions.assertEquals(SkuTier.BASIC, response.sku().tier()); + Assertions.assertEquals("lxymxkqvfqe", response.sku().size()); + Assertions.assertEquals("xcltuubwyvp", response.sku().family()); + Assertions.assertEquals(2136648935, response.sku().capacity()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetWithResponseMockTests.java index 7fd225eff441..b56b68cb7499 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansGetWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -23,7 +23,7 @@ public final class CommitmentPlansGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"etag\":\"bsmfkwiyjvz\",\"kind\":\"osrnawnvzmlnkoy\",\"sku\":{\"name\":\"xvjabjq\",\"tier\":\"Premium\",\"size\":\"yvymcnudndo\",\"family\":\"hjxwxq\",\"capacity\":2080227457},\"tags\":{\"ksmitnsqxtlt\":\"mp\",\"frakkldgrc\":\"lkrdpqgfhy\"},\"location\":\"cmfcnrjajq\",\"properties\":{\"provisioningState\":\"Creating\",\"commitmentPlanGuid\":\"tie\",\"hostingModel\":\"ConnectedContainer\",\"planType\":\"gxxgfb\",\"current\":{\"tier\":\"lpqagyn\",\"count\":1110367561,\"quota\":{\"quantity\":1769523423599098954,\"unit\":\"lin\"},\"startDate\":\"yqxzxaqzibmqim\",\"endDate\":\"mqruqguhfupe\"},\"autoRenew\":true,\"next\":{\"tier\":\"oqsbpkflanfkgxsy\",\"count\":124843164,\"quota\":{\"quantity\":2742281976066601209,\"unit\":\"uohdkcprgukxr\"},\"startDate\":\"io\",\"endDate\":\"lutixmq\"},\"last\":{\"tier\":\"jizcbfzmcrunfhiu\",\"count\":1201337958,\"quota\":{\"quantity\":6768706483497184556,\"unit\":\"qktkrumzuedkyzbf\"},\"startDate\":\"ovqkxiu\",\"endDate\":\"ggvqrnhyhlwcjs\"},\"provisioningIssues\":[\"jhffbxrqrkij\",\"euqlsdxeqztv\"]},\"id\":\"mwwmjswenaww\",\"name\":\"me\",\"type\":\"leqioulndh\"}"; + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"commitmentPlanGuid\":\"sgbipcukdveksbuh\",\"hostingModel\":\"DisconnectedContainer\",\"planType\":\"hvlscrdp\",\"current\":{\"tier\":\"dyjdussp\",\"count\":1022332024,\"quota\":{\"quantity\":9161300172240946259,\"unit\":\"lkaaggkr\"},\"startDate\":\"bfrnuybffljfii\",\"endDate\":\"eoagsqta\"},\"autoRenew\":false,\"next\":{\"tier\":\"e\",\"count\":154919279,\"quota\":{\"quantity\":7281171244196832956,\"unit\":\"udo\"},\"startDate\":\"i\",\"endDate\":\"mnlikpsi\"},\"last\":{\"tier\":\"eypofqpm\",\"count\":1069541838,\"quota\":{\"quantity\":8309451235838829892,\"unit\":\"mmttjxophge\"},\"startDate\":\"smv\",\"endDate\":\"htwzmqilr\"},\"provisioningIssues\":[\"sfnim\"]},\"tags\":{\"mlqoinhzduew\":\"wwwmhkruwaedrym\"},\"location\":\"apfjiik\",\"etag\":\"diqfliejhpclbi\",\"kind\":\"fsbw\",\"sku\":{\"name\":\"ivbvzi\",\"tier\":\"Standard\",\"size\":\"goooxz\",\"family\":\"admskx\",\"capacity\":1492620534},\"id\":\"gzigjsugswhgsaod\",\"name\":\"wwnbafoctohz\",\"type\":\"aquvwsxbgnvkervq\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,24 +33,24 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); CommitmentPlan response = manager.commitmentPlans() - .getWithResponse("hlimby", "ecr", "odlikcdrdaasax", com.azure.core.util.Context.NONE) + .getWithResponse("sfepxyihpq", "dagrhrdicxdw", "jfowxwy", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("osrnawnvzmlnkoy", response.kind()); - Assertions.assertEquals("xvjabjq", response.sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, response.sku().tier()); - Assertions.assertEquals("yvymcnudndo", response.sku().size()); - Assertions.assertEquals("hjxwxq", response.sku().family()); - Assertions.assertEquals(2080227457, response.sku().capacity()); - Assertions.assertEquals("mp", response.tags().get("ksmitnsqxtlt")); - Assertions.assertEquals("cmfcnrjajq", response.location()); - Assertions.assertEquals("tie", response.properties().commitmentPlanGuid()); - Assertions.assertEquals(HostingModel.CONNECTED_CONTAINER, response.properties().hostingModel()); - Assertions.assertEquals("gxxgfb", response.properties().planType()); - Assertions.assertEquals("lpqagyn", response.properties().current().tier()); - Assertions.assertEquals(1110367561, response.properties().current().count()); - Assertions.assertTrue(response.properties().autoRenew()); - Assertions.assertEquals("oqsbpkflanfkgxsy", response.properties().next().tier()); - Assertions.assertEquals(124843164, response.properties().next().count()); + Assertions.assertEquals("sgbipcukdveksbuh", response.properties().commitmentPlanGuid()); + Assertions.assertEquals(HostingModel.DISCONNECTED_CONTAINER, response.properties().hostingModel()); + Assertions.assertEquals("hvlscrdp", response.properties().planType()); + Assertions.assertEquals("dyjdussp", response.properties().current().tier()); + Assertions.assertEquals(1022332024, response.properties().current().count()); + Assertions.assertFalse(response.properties().autoRenew()); + Assertions.assertEquals("e", response.properties().next().tier()); + Assertions.assertEquals(154919279, response.properties().next().count()); + Assertions.assertEquals("wwwmhkruwaedrym", response.tags().get("mlqoinhzduew")); + Assertions.assertEquals("apfjiik", response.location()); + Assertions.assertEquals("fsbw", response.kind()); + Assertions.assertEquals("ivbvzi", response.sku().name()); + Assertions.assertEquals(SkuTier.STANDARD, response.sku().tier()); + Assertions.assertEquals("goooxz", response.sku().size()); + Assertions.assertEquals("admskx", response.sku().family()); + Assertions.assertEquals(1492620534, response.sku().capacity()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListAssociationsMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListAssociationsMockTests.java index 687c44c95ad4..3ac25d1b6361 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListAssociationsMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListAssociationsMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -22,7 +22,7 @@ public final class CommitmentPlansListAssociationsMockTests { @Test public void testListAssociations() throws Exception { String responseStr - = "{\"value\":[{\"etag\":\"w\",\"tags\":{\"jdhsoy\":\"x\",\"pboujs\":\"hpvtyqftteh\",\"suenyg\":\"kfvvdshxcde\"},\"properties\":{\"accountId\":\"g\"},\"id\":\"frn\",\"name\":\"uktrfnslnlrx\",\"type\":\"myltrwntfmtbg\"}]}"; + = "{\"value\":[{\"properties\":{\"accountId\":\"hjulrsulwzpflu\"},\"etag\":\"awmhh\",\"tags\":{\"kvzwxxyxhighctx\":\"tfriyrgko\"},\"id\":\"molpcqyde\",\"name\":\"kvskiczdfrjei\",\"type\":\"ikgqaboohxbms\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,9 +32,9 @@ public void testListAssociations() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.commitmentPlans().listAssociations("aiossscyvaifp", "uacvfy", com.azure.core.util.Context.NONE); + = manager.commitmentPlans().listAssociations("nnuxxrkkmhm", "ulwempdc", com.azure.core.util.Context.NONE); - Assertions.assertEquals("x", response.iterator().next().tags().get("jdhsoy")); - Assertions.assertEquals("g", response.iterator().next().accountId()); + Assertions.assertEquals("tfriyrgko", response.iterator().next().tags().get("kvzwxxyxhighctx")); + Assertions.assertEquals("hjulrsulwzpflu", response.iterator().next().accountId()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListByResourceGroupMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListByResourceGroupMockTests.java index 09ae939590a4..59de5f259419 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListByResourceGroupMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListByResourceGroupMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -24,7 +24,7 @@ public final class CommitmentPlansListByResourceGroupMockTests { @Test public void testListByResourceGroup() throws Exception { String responseStr - = "{\"value\":[{\"etag\":\"lscrdpibfdyjduss\",\"kind\":\"szekbh\",\"sku\":{\"name\":\"kaaggkreh\",\"tier\":\"Premium\",\"size\":\"uybffljfiim\",\"family\":\"oags\",\"capacity\":674819146},\"tags\":{\"vsqw\":\"usrexxf\"},\"location\":\"ohzilfmnli\",\"properties\":{\"provisioningState\":\"Failed\",\"commitmentPlanGuid\":\"s\",\"hostingModel\":\"ProvisionedWeb\",\"planType\":\"ofqpmbhy\",\"current\":{\"tier\":\"drmmttjxoph\",\"count\":1931127313,\"quota\":{\"quantity\":9169059793267417089,\"unit\":\"ohtwzmqilr\"},\"startDate\":\"ysfn\",\"endDate\":\"sqywwwmhkru\"},\"autoRenew\":true,\"next\":{\"tier\":\"ympmlqoin\",\"count\":302028974,\"quota\":{\"quantity\":2822901219251497037,\"unit\":\"apfjiik\"},\"startDate\":\"diqfliejhpclbi\",\"endDate\":\"fsbw\"},\"last\":{\"tier\":\"vbvzipbwxgo\",\"count\":124034225,\"quota\":{\"quantity\":2340409298246648058,\"unit\":\"mskxknp\"},\"startDate\":\"zigjsugswhgsaodk\",\"endDate\":\"nbafoctohzhaquvw\"},\"provisioningIssues\":[\"gnvk\",\"rvqchoadhrsxqvzv\",\"pabdsrg\",\"ajglzrsubklr\"]},\"id\":\"jnltcetjdvqydi\",\"name\":\"q\",\"type\":\"kw\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"commitmentPlanGuid\":\"wdhcebuvczldb\",\"hostingModel\":\"ConnectedContainer\",\"planType\":\"utbaaqgze\",\"current\":{\"tier\":\"clyzgs\",\"count\":1559128353,\"quota\":{\"quantity\":2416884638658987469,\"unit\":\"zjotvmrxkhlo\"},\"startDate\":\"vjb\",\"endDate\":\"hdiqayfl\"},\"autoRenew\":false,\"next\":{\"tier\":\"snuudtelvhyibdr\",\"count\":993231754,\"quota\":{\"quantity\":2219125710154215083,\"unit\":\"bpyrowtjoxzt\"},\"startDate\":\"fqch\",\"endDate\":\"zevjnnctag\"},\"last\":{\"tier\":\"rtpqpemhz\",\"count\":1613445485,\"quota\":{\"quantity\":5694942310463307922,\"unit\":\"hqyhwqw\"},\"startDate\":\"vx\",\"endDate\":\"bckmzeoxinhgr\"},\"provisioningIssues\":[\"twhlpuzjpce\"]},\"tags\":{\"phmsexroq\":\"zangprbfaxyxzlbc\",\"nfee\":\"ndktxfv\",\"bgnixxoww\":\"gpkrie\"},\"location\":\"yfwnw\",\"etag\":\"wxeiicrmpepk\",\"kind\":\"maxxijvskwsdgkjg\",\"sku\":{\"name\":\"cwrase\",\"tier\":\"Basic\",\"size\":\"cvo\",\"family\":\"woqartwy\",\"capacity\":25982768},\"id\":\"l\",\"name\":\"dvatdavuqm\",\"type\":\"bym\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -34,23 +34,24 @@ public void testListByResourceGroup() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.commitmentPlans().listByResourceGroup("ukdveksbuhoduc", com.azure.core.util.Context.NONE); + = manager.commitmentPlans().listByResourceGroup("dwgdn", com.azure.core.util.Context.NONE); - Assertions.assertEquals("szekbh", response.iterator().next().kind()); - Assertions.assertEquals("kaaggkreh", response.iterator().next().sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, response.iterator().next().sku().tier()); - Assertions.assertEquals("uybffljfiim", response.iterator().next().sku().size()); - Assertions.assertEquals("oags", response.iterator().next().sku().family()); - Assertions.assertEquals(674819146, response.iterator().next().sku().capacity()); - Assertions.assertEquals("usrexxf", response.iterator().next().tags().get("vsqw")); - Assertions.assertEquals("ohzilfmnli", response.iterator().next().location()); - Assertions.assertEquals("s", response.iterator().next().properties().commitmentPlanGuid()); - Assertions.assertEquals(HostingModel.PROVISIONED_WEB, response.iterator().next().properties().hostingModel()); - Assertions.assertEquals("ofqpmbhy", response.iterator().next().properties().planType()); - Assertions.assertEquals("drmmttjxoph", response.iterator().next().properties().current().tier()); - Assertions.assertEquals(1931127313, response.iterator().next().properties().current().count()); - Assertions.assertTrue(response.iterator().next().properties().autoRenew()); - Assertions.assertEquals("ympmlqoin", response.iterator().next().properties().next().tier()); - Assertions.assertEquals(302028974, response.iterator().next().properties().next().count()); + Assertions.assertEquals("wdhcebuvczldb", response.iterator().next().properties().commitmentPlanGuid()); + Assertions.assertEquals(HostingModel.CONNECTED_CONTAINER, + response.iterator().next().properties().hostingModel()); + Assertions.assertEquals("utbaaqgze", response.iterator().next().properties().planType()); + Assertions.assertEquals("clyzgs", response.iterator().next().properties().current().tier()); + Assertions.assertEquals(1559128353, response.iterator().next().properties().current().count()); + Assertions.assertFalse(response.iterator().next().properties().autoRenew()); + Assertions.assertEquals("snuudtelvhyibdr", response.iterator().next().properties().next().tier()); + Assertions.assertEquals(993231754, response.iterator().next().properties().next().count()); + Assertions.assertEquals("zangprbfaxyxzlbc", response.iterator().next().tags().get("phmsexroq")); + Assertions.assertEquals("yfwnw", response.iterator().next().location()); + Assertions.assertEquals("maxxijvskwsdgkjg", response.iterator().next().kind()); + Assertions.assertEquals("cwrase", response.iterator().next().sku().name()); + Assertions.assertEquals(SkuTier.BASIC, response.iterator().next().sku().tier()); + Assertions.assertEquals("cvo", response.iterator().next().sku().size()); + Assertions.assertEquals("woqartwy", response.iterator().next().sku().family()); + Assertions.assertEquals(25982768, response.iterator().next().sku().capacity()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListMockTests.java index 638ad17e646e..8482da201734 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -24,7 +24,7 @@ public final class CommitmentPlansListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"etag\":\"zdpv\",\"kind\":\"ojhpcnabxzfsn\",\"sku\":{\"name\":\"ytexvzilmhivzk\",\"tier\":\"Premium\",\"size\":\"cknrzda\",\"family\":\"skzptjxulweucyr\",\"capacity\":1704164450},\"tags\":{\"n\":\"ehmcgcje\",\"qnttmbq\":\"ehokamvfej\",\"kpysthhzagjf\":\"abzfivf\",\"ejgvkvebaqszllrz\":\"yyrlhgenu\"},\"location\":\"mmdqgmihzpimc\",\"properties\":{\"provisioningState\":\"Failed\",\"commitmentPlanGuid\":\"t\",\"hostingModel\":\"ProvisionedWeb\",\"planType\":\"logxsvtzar\",\"current\":{\"tier\":\"qnsqktcmb\",\"count\":69409464,\"quota\":{\"quantity\":8587009995008809809,\"unit\":\"kybtglwkzpgajsqj\"},\"startDate\":\"mqbmfuvqarwz\",\"endDate\":\"qreblui\"},\"autoRenew\":true,\"next\":{\"tier\":\"sfgtdmbvxekra\",\"count\":1209175157,\"quota\":{\"quantity\":2149845324732944468,\"unit\":\"twaokb\"},\"startDate\":\"lyttaaknwfr\",\"endDate\":\"bsmhpdujdiga\"},\"last\":{\"tier\":\"ekscbctnanqimwbz\",\"count\":882308602,\"quota\":{\"quantity\":1030326789921758335,\"unit\":\"awnsnlaimou\"},\"startDate\":\"ksqmudmfcoibi\",\"endDate\":\"iuswswj\"},\"provisioningIssues\":[\"qsj\"]},\"id\":\"tqqvy\",\"name\":\"scyrfwbivqv\",\"type\":\"gfuyzwv\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Moving\",\"commitmentPlanGuid\":\"wzrghsrlein\",\"hostingModel\":\"ProvisionedWeb\",\"planType\":\"jfncjwvuagfqw\",\"current\":{\"tier\":\"ngvmreuptrklzmij\",\"count\":332324374,\"quota\":{\"quantity\":4308660658181451635,\"unit\":\"vaghmpy\"},\"startDate\":\"lslrcigtzjc\",\"endDate\":\"xqlaps\"},\"autoRenew\":true,\"next\":{\"tier\":\"yxpavidnie\",\"count\":2038131960,\"quota\":{\"quantity\":482578146862158951,\"unit\":\"ezslp\"},\"startDate\":\"gcbdsvalpnptw\",\"endDate\":\"kx\"},\"last\":{\"tier\":\"zwugxyqvnjobfel\",\"count\":143469715,\"quota\":{\"quantity\":281284834646865242,\"unit\":\"gqlmfaewzgi\"},\"startDate\":\"jpxpqhttqhnmhkre\",\"endDate\":\"dsuxheqdgcrux\"},\"provisioningIssues\":[\"nymmqgwokmikpa\",\"fbmjxuvji\",\"fdvhaxdvwzae\",\"pphthdklmvetatla\"]},\"tags\":{\"vtooxrpo\":\"oixwgiksb\"},\"location\":\"phchgjtnhtukfaci\",\"etag\":\"bfntumeezbxvq\",\"kind\":\"nuvwcgasgomtmjzw\",\"sku\":{\"name\":\"qgo\",\"tier\":\"Basic\",\"size\":\"wwztj\",\"family\":\"kkhtgfredmlscgrl\",\"capacity\":1807188661},\"id\":\"aovjow\",\"name\":\"zhpabac\",\"type\":\"mlyotg\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -34,23 +34,23 @@ public void testList() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.commitmentPlans().list("slskkz", "xv", com.azure.core.util.Context.NONE); + = manager.commitmentPlans().list("zwjcaye", "zrransyb", com.azure.core.util.Context.NONE); - Assertions.assertEquals("ojhpcnabxzfsn", response.iterator().next().kind()); - Assertions.assertEquals("ytexvzilmhivzk", response.iterator().next().sku().name()); - Assertions.assertEquals(SkuTier.PREMIUM, response.iterator().next().sku().tier()); - Assertions.assertEquals("cknrzda", response.iterator().next().sku().size()); - Assertions.assertEquals("skzptjxulweucyr", response.iterator().next().sku().family()); - Assertions.assertEquals(1704164450, response.iterator().next().sku().capacity()); - Assertions.assertEquals("ehmcgcje", response.iterator().next().tags().get("n")); - Assertions.assertEquals("mmdqgmihzpimc", response.iterator().next().location()); - Assertions.assertEquals("t", response.iterator().next().properties().commitmentPlanGuid()); + Assertions.assertEquals("wzrghsrlein", response.iterator().next().properties().commitmentPlanGuid()); Assertions.assertEquals(HostingModel.PROVISIONED_WEB, response.iterator().next().properties().hostingModel()); - Assertions.assertEquals("logxsvtzar", response.iterator().next().properties().planType()); - Assertions.assertEquals("qnsqktcmb", response.iterator().next().properties().current().tier()); - Assertions.assertEquals(69409464, response.iterator().next().properties().current().count()); + Assertions.assertEquals("jfncjwvuagfqw", response.iterator().next().properties().planType()); + Assertions.assertEquals("ngvmreuptrklzmij", response.iterator().next().properties().current().tier()); + Assertions.assertEquals(332324374, response.iterator().next().properties().current().count()); Assertions.assertTrue(response.iterator().next().properties().autoRenew()); - Assertions.assertEquals("sfgtdmbvxekra", response.iterator().next().properties().next().tier()); - Assertions.assertEquals(1209175157, response.iterator().next().properties().next().count()); + Assertions.assertEquals("yxpavidnie", response.iterator().next().properties().next().tier()); + Assertions.assertEquals(2038131960, response.iterator().next().properties().next().count()); + Assertions.assertEquals("oixwgiksb", response.iterator().next().tags().get("vtooxrpo")); + Assertions.assertEquals("phchgjtnhtukfaci", response.iterator().next().location()); + Assertions.assertEquals("nuvwcgasgomtmjzw", response.iterator().next().kind()); + Assertions.assertEquals("qgo", response.iterator().next().sku().name()); + Assertions.assertEquals(SkuTier.BASIC, response.iterator().next().sku().tier()); + Assertions.assertEquals("wwztj", response.iterator().next().sku().size()); + Assertions.assertEquals("kkhtgfredmlscgrl", response.iterator().next().sku().family()); + Assertions.assertEquals(1807188661, response.iterator().next().sku().capacity()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListPlansBySubscriptionMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListPlansBySubscriptionMockTests.java index 035657cf0a78..04e4cbeb2407 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListPlansBySubscriptionMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentPlansListPlansBySubscriptionMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -24,7 +24,7 @@ public final class CommitmentPlansListPlansBySubscriptionMockTests { @Test public void testListPlansBySubscription() throws Exception { String responseStr - = "{\"value\":[{\"etag\":\"uwdxvqzxoebwgj\",\"kind\":\"ibanb\",\"sku\":{\"name\":\"pwtzvpakloz\",\"tier\":\"Standard\",\"size\":\"rpejp\",\"family\":\"s\",\"capacity\":848316015},\"tags\":{\"boy\":\"tkgsuxunrswgkpj\",\"okhu\":\"kebhuhkslgw\"},\"location\":\"ijyzcqypzqzufgsy\",\"properties\":{\"provisioningState\":\"Deleting\",\"commitmentPlanGuid\":\"dwtfx\",\"hostingModel\":\"Web\",\"planType\":\"ayamkncfgybmxs\",\"current\":{\"tier\":\"cuul\",\"count\":101641984,\"quota\":{\"quantity\":2076792601962568528,\"unit\":\"g\"},\"startDate\":\"djuxdbdljzgd\",\"endDate\":\"cvuq\"},\"autoRenew\":false,\"next\":{\"tier\":\"rqhbjnqogdxwbsfp\",\"count\":97810383,\"quota\":{\"quantity\":5506835104010652262,\"unit\":\"ecominxojjluxxd\"},\"startDate\":\"lzzdz\",\"endDate\":\"jmueza\"},\"last\":{\"tier\":\"ribqlotokh\",\"count\":187521223,\"quota\":{\"quantity\":3002733080564037178,\"unit\":\"cqwwxwj\"},\"startDate\":\"fgwhnkbtlwljs\",\"endDate\":\"ctsnldkpwol\"},\"provisioningIssues\":[\"ubxbteogfgfiijr\"]},\"id\":\"wlefksxqceazfpxg\",\"name\":\"m\",\"type\":\"vzvluyq\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Accepted\",\"commitmentPlanGuid\":\"lquvjezcjumvp\",\"hostingModel\":\"ConnectedContainer\",\"planType\":\"oyoiglkmiqw\",\"current\":{\"tier\":\"aclib\",\"count\":1409709431,\"quota\":{\"quantity\":2702741991134405206,\"unit\":\"adydg\"},\"startDate\":\"autw\",\"endDate\":\"exzgpmnmabedd\"},\"autoRenew\":true,\"next\":{\"tier\":\"d\",\"count\":1041054591,\"quota\":{\"quantity\":4398847964104172114,\"unit\":\"stcl\"},\"startDate\":\"rvwerfwxbsmtb\",\"endDate\":\"jehhci\"},\"last\":{\"tier\":\"dv\",\"count\":614061983,\"quota\":{\"quantity\":4532050487857187660,\"unit\":\"sqhtfpw\"},\"startDate\":\"byejuwyqwdqigm\",\"endDate\":\"ginz\"},\"provisioningIssues\":[\"ujkhnjcmrnkfmkh\",\"qtwmlmhjnqtqeahj\"]},\"tags\":{\"gpokddxejhhkvgu\":\"r\",\"wkqyns\":\"vtptbk\",\"vdxaexqokmyrljia\":\"gbvoffbkk\"},\"location\":\"bn\",\"etag\":\"rqlpbcjtrpz\",\"kind\":\"udivbxnhsqeaeonq\",\"sku\":{\"name\":\"wgdhu\",\"tier\":\"Standard\",\"size\":\"tzarogatmoljiy\",\"family\":\"pinm\",\"capacity\":1058665210},\"id\":\"neerzztrknsj\",\"name\":\"lugdybnhrxlelf\",\"type\":\"hkeizcp\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -36,21 +36,22 @@ public void testListPlansBySubscription() throws Exception { PagedIterable response = manager.commitmentPlans().listPlansBySubscription(com.azure.core.util.Context.NONE); - Assertions.assertEquals("ibanb", response.iterator().next().kind()); - Assertions.assertEquals("pwtzvpakloz", response.iterator().next().sku().name()); + Assertions.assertEquals("lquvjezcjumvp", response.iterator().next().properties().commitmentPlanGuid()); + Assertions.assertEquals(HostingModel.CONNECTED_CONTAINER, + response.iterator().next().properties().hostingModel()); + Assertions.assertEquals("oyoiglkmiqw", response.iterator().next().properties().planType()); + Assertions.assertEquals("aclib", response.iterator().next().properties().current().tier()); + Assertions.assertEquals(1409709431, response.iterator().next().properties().current().count()); + Assertions.assertTrue(response.iterator().next().properties().autoRenew()); + Assertions.assertEquals("d", response.iterator().next().properties().next().tier()); + Assertions.assertEquals(1041054591, response.iterator().next().properties().next().count()); + Assertions.assertEquals("r", response.iterator().next().tags().get("gpokddxejhhkvgu")); + Assertions.assertEquals("bn", response.iterator().next().location()); + Assertions.assertEquals("udivbxnhsqeaeonq", response.iterator().next().kind()); + Assertions.assertEquals("wgdhu", response.iterator().next().sku().name()); Assertions.assertEquals(SkuTier.STANDARD, response.iterator().next().sku().tier()); - Assertions.assertEquals("rpejp", response.iterator().next().sku().size()); - Assertions.assertEquals("s", response.iterator().next().sku().family()); - Assertions.assertEquals(848316015, response.iterator().next().sku().capacity()); - Assertions.assertEquals("tkgsuxunrswgkpj", response.iterator().next().tags().get("boy")); - Assertions.assertEquals("ijyzcqypzqzufgsy", response.iterator().next().location()); - Assertions.assertEquals("dwtfx", response.iterator().next().properties().commitmentPlanGuid()); - Assertions.assertEquals(HostingModel.WEB, response.iterator().next().properties().hostingModel()); - Assertions.assertEquals("ayamkncfgybmxs", response.iterator().next().properties().planType()); - Assertions.assertEquals("cuul", response.iterator().next().properties().current().tier()); - Assertions.assertEquals(101641984, response.iterator().next().properties().current().count()); - Assertions.assertFalse(response.iterator().next().properties().autoRenew()); - Assertions.assertEquals("rqhbjnqogdxwbsfp", response.iterator().next().properties().next().tier()); - Assertions.assertEquals(97810383, response.iterator().next().properties().next().count()); + Assertions.assertEquals("tzarogatmoljiy", response.iterator().next().sku().size()); + Assertions.assertEquals("pinm", response.iterator().next().sku().family()); + Assertions.assertEquals(1058665210, response.iterator().next().sku().capacity()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentQuotaTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentQuotaTests.java index d5737cdeb9f7..70c041b62577 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentQuotaTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentQuotaTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -11,17 +11,9 @@ public final class CommitmentQuotaTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - CommitmentQuota model = BinaryData.fromString("{\"quantity\":9120098526772116433,\"unit\":\"wuwprzqlv\"}") + CommitmentQuota model = BinaryData.fromString("{\"quantity\":353923599587916096,\"unit\":\"hxcr\"}") .toObject(CommitmentQuota.class); - Assertions.assertEquals(9120098526772116433L, model.quantity()); - Assertions.assertEquals("wuwprzqlv", model.unit()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommitmentQuota model = new CommitmentQuota().withQuantity(9120098526772116433L).withUnit("wuwprzqlv"); - model = BinaryData.fromObject(model).toObject(CommitmentQuota.class); - Assertions.assertEquals(9120098526772116433L, model.quantity()); - Assertions.assertEquals("wuwprzqlv", model.unit()); + Assertions.assertEquals(353923599587916096L, model.quantity()); + Assertions.assertEquals("hxcr", model.unit()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTierInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTierInnerTests.java index 4000a6d1d3d0..fed391924909 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTierInnerTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTierInnerTests.java @@ -1,13 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentTierInner; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentCost; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentQuota; import com.azure.resourcemanager.cognitiveservices.models.HostingModel; import org.junit.jupiter.api.Assertions; @@ -15,40 +13,17 @@ public final class CommitmentTierInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CommitmentTierInner model = BinaryData.fromString( - "{\"kind\":\"hzceuojgjrwjue\",\"skuName\":\"twm\",\"hostingModel\":\"ConnectedContainer\",\"planType\":\"dxwitx\",\"tier\":\"jawgqwg\",\"maxCount\":369820426,\"quota\":{\"quantity\":7904939230383834932,\"unit\":\"bkpyc\"},\"cost\":{\"commitmentMeterId\":\"wndnhj\",\"overageMeterId\":\"uwhvylwzbtdhxujz\"}}") + "{\"kind\":\"jbfqzdk\",\"skuName\":\"jyixhaf\",\"hostingModel\":\"ConnectedContainer\",\"planType\":\"xmbjroum\",\"tier\":\"n\",\"maxCount\":63326432,\"quota\":{\"quantity\":5729494135721513095,\"unit\":\"zgfxonjtpusl\"},\"cost\":{\"commitmentMeterId\":\"pvti\",\"overageMeterId\":\"zbpdbo\"}}") .toObject(CommitmentTierInner.class); - Assertions.assertEquals("hzceuojgjrwjue", model.kind()); - Assertions.assertEquals("twm", model.skuName()); + Assertions.assertEquals("jbfqzdk", model.kind()); + Assertions.assertEquals("jyixhaf", model.skuName()); Assertions.assertEquals(HostingModel.CONNECTED_CONTAINER, model.hostingModel()); - Assertions.assertEquals("dxwitx", model.planType()); - Assertions.assertEquals("jawgqwg", model.tier()); - Assertions.assertEquals(369820426, model.maxCount()); - Assertions.assertEquals(7904939230383834932L, model.quota().quantity()); - Assertions.assertEquals("bkpyc", model.quota().unit()); - Assertions.assertEquals("wndnhj", model.cost().commitmentMeterId()); - Assertions.assertEquals("uwhvylwzbtdhxujz", model.cost().overageMeterId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommitmentTierInner model = new CommitmentTierInner().withKind("hzceuojgjrwjue") - .withSkuName("twm") - .withHostingModel(HostingModel.CONNECTED_CONTAINER) - .withPlanType("dxwitx") - .withTier("jawgqwg") - .withMaxCount(369820426) - .withQuota(new CommitmentQuota().withQuantity(7904939230383834932L).withUnit("bkpyc")) - .withCost(new CommitmentCost().withCommitmentMeterId("wndnhj").withOverageMeterId("uwhvylwzbtdhxujz")); - model = BinaryData.fromObject(model).toObject(CommitmentTierInner.class); - Assertions.assertEquals("hzceuojgjrwjue", model.kind()); - Assertions.assertEquals("twm", model.skuName()); - Assertions.assertEquals(HostingModel.CONNECTED_CONTAINER, model.hostingModel()); - Assertions.assertEquals("dxwitx", model.planType()); - Assertions.assertEquals("jawgqwg", model.tier()); - Assertions.assertEquals(369820426, model.maxCount()); - Assertions.assertEquals(7904939230383834932L, model.quota().quantity()); - Assertions.assertEquals("bkpyc", model.quota().unit()); - Assertions.assertEquals("wndnhj", model.cost().commitmentMeterId()); - Assertions.assertEquals("uwhvylwzbtdhxujz", model.cost().overageMeterId()); + Assertions.assertEquals("xmbjroum", model.planType()); + Assertions.assertEquals("n", model.tier()); + Assertions.assertEquals(63326432, model.maxCount()); + Assertions.assertEquals(5729494135721513095L, model.quota().quantity()); + Assertions.assertEquals("zgfxonjtpusl", model.quota().unit()); + Assertions.assertEquals("pvti", model.cost().commitmentMeterId()); + Assertions.assertEquals("zbpdbo", model.cost().overageMeterId()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTierListResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTierListResultTests.java index 5c3cf7187656..54eadf8f9aa9 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTierListResultTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTierListResultTests.java @@ -1,26 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.CommitmentTierListResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.CommitmentTierListResult; import org.junit.jupiter.api.Assertions; public final class CommitmentTierListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CommitmentTierListResult model = BinaryData.fromString( - "{\"nextLink\":\"xpvgo\",\"value\":[{\"kind\":\"misgwbnb\",\"skuName\":\"ldawkzbaliourqha\",\"hostingModel\":\"DisconnectedContainer\",\"planType\":\"ashsfwxos\",\"tier\":\"z\",\"maxCount\":1177990560,\"quota\":{\"quantity\":8073809250590062964,\"unit\":\"oxdjebwpuc\"},\"cost\":{\"commitmentMeterId\":\"vo\",\"overageMeterId\":\"vmeueci\"}}]}") + "{\"nextLink\":\"eqvdsm\",\"value\":[{\"kind\":\"xq\",\"skuName\":\"hyhxa\",\"hostingModel\":\"Web\",\"planType\":\"awoijp\",\"tier\":\"tblxpkkwjdjodqhy\",\"maxCount\":713961317,\"quota\":{\"quantity\":3283756525859253014,\"unit\":\"ehllizhceum\"},\"cost\":{\"commitmentMeterId\":\"dkadppyibn\",\"overageMeterId\":\"ladywrxwhyd\"}},{\"kind\":\"uvvadswzsnu\",\"skuName\":\"mlowuowhl\",\"hostingModel\":\"ConnectedContainer\",\"planType\":\"y\",\"tier\":\"ouvblgmo\",\"maxCount\":1778384866,\"quota\":{\"quantity\":6500965449481894855,\"unit\":\"wtdvrfmvli\"},\"cost\":{\"commitmentMeterId\":\"jdrqcrjidhftu\",\"overageMeterId\":\"hdxlw\"}}]}") .toObject(CommitmentTierListResult.class); - Assertions.assertEquals("xpvgo", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CommitmentTierListResult model = new CommitmentTierListResult().withNextLink("xpvgo"); - model = BinaryData.fromObject(model).toObject(CommitmentTierListResult.class); - Assertions.assertEquals("xpvgo", model.nextLink()); + Assertions.assertEquals("eqvdsm", model.nextLink()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTiersListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTiersListMockTests.java index 05cb39f6a1d0..0e5ac32c84be 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTiersListMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CommitmentTiersListMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -23,7 +23,7 @@ public final class CommitmentTiersListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"kind\":\"tixldzyyfytpqs\",\"skuName\":\"ymmpujivy\",\"hostingModel\":\"ConnectedContainer\",\"planType\":\"uvsmbms\",\"tier\":\"oyovwz\",\"maxCount\":1207112039,\"quota\":{\"quantity\":3063978981670782952,\"unit\":\"fgvmx\"},\"cost\":{\"commitmentMeterId\":\"cvtlubseskvc\",\"overageMeterId\":\"rtrh\"}}]}"; + = "{\"value\":[{\"kind\":\"xtdlxwmvcdkucp\",\"skuName\":\"yafrwr\",\"hostingModel\":\"ProvisionedWeb\",\"planType\":\"ge\",\"tier\":\"mkrspnrsjsemlzo\",\"maxCount\":530144742,\"quota\":{\"quantity\":524466359099310378,\"unit\":\"petexutikelpmw\"},\"cost\":{\"commitmentMeterId\":\"ub\",\"overageMeterId\":\"dhvos\"}}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,17 +33,17 @@ public void testList() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.commitmentTiers().list("nokzwjjz", com.azure.core.util.Context.NONE); + = manager.commitmentTiers().list("jnmcvjbssfcriqx", com.azure.core.util.Context.NONE); - Assertions.assertEquals("tixldzyyfytpqs", response.iterator().next().kind()); - Assertions.assertEquals("ymmpujivy", response.iterator().next().skuName()); - Assertions.assertEquals(HostingModel.CONNECTED_CONTAINER, response.iterator().next().hostingModel()); - Assertions.assertEquals("uvsmbms", response.iterator().next().planType()); - Assertions.assertEquals("oyovwz", response.iterator().next().tier()); - Assertions.assertEquals(1207112039, response.iterator().next().maxCount()); - Assertions.assertEquals(3063978981670782952L, response.iterator().next().quota().quantity()); - Assertions.assertEquals("fgvmx", response.iterator().next().quota().unit()); - Assertions.assertEquals("cvtlubseskvc", response.iterator().next().cost().commitmentMeterId()); - Assertions.assertEquals("rtrh", response.iterator().next().cost().overageMeterId()); + Assertions.assertEquals("xtdlxwmvcdkucp", response.iterator().next().kind()); + Assertions.assertEquals("yafrwr", response.iterator().next().skuName()); + Assertions.assertEquals(HostingModel.PROVISIONED_WEB, response.iterator().next().hostingModel()); + Assertions.assertEquals("ge", response.iterator().next().planType()); + Assertions.assertEquals("mkrspnrsjsemlzo", response.iterator().next().tier()); + Assertions.assertEquals(530144742, response.iterator().next().maxCount()); + Assertions.assertEquals(524466359099310378L, response.iterator().next().quota().quantity()); + Assertions.assertEquals("petexutikelpmw", response.iterator().next().quota().unit()); + Assertions.assertEquals("ub", response.iterator().next().cost().commitmentMeterId()); + Assertions.assertEquals("dhvos", response.iterator().next().cost().overageMeterId()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ConnectionManagedIdentityTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ConnectionManagedIdentityTests.java index 24ed7b688b38..9bedef881c69 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ConnectionManagedIdentityTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ConnectionManagedIdentityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,18 +12,18 @@ public final class ConnectionManagedIdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ConnectionManagedIdentity model - = BinaryData.fromString("{\"clientId\":\"dptysprqs\",\"resourceId\":\"zxojpslsv\"}") + = BinaryData.fromString("{\"clientId\":\"jxtxrdc\",\"resourceId\":\"jvidttge\"}") .toObject(ConnectionManagedIdentity.class); - Assertions.assertEquals("dptysprqs", model.clientId()); - Assertions.assertEquals("zxojpslsv", model.resourceId()); + Assertions.assertEquals("jxtxrdc", model.clientId()); + Assertions.assertEquals("jvidttge", model.resourceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ConnectionManagedIdentity model - = new ConnectionManagedIdentity().withClientId("dptysprqs").withResourceId("zxojpslsv"); + = new ConnectionManagedIdentity().withClientId("jxtxrdc").withResourceId("jvidttge"); model = BinaryData.fromObject(model).toObject(ConnectionManagedIdentity.class); - Assertions.assertEquals("dptysprqs", model.clientId()); - Assertions.assertEquals("zxojpslsv", model.resourceId()); + Assertions.assertEquals("jxtxrdc", model.clientId()); + Assertions.assertEquals("jvidttge", model.resourceId()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ConnectionPersonalAccessTokenTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ConnectionPersonalAccessTokenTests.java index e4258c29d40d..4913b5b393c8 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ConnectionPersonalAccessTokenTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ConnectionPersonalAccessTokenTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,14 +12,14 @@ public final class ConnectionPersonalAccessTokenTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ConnectionPersonalAccessToken model - = BinaryData.fromString("{\"pat\":\"azisgyk\"}").toObject(ConnectionPersonalAccessToken.class); - Assertions.assertEquals("azisgyk", model.pat()); + = BinaryData.fromString("{\"pat\":\"myccx\"}").toObject(ConnectionPersonalAccessToken.class); + Assertions.assertEquals("myccx", model.pat()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ConnectionPersonalAccessToken model = new ConnectionPersonalAccessToken().withPat("azisgyk"); + ConnectionPersonalAccessToken model = new ConnectionPersonalAccessToken().withPat("myccx"); model = BinaryData.fromObject(model).toObject(ConnectionPersonalAccessToken.class); - Assertions.assertEquals("azisgyk", model.pat()); + Assertions.assertEquals("myccx", model.pat()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ConnectionPropertiesV2BasicResourceArmPaginatedResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ConnectionPropertiesV2BasicResourceArmPaginatedResultTests.java index 54b6401b2c14..39cac78f0ae0 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ConnectionPropertiesV2BasicResourceArmPaginatedResultTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ConnectionPropertiesV2BasicResourceArmPaginatedResultTests.java @@ -1,106 +1,34 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; +import com.azure.resourcemanager.cognitiveservices.implementation.models.ConnectionPropertiesV2BasicResourceArmPaginatedResult; import com.azure.resourcemanager.cognitiveservices.models.ConnectionCategory; -import com.azure.resourcemanager.cognitiveservices.models.ConnectionPropertiesV2; -import com.azure.resourcemanager.cognitiveservices.models.ConnectionPropertiesV2BasicResourceArmPaginatedResult; import com.azure.resourcemanager.cognitiveservices.models.ManagedPERequirement; import com.azure.resourcemanager.cognitiveservices.models.ManagedPEStatus; import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; import org.junit.jupiter.api.Assertions; public final class ConnectionPropertiesV2BasicResourceArmPaginatedResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ConnectionPropertiesV2BasicResourceArmPaginatedResult model = BinaryData.fromString( - "{\"nextLink\":\"fkspzhzmtksjci\",\"value\":[{\"properties\":{\"authType\":\"ConnectionPropertiesV2\",\"category\":\"AzureOpenAI\",\"createdByWorkspaceArmId\":\"cdgljplkeuac\",\"error\":\"omflrytswfp\",\"expiryTime\":\"2021-10-02T12:53:04Z\",\"group\":\"AzureAI\",\"isSharedToAll\":false,\"metadata\":{\"qjjyslurl\":\"skw\",\"slsrhmpq\":\"shhkvpedw\",\"dcbrwimuvq\":\"wwsko\"},\"peRequirement\":\"Required\",\"peStatus\":\"NotApplicable\",\"sharedUserList\":[\"rrleaesinuqt\",\"jqo\",\"bpihehcecybmrqbr\",\"bbmpxdlvykfre\"],\"target\":\"rseqwjksghudgz\",\"useWorkspaceManagedIdentity\":true},\"id\":\"jggsvo\",\"name\":\"jkxibda\",\"type\":\"hrkmdyomkxfbvfbh\"},{\"properties\":{\"authType\":\"ConnectionPropertiesV2\",\"category\":\"AzureOpenAI\",\"createdByWorkspaceArmId\":\"hpwpgddeimawzovg\",\"error\":\"um\",\"expiryTime\":\"2021-01-21T03:14:36Z\",\"group\":\"File\",\"isSharedToAll\":false,\"metadata\":{\"nsq\":\"tbw\",\"ytwvczcswkacve\":\"wxwcomli\"},\"peRequirement\":\"NotApplicable\",\"peStatus\":\"Active\",\"sharedUserList\":[\"hbwrnfxtgddpqth\"],\"target\":\"n\",\"useWorkspaceManagedIdentity\":true},\"id\":\"yank\",\"name\":\"oe\",\"type\":\"swankltytmh\"},{\"properties\":{\"authType\":\"ConnectionPropertiesV2\",\"category\":\"MongoDbV2\",\"createdByWorkspaceArmId\":\"nnhdrl\",\"error\":\"gjc\",\"expiryTime\":\"2021-02-02T03:00:16Z\",\"group\":\"Database\",\"isSharedToAll\":false,\"metadata\":{\"eeczgfbu\":\"wyw\",\"ycsxzu\":\"klelssxb\"},\"peRequirement\":\"Required\",\"peStatus\":\"Active\",\"sharedUserList\":[\"desqplpvmjcdo\",\"wb\"],\"target\":\"yvteowxvgpiudeu\",\"useWorkspaceManagedIdentity\":false},\"id\":\"zec\",\"name\":\"axwk\",\"type\":\"fykhvuhxepmru\"}]}") + "{\"nextLink\":\"oogwxhnsduugwb\",\"value\":[{\"properties\":{\"authType\":\"ConnectionPropertiesV2\",\"category\":\"GoogleAdWords\",\"createdByWorkspaceArmId\":\"q\",\"error\":\"uarenlv\",\"expiryTime\":\"2021-07-13T00:13:17Z\",\"group\":\"File\",\"isSharedToAll\":true,\"metadata\":{\"yfedevjbo\":\"fvv\",\"minqcym\":\"lcqxypokk\"},\"peRequirement\":\"NotRequired\",\"peStatus\":\"Active\",\"sharedUserList\":[\"xxewu\",\"invudbch\",\"qdtvqecrqctmxx\"],\"target\":\"ddm\",\"useWorkspaceManagedIdentity\":true},\"id\":\"ytxzvtznapxbanno\",\"name\":\"voxczytpr\",\"type\":\"nwvroevytlyokrr\"}]}") .toObject(ConnectionPropertiesV2BasicResourceArmPaginatedResult.class); - Assertions.assertEquals("fkspzhzmtksjci", model.nextLink()); - Assertions.assertEquals(ConnectionCategory.AZURE_OPEN_AI, model.value().get(0).properties().category()); - Assertions.assertEquals("omflrytswfp", model.value().get(0).properties().error()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-02T12:53:04Z"), + Assertions.assertEquals("oogwxhnsduugwb", model.nextLink()); + Assertions.assertEquals(ConnectionCategory.GOOGLE_AD_WORDS, model.value().get(0).properties().category()); + Assertions.assertEquals("uarenlv", model.value().get(0).properties().error()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-13T00:13:17Z"), model.value().get(0).properties().expiryTime()); - Assertions.assertFalse(model.value().get(0).properties().isSharedToAll()); - Assertions.assertEquals("skw", model.value().get(0).properties().metadata().get("qjjyslurl")); - Assertions.assertEquals(ManagedPERequirement.REQUIRED, model.value().get(0).properties().peRequirement()); - Assertions.assertEquals(ManagedPEStatus.NOT_APPLICABLE, model.value().get(0).properties().peStatus()); - Assertions.assertEquals("rrleaesinuqt", model.value().get(0).properties().sharedUserList().get(0)); - Assertions.assertEquals("rseqwjksghudgz", model.value().get(0).properties().target()); + Assertions.assertTrue(model.value().get(0).properties().isSharedToAll()); + Assertions.assertEquals("fvv", model.value().get(0).properties().metadata().get("yfedevjbo")); + Assertions.assertEquals(ManagedPERequirement.NOT_REQUIRED, model.value().get(0).properties().peRequirement()); + Assertions.assertEquals(ManagedPEStatus.ACTIVE, model.value().get(0).properties().peStatus()); + Assertions.assertEquals("xxewu", model.value().get(0).properties().sharedUserList().get(0)); + Assertions.assertEquals("ddm", model.value().get(0).properties().target()); Assertions.assertTrue(model.value().get(0).properties().useWorkspaceManagedIdentity()); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectionPropertiesV2BasicResourceArmPaginatedResult model - = new ConnectionPropertiesV2BasicResourceArmPaginatedResult().withNextLink("fkspzhzmtksjci") - .withValue( - Arrays.asList( - new ConnectionPropertiesV2BasicResourceInner() - .withProperties(new ConnectionPropertiesV2().withCategory(ConnectionCategory.AZURE_OPEN_AI) - .withError("omflrytswfp") - .withExpiryTime(OffsetDateTime.parse("2021-10-02T12:53:04Z")) - .withIsSharedToAll(false) - .withMetadata(mapOf("qjjyslurl", "skw", "slsrhmpq", "shhkvpedw", "dcbrwimuvq", "wwsko")) - .withPeRequirement(ManagedPERequirement.REQUIRED) - .withPeStatus(ManagedPEStatus.NOT_APPLICABLE) - .withSharedUserList( - Arrays.asList("rrleaesinuqt", "jqo", "bpihehcecybmrqbr", "bbmpxdlvykfre")) - .withTarget("rseqwjksghudgz") - .withUseWorkspaceManagedIdentity(true)), - new ConnectionPropertiesV2BasicResourceInner() - .withProperties(new ConnectionPropertiesV2().withCategory(ConnectionCategory.AZURE_OPEN_AI) - .withError("um") - .withExpiryTime(OffsetDateTime.parse("2021-01-21T03:14:36Z")) - .withIsSharedToAll(false) - .withMetadata(mapOf("nsq", "tbw", "ytwvczcswkacve", "wxwcomli")) - .withPeRequirement(ManagedPERequirement.NOT_APPLICABLE) - .withPeStatus(ManagedPEStatus.ACTIVE) - .withSharedUserList(Arrays.asList("hbwrnfxtgddpqth")) - .withTarget("n") - .withUseWorkspaceManagedIdentity(true)), - new ConnectionPropertiesV2BasicResourceInner() - .withProperties(new ConnectionPropertiesV2().withCategory(ConnectionCategory.MONGO_DB_V2) - .withError("gjc") - .withExpiryTime(OffsetDateTime.parse("2021-02-02T03:00:16Z")) - .withIsSharedToAll(false) - .withMetadata(mapOf("eeczgfbu", "wyw", "ycsxzu", "klelssxb")) - .withPeRequirement(ManagedPERequirement.REQUIRED) - .withPeStatus(ManagedPEStatus.ACTIVE) - .withSharedUserList(Arrays.asList("desqplpvmjcdo", "wb")) - .withTarget("yvteowxvgpiudeu") - .withUseWorkspaceManagedIdentity(false)))); - model = BinaryData.fromObject(model).toObject(ConnectionPropertiesV2BasicResourceArmPaginatedResult.class); - Assertions.assertEquals("fkspzhzmtksjci", model.nextLink()); - Assertions.assertEquals(ConnectionCategory.AZURE_OPEN_AI, model.value().get(0).properties().category()); - Assertions.assertEquals("omflrytswfp", model.value().get(0).properties().error()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-02T12:53:04Z"), - model.value().get(0).properties().expiryTime()); - Assertions.assertFalse(model.value().get(0).properties().isSharedToAll()); - Assertions.assertEquals("skw", model.value().get(0).properties().metadata().get("qjjyslurl")); - Assertions.assertEquals(ManagedPERequirement.REQUIRED, model.value().get(0).properties().peRequirement()); - Assertions.assertEquals(ManagedPEStatus.NOT_APPLICABLE, model.value().get(0).properties().peStatus()); - Assertions.assertEquals("rrleaesinuqt", model.value().get(0).properties().sharedUserList().get(0)); - Assertions.assertEquals("rseqwjksghudgz", model.value().get(0).properties().target()); - Assertions.assertTrue(model.value().get(0).properties().useWorkspaceManagedIdentity()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ConnectionPropertiesV2BasicResourceInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ConnectionPropertiesV2BasicResourceInnerTests.java index 9a0f59df5e32..7f840392ce5f 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ConnectionPropertiesV2BasicResourceInnerTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ConnectionPropertiesV2BasicResourceInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -20,43 +20,44 @@ public final class ConnectionPropertiesV2BasicResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ConnectionPropertiesV2BasicResourceInner model = BinaryData.fromString( - "{\"properties\":{\"authType\":\"ConnectionPropertiesV2\",\"category\":\"GenericContainerRegistry\",\"createdByWorkspaceArmId\":\"zdq\",\"error\":\"hcspo\",\"expiryTime\":\"2021-07-30T02:24Z\",\"group\":\"AzureAI\",\"isSharedToAll\":false,\"metadata\":{\"oichdlpnfpubnt\":\"etgbebjfulb\",\"aelcat\":\"batzviqsows\",\"cwmjvlg\":\"cjuhplrvkm\"},\"peRequirement\":\"NotRequired\",\"peStatus\":\"Inactive\",\"sharedUserList\":[\"y\",\"izrzb\"],\"target\":\"sfxsf\",\"useWorkspaceManagedIdentity\":false},\"id\":\"vtmva\",\"name\":\"bwidql\",\"type\":\"hukoveofizrv\"}") + "{\"properties\":{\"authType\":\"ConnectionPropertiesV2\",\"category\":\"OracleCloudStorage\",\"createdByWorkspaceArmId\":\"jiuqhibtozi\",\"error\":\"wjedmurrxxgew\",\"expiryTime\":\"2021-06-22T20:24:57Z\",\"group\":\"GenericProtocol\",\"isSharedToAll\":false,\"metadata\":{\"gcl\":\"pzoyhlfbcg\",\"qinjipnwjf\":\"xoe\",\"foiyjwpfilk\":\"jqlafcbahhpzp\",\"ogphuartvtiu\":\"kkholvdndvia\"},\"peRequirement\":\"NotRequired\",\"peStatus\":\"Active\",\"sharedUserList\":[\"mnahmnxh\",\"xjqirwrweoox\"],\"target\":\"i\",\"useWorkspaceManagedIdentity\":false},\"id\":\"rsnewmozqvbubqma\",\"name\":\"hsycxhxzgaz\",\"type\":\"taboidvmf\"}") .toObject(ConnectionPropertiesV2BasicResourceInner.class); - Assertions.assertEquals(ConnectionCategory.GENERIC_CONTAINER_REGISTRY, model.properties().category()); - Assertions.assertEquals("hcspo", model.properties().error()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-30T02:24Z"), model.properties().expiryTime()); + Assertions.assertEquals(ConnectionCategory.ORACLE_CLOUD_STORAGE, model.properties().category()); + Assertions.assertEquals("wjedmurrxxgew", model.properties().error()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-22T20:24:57Z"), model.properties().expiryTime()); Assertions.assertFalse(model.properties().isSharedToAll()); - Assertions.assertEquals("etgbebjfulb", model.properties().metadata().get("oichdlpnfpubnt")); + Assertions.assertEquals("pzoyhlfbcg", model.properties().metadata().get("gcl")); Assertions.assertEquals(ManagedPERequirement.NOT_REQUIRED, model.properties().peRequirement()); - Assertions.assertEquals(ManagedPEStatus.INACTIVE, model.properties().peStatus()); - Assertions.assertEquals("y", model.properties().sharedUserList().get(0)); - Assertions.assertEquals("sfxsf", model.properties().target()); + Assertions.assertEquals(ManagedPEStatus.ACTIVE, model.properties().peStatus()); + Assertions.assertEquals("mnahmnxh", model.properties().sharedUserList().get(0)); + Assertions.assertEquals("i", model.properties().target()); Assertions.assertFalse(model.properties().useWorkspaceManagedIdentity()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ConnectionPropertiesV2BasicResourceInner model = new ConnectionPropertiesV2BasicResourceInner() - .withProperties(new ConnectionPropertiesV2().withCategory(ConnectionCategory.GENERIC_CONTAINER_REGISTRY) - .withError("hcspo") - .withExpiryTime(OffsetDateTime.parse("2021-07-30T02:24Z")) + .withProperties(new ConnectionPropertiesV2().withCategory(ConnectionCategory.ORACLE_CLOUD_STORAGE) + .withError("wjedmurrxxgew") + .withExpiryTime(OffsetDateTime.parse("2021-06-22T20:24:57Z")) .withIsSharedToAll(false) - .withMetadata(mapOf("oichdlpnfpubnt", "etgbebjfulb", "aelcat", "batzviqsows", "cwmjvlg", "cjuhplrvkm")) + .withMetadata(mapOf("gcl", "pzoyhlfbcg", "qinjipnwjf", "xoe", "foiyjwpfilk", "jqlafcbahhpzp", + "ogphuartvtiu", "kkholvdndvia")) .withPeRequirement(ManagedPERequirement.NOT_REQUIRED) - .withPeStatus(ManagedPEStatus.INACTIVE) - .withSharedUserList(Arrays.asList("y", "izrzb")) - .withTarget("sfxsf") + .withPeStatus(ManagedPEStatus.ACTIVE) + .withSharedUserList(Arrays.asList("mnahmnxh", "xjqirwrweoox")) + .withTarget("i") .withUseWorkspaceManagedIdentity(false)); model = BinaryData.fromObject(model).toObject(ConnectionPropertiesV2BasicResourceInner.class); - Assertions.assertEquals(ConnectionCategory.GENERIC_CONTAINER_REGISTRY, model.properties().category()); - Assertions.assertEquals("hcspo", model.properties().error()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-30T02:24Z"), model.properties().expiryTime()); + Assertions.assertEquals(ConnectionCategory.ORACLE_CLOUD_STORAGE, model.properties().category()); + Assertions.assertEquals("wjedmurrxxgew", model.properties().error()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-22T20:24:57Z"), model.properties().expiryTime()); Assertions.assertFalse(model.properties().isSharedToAll()); - Assertions.assertEquals("etgbebjfulb", model.properties().metadata().get("oichdlpnfpubnt")); + Assertions.assertEquals("pzoyhlfbcg", model.properties().metadata().get("gcl")); Assertions.assertEquals(ManagedPERequirement.NOT_REQUIRED, model.properties().peRequirement()); - Assertions.assertEquals(ManagedPEStatus.INACTIVE, model.properties().peStatus()); - Assertions.assertEquals("y", model.properties().sharedUserList().get(0)); - Assertions.assertEquals("sfxsf", model.properties().target()); + Assertions.assertEquals(ManagedPEStatus.ACTIVE, model.properties().peStatus()); + Assertions.assertEquals("mnahmnxh", model.properties().sharedUserList().get(0)); + Assertions.assertEquals("i", model.properties().target()); Assertions.assertFalse(model.properties().useWorkspaceManagedIdentity()); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ConnectionPropertiesV2Tests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ConnectionPropertiesV2Tests.java index 7f1e1518fdcf..df03dbd9c413 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ConnectionPropertiesV2Tests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ConnectionPropertiesV2Tests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -19,42 +19,42 @@ public final class ConnectionPropertiesV2Tests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ConnectionPropertiesV2 model = BinaryData.fromString( - "{\"authType\":\"ConnectionPropertiesV2\",\"category\":\"Jira\",\"createdByWorkspaceArmId\":\"jmvl\",\"error\":\"z\",\"expiryTime\":\"2021-04-07T06:34:10Z\",\"group\":\"GenericProtocol\",\"isSharedToAll\":false,\"metadata\":{\"uyjucejikzo\":\"lfojuidjp\",\"ikyju\":\"ovvtzejetjkln\",\"bqzolxr\":\"k\"},\"peRequirement\":\"Required\",\"peStatus\":\"Inactive\",\"sharedUserList\":[\"rhtgvgzpcrrkol\",\"w\",\"mjsmwr\",\"kcdxfzzzw\"],\"target\":\"afitlhguynuchlg\",\"useWorkspaceManagedIdentity\":false}") + "{\"authType\":\"ConnectionPropertiesV2\",\"category\":\"Netezza\",\"createdByWorkspaceArmId\":\"ubowsepdfgkm\",\"error\":\"herngb\",\"expiryTime\":\"2021-05-03T04:12:26Z\",\"group\":\"ServicesAndApps\",\"isSharedToAll\":false,\"metadata\":{\"pnulaiywzej\":\"tobkauxofshfph\",\"llndnpd\":\"whslwkoj\",\"fugsnnfhyetefy\":\"rpqaf\"},\"peRequirement\":\"NotRequired\",\"peStatus\":\"NotApplicable\",\"sharedUserList\":[\"jgtixr\",\"vzuyturmlmu\",\"wolba\"],\"target\":\"ropions\",\"useWorkspaceManagedIdentity\":false}") .toObject(ConnectionPropertiesV2.class); - Assertions.assertEquals(ConnectionCategory.JIRA, model.category()); - Assertions.assertEquals("z", model.error()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-07T06:34:10Z"), model.expiryTime()); + Assertions.assertEquals(ConnectionCategory.NETEZZA, model.category()); + Assertions.assertEquals("herngb", model.error()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-03T04:12:26Z"), model.expiryTime()); Assertions.assertFalse(model.isSharedToAll()); - Assertions.assertEquals("lfojuidjp", model.metadata().get("uyjucejikzo")); - Assertions.assertEquals(ManagedPERequirement.REQUIRED, model.peRequirement()); - Assertions.assertEquals(ManagedPEStatus.INACTIVE, model.peStatus()); - Assertions.assertEquals("rhtgvgzpcrrkol", model.sharedUserList().get(0)); - Assertions.assertEquals("afitlhguynuchlg", model.target()); + Assertions.assertEquals("tobkauxofshfph", model.metadata().get("pnulaiywzej")); + Assertions.assertEquals(ManagedPERequirement.NOT_REQUIRED, model.peRequirement()); + Assertions.assertEquals(ManagedPEStatus.NOT_APPLICABLE, model.peStatus()); + Assertions.assertEquals("jgtixr", model.sharedUserList().get(0)); + Assertions.assertEquals("ropions", model.target()); Assertions.assertFalse(model.useWorkspaceManagedIdentity()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ConnectionPropertiesV2 model = new ConnectionPropertiesV2().withCategory(ConnectionCategory.JIRA) - .withError("z") - .withExpiryTime(OffsetDateTime.parse("2021-04-07T06:34:10Z")) + ConnectionPropertiesV2 model = new ConnectionPropertiesV2().withCategory(ConnectionCategory.NETEZZA) + .withError("herngb") + .withExpiryTime(OffsetDateTime.parse("2021-05-03T04:12:26Z")) .withIsSharedToAll(false) - .withMetadata(mapOf("uyjucejikzo", "lfojuidjp", "ikyju", "ovvtzejetjkln", "bqzolxr", "k")) - .withPeRequirement(ManagedPERequirement.REQUIRED) - .withPeStatus(ManagedPEStatus.INACTIVE) - .withSharedUserList(Arrays.asList("rhtgvgzpcrrkol", "w", "mjsmwr", "kcdxfzzzw")) - .withTarget("afitlhguynuchlg") + .withMetadata(mapOf("pnulaiywzej", "tobkauxofshfph", "llndnpd", "whslwkoj", "fugsnnfhyetefy", "rpqaf")) + .withPeRequirement(ManagedPERequirement.NOT_REQUIRED) + .withPeStatus(ManagedPEStatus.NOT_APPLICABLE) + .withSharedUserList(Arrays.asList("jgtixr", "vzuyturmlmu", "wolba")) + .withTarget("ropions") .withUseWorkspaceManagedIdentity(false); model = BinaryData.fromObject(model).toObject(ConnectionPropertiesV2.class); - Assertions.assertEquals(ConnectionCategory.JIRA, model.category()); - Assertions.assertEquals("z", model.error()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-07T06:34:10Z"), model.expiryTime()); + Assertions.assertEquals(ConnectionCategory.NETEZZA, model.category()); + Assertions.assertEquals("herngb", model.error()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-03T04:12:26Z"), model.expiryTime()); Assertions.assertFalse(model.isSharedToAll()); - Assertions.assertEquals("lfojuidjp", model.metadata().get("uyjucejikzo")); - Assertions.assertEquals(ManagedPERequirement.REQUIRED, model.peRequirement()); - Assertions.assertEquals(ManagedPEStatus.INACTIVE, model.peStatus()); - Assertions.assertEquals("rhtgvgzpcrrkol", model.sharedUserList().get(0)); - Assertions.assertEquals("afitlhguynuchlg", model.target()); + Assertions.assertEquals("tobkauxofshfph", model.metadata().get("pnulaiywzej")); + Assertions.assertEquals(ManagedPERequirement.NOT_REQUIRED, model.peRequirement()); + Assertions.assertEquals(ManagedPEStatus.NOT_APPLICABLE, model.peStatus()); + Assertions.assertEquals("jgtixr", model.sharedUserList().get(0)); + Assertions.assertEquals("ropions", model.target()); Assertions.assertFalse(model.useWorkspaceManagedIdentity()); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ConnectionSharedAccessSignatureTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ConnectionSharedAccessSignatureTests.java index cbf52b38dd89..36d16c5f06eb 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ConnectionSharedAccessSignatureTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ConnectionSharedAccessSignatureTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,14 +12,14 @@ public final class ConnectionSharedAccessSignatureTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ConnectionSharedAccessSignature model - = BinaryData.fromString("{\"sas\":\"unssxlghieegjl\"}").toObject(ConnectionSharedAccessSignature.class); - Assertions.assertEquals("unssxlghieegjl", model.sas()); + = BinaryData.fromString("{\"sas\":\"xdfzantkw\"}").toObject(ConnectionSharedAccessSignature.class); + Assertions.assertEquals("xdfzantkw", model.sas()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ConnectionSharedAccessSignature model = new ConnectionSharedAccessSignature().withSas("unssxlghieegjl"); + ConnectionSharedAccessSignature model = new ConnectionSharedAccessSignature().withSas("xdfzantkw"); model = BinaryData.fromObject(model).toObject(ConnectionSharedAccessSignature.class); - Assertions.assertEquals("unssxlghieegjl", model.sas()); + Assertions.assertEquals("xdfzantkw", model.sas()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ConnectionUpdateContentTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ConnectionUpdateContentTests.java index 6e754d854c62..f19cf5d3b1b3 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ConnectionUpdateContentTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ConnectionUpdateContentTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -20,43 +20,43 @@ public final class ConnectionUpdateContentTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ConnectionUpdateContent model = BinaryData.fromString( - "{\"properties\":{\"authType\":\"ConnectionPropertiesV2\",\"category\":\"SapOpenHub\",\"createdByWorkspaceArmId\":\"mozusgzvlnsnnjz\",\"error\":\"afolpymwamxqzrag\",\"expiryTime\":\"2021-05-09T12:37:58Z\",\"group\":\"Database\",\"isSharedToAll\":false,\"metadata\":{\"ejchcsrlz\":\"lajv\",\"dwv\":\"nmzlanru\",\"mqrhvthl\":\"phcnzqtpj\"},\"peRequirement\":\"NotRequired\",\"peStatus\":\"Inactive\",\"sharedUserList\":[\"mlzzhzdtxetlgyd\",\"hqvlnnpxybafiqg\",\"aarbgjekg\",\"klbyulidwcw\"],\"target\":\"zegjonfhjirwgdn\",\"useWorkspaceManagedIdentity\":false}}") + "{\"properties\":{\"authType\":\"ConnectionPropertiesV2\",\"category\":\"WebTable\",\"createdByWorkspaceArmId\":\"dyynfsvkhgb\",\"error\":\"ta\",\"expiryTime\":\"2021-03-05T18:11:46Z\",\"group\":\"NoSQL\",\"isSharedToAll\":true,\"metadata\":{\"rne\":\"hp\"},\"peRequirement\":\"NotRequired\",\"peStatus\":\"Inactive\",\"sharedUserList\":[\"gkhnmgbrouxddbh\",\"hpfpazjzoywjxhp\",\"ulontacnpqwteht\"],\"target\":\"vrh\",\"useWorkspaceManagedIdentity\":false}}") .toObject(ConnectionUpdateContent.class); - Assertions.assertEquals(ConnectionCategory.SAP_OPEN_HUB, model.properties().category()); - Assertions.assertEquals("afolpymwamxqzrag", model.properties().error()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-09T12:37:58Z"), model.properties().expiryTime()); - Assertions.assertFalse(model.properties().isSharedToAll()); - Assertions.assertEquals("lajv", model.properties().metadata().get("ejchcsrlz")); + Assertions.assertEquals(ConnectionCategory.WEB_TABLE, model.properties().category()); + Assertions.assertEquals("ta", model.properties().error()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-05T18:11:46Z"), model.properties().expiryTime()); + Assertions.assertTrue(model.properties().isSharedToAll()); + Assertions.assertEquals("hp", model.properties().metadata().get("rne")); Assertions.assertEquals(ManagedPERequirement.NOT_REQUIRED, model.properties().peRequirement()); Assertions.assertEquals(ManagedPEStatus.INACTIVE, model.properties().peStatus()); - Assertions.assertEquals("mlzzhzdtxetlgyd", model.properties().sharedUserList().get(0)); - Assertions.assertEquals("zegjonfhjirwgdn", model.properties().target()); + Assertions.assertEquals("gkhnmgbrouxddbh", model.properties().sharedUserList().get(0)); + Assertions.assertEquals("vrh", model.properties().target()); Assertions.assertFalse(model.properties().useWorkspaceManagedIdentity()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ConnectionUpdateContent model = new ConnectionUpdateContent() - .withProperties(new ConnectionPropertiesV2().withCategory(ConnectionCategory.SAP_OPEN_HUB) - .withError("afolpymwamxqzrag") - .withExpiryTime(OffsetDateTime.parse("2021-05-09T12:37:58Z")) - .withIsSharedToAll(false) - .withMetadata(mapOf("ejchcsrlz", "lajv", "dwv", "nmzlanru", "mqrhvthl", "phcnzqtpj")) + .withProperties(new ConnectionPropertiesV2().withCategory(ConnectionCategory.WEB_TABLE) + .withError("ta") + .withExpiryTime(OffsetDateTime.parse("2021-03-05T18:11:46Z")) + .withIsSharedToAll(true) + .withMetadata(mapOf("rne", "hp")) .withPeRequirement(ManagedPERequirement.NOT_REQUIRED) .withPeStatus(ManagedPEStatus.INACTIVE) - .withSharedUserList(Arrays.asList("mlzzhzdtxetlgyd", "hqvlnnpxybafiqg", "aarbgjekg", "klbyulidwcw")) - .withTarget("zegjonfhjirwgdn") + .withSharedUserList(Arrays.asList("gkhnmgbrouxddbh", "hpfpazjzoywjxhp", "ulontacnpqwteht")) + .withTarget("vrh") .withUseWorkspaceManagedIdentity(false)); model = BinaryData.fromObject(model).toObject(ConnectionUpdateContent.class); - Assertions.assertEquals(ConnectionCategory.SAP_OPEN_HUB, model.properties().category()); - Assertions.assertEquals("afolpymwamxqzrag", model.properties().error()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-09T12:37:58Z"), model.properties().expiryTime()); - Assertions.assertFalse(model.properties().isSharedToAll()); - Assertions.assertEquals("lajv", model.properties().metadata().get("ejchcsrlz")); + Assertions.assertEquals(ConnectionCategory.WEB_TABLE, model.properties().category()); + Assertions.assertEquals("ta", model.properties().error()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-05T18:11:46Z"), model.properties().expiryTime()); + Assertions.assertTrue(model.properties().isSharedToAll()); + Assertions.assertEquals("hp", model.properties().metadata().get("rne")); Assertions.assertEquals(ManagedPERequirement.NOT_REQUIRED, model.properties().peRequirement()); Assertions.assertEquals(ManagedPEStatus.INACTIVE, model.properties().peStatus()); - Assertions.assertEquals("mlzzhzdtxetlgyd", model.properties().sharedUserList().get(0)); - Assertions.assertEquals("zegjonfhjirwgdn", model.properties().target()); + Assertions.assertEquals("gkhnmgbrouxddbh", model.properties().sharedUserList().get(0)); + Assertions.assertEquals("vrh", model.properties().target()); Assertions.assertFalse(model.properties().useWorkspaceManagedIdentity()); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CustomBlocklistConfigTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CustomBlocklistConfigTests.java index 75ed871a2127..6b12fd325d66 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CustomBlocklistConfigTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CustomBlocklistConfigTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -13,21 +13,21 @@ public final class CustomBlocklistConfigTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CustomBlocklistConfig model - = BinaryData.fromString("{\"source\":\"Completion\",\"blocklistName\":\"widf\",\"blocking\":true}") + = BinaryData.fromString("{\"source\":\"PreRun\",\"blocklistName\":\"rvimjwosytxitcsk\",\"blocking\":false}") .toObject(CustomBlocklistConfig.class); - Assertions.assertEquals("widf", model.blocklistName()); - Assertions.assertTrue(model.blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, model.source()); + Assertions.assertEquals("rvimjwosytxitcsk", model.blocklistName()); + Assertions.assertFalse(model.blocking()); + Assertions.assertEquals(RaiPolicyContentSource.PRE_RUN, model.source()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CustomBlocklistConfig model = new CustomBlocklistConfig().withBlocklistName("widf") - .withBlocking(true) - .withSource(RaiPolicyContentSource.COMPLETION); + CustomBlocklistConfig model = new CustomBlocklistConfig().withBlocklistName("rvimjwosytxitcsk") + .withBlocking(false) + .withSource(RaiPolicyContentSource.PRE_RUN); model = BinaryData.fromObject(model).toObject(CustomBlocklistConfig.class); - Assertions.assertEquals("widf", model.blocklistName()); - Assertions.assertTrue(model.blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, model.source()); + Assertions.assertEquals("rvimjwosytxitcsk", model.blocklistName()); + Assertions.assertFalse(model.blocking()); + Assertions.assertEquals(RaiPolicyContentSource.PRE_RUN, model.source()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CustomTopicConfigTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CustomTopicConfigTests.java index f2d3683d5f6c..0bba4154cb44 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CustomTopicConfigTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/CustomTopicConfigTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -13,21 +13,21 @@ public final class CustomTopicConfigTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CustomTopicConfig model - = BinaryData.fromString("{\"source\":\"Completion\",\"topicName\":\"hoqca\",\"blocking\":true}") + = BinaryData.fromString("{\"source\":\"PostToolCall\",\"topicName\":\"hlyfjhdgqgg\",\"blocking\":false}") .toObject(CustomTopicConfig.class); - Assertions.assertEquals("hoqca", model.topicName()); - Assertions.assertTrue(model.blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, model.source()); + Assertions.assertEquals("hlyfjhdgqgg", model.topicName()); + Assertions.assertFalse(model.blocking()); + Assertions.assertEquals(RaiPolicyContentSource.POST_TOOL_CALL, model.source()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CustomTopicConfig model = new CustomTopicConfig().withTopicName("hoqca") - .withBlocking(true) - .withSource(RaiPolicyContentSource.COMPLETION); + CustomTopicConfig model = new CustomTopicConfig().withTopicName("hlyfjhdgqgg") + .withBlocking(false) + .withSource(RaiPolicyContentSource.POST_TOOL_CALL); model = BinaryData.fromObject(model).toObject(CustomTopicConfig.class); - Assertions.assertEquals("hoqca", model.topicName()); - Assertions.assertTrue(model.blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, model.source()); + Assertions.assertEquals("hlyfjhdgqgg", model.topicName()); + Assertions.assertFalse(model.blocking()); + Assertions.assertEquals(RaiPolicyContentSource.POST_TOOL_CALL, model.source()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingInnerTests.java index 5ebcbbe08ab6..3d3e819954eb 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingInnerTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -15,19 +15,19 @@ public final class DefenderForAISettingInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DefenderForAISettingInner model = BinaryData.fromString( - "{\"etag\":\"henlusfnr\",\"tags\":{\"gepuslvyjtc\":\"xtxrdcqtjvidt\",\"esfuught\":\"uwkasiz\"},\"properties\":{\"state\":\"Disabled\"},\"id\":\"jxeygtuhxu\",\"name\":\"cbuewmrswnjlxuz\",\"type\":\"hwpusxj\"}") + "{\"properties\":{\"state\":\"Disabled\"},\"etag\":\"ivqiheb\",\"tags\":{\"izvcjfe\":\"wbzuwfmdurage\",\"ggbqi\":\"isdju\",\"m\":\"kxkbsazgakgacyr\",\"pv\":\"dmspof\"},\"id\":\"rylniofrzg\",\"name\":\"zjedmstkvnlv\",\"type\":\"bcuiiz\"}") .toObject(DefenderForAISettingInner.class); - Assertions.assertEquals("xtxrdcqtjvidt", model.tags().get("gepuslvyjtc")); + Assertions.assertEquals("wbzuwfmdurage", model.tags().get("izvcjfe")); Assertions.assertEquals(DefenderForAISettingState.DISABLED, model.state()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DefenderForAISettingInner model - = new DefenderForAISettingInner().withTags(mapOf("gepuslvyjtc", "xtxrdcqtjvidt", "esfuught", "uwkasiz")) - .withState(DefenderForAISettingState.DISABLED); + DefenderForAISettingInner model = new DefenderForAISettingInner() + .withTags(mapOf("izvcjfe", "wbzuwfmdurage", "ggbqi", "isdju", "m", "kxkbsazgakgacyr", "pv", "dmspof")) + .withState(DefenderForAISettingState.DISABLED); model = BinaryData.fromObject(model).toObject(DefenderForAISettingInner.class); - Assertions.assertEquals("xtxrdcqtjvidt", model.tags().get("gepuslvyjtc")); + Assertions.assertEquals("wbzuwfmdurage", model.tags().get("izvcjfe")); Assertions.assertEquals(DefenderForAISettingState.DISABLED, model.state()); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingPropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingPropertiesTests.java index 3d8c274cd459..b8ab96b5f086 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingPropertiesTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingResultTests.java index 2207477d44cb..b895d0a4a04f 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingResultTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingResultTests.java @@ -1,50 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.DefenderForAISettingInner; -import com.azure.resourcemanager.cognitiveservices.models.DefenderForAISettingResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.DefenderForAISettingResult; import com.azure.resourcemanager.cognitiveservices.models.DefenderForAISettingState; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; import org.junit.jupiter.api.Assertions; public final class DefenderForAISettingResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DefenderForAISettingResult model = BinaryData.fromString( - "{\"nextLink\":\"hs\",\"value\":[{\"etag\":\"jpllndnpdwrpq\",\"tags\":{\"oc\":\"fugsnnfhyetefy\",\"vzuyturmlmu\":\"ctfjgtixr\",\"iropionszon\":\"wolba\"},\"properties\":{\"state\":\"Enabled\"},\"id\":\"jinnix\",\"name\":\"awrtmjfjmyccxlz\",\"type\":\"coxovn\"}]}") + "{\"nextLink\":\"f\",\"value\":[{\"properties\":{\"state\":\"Enabled\"},\"etag\":\"ibmikostbzb\",\"tags\":{\"phzfylsgcrp\":\"buqny\",\"fwyfwlwxjwet\":\"bcunezzceze\"},\"id\":\"sihclafzvaylp\",\"name\":\"rsqqwztcm\",\"type\":\"qkc\"},{\"properties\":{\"state\":\"Enabled\"},\"etag\":\"xfe\",\"tags\":{\"ylkkshkbffmbm\":\"kjexfdeqvhp\",\"gjxsnptfu\":\"zjrgyww\"},\"id\":\"icgaao\",\"name\":\"pttaqutd\",\"type\":\"wemxswvruunzz\"},{\"properties\":{\"state\":\"Enabled\"},\"etag\":\"fkimrtix\",\"tags\":{\"ixmonstshiyxg\":\"fqyinljqepqw\",\"irdsvuwcob\":\"elfclducc\"},\"id\":\"gstmninwjizciln\",\"name\":\"hgshe\",\"type\":\"jtbxqmuluxlx\"}]}") .toObject(DefenderForAISettingResult.class); - Assertions.assertEquals("hs", model.nextLink()); - Assertions.assertEquals("fugsnnfhyetefy", model.value().get(0).tags().get("oc")); + Assertions.assertEquals("f", model.nextLink()); + Assertions.assertEquals("buqny", model.value().get(0).tags().get("phzfylsgcrp")); Assertions.assertEquals(DefenderForAISettingState.ENABLED, model.value().get(0).state()); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForAISettingResult model = new DefenderForAISettingResult().withNextLink("hs") - .withValue(Arrays.asList(new DefenderForAISettingInner() - .withTags(mapOf("oc", "fugsnnfhyetefy", "vzuyturmlmu", "ctfjgtixr", "iropionszon", "wolba")) - .withState(DefenderForAISettingState.ENABLED))); - model = BinaryData.fromObject(model).toObject(DefenderForAISettingResult.class); - Assertions.assertEquals("hs", model.nextLink()); - Assertions.assertEquals("fugsnnfhyetefy", model.value().get(0).tags().get("oc")); - Assertions.assertEquals(DefenderForAISettingState.ENABLED, model.value().get(0).state()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsCreateOrUpdateWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsCreateOrUpdateWithResponseMockTests.java index 6d85bf60aebd..b2081b3f47a8 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsCreateOrUpdateWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsCreateOrUpdateWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -24,7 +24,7 @@ public final class DefenderForAISettingsCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"etag\":\"laslgacizux\",\"tags\":{\"doejtighsxjpyt\":\"rwpewsa\"},\"properties\":{\"state\":\"Disabled\"},\"id\":\"lahovuuwx\",\"name\":\"mehjnhjioti\",\"type\":\"fbbcngkegxcypxbb\"}"; + = "{\"properties\":{\"state\":\"Enabled\"},\"etag\":\"imtwuuhau\",\"tags\":{\"zjy\":\"kwmnfeub\",\"nqd\":\"kwfugiphrrkuu\",\"opueo\":\"rhzz\"},\"id\":\"svwlujop\",\"name\":\"nibittoztjdqumq\",\"type\":\"fmwc\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -34,14 +34,14 @@ public void testCreateOrUpdateWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); DefenderForAISetting response = manager.defenderForAISettings() - .define("rcqxgcbvzarmqc") - .withExistingAccount("fhxrzfr", "vztiucwviqllukh") - .withTags(mapOf("qwh", "brdvce", "uwvorbalkjn", "txnmxgnmguz", "lltqstqkqs", "kbd")) + .define("yqxadyfhbmw") + .withExistingAccount("zedv", "iabvnsrgek") + .withTags(mapOf("jrz", "qjsgyzst", "iitt", "rknsfdrlduyeh", "csozjv", "gyuqwrldaxurfqa")) .withState(DefenderForAISettingState.ENABLED) .create(); - Assertions.assertEquals("rwpewsa", response.tags().get("doejtighsxjpyt")); - Assertions.assertEquals(DefenderForAISettingState.DISABLED, response.state()); + Assertions.assertEquals("kwmnfeub", response.tags().get("zjy")); + Assertions.assertEquals(DefenderForAISettingState.ENABLED, response.state()); } // Use "Map.of" if available diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsGetWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsGetWithResponseMockTests.java index 6b389ce359ef..b83baa2eeb97 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsGetWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsGetWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -22,7 +22,7 @@ public final class DefenderForAISettingsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"etag\":\"akvlbishj\",\"tags\":{\"fgcdiykkcxw\":\"aptuoskaoizjix\",\"dmuqohhi\":\"ujvqynvavit\"},\"properties\":{\"state\":\"Disabled\"},\"id\":\"uddrwjc\",\"name\":\"jbrhlhpvzadbw\",\"type\":\"nnin\"}"; + = "{\"properties\":{\"state\":\"Enabled\"},\"etag\":\"jlz\",\"tags\":{\"qlhchwhrktjle\":\"oiwyayyzivrmitc\",\"nsmy\":\"fibfiplhx\"},\"id\":\"owly\",\"name\":\"yzmudsqcmhnx\",\"type\":\"zbuw\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,10 +32,10 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); DefenderForAISetting response = manager.defenderForAISettings() - .getWithResponse("xwr", "lvzkl", "vbgikyj", com.azure.core.util.Context.NONE) + .getWithResponse("urxf", "zqjim", "jtgzj", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("aptuoskaoizjix", response.tags().get("fgcdiykkcxw")); - Assertions.assertEquals(DefenderForAISettingState.DISABLED, response.state()); + Assertions.assertEquals("oiwyayyzivrmitc", response.tags().get("qlhchwhrktjle")); + Assertions.assertEquals(DefenderForAISettingState.ENABLED, response.state()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsListMockTests.java index a78fd5cef723..c3d81ed4229c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsListMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DefenderForAISettingsListMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -23,7 +23,7 @@ public final class DefenderForAISettingsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"etag\":\"nx\",\"tags\":{\"nzuz\":\"rihufoihppiybxv\",\"cscpiuzvkunh\":\"bgk\"},\"properties\":{\"state\":\"Enabled\"},\"id\":\"ktirzka\",\"name\":\"gpucdocfq\",\"type\":\"lwgofm\"}]}"; + = "{\"value\":[{\"properties\":{\"state\":\"Disabled\"},\"etag\":\"hmumkz\",\"tags\":{\"rwnhkgqggoxsst\":\"czd\",\"cwmhlymgnukxrk\":\"ivrakfrryn\",\"zaudgjtfbclakkuc\":\"mjpequlr\"},\"id\":\"wnhczbutou\",\"name\":\"gjtirjwayhic\",\"type\":\"qwwvgwkslvl\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,10 +32,10 @@ public void testList() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.defenderForAISettings() - .list("hdidrmuhkahmjedb", "ucvkhhwmjpjbw", com.azure.core.util.Context.NONE); + PagedIterable response + = manager.defenderForAISettings().list("dmac", "bkvnrpbjrmvg", com.azure.core.util.Context.NONE); - Assertions.assertEquals("rihufoihppiybxv", response.iterator().next().tags().get("nzuz")); - Assertions.assertEquals(DefenderForAISettingState.ENABLED, response.iterator().next().state()); + Assertions.assertEquals("czd", response.iterator().next().tags().get("rwnhkgqggoxsst")); + Assertions.assertEquals(DefenderForAISettingState.DISABLED, response.iterator().next().state()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsPurgeMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsPurgeMockTests.java index 492c52e9282f..802846d5f85d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsPurgeMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeletedAccountsPurgeMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -27,7 +27,7 @@ public void testPurge() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.deletedAccounts().purge("eialwvskb", "hzacaqtyltco", "cujp", com.azure.core.util.Context.NONE); + manager.deletedAccounts().purge("eljtiahxmfqryarv", "x", "qbglcjkaysp", com.azure.core.util.Context.NONE); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentCapacitySettingsTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentCapacitySettingsTests.java index 1d1f98b18d03..5824755ff22a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentCapacitySettingsTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentCapacitySettingsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,18 +12,18 @@ public final class DeploymentCapacitySettingsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DeploymentCapacitySettings model - = BinaryData.fromString("{\"designatedCapacity\":572432734,\"priority\":1916559931}") + = BinaryData.fromString("{\"designatedCapacity\":779451406,\"priority\":1043675485}") .toObject(DeploymentCapacitySettings.class); - Assertions.assertEquals(572432734, model.designatedCapacity()); - Assertions.assertEquals(1916559931, model.priority()); + Assertions.assertEquals(779451406, model.designatedCapacity()); + Assertions.assertEquals(1043675485, model.priority()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { DeploymentCapacitySettings model - = new DeploymentCapacitySettings().withDesignatedCapacity(572432734).withPriority(1916559931); + = new DeploymentCapacitySettings().withDesignatedCapacity(779451406).withPriority(1043675485); model = BinaryData.fromObject(model).toObject(DeploymentCapacitySettings.class); - Assertions.assertEquals(572432734, model.designatedCapacity()); - Assertions.assertEquals(1916559931, model.priority()); + Assertions.assertEquals(779451406, model.designatedCapacity()); + Assertions.assertEquals(1043675485, model.priority()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentScaleSettingsTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentScaleSettingsTests.java index 382f7e5559e9..51f5283a731c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentScaleSettingsTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentScaleSettingsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -13,18 +13,18 @@ public final class DeploymentScaleSettingsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DeploymentScaleSettings model = BinaryData - .fromString("{\"scaleType\":\"Standard\",\"capacity\":1531171615,\"activeCapacity\":1354395459}") + .fromString("{\"scaleType\":\"Standard\",\"capacity\":1091212098,\"activeCapacity\":2077643232}") .toObject(DeploymentScaleSettings.class); Assertions.assertEquals(DeploymentScaleType.STANDARD, model.scaleType()); - Assertions.assertEquals(1531171615, model.capacity()); + Assertions.assertEquals(1091212098, model.capacity()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { DeploymentScaleSettings model - = new DeploymentScaleSettings().withScaleType(DeploymentScaleType.STANDARD).withCapacity(1531171615); + = new DeploymentScaleSettings().withScaleType(DeploymentScaleType.STANDARD).withCapacity(1091212098); model = BinaryData.fromObject(model).toObject(DeploymentScaleSettings.class); Assertions.assertEquals(DeploymentScaleType.STANDARD, model.scaleType()); - Assertions.assertEquals(1531171615, model.capacity()); + Assertions.assertEquals(1091212098, model.capacity()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentSkuListResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentSkuListResultTests.java index b971d54d2e7e..d1621fa50262 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentSkuListResultTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentSkuListResultTests.java @@ -1,26 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentSkuListResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.DeploymentSkuListResult; import org.junit.jupiter.api.Assertions; public final class DeploymentSkuListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DeploymentSkuListResult model = BinaryData.fromString( - "{\"nextLink\":\"sx\",\"value\":[{\"resourceType\":\"lolp\",\"sku\":{\"name\":\"ksrpqv\",\"tier\":\"Basic\",\"size\":\"aehtwd\",\"family\":\"ftswibyrcdlbhsh\",\"capacity\":206253573},\"capacity\":{\"minimum\":1827993805,\"maximum\":168808861,\"step\":1926362561,\"default\":2010330726,\"allowedValues\":[56359046,1926336888]}},{\"resourceType\":\"c\",\"sku\":{\"name\":\"dcpnmdyodnw\",\"tier\":\"Premium\",\"size\":\"jc\",\"family\":\"hlt\",\"capacity\":841084025},\"capacity\":{\"minimum\":1501738623,\"maximum\":1485792464,\"step\":1627588082,\"default\":836619519,\"allowedValues\":[165046754,1077177476]}}]}") + "{\"nextLink\":\"yvpycanuzbpzk\",\"value\":[{\"resourceType\":\"wbcrnwbmehhseyv\",\"sku\":{\"name\":\"srtslhspkdeem\",\"tier\":\"Enterprise\",\"size\":\"xagkvtmelmqkrh\",\"family\":\"vljua\",\"capacity\":836090349},\"capacity\":{\"minimum\":27642330,\"maximum\":1312333731,\"step\":1098069205,\"default\":2135401961,\"allowedValues\":[595850477]}},{\"resourceType\":\"qpv\",\"sku\":{\"name\":\"dmwsrcrgvxpvgomz\",\"tier\":\"Basic\",\"size\":\"sgwbnbbeld\",\"family\":\"k\",\"capacity\":585337534},\"capacity\":{\"minimum\":113893877,\"maximum\":12612409,\"step\":568079364,\"default\":997736872,\"allowedValues\":[1039189909,33232567,1375924345]}},{\"resourceType\":\"sfwxosowzxc\",\"sku\":{\"name\":\"i\",\"tier\":\"Standard\",\"size\":\"xdje\",\"family\":\"pucwwfvovbvme\",\"capacity\":321338352},\"capacity\":{\"minimum\":783632971,\"maximum\":297335263,\"step\":360614729,\"default\":1628145340,\"allowedValues\":[745513484,347281810,1026391011,1178618137]}}]}") .toObject(DeploymentSkuListResult.class); - Assertions.assertEquals("sx", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeploymentSkuListResult model = new DeploymentSkuListResult().withNextLink("sx"); - model = BinaryData.fromObject(model).toObject(DeploymentSkuListResult.class); - Assertions.assertEquals("sx", model.nextLink()); + Assertions.assertEquals("yvpycanuzbpzk", model.nextLink()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsDeleteMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsDeleteMockTests.java index 24dc096652af..49b4d50599ab 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsDeleteMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsDeleteMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -27,7 +27,7 @@ public void testDelete() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.deployments().delete("cgxvrpj", "vczuodacpune", "tepdjxqes", com.azure.core.util.Context.NONE); + manager.deployments().delete("bauzlqbtxxw", "f", "njzudr", com.azure.core.util.Context.NONE); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsListSkusMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsListSkusMockTests.java index e26c9219cd7a..e1cb950caa7e 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsListSkusMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DeploymentsListSkusMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -23,7 +23,7 @@ public final class DeploymentsListSkusMockTests { @Test public void testListSkus() throws Exception { String responseStr - = "{\"value\":[{\"resourceType\":\"eskwxeg\",\"sku\":{\"name\":\"hrg\",\"tier\":\"Standard\",\"size\":\"ctmjtsghpbcbc\",\"family\":\"arpzeqacdldtzm\",\"capacity\":1809146245},\"capacity\":{\"minimum\":698852842,\"maximum\":1337763239,\"step\":1691859102,\"default\":611241791,\"allowedValues\":[731388560,1810636595,830792514,2133411593]}}]}"; + = "{\"value\":[{\"resourceType\":\"qmzjqrbrpvnmdy\",\"sku\":{\"name\":\"ebojtjppglao\",\"tier\":\"Free\",\"size\":\"pjtnqjilaywkdcw\",\"family\":\"syril\",\"capacity\":1144693410},\"capacity\":{\"minimum\":1172997704,\"maximum\":1645404857,\"step\":1997720075,\"default\":2119969330,\"allowedValues\":[1926400340,1400157774,874887359]}}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,18 +33,18 @@ public void testListSkus() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.deployments().listSkus("oy", "uiylpc", "aewse", com.azure.core.util.Context.NONE); + = manager.deployments().listSkus("tmujdtvmc", "yymffhmjp", "dnyxfzuvrz", com.azure.core.util.Context.NONE); - Assertions.assertEquals("eskwxeg", response.iterator().next().resourceType()); - Assertions.assertEquals("hrg", response.iterator().next().sku().name()); - Assertions.assertEquals(SkuTier.STANDARD, response.iterator().next().sku().tier()); - Assertions.assertEquals("ctmjtsghpbcbc", response.iterator().next().sku().size()); - Assertions.assertEquals("arpzeqacdldtzm", response.iterator().next().sku().family()); - Assertions.assertEquals(1809146245, response.iterator().next().sku().capacity()); - Assertions.assertEquals(698852842, response.iterator().next().capacity().minimum()); - Assertions.assertEquals(1337763239, response.iterator().next().capacity().maximum()); - Assertions.assertEquals(1691859102, response.iterator().next().capacity().step()); - Assertions.assertEquals(611241791, response.iterator().next().capacity().defaultProperty()); - Assertions.assertEquals(731388560, response.iterator().next().capacity().allowedValues().get(0)); + Assertions.assertEquals("qmzjqrbrpvnmdy", response.iterator().next().resourceType()); + Assertions.assertEquals("ebojtjppglao", response.iterator().next().sku().name()); + Assertions.assertEquals(SkuTier.FREE, response.iterator().next().sku().tier()); + Assertions.assertEquals("pjtnqjilaywkdcw", response.iterator().next().sku().size()); + Assertions.assertEquals("syril", response.iterator().next().sku().family()); + Assertions.assertEquals(1144693410, response.iterator().next().sku().capacity()); + Assertions.assertEquals(1172997704, response.iterator().next().capacity().minimum()); + Assertions.assertEquals(1645404857, response.iterator().next().capacity().maximum()); + Assertions.assertEquals(1997720075, response.iterator().next().capacity().step()); + Assertions.assertEquals(2119969330, response.iterator().next().capacity().defaultProperty()); + Assertions.assertEquals(1926400340, response.iterator().next().capacity().allowedValues().get(0)); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DomainAvailabilityInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DomainAvailabilityInnerTests.java index 253730445174..dafebdd96c74 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DomainAvailabilityInnerTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/DomainAvailabilityInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,27 +12,12 @@ public final class DomainAvailabilityInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DomainAvailabilityInner model = BinaryData.fromString( - "{\"isSubdomainAvailable\":true,\"reason\":\"zrpzb\",\"subdomainName\":\"ckqqzqioxiysui\",\"type\":\"ynkedyatrwyhqmib\",\"kind\":\"hwit\"}") + "{\"isSubdomainAvailable\":false,\"reason\":\"jddeqsrdeupewnw\",\"subdomainName\":\"itjz\",\"type\":\"lusarh\",\"kind\":\"fcqhsmyurkd\"}") .toObject(DomainAvailabilityInner.class); - Assertions.assertTrue(model.isSubdomainAvailable()); - Assertions.assertEquals("zrpzb", model.reason()); - Assertions.assertEquals("ckqqzqioxiysui", model.subdomainName()); - Assertions.assertEquals("ynkedyatrwyhqmib", model.type()); - Assertions.assertEquals("hwit", model.kind()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DomainAvailabilityInner model = new DomainAvailabilityInner().withIsSubdomainAvailable(true) - .withReason("zrpzb") - .withSubdomainName("ckqqzqioxiysui") - .withType("ynkedyatrwyhqmib") - .withKind("hwit"); - model = BinaryData.fromObject(model).toObject(DomainAvailabilityInner.class); - Assertions.assertTrue(model.isSubdomainAvailable()); - Assertions.assertEquals("zrpzb", model.reason()); - Assertions.assertEquals("ckqqzqioxiysui", model.subdomainName()); - Assertions.assertEquals("ynkedyatrwyhqmib", model.type()); - Assertions.assertEquals("hwit", model.kind()); + Assertions.assertFalse(model.isSubdomainAvailable()); + Assertions.assertEquals("jddeqsrdeupewnw", model.reason()); + Assertions.assertEquals("itjz", model.subdomainName()); + Assertions.assertEquals("lusarh", model.type()); + Assertions.assertEquals("fcqhsmyurkd", model.kind()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/FoundryAutoUpgradeTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/FoundryAutoUpgradeTests.java new file mode 100644 index 000000000000..0acf74fb37aa --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/FoundryAutoUpgradeTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.models.FoundryAutoUpgrade; +import com.azure.resourcemanager.cognitiveservices.models.FoundryAutoUpgradeMode; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class FoundryAutoUpgradeTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FoundryAutoUpgrade model = BinaryData.fromString( + "{\"mode\":\"Disabled\",\"plannedByMicrosoft\":false,\"statusReason\":\"sycbkbfk\",\"scheduledAt\":\"2021-04-13T09:52:22Z\"}") + .toObject(FoundryAutoUpgrade.class); + Assertions.assertEquals(FoundryAutoUpgradeMode.DISABLED, model.mode()); + Assertions.assertFalse(model.plannedByMicrosoft()); + Assertions.assertEquals("sycbkbfk", model.statusReason()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-13T09:52:22Z"), model.scheduledAt()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FoundryAutoUpgrade model = new FoundryAutoUpgrade().withMode(FoundryAutoUpgradeMode.DISABLED) + .withPlannedByMicrosoft(false) + .withStatusReason("sycbkbfk") + .withScheduledAt(OffsetDateTime.parse("2021-04-13T09:52:22Z")); + model = BinaryData.fromObject(model).toObject(FoundryAutoUpgrade.class); + Assertions.assertEquals(FoundryAutoUpgradeMode.DISABLED, model.mode()); + Assertions.assertFalse(model.plannedByMicrosoft()); + Assertions.assertEquals("sycbkbfk", model.statusReason()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-13T09:52:22Z"), model.scheduledAt()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/FqdnOutboundRuleTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/FqdnOutboundRuleTests.java new file mode 100644 index 000000000000..15eff2f9a06e --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/FqdnOutboundRuleTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.models.FqdnOutboundRule; +import com.azure.resourcemanager.cognitiveservices.models.RuleCategory; +import com.azure.resourcemanager.cognitiveservices.models.RuleStatus; +import org.junit.jupiter.api.Assertions; + +public final class FqdnOutboundRuleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FqdnOutboundRule model = BinaryData.fromString( + "{\"type\":\"FQDN\",\"destination\":\"ylyl\",\"category\":\"Recommended\",\"status\":\"Failed\",\"errorInformation\":\"tgqztwhghmup\",\"parentRuleNames\":[\"jtcdxabbujftaben\",\"bklqpxz\",\"cafeddw\",\"nlzafwxudgnh\"]}") + .toObject(FqdnOutboundRule.class); + Assertions.assertEquals(RuleCategory.RECOMMENDED, model.category()); + Assertions.assertEquals(RuleStatus.FAILED, model.status()); + Assertions.assertEquals("ylyl", model.destination()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FqdnOutboundRule model = new FqdnOutboundRule().withCategory(RuleCategory.RECOMMENDED) + .withStatus(RuleStatus.FAILED) + .withDestination("ylyl"); + model = BinaryData.fromObject(model).toObject(FqdnOutboundRule.class); + Assertions.assertEquals(RuleCategory.RECOMMENDED, model.category()); + Assertions.assertEquals(RuleStatus.FAILED, model.status()); + Assertions.assertEquals("ylyl", model.destination()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/HostedAgentDeploymentTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/HostedAgentDeploymentTests.java new file mode 100644 index 000000000000..6465b73e5670 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/HostedAgentDeploymentTests.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.models.AgentDeploymentState; +import com.azure.resourcemanager.cognitiveservices.models.AgentProtocol; +import com.azure.resourcemanager.cognitiveservices.models.AgentProtocolVersion; +import com.azure.resourcemanager.cognitiveservices.models.HostedAgentDeployment; +import com.azure.resourcemanager.cognitiveservices.models.VersionedAgentReference; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class HostedAgentDeploymentTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + HostedAgentDeployment model = BinaryData.fromString( + "{\"deploymentType\":\"Hosted\",\"minReplicas\":1569621723,\"maxReplicas\":917747025,\"displayName\":\"yimsfayorpr\",\"deploymentId\":\"kj\",\"state\":\"Deleted\",\"protocols\":[{\"protocol\":\"Responses\",\"version\":\"smjkwynqxaekqsy\"},{\"protocol\":\"A2A\",\"version\":\"tqpkevmy\"},{\"protocol\":\"Responses\",\"version\":\"rspxklur\"}],\"agents\":[{\"agentVersion\":\"gxannnoytzposewx\",\"agentId\":\"pxvkqma\",\"agentName\":\"xvpif\"}],\"provisioningState\":\"Deleting\",\"description\":\"fyzyzeyuub\",\"tags\":{\"ith\":\"szlfyt\"}}") + .toObject(HostedAgentDeployment.class); + Assertions.assertEquals("fyzyzeyuub", model.description()); + Assertions.assertEquals("szlfyt", model.tags().get("ith")); + Assertions.assertEquals("yimsfayorpr", model.displayName()); + Assertions.assertEquals("kj", model.deploymentId()); + Assertions.assertEquals(AgentDeploymentState.DELETED, model.state()); + Assertions.assertEquals(AgentProtocol.RESPONSES, model.protocols().get(0).protocol()); + Assertions.assertEquals("smjkwynqxaekqsy", model.protocols().get(0).version()); + Assertions.assertEquals("pxvkqma", model.agents().get(0).agentId()); + Assertions.assertEquals("xvpif", model.agents().get(0).agentName()); + Assertions.assertEquals("gxannnoytzposewx", model.agents().get(0).agentVersion()); + Assertions.assertEquals(1569621723, model.minReplicas()); + Assertions.assertEquals(917747025, model.maxReplicas()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + HostedAgentDeployment model = new HostedAgentDeployment().withDescription("fyzyzeyuub") + .withTags(mapOf("ith", "szlfyt")) + .withDisplayName("yimsfayorpr") + .withDeploymentId("kj") + .withState(AgentDeploymentState.DELETED) + .withProtocols(Arrays.asList( + new AgentProtocolVersion().withProtocol(AgentProtocol.RESPONSES).withVersion("smjkwynqxaekqsy"), + new AgentProtocolVersion().withProtocol(AgentProtocol.A2A).withVersion("tqpkevmy"), + new AgentProtocolVersion().withProtocol(AgentProtocol.RESPONSES).withVersion("rspxklur"))) + .withAgents(Arrays.asList(new VersionedAgentReference().withAgentId("pxvkqma") + .withAgentName("xvpif") + .withAgentVersion("gxannnoytzposewx"))) + .withMinReplicas(1569621723) + .withMaxReplicas(917747025); + model = BinaryData.fromObject(model).toObject(HostedAgentDeployment.class); + Assertions.assertEquals("fyzyzeyuub", model.description()); + Assertions.assertEquals("szlfyt", model.tags().get("ith")); + Assertions.assertEquals("yimsfayorpr", model.displayName()); + Assertions.assertEquals("kj", model.deploymentId()); + Assertions.assertEquals(AgentDeploymentState.DELETED, model.state()); + Assertions.assertEquals(AgentProtocol.RESPONSES, model.protocols().get(0).protocol()); + Assertions.assertEquals("smjkwynqxaekqsy", model.protocols().get(0).version()); + Assertions.assertEquals("pxvkqma", model.agents().get(0).agentId()); + Assertions.assertEquals("xvpif", model.agents().get(0).agentName()); + Assertions.assertEquals("gxannnoytzposewx", model.agents().get(0).agentVersion()); + Assertions.assertEquals(1569621723, model.minReplicas()); + Assertions.assertEquals(917747025, model.maxReplicas()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/IdentityTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/IdentityTests.java index 4424475d554a..3fe6fd4d614a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/IdentityTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/IdentityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -16,18 +16,19 @@ public final class IdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Identity model = BinaryData.fromString( - "{\"type\":\"SystemAssigned, UserAssigned\",\"tenantId\":\"lx\",\"principalId\":\"kuksjtxukcdm\",\"userAssignedIdentities\":{\"mt\":{\"principalId\":\"ryuanzwuxzdxtay\",\"clientId\":\"hmwhfpmrqo\"},\"mglzufcy\":{\"principalId\":\"knryrtihfxtij\",\"clientId\":\"zvgnwzs\"},\"s\":{\"principalId\":\"ohdbihanufh\",\"clientId\":\"bj\"},\"npqxuh\":{\"principalId\":\"ithxqhabifpi\",\"clientId\":\"wczbys\"}}}") + "{\"type\":\"UserAssigned\",\"tenantId\":\"nxqbzvddn\",\"principalId\":\"ndei\",\"userAssignedIdentities\":{\"qkwpyeicxmqc\":{\"principalId\":\"npzaoq\",\"clientId\":\"hrhcffcyddglmjth\"},\"joghmewuama\":{\"principalId\":\"q\",\"clientId\":\"khixuigdtopbo\"},\"iotkftutqxl\":{\"principalId\":\"rzayv\",\"clientId\":\"pgvdf\"},\"tthzrvqd\":{\"principalId\":\"xlefgugnxkrx\",\"clientId\":\"mi\"}}}") .toObject(Identity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); + Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Identity model = new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("mt", new UserAssignedIdentity(), "mglzufcy", new UserAssignedIdentity(), - "s", new UserAssignedIdentity(), "npqxuh", new UserAssignedIdentity())); + Identity model = new Identity().withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf("qkwpyeicxmqc", new UserAssignedIdentity(), "joghmewuama", new UserAssignedIdentity(), + "iotkftutqxl", new UserAssignedIdentity(), "tthzrvqd", new UserAssignedIdentity())); model = BinaryData.fromObject(model).toObject(Identity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); + Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, model.type()); } // Use "Map.of" if available diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/IpRuleTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/IpRuleTests.java index b7860becd753..dfd8df169ed8 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/IpRuleTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/IpRuleTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -11,14 +11,14 @@ public final class IpRuleTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - IpRule model = BinaryData.fromString("{\"value\":\"qpsoacctazak\"}").toObject(IpRule.class); - Assertions.assertEquals("qpsoacctazak", model.value()); + IpRule model = BinaryData.fromString("{\"value\":\"rkujy\"}").toObject(IpRule.class); + Assertions.assertEquals("rkujy", model.value()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - IpRule model = new IpRule().withValue("qpsoacctazak"); + IpRule model = new IpRule().withValue("rkujy"); model = BinaryData.fromObject(model).toObject(IpRule.class); - Assertions.assertEquals("qpsoacctazak", model.value()); + Assertions.assertEquals("rkujy", model.value()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/LocationBasedModelCapacitiesListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/LocationBasedModelCapacitiesListMockTests.java index 34ed07218a01..410639c6d24f 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/LocationBasedModelCapacitiesListMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/LocationBasedModelCapacitiesListMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,6 +12,7 @@ import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; import com.azure.resourcemanager.cognitiveservices.models.ModelCapacityListResultValueItem; +import com.azure.resourcemanager.cognitiveservices.models.QuotaScopeType; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; @@ -22,7 +23,7 @@ public final class LocationBasedModelCapacitiesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"location\":\"dxlwyojbfqz\",\"properties\":{\"model\":{\"publisher\":\"jyixhaf\",\"format\":\"tqxmbj\",\"name\":\"umzznvalqjrhuz\",\"version\":\"xonjtpusl\",\"source\":\"wpvtiotzbpdbol\",\"sourceAccount\":\"ryf\",\"callRateLimit\":{\"count\":71.75664,\"renewalPeriod\":1.5519679,\"rules\":[{},{},{}]}},\"skuName\":\"wsocnequygdjbo\",\"availableCapacity\":73.7661,\"availableFinetuneCapacity\":54.30265},\"id\":\"jkqev\",\"name\":\"drmmwiuawvcmjz\",\"type\":\"xiid\"}]}"; + = "{\"value\":[{\"location\":\"wbebsnbwutlv\",\"properties\":{\"model\":{\"publisher\":\"u\",\"format\":\"stih\",\"name\":\"rafjajvkyxmm\",\"version\":\"zvogtde\",\"source\":\"ennmkvaeuwqd\",\"sourceAccount\":\"hhlbm\",\"callRateLimit\":{\"count\":29.021614,\"renewalPeriod\":57.33737,\"rules\":[{},{},{}]}},\"skuName\":\"hewokyqsfkxf\",\"availableCapacity\":95.886314,\"availableFinetuneCapacity\":42.132484,\"scopeId\":\"qbtodjfy\",\"scopeType\":\"DataZone\"},\"id\":\"vwzdmvddqwcrugy\",\"name\":\"zzzawnjdvvlrho\",\"type\":\"rkkvxundqzbv\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,17 +33,19 @@ public void testList() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.locationBasedModelCapacities() - .list("wyrmouv", "lgmokzkl", "rfowtdvrfmvlih", "vjdrqcrjidhftuk", com.azure.core.util.Context.NONE); + .list("aacxauhvc", "zxhkl", "qxtoiyygktsrjyxx", "xwfzbkvecnxfxph", com.azure.core.util.Context.NONE); - Assertions.assertEquals("dxlwyojbfqz", response.iterator().next().location()); - Assertions.assertEquals("jyixhaf", response.iterator().next().properties().model().publisher()); - Assertions.assertEquals("tqxmbj", response.iterator().next().properties().model().format()); - Assertions.assertEquals("umzznvalqjrhuz", response.iterator().next().properties().model().name()); - Assertions.assertEquals("xonjtpusl", response.iterator().next().properties().model().version()); - Assertions.assertEquals("wpvtiotzbpdbol", response.iterator().next().properties().model().source()); - Assertions.assertEquals("ryf", response.iterator().next().properties().model().sourceAccount()); - Assertions.assertEquals("wsocnequygdjbo", response.iterator().next().properties().skuName()); - Assertions.assertEquals(73.7661F, response.iterator().next().properties().availableCapacity()); - Assertions.assertEquals(54.30265F, response.iterator().next().properties().availableFinetuneCapacity()); + Assertions.assertEquals("wbebsnbwutlv", response.iterator().next().location()); + Assertions.assertEquals("u", response.iterator().next().properties().model().publisher()); + Assertions.assertEquals("stih", response.iterator().next().properties().model().format()); + Assertions.assertEquals("rafjajvkyxmm", response.iterator().next().properties().model().name()); + Assertions.assertEquals("zvogtde", response.iterator().next().properties().model().version()); + Assertions.assertEquals("ennmkvaeuwqd", response.iterator().next().properties().model().source()); + Assertions.assertEquals("hhlbm", response.iterator().next().properties().model().sourceAccount()); + Assertions.assertEquals("hewokyqsfkxf", response.iterator().next().properties().skuName()); + Assertions.assertEquals(95.886314F, response.iterator().next().properties().availableCapacity()); + Assertions.assertEquals(42.132484F, response.iterator().next().properties().availableFinetuneCapacity()); + Assertions.assertEquals("qbtodjfy", response.iterator().next().properties().scopeId()); + Assertions.assertEquals(QuotaScopeType.DATA_ZONE, response.iterator().next().properties().scopeType()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedAgentDeploymentTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedAgentDeploymentTests.java new file mode 100644 index 000000000000..1c781f930aab --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedAgentDeploymentTests.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.models.AgentDeploymentState; +import com.azure.resourcemanager.cognitiveservices.models.AgentProtocol; +import com.azure.resourcemanager.cognitiveservices.models.AgentProtocolVersion; +import com.azure.resourcemanager.cognitiveservices.models.ManagedAgentDeployment; +import com.azure.resourcemanager.cognitiveservices.models.VersionedAgentReference; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ManagedAgentDeploymentTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedAgentDeployment model = BinaryData.fromString( + "{\"deploymentType\":\"Managed\",\"displayName\":\"zfboj\",\"deploymentId\":\"mcsmyqwixvcp\",\"state\":\"Deleting\",\"protocols\":[{\"protocol\":\"Agent\",\"version\":\"ofalickduoiqtam\"},{\"protocol\":\"Agent\",\"version\":\"kn\"},{\"protocol\":\"A2A\",\"version\":\"awnvsbcfhza\"}],\"agents\":[{\"agentVersion\":\"hycvdimwrzre\",\"agentId\":\"gy\",\"agentName\":\"utrwpweryekz\"},{\"agentVersion\":\"hmeott\",\"agentId\":\"jyosxwwh\",\"agentName\":\"jtfvpndpmiljpn\"},{\"agentVersion\":\"nudqllz\",\"agentId\":\"uzpjlxeehux\",\"agentName\":\"hzlraymezxlsk\"}],\"provisioningState\":\"Failed\",\"description\":\"rfdsajrednwy\",\"tags\":{\"w\":\"t\",\"frkgwltxeq\":\"mevuafpwzy\"}}") + .toObject(ManagedAgentDeployment.class); + Assertions.assertEquals("rfdsajrednwy", model.description()); + Assertions.assertEquals("t", model.tags().get("w")); + Assertions.assertEquals("zfboj", model.displayName()); + Assertions.assertEquals("mcsmyqwixvcp", model.deploymentId()); + Assertions.assertEquals(AgentDeploymentState.DELETING, model.state()); + Assertions.assertEquals(AgentProtocol.AGENT, model.protocols().get(0).protocol()); + Assertions.assertEquals("ofalickduoiqtam", model.protocols().get(0).version()); + Assertions.assertEquals("gy", model.agents().get(0).agentId()); + Assertions.assertEquals("utrwpweryekz", model.agents().get(0).agentName()); + Assertions.assertEquals("hycvdimwrzre", model.agents().get(0).agentVersion()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedAgentDeployment model = new ManagedAgentDeployment().withDescription("rfdsajrednwy") + .withTags(mapOf("w", "t", "frkgwltxeq", "mevuafpwzy")) + .withDisplayName("zfboj") + .withDeploymentId("mcsmyqwixvcp") + .withState(AgentDeploymentState.DELETING) + .withProtocols(Arrays.asList( + new AgentProtocolVersion().withProtocol(AgentProtocol.AGENT).withVersion("ofalickduoiqtam"), + new AgentProtocolVersion().withProtocol(AgentProtocol.AGENT).withVersion("kn"), + new AgentProtocolVersion().withProtocol(AgentProtocol.A2A).withVersion("awnvsbcfhza"))) + .withAgents(Arrays.asList( + new VersionedAgentReference().withAgentId("gy") + .withAgentName("utrwpweryekz") + .withAgentVersion("hycvdimwrzre"), + new VersionedAgentReference().withAgentId("jyosxwwh") + .withAgentName("jtfvpndpmiljpn") + .withAgentVersion("hmeott"), + new VersionedAgentReference().withAgentId("uzpjlxeehux") + .withAgentName("hzlraymezxlsk") + .withAgentVersion("nudqllz"))); + model = BinaryData.fromObject(model).toObject(ManagedAgentDeployment.class); + Assertions.assertEquals("rfdsajrednwy", model.description()); + Assertions.assertEquals("t", model.tags().get("w")); + Assertions.assertEquals("zfboj", model.displayName()); + Assertions.assertEquals("mcsmyqwixvcp", model.deploymentId()); + Assertions.assertEquals(AgentDeploymentState.DELETING, model.state()); + Assertions.assertEquals(AgentProtocol.AGENT, model.protocols().get(0).protocol()); + Assertions.assertEquals("ofalickduoiqtam", model.protocols().get(0).version()); + Assertions.assertEquals("gy", model.agents().get(0).agentId()); + Assertions.assertEquals("utrwpweryekz", model.agents().get(0).agentName()); + Assertions.assertEquals("hycvdimwrzre", model.agents().get(0).agentVersion()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkListResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkListResultTests.java new file mode 100644 index 000000000000..d0f938d58c81 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkListResultTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.implementation.models.ManagedNetworkListResult; +import com.azure.resourcemanager.cognitiveservices.models.FirewallSku; +import com.azure.resourcemanager.cognitiveservices.models.IsolationMode; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkKind; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkStatus; +import org.junit.jupiter.api.Assertions; + +public final class ManagedNetworkListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedNetworkListResult model = BinaryData.fromString( + "{\"nextLink\":\"td\",\"value\":[{\"properties\":{\"managedNetwork\":{\"changeableIsolationModes\":[\"AllowOnlyApprovedOutbound\",\"AllowOnlyApprovedOutbound\",\"AllowInternetOutbound\"],\"isolationMode\":\"AllowOnlyApprovedOutbound\",\"networkId\":\"cwnpqigtuujwouhd\",\"outboundRules\":{\"igrb\":{\"type\":\"OutboundRule\"}},\"status\":{\"status\":\"Inactive\"},\"firewallSku\":\"Basic\",\"managedNetworkKind\":\"V2\",\"firewallPublicIpAddress\":\"tvqkjyazn\",\"provisioningState\":\"Deferred\"},\"provisioningState\":\"Succeeded\"},\"id\":\"uwdchozf\",\"name\":\"kfexlv\",\"type\":\"noakiz\"},{\"properties\":{\"managedNetwork\":{\"changeableIsolationModes\":[\"Disabled\",\"AllowOnlyApprovedOutbound\",\"AllowInternetOutbound\"],\"isolationMode\":\"Disabled\",\"networkId\":\"wiguyxlyk\",\"outboundRules\":{\"vx\":{\"type\":\"OutboundRule\"},\"cwxhmpej\":{\"type\":\"OutboundRule\"},\"lkexaonwivkcqh\":{\"type\":\"OutboundRule\"}},\"status\":{\"status\":\"Inactive\"},\"firewallSku\":\"Standard\",\"managedNetworkKind\":\"V1\",\"firewallPublicIpAddress\":\"rmmkyupiju\",\"provisioningState\":\"Deferred\"},\"provisioningState\":\"Updating\"},\"id\":\"akfqfrkemyildud\",\"name\":\"jascowvfdjkpd\",\"type\":\"phlkksnm\"},{\"properties\":{\"managedNetwork\":{\"changeableIsolationModes\":[\"AllowOnlyApprovedOutbound\"],\"isolationMode\":\"AllowOnlyApprovedOutbound\",\"networkId\":\"zuqnwsithuqo\",\"outboundRules\":{\"hluqwquls\":{\"type\":\"OutboundRule\"}},\"status\":{\"status\":\"Inactive\"},\"firewallSku\":\"Basic\",\"managedNetworkKind\":\"V2\",\"firewallPublicIpAddress\":\"fhyqezvqqugdrft\",\"provisioningState\":\"Succeeded\"},\"provisioningState\":\"Deleting\"},\"id\":\"e\",\"name\":\"quowtljvfwhrea\",\"type\":\"khyxvrqtvbcz\"},{\"properties\":{\"managedNetwork\":{\"changeableIsolationModes\":[\"AllowInternetOutbound\",\"AllowOnlyApprovedOutbound\",\"AllowOnlyApprovedOutbound\"],\"isolationMode\":\"AllowOnlyApprovedOutbound\",\"networkId\":\"jpfseykg\",\"outboundRules\":{\"gpszngafpg\":{\"type\":\"OutboundRule\"},\"lkvec\":{\"type\":\"OutboundRule\"},\"ujcngo\":{\"type\":\"OutboundRule\"}},\"status\":{\"status\":\"Active\"},\"firewallSku\":\"Standard\",\"managedNetworkKind\":\"V2\",\"firewallPublicIpAddress\":\"jfoknubnoitpkp\",\"provisioningState\":\"Deleted\"},\"provisioningState\":\"Deleting\"},\"id\":\"x\",\"name\":\"coqra\",\"type\":\"wugyx\"}]}") + .toObject(ManagedNetworkListResult.class); + Assertions.assertEquals("td", model.nextLink()); + Assertions.assertEquals(IsolationMode.ALLOW_ONLY_APPROVED_OUTBOUND, + model.value().get(0).properties().managedNetwork().isolationMode()); + Assertions.assertEquals(ManagedNetworkStatus.INACTIVE, + model.value().get(0).properties().managedNetwork().status().status()); + Assertions.assertEquals(FirewallSku.BASIC, model.value().get(0).properties().managedNetwork().firewallSku()); + Assertions.assertEquals(ManagedNetworkKind.V2, + model.value().get(0).properties().managedNetwork().managedNetworkKind()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkProvisionOptionsTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkProvisionOptionsTests.java new file mode 100644 index 000000000000..d8b8a4f805bf --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkProvisionOptionsTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkProvisionOptions; + +public final class ManagedNetworkProvisionOptionsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedNetworkProvisionOptions model + = BinaryData.fromString("{}").toObject(ManagedNetworkProvisionOptions.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedNetworkProvisionOptions model = new ManagedNetworkProvisionOptions(); + model = BinaryData.fromObject(model).toObject(ManagedNetworkProvisionOptions.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkProvisionStatusInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkProvisionStatusInnerTests.java new file mode 100644 index 000000000000..8ac21012a8e8 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkProvisionStatusInnerTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkProvisionStatusInner; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkStatus; +import org.junit.jupiter.api.Assertions; + +public final class ManagedNetworkProvisionStatusInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedNetworkProvisionStatusInner model + = BinaryData.fromString("{\"status\":\"Inactive\"}").toObject(ManagedNetworkProvisionStatusInner.class); + Assertions.assertEquals(ManagedNetworkStatus.INACTIVE, model.status()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedNetworkProvisionStatusInner model + = new ManagedNetworkProvisionStatusInner().withStatus(ManagedNetworkStatus.INACTIVE); + model = BinaryData.fromObject(model).toObject(ManagedNetworkProvisionStatusInner.class); + Assertions.assertEquals(ManagedNetworkStatus.INACTIVE, model.status()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkProvisionsProvisionManagedNetworkMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkProvisionsProvisionManagedNetworkMockTests.java new file mode 100644 index 000000000000..f02a866be85e --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkProvisionsProvisionManagedNetworkMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkProvisionOptions; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkProvisionStatus; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkStatus; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ManagedNetworkProvisionsProvisionManagedNetworkMockTests { + @Test + public void testProvisionManagedNetwork() throws Exception { + String responseStr = "{\"status\":\"Active\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CognitiveServicesManager manager = CognitiveServicesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ManagedNetworkProvisionStatus response = manager.managedNetworkProvisions() + .provisionManagedNetwork("mw", "lvxgwzz", "wdtlcjgpvc", new ManagedNetworkProvisionOptions(), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals(ManagedNetworkStatus.ACTIVE, response.status()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsBasicResourceInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsBasicResourceInnerTests.java new file mode 100644 index 000000000000..68654fbcffc4 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsBasicResourceInnerTests.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkProvisionStatusInner; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsBasicResourceInner; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsInner; +import com.azure.resourcemanager.cognitiveservices.models.FirewallSku; +import com.azure.resourcemanager.cognitiveservices.models.IsolationMode; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkKind; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkStatus; +import com.azure.resourcemanager.cognitiveservices.models.OutboundRule; +import com.azure.resourcemanager.cognitiveservices.models.RuleCategory; +import com.azure.resourcemanager.cognitiveservices.models.RuleStatus; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ManagedNetworkSettingsBasicResourceInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedNetworkSettingsBasicResourceInner model = BinaryData.fromString( + "{\"properties\":{\"isolationMode\":\"AllowOnlyApprovedOutbound\",\"networkId\":\"eialwvskb\",\"outboundRules\":{\"ofqcvovjufycsjm\":{\"type\":\"OutboundRule\",\"category\":\"Required\",\"status\":\"Deleting\",\"errorInformation\":\"yltcoqcuj\",\"parentRuleNames\":[\"xzak\",\"ejkm\",\"bizt\"]}},\"status\":{\"status\":\"Active\"},\"firewallSku\":\"Standard\",\"managedNetworkKind\":\"V2\",\"firewallPublicIpAddress\":\"iuxegth\",\"provisioningState\":\"Updating\"},\"id\":\"dawlpjfelqerpp\",\"name\":\"cbgqnzmnhiil\",\"type\":\"alwcjgckbb\"}") + .toObject(ManagedNetworkSettingsBasicResourceInner.class); + Assertions.assertEquals(IsolationMode.ALLOW_ONLY_APPROVED_OUTBOUND, model.properties().isolationMode()); + Assertions.assertEquals(RuleCategory.REQUIRED, + model.properties().outboundRules().get("ofqcvovjufycsjm").category()); + Assertions.assertEquals(RuleStatus.DELETING, + model.properties().outboundRules().get("ofqcvovjufycsjm").status()); + Assertions.assertEquals(ManagedNetworkStatus.ACTIVE, model.properties().status().status()); + Assertions.assertEquals(FirewallSku.STANDARD, model.properties().firewallSku()); + Assertions.assertEquals(ManagedNetworkKind.V2, model.properties().managedNetworkKind()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedNetworkSettingsBasicResourceInner model = new ManagedNetworkSettingsBasicResourceInner().withProperties( + new ManagedNetworkSettingsInner().withIsolationMode(IsolationMode.ALLOW_ONLY_APPROVED_OUTBOUND) + .withOutboundRules(mapOf("ofqcvovjufycsjm", + new OutboundRule().withCategory(RuleCategory.REQUIRED).withStatus(RuleStatus.DELETING))) + .withStatus(new ManagedNetworkProvisionStatusInner().withStatus(ManagedNetworkStatus.ACTIVE)) + .withFirewallSku(FirewallSku.STANDARD) + .withManagedNetworkKind(ManagedNetworkKind.V2)); + model = BinaryData.fromObject(model).toObject(ManagedNetworkSettingsBasicResourceInner.class); + Assertions.assertEquals(IsolationMode.ALLOW_ONLY_APPROVED_OUTBOUND, model.properties().isolationMode()); + Assertions.assertEquals(RuleCategory.REQUIRED, + model.properties().outboundRules().get("ofqcvovjufycsjm").category()); + Assertions.assertEquals(RuleStatus.DELETING, + model.properties().outboundRules().get("ofqcvovjufycsjm").status()); + Assertions.assertEquals(ManagedNetworkStatus.ACTIVE, model.properties().status().status()); + Assertions.assertEquals(FirewallSku.STANDARD, model.properties().firewallSku()); + Assertions.assertEquals(ManagedNetworkKind.V2, model.properties().managedNetworkKind()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsExTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsExTests.java new file mode 100644 index 000000000000..a42c6d66b685 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsExTests.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkProvisionStatusInner; +import com.azure.resourcemanager.cognitiveservices.models.FirewallSku; +import com.azure.resourcemanager.cognitiveservices.models.IsolationMode; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkKind; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsEx; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkStatus; +import com.azure.resourcemanager.cognitiveservices.models.OutboundRule; +import com.azure.resourcemanager.cognitiveservices.models.RuleCategory; +import com.azure.resourcemanager.cognitiveservices.models.RuleStatus; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ManagedNetworkSettingsExTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedNetworkSettingsEx model = BinaryData.fromString( + "{\"changeableIsolationModes\":[\"Disabled\"],\"isolationMode\":\"AllowOnlyApprovedOutbound\",\"networkId\":\"pabgdexjddvjsaqw\",\"outboundRules\":{\"poq\":{\"type\":\"OutboundRule\",\"category\":\"Recommended\",\"status\":\"Inactive\",\"errorInformation\":\"olsrsxapt\",\"parentRuleNames\":[\"excgjokjljnhvl\",\"jbekpeeksnbksdq\",\"jvyklxeslkhhust\"]},\"vkzykjtjknsxf\":{\"type\":\"OutboundRule\",\"category\":\"Recommended\",\"status\":\"Inactive\",\"errorInformation\":\"jwgo\",\"parentRuleNames\":[\"ejjjkxybwfdb\",\"jbzten\"]}},\"status\":{\"status\":\"Active\"},\"firewallSku\":\"Basic\",\"managedNetworkKind\":\"V2\",\"firewallPublicIpAddress\":\"pn\",\"provisioningState\":\"Updating\"}") + .toObject(ManagedNetworkSettingsEx.class); + Assertions.assertEquals(IsolationMode.ALLOW_ONLY_APPROVED_OUTBOUND, model.isolationMode()); + Assertions.assertEquals(RuleCategory.RECOMMENDED, model.outboundRules().get("poq").category()); + Assertions.assertEquals(RuleStatus.INACTIVE, model.outboundRules().get("poq").status()); + Assertions.assertEquals(ManagedNetworkStatus.ACTIVE, model.status().status()); + Assertions.assertEquals(FirewallSku.BASIC, model.firewallSku()); + Assertions.assertEquals(ManagedNetworkKind.V2, model.managedNetworkKind()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedNetworkSettingsEx model + = new ManagedNetworkSettingsEx().withIsolationMode(IsolationMode.ALLOW_ONLY_APPROVED_OUTBOUND) + .withOutboundRules(mapOf("poq", + new OutboundRule().withCategory(RuleCategory.RECOMMENDED).withStatus(RuleStatus.INACTIVE), + "vkzykjtjknsxf", + new OutboundRule().withCategory(RuleCategory.RECOMMENDED).withStatus(RuleStatus.INACTIVE))) + .withStatus(new ManagedNetworkProvisionStatusInner().withStatus(ManagedNetworkStatus.ACTIVE)) + .withFirewallSku(FirewallSku.BASIC) + .withManagedNetworkKind(ManagedNetworkKind.V2); + model = BinaryData.fromObject(model).toObject(ManagedNetworkSettingsEx.class); + Assertions.assertEquals(IsolationMode.ALLOW_ONLY_APPROVED_OUTBOUND, model.isolationMode()); + Assertions.assertEquals(RuleCategory.RECOMMENDED, model.outboundRules().get("poq").category()); + Assertions.assertEquals(RuleStatus.INACTIVE, model.outboundRules().get("poq").status()); + Assertions.assertEquals(ManagedNetworkStatus.ACTIVE, model.status().status()); + Assertions.assertEquals(FirewallSku.BASIC, model.firewallSku()); + Assertions.assertEquals(ManagedNetworkKind.V2, model.managedNetworkKind()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsInnerTests.java new file mode 100644 index 000000000000..b94e915d20ce --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsInnerTests.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkProvisionStatusInner; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsInner; +import com.azure.resourcemanager.cognitiveservices.models.FirewallSku; +import com.azure.resourcemanager.cognitiveservices.models.IsolationMode; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkKind; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkStatus; +import com.azure.resourcemanager.cognitiveservices.models.OutboundRule; +import com.azure.resourcemanager.cognitiveservices.models.RuleCategory; +import com.azure.resourcemanager.cognitiveservices.models.RuleStatus; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ManagedNetworkSettingsInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedNetworkSettingsInner model = BinaryData.fromString( + "{\"isolationMode\":\"AllowInternetOutbound\",\"networkId\":\"bpkuwxeoio\",\"outboundRules\":{\"bfw\":{\"type\":\"OutboundRule\",\"category\":\"Required\",\"status\":\"Failed\",\"errorInformation\":\"jzwfb\",\"parentRuleNames\":[\"y\",\"mmfz\"]},\"qwjhqkbiwetpozyc\":{\"type\":\"OutboundRule\",\"category\":\"Recommended\",\"status\":\"Active\",\"errorInformation\":\"ewsrsxkrplbjaze\",\"parentRuleNames\":[\"viyoypsuhbrnnhjx\"]},\"selpkpbaf\":{\"type\":\"OutboundRule\",\"category\":\"Recommended\",\"status\":\"Provisioning\",\"errorInformation\":\"gfsetzlexbsfled\",\"parentRuleNames\":[\"jpziu\",\"fbzkk\",\"tnhqsycl\"]}},\"status\":{\"status\":\"Active\"},\"firewallSku\":\"Standard\",\"managedNetworkKind\":\"V1\",\"firewallPublicIpAddress\":\"cbevxrhyzdfw\",\"provisioningState\":\"Succeeded\"}") + .toObject(ManagedNetworkSettingsInner.class); + Assertions.assertEquals(IsolationMode.ALLOW_INTERNET_OUTBOUND, model.isolationMode()); + Assertions.assertEquals(RuleCategory.REQUIRED, model.outboundRules().get("bfw").category()); + Assertions.assertEquals(RuleStatus.FAILED, model.outboundRules().get("bfw").status()); + Assertions.assertEquals(ManagedNetworkStatus.ACTIVE, model.status().status()); + Assertions.assertEquals(FirewallSku.STANDARD, model.firewallSku()); + Assertions.assertEquals(ManagedNetworkKind.V1, model.managedNetworkKind()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedNetworkSettingsInner model = new ManagedNetworkSettingsInner() + .withIsolationMode(IsolationMode.ALLOW_INTERNET_OUTBOUND) + .withOutboundRules(mapOf("bfw", + new OutboundRule().withCategory(RuleCategory.REQUIRED).withStatus(RuleStatus.FAILED), + "qwjhqkbiwetpozyc", + new OutboundRule().withCategory(RuleCategory.RECOMMENDED).withStatus(RuleStatus.ACTIVE), "selpkpbaf", + new OutboundRule().withCategory(RuleCategory.RECOMMENDED).withStatus(RuleStatus.PROVISIONING))) + .withStatus(new ManagedNetworkProvisionStatusInner().withStatus(ManagedNetworkStatus.ACTIVE)) + .withFirewallSku(FirewallSku.STANDARD) + .withManagedNetworkKind(ManagedNetworkKind.V1); + model = BinaryData.fromObject(model).toObject(ManagedNetworkSettingsInner.class); + Assertions.assertEquals(IsolationMode.ALLOW_INTERNET_OUTBOUND, model.isolationMode()); + Assertions.assertEquals(RuleCategory.REQUIRED, model.outboundRules().get("bfw").category()); + Assertions.assertEquals(RuleStatus.FAILED, model.outboundRules().get("bfw").status()); + Assertions.assertEquals(ManagedNetworkStatus.ACTIVE, model.status().status()); + Assertions.assertEquals(FirewallSku.STANDARD, model.firewallSku()); + Assertions.assertEquals(ManagedNetworkKind.V1, model.managedNetworkKind()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationsGetWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationsGetWithResponseMockTests.java new file mode 100644 index 000000000000..d9315077c959 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationsGetWithResponseMockTests.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; +import com.azure.resourcemanager.cognitiveservices.models.FirewallSku; +import com.azure.resourcemanager.cognitiveservices.models.IsolationMode; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkKind; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsPropertiesBasicResource; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkStatus; +import com.azure.resourcemanager.cognitiveservices.models.RuleCategory; +import com.azure.resourcemanager.cognitiveservices.models.RuleStatus; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ManagedNetworkSettingsOperationsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"managedNetwork\":{\"changeableIsolationModes\":[\"AllowOnlyApprovedOutbound\"],\"isolationMode\":\"AllowOnlyApprovedOutbound\",\"networkId\":\"xerxlobkdb\",\"outboundRules\":{\"gvxrktjcjigc\":{\"type\":\"OutboundRule\",\"category\":\"Dependency\",\"status\":\"Failed\",\"errorInformation\":\"iqyholhjnskbgg\",\"parentRuleNames\":[\"qwlctmwpblxkrk\"]}},\"status\":{\"status\":\"Active\"},\"firewallSku\":\"Standard\",\"managedNetworkKind\":\"V1\",\"firewallPublicIpAddress\":\"asevc\",\"provisioningState\":\"Deferred\"},\"provisioningState\":\"Failed\"},\"id\":\"edyybruholaemwcg\",\"name\":\"mmrimaabsq\",\"type\":\"lonbzaowcahdkmb\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CognitiveServicesManager manager = CognitiveServicesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ManagedNetworkSettingsPropertiesBasicResource response = manager.managedNetworkSettingsOperations() + .getWithResponse("ybsrwzzmrgtxdh", "fppinmgik", "smkw", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(IsolationMode.ALLOW_ONLY_APPROVED_OUTBOUND, + response.properties().managedNetwork().isolationMode()); + Assertions.assertEquals(RuleCategory.DEPENDENCY, + response.properties().managedNetwork().outboundRules().get("gvxrktjcjigc").category()); + Assertions.assertEquals(RuleStatus.FAILED, + response.properties().managedNetwork().outboundRules().get("gvxrktjcjigc").status()); + Assertions.assertEquals(ManagedNetworkStatus.ACTIVE, response.properties().managedNetwork().status().status()); + Assertions.assertEquals(FirewallSku.STANDARD, response.properties().managedNetwork().firewallSku()); + Assertions.assertEquals(ManagedNetworkKind.V1, response.properties().managedNetwork().managedNetworkKind()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationsListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationsListMockTests.java new file mode 100644 index 000000000000..bfe4a608d71f --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationsListMockTests.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; +import com.azure.resourcemanager.cognitiveservices.models.FirewallSku; +import com.azure.resourcemanager.cognitiveservices.models.IsolationMode; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkKind; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsPropertiesBasicResource; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkStatus; +import com.azure.resourcemanager.cognitiveservices.models.RuleCategory; +import com.azure.resourcemanager.cognitiveservices.models.RuleStatus; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ManagedNetworkSettingsOperationsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"managedNetwork\":{\"changeableIsolationModes\":[\"Disabled\",\"AllowInternetOutbound\"],\"isolationMode\":\"AllowInternetOutbound\",\"networkId\":\"nhjgclxaxwcffasp\",\"outboundRules\":{\"wvpu\":{\"type\":\"OutboundRule\",\"category\":\"Recommended\",\"status\":\"Provisioning\",\"errorInformation\":\"ghdoaqipmnxclf\",\"parentRuleNames\":[\"zrn\",\"u\"]},\"gyxzmxynofxl\":{\"type\":\"OutboundRule\",\"category\":\"Dependency\",\"status\":\"Deleting\",\"errorInformation\":\"fmekjcnginx\",\"parentRuleNames\":[\"aoy\",\"xf\"]},\"vjwyuveox\":{\"type\":\"OutboundRule\",\"category\":\"UserDefined\",\"status\":\"Provisioning\",\"errorInformation\":\"tdnzujsjirkrpskc\",\"parentRuleNames\":[\"mofbnivd\",\"tkykpaxnlsfgnys\",\"accptbzetxy\",\"xxicee\"]},\"gxmbrygmwibiosiq\":{\"type\":\"OutboundRule\",\"category\":\"Required\",\"status\":\"Failed\",\"errorInformation\":\"hd\",\"parentRuleNames\":[\"haz\",\"kx\",\"ivz\"]}},\"status\":{\"status\":\"Active\"},\"firewallSku\":\"Basic\",\"managedNetworkKind\":\"V2\",\"firewallPublicIpAddress\":\"rtxtfdag\",\"provisioningState\":\"Deferred\"},\"provisioningState\":\"Deleting\"},\"id\":\"zzertkounzsiy\",\"name\":\"hubymfp\",\"type\":\"pikzebq\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CognitiveServicesManager manager = CognitiveServicesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.managedNetworkSettingsOperations() + .list("smihrijezbfsjwfc", "glkvbgukbsv", com.azure.core.util.Context.NONE); + + Assertions.assertEquals(IsolationMode.ALLOW_INTERNET_OUTBOUND, + response.iterator().next().properties().managedNetwork().isolationMode()); + Assertions.assertEquals(RuleCategory.RECOMMENDED, + response.iterator().next().properties().managedNetwork().outboundRules().get("wvpu").category()); + Assertions.assertEquals(RuleStatus.PROVISIONING, + response.iterator().next().properties().managedNetwork().outboundRules().get("wvpu").status()); + Assertions.assertEquals(ManagedNetworkStatus.ACTIVE, + response.iterator().next().properties().managedNetwork().status().status()); + Assertions.assertEquals(FirewallSku.BASIC, + response.iterator().next().properties().managedNetwork().firewallSku()); + Assertions.assertEquals(ManagedNetworkKind.V2, + response.iterator().next().properties().managedNetwork().managedNetworkKind()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationsPutMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationsPutMockTests.java new file mode 100644 index 000000000000..010c48ee49ad --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsOperationsPutMockTests.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkProvisionStatusInner; +import com.azure.resourcemanager.cognitiveservices.models.FirewallSku; +import com.azure.resourcemanager.cognitiveservices.models.IsolationMode; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkKind; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsEx; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsProperties; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsPropertiesBasicResource; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkStatus; +import com.azure.resourcemanager.cognitiveservices.models.OutboundRule; +import com.azure.resourcemanager.cognitiveservices.models.RuleCategory; +import com.azure.resourcemanager.cognitiveservices.models.RuleStatus; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ManagedNetworkSettingsOperationsPutMockTests { + @Test + public void testPut() throws Exception { + String responseStr + = "{\"properties\":{\"managedNetwork\":{\"changeableIsolationModes\":[\"AllowOnlyApprovedOutbound\",\"AllowOnlyApprovedOutbound\"],\"isolationMode\":\"AllowOnlyApprovedOutbound\",\"networkId\":\"ocjnzdaiovrbhr\",\"outboundRules\":{\"s\":{\"type\":\"OutboundRule\",\"category\":\"Recommended\",\"status\":\"Provisioning\",\"errorInformation\":\"zadcrxyla\",\"parentRuleNames\":[\"tyzvelffohu\",\"iwhjdfrwpsshrmn\",\"cclpct\",\"ogkscxj\"]},\"fu\":{\"type\":\"OutboundRule\",\"category\":\"Recommended\",\"status\":\"Provisioning\",\"errorInformation\":\"ebnxsqcows\",\"parentRuleNames\":[\"fqlamfbqhsu\",\"k\"]}},\"status\":{\"status\":\"Active\"},\"firewallSku\":\"Basic\",\"managedNetworkKind\":\"V1\",\"firewallPublicIpAddress\":\"kxkcajgrbrc\",\"provisioningState\":\"Succeeded\"},\"provisioningState\":\"Succeeded\"},\"id\":\"cq\",\"name\":\"azmzlpcx\",\"type\":\"tm\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CognitiveServicesManager manager = CognitiveServicesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ManagedNetworkSettingsPropertiesBasicResource response = manager.managedNetworkSettingsOperations() + .define("dlkhczygpm") + .withExistingAccount("nfywtkq", "w") + .withProperties(new ManagedNetworkSettingsProperties().withManagedNetwork(new ManagedNetworkSettingsEx() + .withIsolationMode(IsolationMode.ALLOW_INTERNET_OUTBOUND) + .withOutboundRules(mapOf("vswmehfxrtt", + new OutboundRule().withCategory(RuleCategory.DEPENDENCY).withStatus(RuleStatus.PROVISIONING), + "xhjtlxfikjkxarav", + new OutboundRule().withCategory(RuleCategory.DEPENDENCY).withStatus(RuleStatus.ACTIVE), "svoqiza", + new OutboundRule().withCategory(RuleCategory.DEPENDENCY).withStatus(RuleStatus.ACTIVE))) + .withStatus(new ManagedNetworkProvisionStatusInner().withStatus(ManagedNetworkStatus.ACTIVE)) + .withFirewallSku(FirewallSku.BASIC) + .withManagedNetworkKind(ManagedNetworkKind.V2))) + .create(); + + Assertions.assertEquals(IsolationMode.ALLOW_ONLY_APPROVED_OUTBOUND, + response.properties().managedNetwork().isolationMode()); + Assertions.assertEquals(RuleCategory.RECOMMENDED, + response.properties().managedNetwork().outboundRules().get("s").category()); + Assertions.assertEquals(RuleStatus.PROVISIONING, + response.properties().managedNetwork().outboundRules().get("s").status()); + Assertions.assertEquals(ManagedNetworkStatus.ACTIVE, response.properties().managedNetwork().status().status()); + Assertions.assertEquals(FirewallSku.BASIC, response.properties().managedNetwork().firewallSku()); + Assertions.assertEquals(ManagedNetworkKind.V1, response.properties().managedNetwork().managedNetworkKind()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsPropertiesBasicResourceInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsPropertiesBasicResourceInnerTests.java new file mode 100644 index 000000000000..45372d02ceb4 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsPropertiesBasicResourceInnerTests.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkProvisionStatusInner; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsPropertiesBasicResourceInner; +import com.azure.resourcemanager.cognitiveservices.models.FirewallSku; +import com.azure.resourcemanager.cognitiveservices.models.IsolationMode; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkKind; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsEx; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsProperties; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkStatus; +import com.azure.resourcemanager.cognitiveservices.models.OutboundRule; +import com.azure.resourcemanager.cognitiveservices.models.RuleCategory; +import com.azure.resourcemanager.cognitiveservices.models.RuleStatus; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ManagedNetworkSettingsPropertiesBasicResourceInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedNetworkSettingsPropertiesBasicResourceInner model = BinaryData.fromString( + "{\"properties\":{\"managedNetwork\":{\"changeableIsolationModes\":[\"Disabled\"],\"isolationMode\":\"AllowOnlyApprovedOutbound\",\"networkId\":\"jdjusk\",\"outboundRules\":{\"vvlfntymtp\":{\"type\":\"OutboundRule\",\"category\":\"Required\",\"status\":\"Inactive\",\"errorInformation\":\"ceysfaqeg\",\"parentRuleNames\":[\"ryshwddkvbxgk\",\"usybwptdaca\"]}},\"status\":{\"status\":\"Active\"},\"firewallSku\":\"Basic\",\"managedNetworkKind\":\"V2\",\"firewallPublicIpAddress\":\"ohzrsqalsx\",\"provisioningState\":\"Deleted\"},\"provisioningState\":\"Deferred\"},\"id\":\"pfgsdpcvessmzhh\",\"name\":\"uuipldq\",\"type\":\"ctekval\"}") + .toObject(ManagedNetworkSettingsPropertiesBasicResourceInner.class); + Assertions.assertEquals(IsolationMode.ALLOW_ONLY_APPROVED_OUTBOUND, + model.properties().managedNetwork().isolationMode()); + Assertions.assertEquals(RuleCategory.REQUIRED, + model.properties().managedNetwork().outboundRules().get("vvlfntymtp").category()); + Assertions.assertEquals(RuleStatus.INACTIVE, + model.properties().managedNetwork().outboundRules().get("vvlfntymtp").status()); + Assertions.assertEquals(ManagedNetworkStatus.ACTIVE, model.properties().managedNetwork().status().status()); + Assertions.assertEquals(FirewallSku.BASIC, model.properties().managedNetwork().firewallSku()); + Assertions.assertEquals(ManagedNetworkKind.V2, model.properties().managedNetwork().managedNetworkKind()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedNetworkSettingsPropertiesBasicResourceInner model + = new ManagedNetworkSettingsPropertiesBasicResourceInner() + .withProperties(new ManagedNetworkSettingsProperties().withManagedNetwork( + new ManagedNetworkSettingsEx().withIsolationMode(IsolationMode.ALLOW_ONLY_APPROVED_OUTBOUND) + .withOutboundRules(mapOf("vvlfntymtp", + new OutboundRule().withCategory(RuleCategory.REQUIRED).withStatus(RuleStatus.INACTIVE))) + .withStatus(new ManagedNetworkProvisionStatusInner().withStatus(ManagedNetworkStatus.ACTIVE)) + .withFirewallSku(FirewallSku.BASIC) + .withManagedNetworkKind(ManagedNetworkKind.V2))); + model = BinaryData.fromObject(model).toObject(ManagedNetworkSettingsPropertiesBasicResourceInner.class); + Assertions.assertEquals(IsolationMode.ALLOW_ONLY_APPROVED_OUTBOUND, + model.properties().managedNetwork().isolationMode()); + Assertions.assertEquals(RuleCategory.REQUIRED, + model.properties().managedNetwork().outboundRules().get("vvlfntymtp").category()); + Assertions.assertEquals(RuleStatus.INACTIVE, + model.properties().managedNetwork().outboundRules().get("vvlfntymtp").status()); + Assertions.assertEquals(ManagedNetworkStatus.ACTIVE, model.properties().managedNetwork().status().status()); + Assertions.assertEquals(FirewallSku.BASIC, model.properties().managedNetwork().firewallSku()); + Assertions.assertEquals(ManagedNetworkKind.V2, model.properties().managedNetwork().managedNetworkKind()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsPropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsPropertiesTests.java new file mode 100644 index 000000000000..051921cbd189 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ManagedNetworkSettingsPropertiesTests.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkProvisionStatusInner; +import com.azure.resourcemanager.cognitiveservices.models.FirewallSku; +import com.azure.resourcemanager.cognitiveservices.models.IsolationMode; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkKind; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsEx; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkSettingsProperties; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkStatus; +import com.azure.resourcemanager.cognitiveservices.models.OutboundRule; +import com.azure.resourcemanager.cognitiveservices.models.RuleCategory; +import com.azure.resourcemanager.cognitiveservices.models.RuleStatus; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ManagedNetworkSettingsPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedNetworkSettingsProperties model = BinaryData.fromString( + "{\"managedNetwork\":{\"changeableIsolationModes\":[\"AllowOnlyApprovedOutbound\",\"AllowOnlyApprovedOutbound\",\"AllowOnlyApprovedOutbound\"],\"isolationMode\":\"AllowOnlyApprovedOutbound\",\"networkId\":\"wehtaemxh\",\"outboundRules\":{\"gkkileplkcsmkn\":{\"type\":\"OutboundRule\",\"category\":\"Required\",\"status\":\"Active\",\"errorInformation\":\"xivzrrry\",\"parentRuleNames\":[\"mipskdyzatv\",\"uzkaftjvvruxwi\",\"syeipqd\",\"mjtgrqg\"]}},\"status\":{\"status\":\"Active\"},\"firewallSku\":\"Basic\",\"managedNetworkKind\":\"V2\",\"firewallPublicIpAddress\":\"rvvmqfloygb\",\"provisioningState\":\"Deferred\"},\"provisioningState\":\"Deferred\"}") + .toObject(ManagedNetworkSettingsProperties.class); + Assertions.assertEquals(IsolationMode.ALLOW_ONLY_APPROVED_OUTBOUND, model.managedNetwork().isolationMode()); + Assertions.assertEquals(RuleCategory.REQUIRED, + model.managedNetwork().outboundRules().get("gkkileplkcsmkn").category()); + Assertions.assertEquals(RuleStatus.ACTIVE, + model.managedNetwork().outboundRules().get("gkkileplkcsmkn").status()); + Assertions.assertEquals(ManagedNetworkStatus.ACTIVE, model.managedNetwork().status().status()); + Assertions.assertEquals(FirewallSku.BASIC, model.managedNetwork().firewallSku()); + Assertions.assertEquals(ManagedNetworkKind.V2, model.managedNetwork().managedNetworkKind()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ManagedNetworkSettingsProperties model = new ManagedNetworkSettingsProperties().withManagedNetwork( + new ManagedNetworkSettingsEx().withIsolationMode(IsolationMode.ALLOW_ONLY_APPROVED_OUTBOUND) + .withOutboundRules(mapOf("gkkileplkcsmkn", + new OutboundRule().withCategory(RuleCategory.REQUIRED).withStatus(RuleStatus.ACTIVE))) + .withStatus(new ManagedNetworkProvisionStatusInner().withStatus(ManagedNetworkStatus.ACTIVE)) + .withFirewallSku(FirewallSku.BASIC) + .withManagedNetworkKind(ManagedNetworkKind.V2)); + model = BinaryData.fromObject(model).toObject(ManagedNetworkSettingsProperties.class); + Assertions.assertEquals(IsolationMode.ALLOW_ONLY_APPROVED_OUTBOUND, model.managedNetwork().isolationMode()); + Assertions.assertEquals(RuleCategory.REQUIRED, + model.managedNetwork().outboundRules().get("gkkileplkcsmkn").category()); + Assertions.assertEquals(RuleStatus.ACTIVE, + model.managedNetwork().outboundRules().get("gkkileplkcsmkn").status()); + Assertions.assertEquals(ManagedNetworkStatus.ACTIVE, model.managedNetwork().status().status()); + Assertions.assertEquals(FirewallSku.BASIC, model.managedNetwork().firewallSku()); + Assertions.assertEquals(ManagedNetworkKind.V2, model.managedNetwork().managedNetworkKind()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/MetricNameTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/MetricNameTests.java index 91215c24f56c..74f432308974 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/MetricNameTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/MetricNameTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -11,17 +11,9 @@ public final class MetricNameTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - MetricName model = BinaryData.fromString("{\"value\":\"mbsureximo\",\"localizedValue\":\"ocfs\"}") + MetricName model = BinaryData.fromString("{\"value\":\"bvvnchrkcciw\",\"localizedValue\":\"juqk\"}") .toObject(MetricName.class); - Assertions.assertEquals("mbsureximo", model.value()); - Assertions.assertEquals("ocfs", model.localizedValue()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MetricName model = new MetricName().withValue("mbsureximo").withLocalizedValue("ocfs"); - model = BinaryData.fromObject(model).toObject(MetricName.class); - Assertions.assertEquals("mbsureximo", model.value()); - Assertions.assertEquals("ocfs", model.localizedValue()); + Assertions.assertEquals("bvvnchrkcciw", model.value()); + Assertions.assertEquals("juqk", model.localizedValue()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ModelCapacitiesListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ModelCapacitiesListMockTests.java index 1eca0492b8fc..7839cd90c107 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ModelCapacitiesListMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ModelCapacitiesListMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,6 +12,7 @@ import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; import com.azure.resourcemanager.cognitiveservices.models.ModelCapacityListResultValueItem; +import com.azure.resourcemanager.cognitiveservices.models.QuotaScopeType; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; @@ -22,7 +23,7 @@ public final class ModelCapacitiesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"location\":\"bamnppcc\",\"properties\":{\"model\":{\"publisher\":\"tdsbezax\",\"format\":\"ukzxuizh\",\"name\":\"nepk\",\"version\":\"tiarxqiubxduk\",\"source\":\"pxdazv\",\"sourceAccount\":\"ctmmkoszudbl\",\"callRateLimit\":{\"count\":22.459858,\"renewalPeriod\":36.415142,\"rules\":[{},{}]}},\"skuName\":\"kiofkbt\",\"availableCapacity\":73.723434,\"availableFinetuneCapacity\":26.572048},\"id\":\"nldpvcbhhezyquwu\",\"name\":\"qxutrpbrruyuua\",\"type\":\"vlm\"}]}"; + = "{\"value\":[{\"location\":\"ipjclzjwaqdz\",\"properties\":{\"model\":{\"publisher\":\"wuwxyllz\",\"format\":\"evt\",\"name\":\"wczochw\",\"version\":\"k\",\"source\":\"ynfpkyvnhiysdho\",\"sourceAccount\":\"slhraqkiwlwkff\",\"callRateLimit\":{\"count\":67.75082,\"renewalPeriod\":80.72204,\"rules\":[{},{},{}]}},\"skuName\":\"uf\",\"availableCapacity\":31.040794,\"availableFinetuneCapacity\":6.0118017,\"scopeId\":\"egefzjx\",\"scopeType\":\"Global\"},\"id\":\"bgysibthnvxw\",\"name\":\"dqtcbjdbtqyhkx\",\"type\":\"ns\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,17 +33,19 @@ public void testList() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.modelCapacities().list("scz", "koswoqiqazugamxz", "rrcoi", com.azure.core.util.Context.NONE); + = manager.modelCapacities().list("p", "uvqhxtozfgdkw", "kurklpiigfuzkeu", com.azure.core.util.Context.NONE); - Assertions.assertEquals("bamnppcc", response.iterator().next().location()); - Assertions.assertEquals("tdsbezax", response.iterator().next().properties().model().publisher()); - Assertions.assertEquals("ukzxuizh", response.iterator().next().properties().model().format()); - Assertions.assertEquals("nepk", response.iterator().next().properties().model().name()); - Assertions.assertEquals("tiarxqiubxduk", response.iterator().next().properties().model().version()); - Assertions.assertEquals("pxdazv", response.iterator().next().properties().model().source()); - Assertions.assertEquals("ctmmkoszudbl", response.iterator().next().properties().model().sourceAccount()); - Assertions.assertEquals("kiofkbt", response.iterator().next().properties().skuName()); - Assertions.assertEquals(73.723434F, response.iterator().next().properties().availableCapacity()); - Assertions.assertEquals(26.572048F, response.iterator().next().properties().availableFinetuneCapacity()); + Assertions.assertEquals("ipjclzjwaqdz", response.iterator().next().location()); + Assertions.assertEquals("wuwxyllz", response.iterator().next().properties().model().publisher()); + Assertions.assertEquals("evt", response.iterator().next().properties().model().format()); + Assertions.assertEquals("wczochw", response.iterator().next().properties().model().name()); + Assertions.assertEquals("k", response.iterator().next().properties().model().version()); + Assertions.assertEquals("ynfpkyvnhiysdho", response.iterator().next().properties().model().source()); + Assertions.assertEquals("slhraqkiwlwkff", response.iterator().next().properties().model().sourceAccount()); + Assertions.assertEquals("uf", response.iterator().next().properties().skuName()); + Assertions.assertEquals(31.040794F, response.iterator().next().properties().availableCapacity()); + Assertions.assertEquals(6.0118017F, response.iterator().next().properties().availableFinetuneCapacity()); + Assertions.assertEquals("egefzjx", response.iterator().next().properties().scopeId()); + Assertions.assertEquals(QuotaScopeType.GLOBAL, response.iterator().next().properties().scopeType()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ModelCapacityListResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ModelCapacityListResultTests.java index 1fac967a5148..b2aa9dd5fb28 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ModelCapacityListResultTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ModelCapacityListResultTests.java @@ -1,61 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ModelCapacityListResultValueItemInner; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentModel; -import com.azure.resourcemanager.cognitiveservices.models.ModelCapacityListResult; -import com.azure.resourcemanager.cognitiveservices.models.ModelSkuCapacityProperties; -import java.util.Arrays; +import com.azure.resourcemanager.cognitiveservices.implementation.models.ModelCapacityListResult; import org.junit.jupiter.api.Assertions; public final class ModelCapacityListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ModelCapacityListResult model = BinaryData.fromString( - "{\"nextLink\":\"cuejrjxgci\",\"value\":[{\"location\":\"hos\",\"properties\":{\"model\":{\"publisher\":\"rhzo\",\"format\":\"i\",\"name\":\"rq\",\"version\":\"bahwfl\",\"source\":\"zdtmhrkwofy\",\"sourceAccount\":\"oqac\",\"callRateLimit\":{\"count\":57.89401,\"renewalPeriod\":79.0544,\"rules\":[{},{},{}]}},\"skuName\":\"wbwo\",\"availableCapacity\":26.065277,\"availableFinetuneCapacity\":81.16658},\"id\":\"rtdtkcnqxw\",\"name\":\"p\",\"type\":\"kulpiujwaasi\"}]}") + "{\"nextLink\":\"tiwlwxlboncqb\",\"value\":[{\"location\":\"cqchygtvxbyjane\",\"properties\":{\"model\":{\"publisher\":\"pkxyqvgxi\",\"format\":\"detv\",\"name\":\"kxdxuwsaifmcwn\",\"version\":\"bzlehgc\",\"source\":\"bcknjolgj\",\"sourceAccount\":\"xpvelszerqzevxo\",\"callRateLimit\":{\"count\":69.122826,\"renewalPeriod\":41.441334,\"rules\":[{},{},{}]}},\"skuName\":\"jglzoblqwaafrq\",\"availableCapacity\":96.938736,\"availableFinetuneCapacity\":33.90711,\"scopeId\":\"qb\",\"scopeType\":\"Classic\"},\"id\":\"fjrqpjiyr\",\"name\":\"jc\",\"type\":\"gaxwmzwdfkbnrzo\"},{\"location\":\"dltb\",\"properties\":{\"model\":{\"publisher\":\"jfgxxsaetg\",\"format\":\"gvpyigdaqqilzdc\",\"name\":\"wjoe\",\"version\":\"ngucaifpaurww\",\"source\":\"l\",\"sourceAccount\":\"qqa\",\"callRateLimit\":{\"count\":99.61544,\"renewalPeriod\":61.63684,\"rules\":[{},{}]}},\"skuName\":\"vjw\",\"availableCapacity\":1.5225887,\"availableFinetuneCapacity\":53.45938,\"scopeId\":\"eciqchxr\",\"scopeType\":\"Global\"},\"id\":\"dsiwdfmmp\",\"name\":\"hzzwvywrgyngy\",\"type\":\"grpxncakiqaondjr\"},{\"location\":\"lamgglvlmfejdo\",\"properties\":{\"model\":{\"publisher\":\"gltygxhqfgq\",\"format\":\"yejsxtlg\",\"name\":\"wf\",\"version\":\"ii\",\"source\":\"ijjcea\",\"sourceAccount\":\"ijjj\",\"callRateLimit\":{\"count\":6.4081907,\"renewalPeriod\":26.98627,\"rules\":[{},{},{}]}},\"skuName\":\"knxkvccxetyvkunm\",\"availableCapacity\":49.409847,\"availableFinetuneCapacity\":10.316515,\"scopeId\":\"k\",\"scopeType\":\"Regional\"},\"id\":\"g\",\"name\":\"wpin\",\"type\":\"edvabbxbhmedeilb\"}]}") .toObject(ModelCapacityListResult.class); - Assertions.assertEquals("cuejrjxgci", model.nextLink()); - Assertions.assertEquals("hos", model.value().get(0).location()); - Assertions.assertEquals("rhzo", model.value().get(0).properties().model().publisher()); - Assertions.assertEquals("i", model.value().get(0).properties().model().format()); - Assertions.assertEquals("rq", model.value().get(0).properties().model().name()); - Assertions.assertEquals("bahwfl", model.value().get(0).properties().model().version()); - Assertions.assertEquals("zdtmhrkwofy", model.value().get(0).properties().model().source()); - Assertions.assertEquals("oqac", model.value().get(0).properties().model().sourceAccount()); - Assertions.assertEquals("wbwo", model.value().get(0).properties().skuName()); - Assertions.assertEquals(26.065277F, model.value().get(0).properties().availableCapacity()); - Assertions.assertEquals(81.16658F, model.value().get(0).properties().availableFinetuneCapacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ModelCapacityListResult model = new ModelCapacityListResult().withNextLink("cuejrjxgci") - .withValue(Arrays.asList(new ModelCapacityListResultValueItemInner().withLocation("hos") - .withProperties(new ModelSkuCapacityProperties() - .withModel(new DeploymentModel().withPublisher("rhzo") - .withFormat("i") - .withName("rq") - .withVersion("bahwfl") - .withSource("zdtmhrkwofy") - .withSourceAccount("oqac")) - .withSkuName("wbwo") - .withAvailableCapacity(26.065277F) - .withAvailableFinetuneCapacity(81.16658F)))); - model = BinaryData.fromObject(model).toObject(ModelCapacityListResult.class); - Assertions.assertEquals("cuejrjxgci", model.nextLink()); - Assertions.assertEquals("hos", model.value().get(0).location()); - Assertions.assertEquals("rhzo", model.value().get(0).properties().model().publisher()); - Assertions.assertEquals("i", model.value().get(0).properties().model().format()); - Assertions.assertEquals("rq", model.value().get(0).properties().model().name()); - Assertions.assertEquals("bahwfl", model.value().get(0).properties().model().version()); - Assertions.assertEquals("zdtmhrkwofy", model.value().get(0).properties().model().source()); - Assertions.assertEquals("oqac", model.value().get(0).properties().model().sourceAccount()); - Assertions.assertEquals("wbwo", model.value().get(0).properties().skuName()); - Assertions.assertEquals(26.065277F, model.value().get(0).properties().availableCapacity()); - Assertions.assertEquals(81.16658F, model.value().get(0).properties().availableFinetuneCapacity()); + Assertions.assertEquals("tiwlwxlboncqb", model.nextLink()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ModelDeprecationInfoTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ModelDeprecationInfoTests.java index c0cb570b47ed..bbf3406da064 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ModelDeprecationInfoTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ModelDeprecationInfoTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -13,21 +13,10 @@ public final class ModelDeprecationInfoTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ModelDeprecationInfo model = BinaryData - .fromString("{\"fineTune\":\"zfcl\",\"inference\":\"axdbabph\",\"deprecationStatus\":\"Tentative\"}") + .fromString("{\"fineTune\":\"ijhtxf\",\"inference\":\"xbf\",\"deprecationStatus\":\"Tentative\"}") .toObject(ModelDeprecationInfo.class); - Assertions.assertEquals("zfcl", model.fineTune()); - Assertions.assertEquals("axdbabph", model.inference()); - Assertions.assertEquals(DeprecationStatus.TENTATIVE, model.deprecationStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ModelDeprecationInfo model = new ModelDeprecationInfo().withFineTune("zfcl") - .withInference("axdbabph") - .withDeprecationStatus(DeprecationStatus.TENTATIVE); - model = BinaryData.fromObject(model).toObject(ModelDeprecationInfo.class); - Assertions.assertEquals("zfcl", model.fineTune()); - Assertions.assertEquals("axdbabph", model.inference()); + Assertions.assertEquals("ijhtxf", model.fineTune()); + Assertions.assertEquals("xbf", model.inference()); Assertions.assertEquals(DeprecationStatus.TENTATIVE, model.deprecationStatus()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ModelListResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ModelListResultTests.java index c12317307444..3fc725a343d7 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ModelListResultTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ModelListResultTests.java @@ -1,279 +1,57 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.AccountModelInner; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ModelInner; -import com.azure.resourcemanager.cognitiveservices.models.BillingMeterInfo; -import com.azure.resourcemanager.cognitiveservices.models.CallRateLimit; -import com.azure.resourcemanager.cognitiveservices.models.CapacityConfig; -import com.azure.resourcemanager.cognitiveservices.models.DeploymentModel; +import com.azure.resourcemanager.cognitiveservices.implementation.models.ModelListResult; import com.azure.resourcemanager.cognitiveservices.models.DeprecationStatus; -import com.azure.resourcemanager.cognitiveservices.models.ModelDeprecationInfo; import com.azure.resourcemanager.cognitiveservices.models.ModelLifecycleStatus; -import com.azure.resourcemanager.cognitiveservices.models.ModelListResult; -import com.azure.resourcemanager.cognitiveservices.models.ModelSku; -import com.azure.resourcemanager.cognitiveservices.models.ReplacementConfig; import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; import org.junit.jupiter.api.Assertions; public final class ModelListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ModelListResult model = BinaryData.fromString( - "{\"nextLink\":\"jriplrbpbewtghf\",\"value\":[{\"model\":{\"baseModel\":{\"publisher\":\"xzvlvqhjkbegib\",\"format\":\"mxiebw\",\"name\":\"loayqcgw\",\"version\":\"zjuzgwyz\",\"source\":\"txon\",\"sourceAccount\":\"ts\",\"callRateLimit\":{\"count\":76.81561,\"renewalPeriod\":29.432487,\"rules\":[{},{},{}]}},\"isDefaultVersion\":false,\"skus\":[{\"name\":\"nftguvriuhpr\",\"usageName\":\"dyvxqtayriww\",\"deprecationDate\":\"2021-05-20T03:51:26Z\",\"capacity\":{},\"rateLimits\":[{},{},{},{}],\"cost\":[{},{}]},{\"name\":\"cqibycnojv\",\"usageName\":\"mefqsgzvahapjyzh\",\"deprecationDate\":\"2021-04-21T18:37:49Z\",\"capacity\":{},\"rateLimits\":[{},{},{},{}],\"cost\":[{},{},{}]},{\"name\":\"xdjzlmwlxk\",\"usageName\":\"gfhzovawjvzunlut\",\"deprecationDate\":\"2021-09-06T05:22:37Z\",\"capacity\":{},\"rateLimits\":[{},{}],\"cost\":[{}]},{\"name\":\"eilpjzuaejxdu\",\"usageName\":\"skzbb\",\"deprecationDate\":\"2021-08-12T02:58:19Z\",\"capacity\":{},\"rateLimits\":[{},{},{},{}],\"cost\":[{}]}],\"maxCapacity\":583849936,\"capabilities\":{\"sjyofdx\":\"ozuhkfp\",\"oekqvk\":\"uusdttouwa\"},\"finetuneCapabilities\":{\"xwyjsflhhc\":\"smv\",\"ixisxyawjoy\":\"aln\",\"yexz\":\"qcslyjpkiid\"},\"deprecation\":{\"fineTune\":\"ixhnrztf\",\"inference\":\"hb\",\"deprecationStatus\":\"Tentative\"},\"replacementConfig\":{\"targetModelName\":\"laulppg\",\"targetModelVersion\":\"tpnapnyiropuhpig\",\"autoUpgradeStartDate\":\"2021-05-18T16:57:02Z\",\"upgradeOnExpiryLeadTimeDays\":1573909011},\"modelCatalogAssetId\":\"git\",\"lifecycleStatus\":\"Deprecated\",\"publisher\":\"v\",\"format\":\"lynqwwncwzzh\",\"name\":\"ktrmgucnapkt\",\"version\":\"ellwptfdy\",\"source\":\"fqbuaceopzf\",\"sourceAccount\":\"hhuao\",\"callRateLimit\":{\"count\":11.676657,\"renewalPeriod\":15.0559845,\"rules\":[{},{},{}]}},\"kind\":\"lzdahzxctobgbkdm\",\"skuName\":\"zpostmgrcfbu\",\"description\":\"mfqjhhkxbp\"},{\"model\":{\"baseModel\":{\"publisher\":\"jhxxjyn\",\"format\":\"divkrt\",\"name\":\"bxqz\",\"version\":\"zjf\",\"source\":\"vjfdx\",\"sourceAccount\":\"vetvt\",\"callRateLimit\":{\"count\":21.629738,\"renewalPeriod\":79.37379,\"rules\":[{},{},{},{}]}},\"isDefaultVersion\":true,\"skus\":[{\"name\":\"wvxysl\",\"usageName\":\"hsfxoblytkb\",\"deprecationDate\":\"2021-09-21T19:24:42Z\",\"capacity\":{},\"rateLimits\":[{},{},{},{}],\"cost\":[{},{},{}]}],\"maxCapacity\":1577221415,\"capabilities\":{\"vshqjohxcr\":\"rn\",\"sub\":\"bfovasrruvwbhsq\",\"rxbpyb\":\"gjb\",\"twss\":\"rfbjf\"},\"finetuneCapabilities\":{\"vwpm\":\"tpvjzbexilzznfqq\",\"wqytjrybnwjewgdr\":\"taruoujmkcj\",\"doy\":\"ervnaenqpehi\"},\"deprecation\":{\"fineTune\":\"fthnzdn\",\"inference\":\"l\",\"deprecationStatus\":\"Tentative\"},\"replacementConfig\":{\"targetModelName\":\"igynduhavhqlk\",\"targetModelVersion\":\"umaq\",\"autoUpgradeStartDate\":\"2021-04-19T22:18:17Z\",\"upgradeOnExpiryLeadTimeDays\":1673515128},\"modelCatalogAssetId\":\"duiertgcc\",\"lifecycleStatus\":\"Deprecated\",\"publisher\":\"l\",\"format\":\"slqlfmmdn\",\"name\":\"glzpswiydm\",\"version\":\"yhz\",\"source\":\"ss\",\"sourceAccount\":\"bzmnvdfznud\",\"callRateLimit\":{\"count\":37.639458,\"renewalPeriod\":16.816956,\"rules\":[{},{},{}]}},\"kind\":\"blylpstdbh\",\"skuName\":\"srzdzucerscdn\",\"description\":\"evfiwjmygt\"},{\"model\":{\"baseModel\":{\"publisher\":\"s\",\"format\":\"mweriofzpy\",\"name\":\"emwabnet\",\"version\":\"hszhedplvwiwu\",\"source\":\"wmbesldnkw\",\"sourceAccount\":\"pp\",\"callRateLimit\":{\"count\":68.60454,\"renewalPeriod\":29.06893,\"rules\":[{},{},{}]}},\"isDefaultVersion\":true,\"skus\":[{\"name\":\"m\",\"usageName\":\"ikvmkqzeqqk\",\"deprecationDate\":\"2021-02-28T12:22:55Z\",\"capacity\":{},\"rateLimits\":[{},{},{}],\"cost\":[{}]},{\"name\":\"v\",\"usageName\":\"ur\",\"deprecationDate\":\"2020-12-25T12:19:04Z\",\"capacity\":{},\"rateLimits\":[{},{},{},{}],\"cost\":[{},{},{}]},{\"name\":\"gxtibqdxbxw\",\"usageName\":\"bogqxndlkzgxhu\",\"deprecationDate\":\"2021-03-23T13:44:10Z\",\"capacity\":{},\"rateLimits\":[{},{}],\"cost\":[{},{},{},{}]}],\"maxCapacity\":1806634279,\"capabilities\":{\"bqtkoievseotgqr\":\"bebxmubyyntwl\",\"mpgcjefuzmuvpbt\":\"ltmuwlauwzizx\",\"morppxebmnzbtbh\":\"d\",\"ohdneuel\":\"pglkf\"},\"finetuneCapabilities\":{\"uvxzxclvi\":\"sdyhtozfikdowwq\"},\"deprecation\":{\"fineTune\":\"qzonosggbhcohf\",\"inference\":\"sjnkal\",\"deprecationStatus\":\"Tentative\"},\"replacementConfig\":{\"targetModelName\":\"swacffgdkzz\",\"targetModelVersion\":\"kfvhqcrailvpn\",\"autoUpgradeStartDate\":\"2021-05-22T20:04:23Z\",\"upgradeOnExpiryLeadTimeDays\":1159921712},\"modelCatalogAssetId\":\"rwdmhdlxyjrxsa\",\"lifecycleStatus\":\"Stable\",\"publisher\":\"ihgwqapnedgfbcv\",\"format\":\"vq\",\"name\":\"keqdcvdrhvoods\",\"version\":\"bobzdopcjwvnhd\",\"source\":\"wmgxcxrsl\",\"sourceAccount\":\"utwu\",\"callRateLimit\":{\"count\":42.323845,\"renewalPeriod\":31.021076,\"rules\":[{}]}},\"kind\":\"niyqslui\",\"skuName\":\"dggkzzlvmbmpa\",\"description\":\"odfvuefywsbp\"}]}") + "{\"nextLink\":\"rmtqjkqevadr\",\"value\":[{\"model\":{\"baseModel\":{\"publisher\":\"wvcmj\",\"format\":\"xiid\",\"name\":\"czskoswoqiqazu\",\"version\":\"mxzkr\",\"source\":\"oiisbamnppcce\",\"sourceAccount\":\"ztdsbeza\",\"callRateLimit\":{\"count\":49.472355,\"renewalPeriod\":87.29736,\"rules\":[{}]}},\"isDefaultVersion\":false,\"skus\":[{\"name\":\"nepk\",\"usageName\":\"tiarxqiubxduk\",\"deprecationDate\":\"2021-11-03T05:27:36Z\",\"capacity\":{},\"rateLimits\":[{},{},{},{}],\"cost\":[{}]}],\"maxCapacity\":7887655,\"capabilities\":{\"nsntrpcaqki\":\"mmkoszudb\",\"btfmhklbnldpvcbh\":\"f\"},\"finetuneCapabilities\":{\"wusqx\":\"yq\"},\"deprecation\":{\"fineTune\":\"pbrruyu\",\"inference\":\"tvlmbjwcolbmxlb\",\"deprecationStatus\":\"Planned\"},\"replacementConfig\":{\"targetModelName\":\"pa\",\"targetModelVersion\":\"rzrv\",\"autoUpgradeStartDate\":\"2021-01-25T19:22:53Z\",\"upgradeOnExpiryLeadTimeDays\":351977978},\"modelCatalogAssetId\":\"ocnxz\",\"lifecycleStatus\":\"Deprecated\",\"publisher\":\"gxnoqrxtdis\",\"format\":\"evhdlmydid\",\"name\":\"epfwwt\",\"version\":\"doesxxhmwcdb\",\"source\":\"yo\",\"sourceAccount\":\"xkxhnegknjzrbhtm\",\"callRateLimit\":{\"count\":81.79294,\"renewalPeriod\":37.314953,\"rules\":[{}]}},\"kind\":\"rlbpgsnbagnc\",\"skuName\":\"hg\",\"description\":\"uowakyw\"}]}") .toObject(ModelListResult.class); - Assertions.assertEquals("jriplrbpbewtghf", model.nextLink()); - Assertions.assertEquals("v", model.value().get(0).model().publisher()); - Assertions.assertEquals("lynqwwncwzzh", model.value().get(0).model().format()); - Assertions.assertEquals("ktrmgucnapkt", model.value().get(0).model().name()); - Assertions.assertEquals("ellwptfdy", model.value().get(0).model().version()); - Assertions.assertEquals("fqbuaceopzf", model.value().get(0).model().source()); - Assertions.assertEquals("hhuao", model.value().get(0).model().sourceAccount()); - Assertions.assertEquals("xzvlvqhjkbegib", model.value().get(0).model().baseModel().publisher()); - Assertions.assertEquals("mxiebw", model.value().get(0).model().baseModel().format()); - Assertions.assertEquals("loayqcgw", model.value().get(0).model().baseModel().name()); - Assertions.assertEquals("zjuzgwyz", model.value().get(0).model().baseModel().version()); - Assertions.assertEquals("txon", model.value().get(0).model().baseModel().source()); - Assertions.assertEquals("ts", model.value().get(0).model().baseModel().sourceAccount()); + Assertions.assertEquals("rmtqjkqevadr", model.nextLink()); + Assertions.assertEquals("gxnoqrxtdis", model.value().get(0).model().publisher()); + Assertions.assertEquals("evhdlmydid", model.value().get(0).model().format()); + Assertions.assertEquals("epfwwt", model.value().get(0).model().name()); + Assertions.assertEquals("doesxxhmwcdb", model.value().get(0).model().version()); + Assertions.assertEquals("yo", model.value().get(0).model().source()); + Assertions.assertEquals("xkxhnegknjzrbhtm", model.value().get(0).model().sourceAccount()); + Assertions.assertEquals("wvcmj", model.value().get(0).model().baseModel().publisher()); + Assertions.assertEquals("xiid", model.value().get(0).model().baseModel().format()); + Assertions.assertEquals("czskoswoqiqazu", model.value().get(0).model().baseModel().name()); + Assertions.assertEquals("mxzkr", model.value().get(0).model().baseModel().version()); + Assertions.assertEquals("oiisbamnppcce", model.value().get(0).model().baseModel().source()); + Assertions.assertEquals("ztdsbeza", model.value().get(0).model().baseModel().sourceAccount()); Assertions.assertFalse(model.value().get(0).model().isDefaultVersion()); - Assertions.assertEquals("nftguvriuhpr", model.value().get(0).model().skus().get(0).name()); - Assertions.assertEquals("dyvxqtayriww", model.value().get(0).model().skus().get(0).usageName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-20T03:51:26Z"), + Assertions.assertEquals("nepk", model.value().get(0).model().skus().get(0).name()); + Assertions.assertEquals("tiarxqiubxduk", model.value().get(0).model().skus().get(0).usageName()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-03T05:27:36Z"), model.value().get(0).model().skus().get(0).deprecationDate()); - Assertions.assertEquals(583849936, model.value().get(0).model().maxCapacity()); - Assertions.assertEquals("ozuhkfp", model.value().get(0).model().capabilities().get("sjyofdx")); - Assertions.assertEquals("smv", model.value().get(0).model().finetuneCapabilities().get("xwyjsflhhc")); - Assertions.assertEquals("ixhnrztf", model.value().get(0).model().deprecation().fineTune()); - Assertions.assertEquals("hb", model.value().get(0).model().deprecation().inference()); - Assertions.assertEquals(DeprecationStatus.TENTATIVE, + Assertions.assertEquals(7887655, model.value().get(0).model().maxCapacity()); + Assertions.assertEquals("mmkoszudb", model.value().get(0).model().capabilities().get("nsntrpcaqki")); + Assertions.assertEquals("yq", model.value().get(0).model().finetuneCapabilities().get("wusqx")); + Assertions.assertEquals("pbrruyu", model.value().get(0).model().deprecation().fineTune()); + Assertions.assertEquals("tvlmbjwcolbmxlb", model.value().get(0).model().deprecation().inference()); + Assertions.assertEquals(DeprecationStatus.PLANNED, model.value().get(0).model().deprecation().deprecationStatus()); - Assertions.assertEquals("laulppg", model.value().get(0).model().replacementConfig().targetModelName()); - Assertions.assertEquals("tpnapnyiropuhpig", - model.value().get(0).model().replacementConfig().targetModelVersion()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-18T16:57:02Z"), + Assertions.assertEquals("pa", model.value().get(0).model().replacementConfig().targetModelName()); + Assertions.assertEquals("rzrv", model.value().get(0).model().replacementConfig().targetModelVersion()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-25T19:22:53Z"), model.value().get(0).model().replacementConfig().autoUpgradeStartDate()); - Assertions.assertEquals(1573909011, + Assertions.assertEquals(351977978, model.value().get(0).model().replacementConfig().upgradeOnExpiryLeadTimeDays()); - Assertions.assertEquals("git", model.value().get(0).model().modelCatalogAssetId()); + Assertions.assertEquals("ocnxz", model.value().get(0).model().modelCatalogAssetId()); Assertions.assertEquals(ModelLifecycleStatus.DEPRECATED, model.value().get(0).model().lifecycleStatus()); - Assertions.assertEquals("lzdahzxctobgbkdm", model.value().get(0).kind()); - Assertions.assertEquals("zpostmgrcfbu", model.value().get(0).skuName()); - Assertions.assertEquals("mfqjhhkxbp", model.value().get(0).description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ModelListResult model = new ModelListResult().withNextLink("jriplrbpbewtghf") - .withValue(Arrays.asList( - new ModelInner() - .withModel(new AccountModelInner().withPublisher("v") - .withFormat("lynqwwncwzzh") - .withName("ktrmgucnapkt") - .withVersion("ellwptfdy") - .withSource("fqbuaceopzf") - .withSourceAccount("hhuao") - .withBaseModel(new DeploymentModel().withPublisher("xzvlvqhjkbegib") - .withFormat("mxiebw") - .withName("loayqcgw") - .withVersion("zjuzgwyz") - .withSource("txon") - .withSourceAccount("ts")) - .withIsDefaultVersion(false) - .withSkus(Arrays.asList( - new ModelSku().withName("nftguvriuhpr") - .withUsageName("dyvxqtayriww") - .withDeprecationDate(OffsetDateTime.parse("2021-05-20T03:51:26Z")) - .withCapacity(new CapacityConfig()) - .withRateLimits(Arrays.asList(new CallRateLimit(), new CallRateLimit(), - new CallRateLimit(), new CallRateLimit())) - .withCost(Arrays.asList(new BillingMeterInfo(), new BillingMeterInfo())), - new ModelSku().withName("cqibycnojv") - .withUsageName("mefqsgzvahapjyzh") - .withDeprecationDate(OffsetDateTime.parse("2021-04-21T18:37:49Z")) - .withCapacity(new CapacityConfig()) - .withRateLimits(Arrays.asList(new CallRateLimit(), new CallRateLimit(), - new CallRateLimit(), new CallRateLimit())) - .withCost(Arrays.asList(new BillingMeterInfo(), new BillingMeterInfo(), - new BillingMeterInfo())), - new ModelSku().withName("xdjzlmwlxk") - .withUsageName("gfhzovawjvzunlut") - .withDeprecationDate(OffsetDateTime.parse("2021-09-06T05:22:37Z")) - .withCapacity(new CapacityConfig()) - .withRateLimits(Arrays.asList(new CallRateLimit(), new CallRateLimit())) - .withCost(Arrays.asList(new BillingMeterInfo())), - new ModelSku().withName("eilpjzuaejxdu") - .withUsageName("skzbb") - .withDeprecationDate(OffsetDateTime.parse("2021-08-12T02:58:19Z")) - .withCapacity(new CapacityConfig()) - .withRateLimits(Arrays.asList(new CallRateLimit(), new CallRateLimit(), - new CallRateLimit(), new CallRateLimit())) - .withCost(Arrays.asList(new BillingMeterInfo())))) - .withMaxCapacity(583849936) - .withCapabilities(mapOf("sjyofdx", "ozuhkfp", "oekqvk", "uusdttouwa")) - .withFinetuneCapabilities( - mapOf("xwyjsflhhc", "smv", "ixisxyawjoy", "aln", "yexz", "qcslyjpkiid")) - .withDeprecation(new ModelDeprecationInfo().withFineTune("ixhnrztf") - .withInference("hb") - .withDeprecationStatus(DeprecationStatus.TENTATIVE)) - .withReplacementConfig(new ReplacementConfig().withTargetModelName("laulppg") - .withTargetModelVersion("tpnapnyiropuhpig") - .withAutoUpgradeStartDate(OffsetDateTime.parse("2021-05-18T16:57:02Z")) - .withUpgradeOnExpiryLeadTimeDays(1573909011)) - .withModelCatalogAssetId("git") - .withLifecycleStatus(ModelLifecycleStatus.DEPRECATED)) - .withKind("lzdahzxctobgbkdm") - .withSkuName("zpostmgrcfbu") - .withDescription("mfqjhhkxbp"), - new ModelInner() - .withModel(new AccountModelInner().withPublisher("l") - .withFormat("slqlfmmdn") - .withName("glzpswiydm") - .withVersion("yhz") - .withSource("ss") - .withSourceAccount("bzmnvdfznud") - .withBaseModel(new DeploymentModel().withPublisher("jhxxjyn") - .withFormat("divkrt") - .withName("bxqz") - .withVersion("zjf") - .withSource("vjfdx") - .withSourceAccount("vetvt")) - .withIsDefaultVersion(true) - .withSkus(Arrays.asList(new ModelSku().withName("wvxysl") - .withUsageName("hsfxoblytkb") - .withDeprecationDate(OffsetDateTime.parse("2021-09-21T19:24:42Z")) - .withCapacity(new CapacityConfig()) - .withRateLimits(Arrays.asList(new CallRateLimit(), new CallRateLimit(), new CallRateLimit(), - new CallRateLimit())) - .withCost( - Arrays.asList(new BillingMeterInfo(), new BillingMeterInfo(), new BillingMeterInfo())))) - .withMaxCapacity(1577221415) - .withCapabilities( - mapOf("vshqjohxcr", "rn", "sub", "bfovasrruvwbhsq", "rxbpyb", "gjb", "twss", "rfbjf")) - .withFinetuneCapabilities( - mapOf("vwpm", "tpvjzbexilzznfqq", "wqytjrybnwjewgdr", "taruoujmkcj", "doy", "ervnaenqpehi")) - .withDeprecation(new ModelDeprecationInfo().withFineTune("fthnzdn") - .withInference("l") - .withDeprecationStatus(DeprecationStatus.TENTATIVE)) - .withReplacementConfig(new ReplacementConfig().withTargetModelName("igynduhavhqlk") - .withTargetModelVersion("umaq") - .withAutoUpgradeStartDate(OffsetDateTime.parse("2021-04-19T22:18:17Z")) - .withUpgradeOnExpiryLeadTimeDays(1673515128)) - .withModelCatalogAssetId("duiertgcc") - .withLifecycleStatus(ModelLifecycleStatus.DEPRECATED)) - .withKind("blylpstdbh") - .withSkuName("srzdzucerscdn") - .withDescription("evfiwjmygt"), - new ModelInner() - .withModel( - new AccountModelInner().withPublisher("ihgwqapnedgfbcv") - .withFormat("vq") - .withName("keqdcvdrhvoods") - .withVersion("bobzdopcjwvnhd") - .withSource("wmgxcxrsl") - .withSourceAccount("utwu") - .withBaseModel(new DeploymentModel().withPublisher("s") - .withFormat("mweriofzpy") - .withName("emwabnet") - .withVersion("hszhedplvwiwu") - .withSource("wmbesldnkw") - .withSourceAccount("pp")) - .withIsDefaultVersion(true) - .withSkus( - Arrays.asList( - new ModelSku().withName("m") - .withUsageName("ikvmkqzeqqk") - .withDeprecationDate(OffsetDateTime.parse("2021-02-28T12:22:55Z")) - .withCapacity(new CapacityConfig()) - .withRateLimits(Arrays.asList(new CallRateLimit(), new CallRateLimit(), - new CallRateLimit())) - .withCost(Arrays.asList(new BillingMeterInfo())), - new ModelSku().withName("v") - .withUsageName("ur") - .withDeprecationDate(OffsetDateTime.parse("2020-12-25T12:19:04Z")) - .withCapacity(new CapacityConfig()) - .withRateLimits(Arrays.asList(new CallRateLimit(), new CallRateLimit(), - new CallRateLimit(), new CallRateLimit())) - .withCost(Arrays.asList(new BillingMeterInfo(), new BillingMeterInfo(), - new BillingMeterInfo())), - new ModelSku().withName("gxtibqdxbxw") - .withUsageName("bogqxndlkzgxhu") - .withDeprecationDate(OffsetDateTime.parse("2021-03-23T13:44:10Z")) - .withCapacity(new CapacityConfig()) - .withRateLimits(Arrays.asList(new CallRateLimit(), new CallRateLimit())) - .withCost(Arrays.asList(new BillingMeterInfo(), new BillingMeterInfo(), - new BillingMeterInfo(), new BillingMeterInfo())))) - .withMaxCapacity(1806634279) - .withCapabilities(mapOf("bqtkoievseotgqr", "bebxmubyyntwl", "mpgcjefuzmuvpbt", - "ltmuwlauwzizx", "morppxebmnzbtbh", "d", "ohdneuel", "pglkf")) - .withFinetuneCapabilities(mapOf("uvxzxclvi", "sdyhtozfikdowwq")) - .withDeprecation(new ModelDeprecationInfo().withFineTune("qzonosggbhcohf") - .withInference("sjnkal") - .withDeprecationStatus(DeprecationStatus.TENTATIVE)) - .withReplacementConfig(new ReplacementConfig().withTargetModelName("swacffgdkzz") - .withTargetModelVersion("kfvhqcrailvpn") - .withAutoUpgradeStartDate(OffsetDateTime.parse("2021-05-22T20:04:23Z")) - .withUpgradeOnExpiryLeadTimeDays(1159921712)) - .withModelCatalogAssetId("rwdmhdlxyjrxsa") - .withLifecycleStatus(ModelLifecycleStatus.STABLE)) - .withKind("niyqslui") - .withSkuName("dggkzzlvmbmpa") - .withDescription("odfvuefywsbp"))); - model = BinaryData.fromObject(model).toObject(ModelListResult.class); - Assertions.assertEquals("jriplrbpbewtghf", model.nextLink()); - Assertions.assertEquals("v", model.value().get(0).model().publisher()); - Assertions.assertEquals("lynqwwncwzzh", model.value().get(0).model().format()); - Assertions.assertEquals("ktrmgucnapkt", model.value().get(0).model().name()); - Assertions.assertEquals("ellwptfdy", model.value().get(0).model().version()); - Assertions.assertEquals("fqbuaceopzf", model.value().get(0).model().source()); - Assertions.assertEquals("hhuao", model.value().get(0).model().sourceAccount()); - Assertions.assertEquals("xzvlvqhjkbegib", model.value().get(0).model().baseModel().publisher()); - Assertions.assertEquals("mxiebw", model.value().get(0).model().baseModel().format()); - Assertions.assertEquals("loayqcgw", model.value().get(0).model().baseModel().name()); - Assertions.assertEquals("zjuzgwyz", model.value().get(0).model().baseModel().version()); - Assertions.assertEquals("txon", model.value().get(0).model().baseModel().source()); - Assertions.assertEquals("ts", model.value().get(0).model().baseModel().sourceAccount()); - Assertions.assertFalse(model.value().get(0).model().isDefaultVersion()); - Assertions.assertEquals("nftguvriuhpr", model.value().get(0).model().skus().get(0).name()); - Assertions.assertEquals("dyvxqtayriww", model.value().get(0).model().skus().get(0).usageName()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-20T03:51:26Z"), - model.value().get(0).model().skus().get(0).deprecationDate()); - Assertions.assertEquals(583849936, model.value().get(0).model().maxCapacity()); - Assertions.assertEquals("ozuhkfp", model.value().get(0).model().capabilities().get("sjyofdx")); - Assertions.assertEquals("smv", model.value().get(0).model().finetuneCapabilities().get("xwyjsflhhc")); - Assertions.assertEquals("ixhnrztf", model.value().get(0).model().deprecation().fineTune()); - Assertions.assertEquals("hb", model.value().get(0).model().deprecation().inference()); - Assertions.assertEquals(DeprecationStatus.TENTATIVE, - model.value().get(0).model().deprecation().deprecationStatus()); - Assertions.assertEquals("laulppg", model.value().get(0).model().replacementConfig().targetModelName()); - Assertions.assertEquals("tpnapnyiropuhpig", - model.value().get(0).model().replacementConfig().targetModelVersion()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-18T16:57:02Z"), - model.value().get(0).model().replacementConfig().autoUpgradeStartDate()); - Assertions.assertEquals(1573909011, - model.value().get(0).model().replacementConfig().upgradeOnExpiryLeadTimeDays()); - Assertions.assertEquals("git", model.value().get(0).model().modelCatalogAssetId()); - Assertions.assertEquals(ModelLifecycleStatus.DEPRECATED, model.value().get(0).model().lifecycleStatus()); - Assertions.assertEquals("lzdahzxctobgbkdm", model.value().get(0).kind()); - Assertions.assertEquals("zpostmgrcfbu", model.value().get(0).skuName()); - Assertions.assertEquals("mfqjhhkxbp", model.value().get(0).description()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + Assertions.assertEquals("rlbpgsnbagnc", model.value().get(0).kind()); + Assertions.assertEquals("hg", model.value().get(0).skuName()); + Assertions.assertEquals("uowakyw", model.value().get(0).description()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/MultiRegionSettingsTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/MultiRegionSettingsTests.java index d19f77df6c83..8d7b69254f43 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/MultiRegionSettingsTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/MultiRegionSettingsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -15,23 +15,23 @@ public final class MultiRegionSettingsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MultiRegionSettings model = BinaryData.fromString( - "{\"routingMethod\":\"Weighted\",\"regions\":[{\"name\":\"yqkgfg\",\"value\":77.32275,\"customsubdomain\":\"dgak\"}]}") + "{\"routingMethod\":\"Performance\",\"regions\":[{\"name\":\"c\",\"value\":3.4862816,\"customsubdomain\":\"aierhhb\"}]}") .toObject(MultiRegionSettings.class); - Assertions.assertEquals(RoutingMethods.WEIGHTED, model.routingMethod()); - Assertions.assertEquals("yqkgfg", model.regions().get(0).name()); - Assertions.assertEquals(77.32275F, model.regions().get(0).value()); - Assertions.assertEquals("dgak", model.regions().get(0).customsubdomain()); + Assertions.assertEquals(RoutingMethods.PERFORMANCE, model.routingMethod()); + Assertions.assertEquals("c", model.regions().get(0).name()); + Assertions.assertEquals(3.4862816F, model.regions().get(0).value()); + Assertions.assertEquals("aierhhb", model.regions().get(0).customsubdomain()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MultiRegionSettings model = new MultiRegionSettings().withRoutingMethod(RoutingMethods.WEIGHTED) + MultiRegionSettings model = new MultiRegionSettings().withRoutingMethod(RoutingMethods.PERFORMANCE) .withRegions( - Arrays.asList(new RegionSetting().withName("yqkgfg").withValue(77.32275F).withCustomsubdomain("dgak"))); + Arrays.asList(new RegionSetting().withName("c").withValue(3.4862816F).withCustomsubdomain("aierhhb"))); model = BinaryData.fromObject(model).toObject(MultiRegionSettings.class); - Assertions.assertEquals(RoutingMethods.WEIGHTED, model.routingMethod()); - Assertions.assertEquals("yqkgfg", model.regions().get(0).name()); - Assertions.assertEquals(77.32275F, model.regions().get(0).value()); - Assertions.assertEquals("dgak", model.regions().get(0).customsubdomain()); + Assertions.assertEquals(RoutingMethods.PERFORMANCE, model.routingMethod()); + Assertions.assertEquals("c", model.regions().get(0).name()); + Assertions.assertEquals(3.4862816F, model.regions().get(0).value()); + Assertions.assertEquals("aierhhb", model.regions().get(0).customsubdomain()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkInjectionTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkInjectionTests.java index 1ef8fda5eba7..1c60f825d9d1 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkInjectionTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkInjectionTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -13,21 +13,22 @@ public final class NetworkInjectionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NetworkInjection model = BinaryData - .fromString("{\"scenario\":\"none\",\"subnetArmId\":\"cuertu\",\"useMicrosoftManagedNetwork\":true}") + .fromString( + "{\"scenario\":\"none\",\"subnetArmId\":\"zrlovmclwhijcoej\",\"useMicrosoftManagedNetwork\":true}") .toObject(NetworkInjection.class); Assertions.assertEquals(ScenarioType.NONE, model.scenario()); - Assertions.assertEquals("cuertu", model.subnetArmId()); + Assertions.assertEquals("zrlovmclwhijcoej", model.subnetArmId()); Assertions.assertTrue(model.useMicrosoftManagedNetwork()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { NetworkInjection model = new NetworkInjection().withScenario(ScenarioType.NONE) - .withSubnetArmId("cuertu") + .withSubnetArmId("zrlovmclwhijcoej") .withUseMicrosoftManagedNetwork(true); model = BinaryData.fromObject(model).toObject(NetworkInjection.class); Assertions.assertEquals(ScenarioType.NONE, model.scenario()); - Assertions.assertEquals("cuertu", model.subnetArmId()); + Assertions.assertEquals("zrlovmclwhijcoej", model.subnetArmId()); Assertions.assertTrue(model.useMicrosoftManagedNetwork()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkRuleSetTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkRuleSetTests.java index 37f9ed7510dc..56b79226827c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkRuleSetTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkRuleSetTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -17,31 +17,30 @@ public final class NetworkRuleSetTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NetworkRuleSet model = BinaryData.fromString( - "{\"defaultAction\":\"Deny\",\"bypass\":\"AzureServices\",\"ipRules\":[{\"value\":\"xj\"},{\"value\":\"prozvcputegjvwmf\"},{\"value\":\"atscmd\"},{\"value\":\"pjhulsuuvmkj\"}],\"virtualNetworkRules\":[{\"id\":\"rwfndiod\",\"state\":\"slwejdpvw\",\"ignoreMissingVnetServiceEndpoint\":false}]}") + "{\"defaultAction\":\"Deny\",\"bypass\":\"None\",\"ipRules\":[{\"value\":\"xppbhtqqro\"}],\"virtualNetworkRules\":[{\"id\":\"fpsalgbqu\",\"state\":\"gjyjgzjaoyfhrtxi\",\"ignoreMissingVnetServiceEndpoint\":false}]}") .toObject(NetworkRuleSet.class); Assertions.assertEquals(NetworkRuleAction.DENY, model.defaultAction()); - Assertions.assertEquals(ByPassSelection.AZURE_SERVICES, model.bypass()); - Assertions.assertEquals("xj", model.ipRules().get(0).value()); - Assertions.assertEquals("rwfndiod", model.virtualNetworkRules().get(0).id()); - Assertions.assertEquals("slwejdpvw", model.virtualNetworkRules().get(0).state()); + Assertions.assertEquals(ByPassSelection.NONE, model.bypass()); + Assertions.assertEquals("xppbhtqqro", model.ipRules().get(0).value()); + Assertions.assertEquals("fpsalgbqu", model.virtualNetworkRules().get(0).id()); + Assertions.assertEquals("gjyjgzjaoyfhrtxi", model.virtualNetworkRules().get(0).state()); Assertions.assertFalse(model.virtualNetworkRules().get(0).ignoreMissingVnetServiceEndpoint()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { NetworkRuleSet model = new NetworkRuleSet().withDefaultAction(NetworkRuleAction.DENY) - .withBypass(ByPassSelection.AZURE_SERVICES) - .withIpRules(Arrays.asList(new IpRule().withValue("xj"), new IpRule().withValue("prozvcputegjvwmf"), - new IpRule().withValue("atscmd"), new IpRule().withValue("pjhulsuuvmkj"))) - .withVirtualNetworkRules(Arrays.asList(new VirtualNetworkRule().withId("rwfndiod") - .withState("slwejdpvw") + .withBypass(ByPassSelection.NONE) + .withIpRules(Arrays.asList(new IpRule().withValue("xppbhtqqro"))) + .withVirtualNetworkRules(Arrays.asList(new VirtualNetworkRule().withId("fpsalgbqu") + .withState("gjyjgzjaoyfhrtxi") .withIgnoreMissingVnetServiceEndpoint(false))); model = BinaryData.fromObject(model).toObject(NetworkRuleSet.class); Assertions.assertEquals(NetworkRuleAction.DENY, model.defaultAction()); - Assertions.assertEquals(ByPassSelection.AZURE_SERVICES, model.bypass()); - Assertions.assertEquals("xj", model.ipRules().get(0).value()); - Assertions.assertEquals("rwfndiod", model.virtualNetworkRules().get(0).id()); - Assertions.assertEquals("slwejdpvw", model.virtualNetworkRules().get(0).state()); + Assertions.assertEquals(ByPassSelection.NONE, model.bypass()); + Assertions.assertEquals("xppbhtqqro", model.ipRules().get(0).value()); + Assertions.assertEquals("fpsalgbqu", model.virtualNetworkRules().get(0).id()); + Assertions.assertEquals("gjyjgzjaoyfhrtxi", model.virtualNetworkRules().get(0).state()); Assertions.assertFalse(model.virtualNetworkRules().get(0).ignoreMissingVnetServiceEndpoint()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItemTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItemTests.java index ef2d1df722d2..c8a16aa5597e 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItemTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItemTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -11,18 +11,8 @@ public final class NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItemTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem model - = BinaryData.fromString("{\"id\":\"viirhgfgrws\"}") - .toObject(NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem.class); - Assertions.assertEquals("viirhgfgrws", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem model - = new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("viirhgfgrws"); - model = BinaryData.fromObject(model) + NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem model = BinaryData.fromString("{\"id\":\"v\"}") .toObject(NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem.class); - Assertions.assertEquals("viirhgfgrws", model.id()); + Assertions.assertEquals("v", model.id()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterAccessRulePropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterAccessRulePropertiesTests.java index 353724a4f388..1d755bcf2929 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterAccessRulePropertiesTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterAccessRulePropertiesTests.java @@ -1,60 +1,26 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeter; import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRuleProperties; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem; import com.azure.resourcemanager.cognitiveservices.models.NspAccessRuleDirection; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class NetworkSecurityPerimeterAccessRulePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NetworkSecurityPerimeterAccessRuleProperties model = BinaryData.fromString( - "{\"direction\":\"Outbound\",\"addressPrefixes\":[\"oqeq\"],\"subscriptions\":[{\"id\":\"vlagun\"},{\"id\":\"gfebwlnb\"},{\"id\":\"yreeudz\"}],\"networkSecurityPerimeters\":[{\"id\":\"pdqmjxlyyzglgouw\",\"perimeterGuid\":\"mjjyuojq\",\"location\":\"baxk\"},{\"id\":\"ytunlbfjkwr\",\"perimeterGuid\":\"nkqbhsyrq\",\"location\":\"jqhden\"},{\"id\":\"ulkpakd\",\"perimeterGuid\":\"fmjnnawtqa\",\"location\":\"xuckpggqoweyir\"},{\"id\":\"lisn\",\"perimeterGuid\":\"fl\",\"location\":\"mpizru\"}],\"fullyQualifiedDomainNames\":[\"qxpxiwfcngjsaa\",\"iixtmkzj\"]}") + "{\"direction\":\"Outbound\",\"addressPrefixes\":[\"thwtzol\",\"a\"],\"subscriptions\":[{\"id\":\"dxmeb\"}],\"networkSecurityPerimeters\":[{\"id\":\"jpahlxvea\",\"perimeterGuid\":\"qxnmwmqt\",\"location\":\"xyi\"},{\"id\":\"dt\",\"perimeterGuid\":\"cttadi\",\"location\":\"eukmr\"},{\"id\":\"eekpndz\",\"perimeterGuid\":\"pmudqmeqwig\",\"location\":\"bu\"}],\"fullyQualifiedDomainNames\":[\"yxeb\",\"ybpmzznrtffyaq\",\"tmhheioqa\"]}") .toObject(NetworkSecurityPerimeterAccessRuleProperties.class); Assertions.assertEquals(NspAccessRuleDirection.OUTBOUND, model.direction()); - Assertions.assertEquals("oqeq", model.addressPrefixes().get(0)); - Assertions.assertEquals("vlagun", model.subscriptions().get(0).id()); - Assertions.assertEquals("pdqmjxlyyzglgouw", model.networkSecurityPerimeters().get(0).id()); - Assertions.assertEquals("mjjyuojq", model.networkSecurityPerimeters().get(0).perimeterGuid()); - Assertions.assertEquals("baxk", model.networkSecurityPerimeters().get(0).location()); - Assertions.assertEquals("qxpxiwfcngjsaa", model.fullyQualifiedDomainNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkSecurityPerimeterAccessRuleProperties model - = new NetworkSecurityPerimeterAccessRuleProperties().withDirection(NspAccessRuleDirection.OUTBOUND) - .withAddressPrefixes(Arrays.asList("oqeq")) - .withSubscriptions( - Arrays.asList(new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("vlagun"), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("gfebwlnb"), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("yreeudz"))) - .withNetworkSecurityPerimeters(Arrays.asList( - new NetworkSecurityPerimeter().withId("pdqmjxlyyzglgouw") - .withPerimeterGuid("mjjyuojq") - .withLocation("baxk"), - new NetworkSecurityPerimeter().withId("ytunlbfjkwr") - .withPerimeterGuid("nkqbhsyrq") - .withLocation("jqhden"), - new NetworkSecurityPerimeter().withId("ulkpakd") - .withPerimeterGuid("fmjnnawtqa") - .withLocation("xuckpggqoweyir"), - new NetworkSecurityPerimeter().withId("lisn").withPerimeterGuid("fl").withLocation("mpizru"))) - .withFullyQualifiedDomainNames(Arrays.asList("qxpxiwfcngjsaa", "iixtmkzj")); - model = BinaryData.fromObject(model).toObject(NetworkSecurityPerimeterAccessRuleProperties.class); - Assertions.assertEquals(NspAccessRuleDirection.OUTBOUND, model.direction()); - Assertions.assertEquals("oqeq", model.addressPrefixes().get(0)); - Assertions.assertEquals("vlagun", model.subscriptions().get(0).id()); - Assertions.assertEquals("pdqmjxlyyzglgouw", model.networkSecurityPerimeters().get(0).id()); - Assertions.assertEquals("mjjyuojq", model.networkSecurityPerimeters().get(0).perimeterGuid()); - Assertions.assertEquals("baxk", model.networkSecurityPerimeters().get(0).location()); - Assertions.assertEquals("qxpxiwfcngjsaa", model.fullyQualifiedDomainNames().get(0)); + Assertions.assertEquals("thwtzol", model.addressPrefixes().get(0)); + Assertions.assertEquals("dxmeb", model.subscriptions().get(0).id()); + Assertions.assertEquals("jpahlxvea", model.networkSecurityPerimeters().get(0).id()); + Assertions.assertEquals("qxnmwmqt", model.networkSecurityPerimeters().get(0).perimeterGuid()); + Assertions.assertEquals("xyi", model.networkSecurityPerimeters().get(0).location()); + Assertions.assertEquals("yxeb", model.fullyQualifiedDomainNames().get(0)); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterAccessRuleTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterAccessRuleTests.java index f9c7d928a22f..89c248bf4099 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterAccessRuleTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterAccessRuleTests.java @@ -1,66 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeter; import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRule; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRuleProperties; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem; import com.azure.resourcemanager.cognitiveservices.models.NspAccessRuleDirection; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class NetworkSecurityPerimeterAccessRuleTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NetworkSecurityPerimeterAccessRule model = BinaryData.fromString( - "{\"name\":\"ikzebr\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"ziqgfuh\",\"kzruswh\",\"hczznvf\"],\"subscriptions\":[{\"id\":\"sxjwwixz\"},{\"id\":\"mwmxqhndvnoamld\"}],\"networkSecurityPerimeters\":[{\"id\":\"ohdjhhflzok\",\"perimeterGuid\":\"ox\",\"location\":\"lnjetaglt\"},{\"id\":\"oatftgzpnpbswvef\",\"perimeterGuid\":\"ccsrmozihmipgaw\",\"location\":\"xp\"},{\"id\":\"jcxcjxgrytfmpcyc\",\"perimeterGuid\":\"rmcaykgg\",\"location\":\"xu\"},{\"id\":\"rksxwpndfc\",\"perimeterGuid\":\"nznthjtw\",\"location\":\"aosrxuz\"}],\"fullyQualifiedDomainNames\":[\"mktcqiosmgbza\",\"gxq\",\"lyrtltlaprlt\",\"katbhjm\"]}}") + "{\"name\":\"llibphbqzmizak\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"p\"],\"subscriptions\":[{\"id\":\"ha\"},{\"id\":\"ylhjlm\"}],\"networkSecurityPerimeters\":[{\"id\":\"primr\",\"perimeterGuid\":\"pteecjme\",\"location\":\"ls\"}],\"fullyQualifiedDomainNames\":[\"sylwxdzaumweooh\",\"uufuz\"]}}") .toObject(NetworkSecurityPerimeterAccessRule.class); - Assertions.assertEquals("ikzebr", model.name()); - Assertions.assertEquals(NspAccessRuleDirection.INBOUND, model.properties().direction()); - Assertions.assertEquals("ziqgfuh", model.properties().addressPrefixes().get(0)); - Assertions.assertEquals("sxjwwixz", model.properties().subscriptions().get(0).id()); - Assertions.assertEquals("ohdjhhflzok", model.properties().networkSecurityPerimeters().get(0).id()); - Assertions.assertEquals("ox", model.properties().networkSecurityPerimeters().get(0).perimeterGuid()); - Assertions.assertEquals("lnjetaglt", model.properties().networkSecurityPerimeters().get(0).location()); - Assertions.assertEquals("mktcqiosmgbza", model.properties().fullyQualifiedDomainNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkSecurityPerimeterAccessRule model - = new NetworkSecurityPerimeterAccessRule().withName("ikzebr") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.INBOUND) - .withAddressPrefixes(Arrays.asList("ziqgfuh", "kzruswh", "hczznvf")) - .withSubscriptions(Arrays.asList( - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("sxjwwixz"), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("mwmxqhndvnoamld"))) - .withNetworkSecurityPerimeters(Arrays.asList( - new NetworkSecurityPerimeter().withId("ohdjhhflzok") - .withPerimeterGuid("ox") - .withLocation("lnjetaglt"), - new NetworkSecurityPerimeter().withId("oatftgzpnpbswvef") - .withPerimeterGuid("ccsrmozihmipgaw") - .withLocation("xp"), - new NetworkSecurityPerimeter().withId("jcxcjxgrytfmpcyc") - .withPerimeterGuid("rmcaykgg") - .withLocation("xu"), - new NetworkSecurityPerimeter().withId("rksxwpndfc") - .withPerimeterGuid("nznthjtw") - .withLocation("aosrxuz"))) - .withFullyQualifiedDomainNames(Arrays.asList("mktcqiosmgbza", "gxq", "lyrtltlaprlt", "katbhjm"))); - model = BinaryData.fromObject(model).toObject(NetworkSecurityPerimeterAccessRule.class); - Assertions.assertEquals("ikzebr", model.name()); - Assertions.assertEquals(NspAccessRuleDirection.INBOUND, model.properties().direction()); - Assertions.assertEquals("ziqgfuh", model.properties().addressPrefixes().get(0)); - Assertions.assertEquals("sxjwwixz", model.properties().subscriptions().get(0).id()); - Assertions.assertEquals("ohdjhhflzok", model.properties().networkSecurityPerimeters().get(0).id()); - Assertions.assertEquals("ox", model.properties().networkSecurityPerimeters().get(0).perimeterGuid()); - Assertions.assertEquals("lnjetaglt", model.properties().networkSecurityPerimeters().get(0).location()); - Assertions.assertEquals("mktcqiosmgbza", model.properties().fullyQualifiedDomainNames().get(0)); + Assertions.assertEquals("llibphbqzmizak", model.name()); + Assertions.assertEquals(NspAccessRuleDirection.OUTBOUND, model.properties().direction()); + Assertions.assertEquals("p", model.properties().addressPrefixes().get(0)); + Assertions.assertEquals("ha", model.properties().subscriptions().get(0).id()); + Assertions.assertEquals("primr", model.properties().networkSecurityPerimeters().get(0).id()); + Assertions.assertEquals("pteecjme", model.properties().networkSecurityPerimeters().get(0).perimeterGuid()); + Assertions.assertEquals("ls", model.properties().networkSecurityPerimeters().get(0).location()); + Assertions.assertEquals("sylwxdzaumweooh", model.properties().fullyQualifiedDomainNames().get(0)); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationAssociationInfoTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationAssociationInfoTests.java index 0111325382f9..2375bf196eef 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationAssociationInfoTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationAssociationInfoTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,19 +12,9 @@ public final class NetworkSecurityPerimeterConfigurationAssociationInfoTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NetworkSecurityPerimeterConfigurationAssociationInfo model - = BinaryData.fromString("{\"name\":\"kwfbkgo\",\"accessMode\":\"wopdbydpiz\"}") + = BinaryData.fromString("{\"name\":\"uhiosrsju\",\"accessMode\":\"fcdis\"}") .toObject(NetworkSecurityPerimeterConfigurationAssociationInfo.class); - Assertions.assertEquals("kwfbkgo", model.name()); - Assertions.assertEquals("wopdbydpiz", model.accessMode()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkSecurityPerimeterConfigurationAssociationInfo model - = new NetworkSecurityPerimeterConfigurationAssociationInfo().withName("kwfbkgo") - .withAccessMode("wopdbydpiz"); - model = BinaryData.fromObject(model).toObject(NetworkSecurityPerimeterConfigurationAssociationInfo.class); - Assertions.assertEquals("kwfbkgo", model.name()); - Assertions.assertEquals("wopdbydpiz", model.accessMode()); + Assertions.assertEquals("uhiosrsju", model.name()); + Assertions.assertEquals("fcdis", model.accessMode()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationInnerTests.java index ea1dfd217cc8..3650e5fc5f2f 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationInnerTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationInnerTests.java @@ -1,158 +1,43 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.cognitiveservices.fluent.models.NetworkSecurityPerimeterConfigurationInner; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeter; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRule; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRuleProperties; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterConfigurationAssociationInfo; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterConfigurationProperties; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterProfileInfo; import com.azure.resourcemanager.cognitiveservices.models.NspAccessRuleDirection; -import com.azure.resourcemanager.cognitiveservices.models.ProvisioningIssue; -import com.azure.resourcemanager.cognitiveservices.models.ProvisioningIssueProperties; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class NetworkSecurityPerimeterConfigurationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NetworkSecurityPerimeterConfigurationInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"teecjmeislst\",\"provisioningIssues\":[{\"name\":\"lwxdzaum\",\"properties\":{\"issueType\":\"ohguuf\",\"severity\":\"boyjathwt\",\"description\":\"lbaemwmdxmeb\",\"suggestedResourceIds\":[\"cjpahl\",\"veabfqxnmwmqtib\",\"yijddtvqcttad\"],\"suggestedAccessRules\":[{},{}]}},{\"name\":\"ukm\",\"properties\":{\"issueType\":\"eekpndz\",\"severity\":\"pmudqmeqwig\",\"description\":\"bu\",\"suggestedResourceIds\":[\"yxeb\",\"ybpmzznrtffyaq\",\"tmhheioqa\"],\"suggestedAccessRules\":[{}]}},{\"name\":\"eufuqyrxpdlcgql\",\"properties\":{\"issueType\":\"mjqfrddgamquhio\",\"severity\":\"sjuivfcdisyir\",\"description\":\"zhczexrxzbujrtrh\",\"suggestedResourceIds\":[\"revkhgnlnzo\",\"zlrpiqywncvj\",\"szcofizeht\",\"hgbjkvrelje\"],\"suggestedAccessRules\":[{},{},{},{}]}},{\"name\":\"vzmlovuanashcxl\",\"properties\":{\"issueType\":\"erbdk\",\"severity\":\"vidizozsdb\",\"description\":\"xjmonf\",\"suggestedResourceIds\":[\"w\",\"cypuuwwlt\",\"uqj\"],\"suggestedAccessRules\":[{},{},{},{}]}}],\"networkSecurityPerimeter\":{\"id\":\"keifzzhmkdasv\",\"perimeterGuid\":\"yhbxcudchxgs\",\"location\":\"oldforobw\"},\"resourceAssociation\":{\"name\":\"izbfhfovvacq\",\"accessMode\":\"tuodxeszabbelaw\"},\"profile\":{\"name\":\"aslzkwr\",\"accessRulesVersion\":8393955549840736725,\"accessRules\":[{\"name\":\"cwyhahno\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"uh\",\"svfuurutlwexxwl\",\"lniexz\"],\"subscriptions\":[{},{}],\"networkSecurityPerimeters\":[{},{},{}],\"fullyQualifiedDomainNames\":[\"q\",\"yb\"]}},{\"name\":\"wpgdak\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"ixqnrkcxkjibnxm\",\"suxswqrntvlwijp\",\"ttexoqqpwcyyufmh\",\"uncuw\"],\"subscriptions\":[{},{}],\"networkSecurityPerimeters\":[{},{},{}],\"fullyQualifiedDomainNames\":[\"qzhlctddunq\"]}},{\"name\":\"yfp\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"jjrcgegydc\",\"boxjumvq\",\"olihrra\",\"ouau\"],\"subscriptions\":[{}],\"networkSecurityPerimeters\":[{},{},{},{}],\"fullyQualifiedDomainNames\":[\"xfuojrn\",\"iflrzpasccbiu\",\"mzdlyjdfqwmkyo\"]}}],\"diagnosticSettingsVersion\":6880229731652721243,\"enabledLogCategories\":[\"uzslzojhpctfnmdx\",\"tngfdgugeyzihgr\"]}},\"id\":\"ui\",\"name\":\"absnmfpp\",\"type\":\"ojeevy\"}") + "{\"properties\":{\"provisioningState\":\"vkjlmxhom\",\"provisioningIssues\":[{\"name\":\"dwdigumb\",\"properties\":{\"issueType\":\"auzzptjazysd\",\"severity\":\"ezwwv\",\"description\":\"qyuvvfonkp\",\"suggestedResourceIds\":[\"yik\",\"y\"],\"suggestedAccessRules\":[{}]}},{\"name\":\"avluwmncs\",\"properties\":{\"issueType\":\"jfybvpoekrsgsgb\",\"severity\":\"uzqgnjdgkynsc\",\"description\":\"qhzvhxnkomt\",\"suggestedResourceIds\":[\"otppnv\"],\"suggestedAccessRules\":[{}]}},{\"name\":\"hihfrbbcevqagtlt\",\"properties\":{\"issueType\":\"fkqojpy\",\"severity\":\"gtrd\",\"description\":\"ifmzzsd\",\"suggestedResourceIds\":[\"rnysux\"],\"suggestedAccessRules\":[{},{},{},{}]}},{\"name\":\"fwgckhocxvdfffw\",\"properties\":{\"issueType\":\"roud\",\"severity\":\"pavehhr\",\"description\":\"bunzozudh\",\"suggestedResourceIds\":[\"kmoyxcdyuibh\",\"fdn\",\"zydvfvf\",\"jnaeois\"],\"suggestedAccessRules\":[{},{},{},{}]}}],\"networkSecurityPerimeter\":{\"id\":\"orffukiscv\",\"perimeterGuid\":\"zhwplefaxvxilc\",\"location\":\"gnhnzeyq\"},\"resourceAssociation\":{\"name\":\"jfzqlqhycavodgg\",\"accessMode\":\"beesmieknlra\"},\"profile\":{\"name\":\"awiuagyd\",\"accessRulesVersion\":8392450859936249123,\"accessRules\":[{\"name\":\"rfgi\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"ocqwogfnzjvus\",\"zldmozuxy\",\"fsbtkad\",\"ysownbtgkbug\"],\"subscriptions\":[{},{},{}],\"networkSecurityPerimeters\":[{}],\"fullyQualifiedDomainNames\":[\"cmisofie\"]}}],\"diagnosticSettingsVersion\":3696024877385446092,\"enabledLogCategories\":[\"yqdhcuplcplcw\"]}},\"id\":\"ihih\",\"name\":\"hzdsqtzbsrgnow\",\"type\":\"jhf\"}") .toObject(NetworkSecurityPerimeterConfigurationInner.class); - Assertions.assertEquals("lwxdzaum", model.properties().provisioningIssues().get(0).name()); - Assertions.assertEquals("ohguuf", model.properties().provisioningIssues().get(0).properties().issueType()); - Assertions.assertEquals("boyjathwt", model.properties().provisioningIssues().get(0).properties().severity()); - Assertions.assertEquals("lbaemwmdxmeb", + Assertions.assertEquals("dwdigumb", model.properties().provisioningIssues().get(0).name()); + Assertions.assertEquals("auzzptjazysd", + model.properties().provisioningIssues().get(0).properties().issueType()); + Assertions.assertEquals("ezwwv", model.properties().provisioningIssues().get(0).properties().severity()); + Assertions.assertEquals("qyuvvfonkp", model.properties().provisioningIssues().get(0).properties().description()); - Assertions.assertEquals("cjpahl", + Assertions.assertEquals("yik", model.properties().provisioningIssues().get(0).properties().suggestedResourceIds().get(0)); - Assertions.assertEquals("keifzzhmkdasv", model.properties().networkSecurityPerimeter().id()); - Assertions.assertEquals("yhbxcudchxgs", model.properties().networkSecurityPerimeter().perimeterGuid()); - Assertions.assertEquals("oldforobw", model.properties().networkSecurityPerimeter().location()); - Assertions.assertEquals("izbfhfovvacq", model.properties().resourceAssociation().name()); - Assertions.assertEquals("tuodxeszabbelaw", model.properties().resourceAssociation().accessMode()); - Assertions.assertEquals("aslzkwr", model.properties().profile().name()); - Assertions.assertEquals(8393955549840736725L, model.properties().profile().accessRulesVersion()); - Assertions.assertEquals("cwyhahno", model.properties().profile().accessRules().get(0).name()); + Assertions.assertEquals("orffukiscv", model.properties().networkSecurityPerimeter().id()); + Assertions.assertEquals("zhwplefaxvxilc", model.properties().networkSecurityPerimeter().perimeterGuid()); + Assertions.assertEquals("gnhnzeyq", model.properties().networkSecurityPerimeter().location()); + Assertions.assertEquals("jfzqlqhycavodgg", model.properties().resourceAssociation().name()); + Assertions.assertEquals("beesmieknlra", model.properties().resourceAssociation().accessMode()); + Assertions.assertEquals("awiuagyd", model.properties().profile().name()); + Assertions.assertEquals(8392450859936249123L, model.properties().profile().accessRulesVersion()); + Assertions.assertEquals("rfgi", model.properties().profile().accessRules().get(0).name()); Assertions.assertEquals(NspAccessRuleDirection.OUTBOUND, model.properties().profile().accessRules().get(0).properties().direction()); - Assertions.assertEquals("uh", + Assertions.assertEquals("ocqwogfnzjvus", model.properties().profile().accessRules().get(0).properties().addressPrefixes().get(0)); - Assertions.assertEquals("q", + Assertions.assertEquals("cmisofie", model.properties().profile().accessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); - Assertions.assertEquals(6880229731652721243L, model.properties().profile().diagnosticSettingsVersion()); - Assertions.assertEquals("uzslzojhpctfnmdx", model.properties().profile().enabledLogCategories().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkSecurityPerimeterConfigurationInner model = new NetworkSecurityPerimeterConfigurationInner() - .withProperties(new NetworkSecurityPerimeterConfigurationProperties() - .withProvisioningIssues(Arrays.asList( - new ProvisioningIssue().withName("lwxdzaum") - .withProperties(new ProvisioningIssueProperties().withIssueType("ohguuf") - .withSeverity("boyjathwt") - .withDescription("lbaemwmdxmeb") - .withSuggestedResourceIds(Arrays.asList("cjpahl", "veabfqxnmwmqtib", "yijddtvqcttad")) - .withSuggestedAccessRules(Arrays.asList(new NetworkSecurityPerimeterAccessRule(), - new NetworkSecurityPerimeterAccessRule()))), - new ProvisioningIssue().withName("ukm") - .withProperties(new ProvisioningIssueProperties().withIssueType("eekpndz") - .withSeverity("pmudqmeqwig") - .withDescription("bu") - .withSuggestedResourceIds(Arrays.asList("yxeb", "ybpmzznrtffyaq", "tmhheioqa")) - .withSuggestedAccessRules(Arrays.asList(new NetworkSecurityPerimeterAccessRule()))), - new ProvisioningIssue().withName("eufuqyrxpdlcgql") - .withProperties(new ProvisioningIssueProperties().withIssueType("mjqfrddgamquhio") - .withSeverity("sjuivfcdisyir") - .withDescription("zhczexrxzbujrtrh") - .withSuggestedResourceIds( - Arrays.asList("revkhgnlnzo", "zlrpiqywncvj", "szcofizeht", "hgbjkvrelje")) - .withSuggestedAccessRules(Arrays.asList(new NetworkSecurityPerimeterAccessRule(), - new NetworkSecurityPerimeterAccessRule(), new NetworkSecurityPerimeterAccessRule(), - new NetworkSecurityPerimeterAccessRule()))), - new ProvisioningIssue().withName("vzmlovuanashcxl") - .withProperties(new ProvisioningIssueProperties().withIssueType("erbdk") - .withSeverity("vidizozsdb") - .withDescription("xjmonf") - .withSuggestedResourceIds(Arrays.asList("w", "cypuuwwlt", "uqj")) - .withSuggestedAccessRules(Arrays.asList(new NetworkSecurityPerimeterAccessRule(), - new NetworkSecurityPerimeterAccessRule(), new NetworkSecurityPerimeterAccessRule(), - new NetworkSecurityPerimeterAccessRule()))))) - .withNetworkSecurityPerimeter(new NetworkSecurityPerimeter().withId("keifzzhmkdasv") - .withPerimeterGuid("yhbxcudchxgs") - .withLocation("oldforobw")) - .withResourceAssociation( - new NetworkSecurityPerimeterConfigurationAssociationInfo().withName("izbfhfovvacq") - .withAccessMode("tuodxeszabbelaw")) - .withProfile( - new NetworkSecurityPerimeterProfileInfo().withName("aslzkwr") - .withAccessRulesVersion(8393955549840736725L) - .withAccessRules(Arrays.asList( - new NetworkSecurityPerimeterAccessRule().withName("cwyhahno") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.OUTBOUND) - .withAddressPrefixes(Arrays.asList("uh", "svfuurutlwexxwl", "lniexz")) - .withSubscriptions(Arrays.asList( - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem(), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem())) - .withNetworkSecurityPerimeters( - Arrays.asList(new NetworkSecurityPerimeter(), new NetworkSecurityPerimeter(), - new NetworkSecurityPerimeter())) - .withFullyQualifiedDomainNames(Arrays.asList("q", "yb"))), - new NetworkSecurityPerimeterAccessRule().withName("wpgdak") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.OUTBOUND) - .withAddressPrefixes(Arrays - .asList("ixqnrkcxkjibnxm", "suxswqrntvlwijp", "ttexoqqpwcyyufmh", "uncuw")) - .withSubscriptions(Arrays.asList( - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem(), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem())) - .withNetworkSecurityPerimeters(Arrays.asList(new NetworkSecurityPerimeter(), - new NetworkSecurityPerimeter(), new NetworkSecurityPerimeter())) - .withFullyQualifiedDomainNames(Arrays.asList("qzhlctddunq"))), - new NetworkSecurityPerimeterAccessRule().withName("yfp") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.INBOUND) - .withAddressPrefixes(Arrays.asList("jjrcgegydc", "boxjumvq", "olihrra", "ouau")) - .withSubscriptions(Arrays - .asList(new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem())) - .withNetworkSecurityPerimeters( - Arrays.asList(new NetworkSecurityPerimeter(), new NetworkSecurityPerimeter(), - new NetworkSecurityPerimeter(), new NetworkSecurityPerimeter())) - .withFullyQualifiedDomainNames( - Arrays.asList("xfuojrn", "iflrzpasccbiu", "mzdlyjdfqwmkyo"))))) - .withDiagnosticSettingsVersion(6880229731652721243L) - .withEnabledLogCategories(Arrays.asList("uzslzojhpctfnmdx", "tngfdgugeyzihgr")))); - model = BinaryData.fromObject(model).toObject(NetworkSecurityPerimeterConfigurationInner.class); - Assertions.assertEquals("lwxdzaum", model.properties().provisioningIssues().get(0).name()); - Assertions.assertEquals("ohguuf", model.properties().provisioningIssues().get(0).properties().issueType()); - Assertions.assertEquals("boyjathwt", model.properties().provisioningIssues().get(0).properties().severity()); - Assertions.assertEquals("lbaemwmdxmeb", - model.properties().provisioningIssues().get(0).properties().description()); - Assertions.assertEquals("cjpahl", - model.properties().provisioningIssues().get(0).properties().suggestedResourceIds().get(0)); - Assertions.assertEquals("keifzzhmkdasv", model.properties().networkSecurityPerimeter().id()); - Assertions.assertEquals("yhbxcudchxgs", model.properties().networkSecurityPerimeter().perimeterGuid()); - Assertions.assertEquals("oldforobw", model.properties().networkSecurityPerimeter().location()); - Assertions.assertEquals("izbfhfovvacq", model.properties().resourceAssociation().name()); - Assertions.assertEquals("tuodxeszabbelaw", model.properties().resourceAssociation().accessMode()); - Assertions.assertEquals("aslzkwr", model.properties().profile().name()); - Assertions.assertEquals(8393955549840736725L, model.properties().profile().accessRulesVersion()); - Assertions.assertEquals("cwyhahno", model.properties().profile().accessRules().get(0).name()); - Assertions.assertEquals(NspAccessRuleDirection.OUTBOUND, - model.properties().profile().accessRules().get(0).properties().direction()); - Assertions.assertEquals("uh", - model.properties().profile().accessRules().get(0).properties().addressPrefixes().get(0)); - Assertions.assertEquals("q", - model.properties().profile().accessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); - Assertions.assertEquals(6880229731652721243L, model.properties().profile().diagnosticSettingsVersion()); - Assertions.assertEquals("uzslzojhpctfnmdx", model.properties().profile().enabledLogCategories().get(0)); + Assertions.assertEquals(3696024877385446092L, model.properties().profile().diagnosticSettingsVersion()); + Assertions.assertEquals("yqdhcuplcplcw", model.properties().profile().enabledLogCategories().get(0)); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationListTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationListTests.java index be41c9b9a3d1..17e348e6dd73 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationListTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationListTests.java @@ -1,132 +1,30 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.NetworkSecurityPerimeterConfigurationInner; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeter; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRule; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterConfigurationAssociationInfo; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterConfigurationList; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterConfigurationProperties; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterProfileInfo; -import com.azure.resourcemanager.cognitiveservices.models.ProvisioningIssue; -import com.azure.resourcemanager.cognitiveservices.models.ProvisioningIssueProperties; -import java.util.Arrays; +import com.azure.resourcemanager.cognitiveservices.implementation.models.NetworkSecurityPerimeterConfigurationList; import org.junit.jupiter.api.Assertions; public final class NetworkSecurityPerimeterConfigurationListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NetworkSecurityPerimeterConfigurationList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"megni\",\"provisioningIssues\":[{\"name\":\"xlzyqd\",\"properties\":{}},{\"name\":\"gcealzxwh\",\"properties\":{}}],\"networkSecurityPerimeter\":{\"id\":\"ymo\",\"perimeterGuid\":\"hlwigdivbkbxg\",\"location\":\"fajuwas\"},\"resourceAssociation\":{\"name\":\"aeyyg\",\"accessMode\":\"akjsqz\"},\"profile\":{\"name\":\"ezkgi\",\"accessRulesVersion\":4649158713175813232,\"accessRules\":[{}],\"diagnosticSettingsVersion\":9183823465010358028,\"enabledLogCategories\":[\"yvvjskgfmo\",\"wa\",\"pqg\",\"tjeaahhvjhh\"]}},\"id\":\"kzyb\",\"name\":\"jjidjk\",\"type\":\"yxkyxvx\"},{\"properties\":{\"provisioningState\":\"lbj\",\"provisioningIssues\":[{\"name\":\"jlageu\",\"properties\":{}},{\"name\":\"xuns\",\"properties\":{}},{\"name\":\"nkppxynen\",\"properties\":{}}],\"networkSecurityPerimeter\":{\"id\":\"eizzgwk\",\"perimeterGuid\":\"srmffeycxcktpiym\",\"location\":\"teeammxqiekkkzd\"},\"resourceAssociation\":{\"name\":\"kgdoj\",\"accessMode\":\"xv\"},\"profile\":{\"name\":\"efdeesve\",\"accessRulesVersion\":6092152173451849353,\"accessRules\":[{},{},{}],\"diagnosticSettingsVersion\":1397812267932318523,\"enabledLogCategories\":[\"prtujwsawdd\",\"ibabxvititvtzeex\"]}},\"id\":\"oxtfglecdmdqbwp\",\"name\":\"pqtgsfjac\",\"type\":\"slhhxudbxv\"},{\"properties\":{\"provisioningState\":\"tnsi\",\"provisioningIssues\":[{\"name\":\"z\",\"properties\":{}},{\"name\":\"sckdlp\",\"properties\":{}},{\"name\":\"rcxfailcfxwmdb\",\"properties\":{}}],\"networkSecurityPerimeter\":{\"id\":\"gsftufqobrjlnacg\",\"perimeterGuid\":\"kknhxkizvytnrzv\",\"location\":\"jraaeranokqguk\"},\"resourceAssociation\":{\"name\":\"nvbroylaxx\",\"accessMode\":\"cdisd\"},\"profile\":{\"name\":\"jbjsvgjrwh\",\"accessRulesVersion\":3248825400677255571,\"accessRules\":[{}],\"diagnosticSettingsVersion\":6340875770709691439,\"enabledLogCategories\":[\"gc\",\"knfnwmbtmvpdv\",\"dhttzaefedxihchr\"]}},\"id\":\"k\",\"name\":\"crjdqnsdfzpbgtg\",\"type\":\"ylkdghrje\"},{\"properties\":{\"provisioningState\":\"lwxezwzhokvbwnh\",\"provisioningIssues\":[{\"name\":\"gehgppi\",\"properties\":{}},{\"name\":\"hpfeoajvgcxtxjc\",\"properties\":{}}],\"networkSecurityPerimeter\":{\"id\":\"fidltug\",\"perimeterGuid\":\"esmkssjhoiftxfkf\",\"location\":\"gpr\"},\"resourceAssociation\":{\"name\":\"ill\",\"accessMode\":\"biqtgdq\"},\"profile\":{\"name\":\"cwsldri\",\"accessRulesVersion\":3904002199419630886,\"accessRules\":[{}],\"diagnosticSettingsVersion\":809827059140233177,\"enabledLogCategories\":[\"ibph\",\"qzmiza\"]}},\"id\":\"kan\",\"name\":\"jpdn\",\"type\":\"zhajoylhjlmuo\"}],\"nextLink\":\"primr\"}") + "{\"value\":[{\"properties\":{\"provisioningState\":\"xcczurtl\",\"provisioningIssues\":[{\"name\":\"xbkwv\",\"properties\":{}},{\"name\":\"zvd\",\"properties\":{}},{\"name\":\"d\",\"properties\":{}},{\"name\":\"mqpnoda\",\"properties\":{}}],\"networkSecurityPerimeter\":{\"id\":\"hewjptmcgsbost\",\"perimeterGuid\":\"lnd\",\"location\":\"tutmzl\"},\"resourceAssociation\":{\"name\":\"jlvfhrbbpneqv\",\"accessMode\":\"wyyu\"},\"profile\":{\"name\":\"chpp\",\"accessRulesVersion\":4561612083972163762,\"accessRules\":[{}],\"diagnosticSettingsVersion\":526653050845106445,\"enabledLogCategories\":[\"ejnhlbkpb\",\"pcpil\"]}},\"id\":\"a\",\"name\":\"zv\",\"type\":\"chndbnwie\"},{\"properties\":{\"provisioningState\":\"ewjwiuubw\",\"provisioningIssues\":[{\"name\":\"fapaqtfer\",\"properties\":{}},{\"name\":\"ex\",\"properties\":{}}],\"networkSecurityPerimeter\":{\"id\":\"xap\",\"perimeterGuid\":\"og\",\"location\":\"nobpudcdabtqwpw\"},\"resourceAssociation\":{\"name\":\"bzasqbucljgkyexa\",\"accessMode\":\"uy\"},\"profile\":{\"name\":\"ids\",\"accessRulesVersion\":2636118125611437621,\"accessRules\":[{}],\"diagnosticSettingsVersion\":4275757314520852483,\"enabledLogCategories\":[\"fqwazlnqnmcjn\",\"zqdqxt\"]}},\"id\":\"wgnyfusfzsvtui\",\"name\":\"zh\",\"type\":\"jqg\"},{\"properties\":{\"provisioningState\":\"hm\",\"provisioningIssues\":[{\"name\":\"yxynq\",\"properties\":{}},{\"name\":\"dpsovwxznptgo\",\"properties\":{}}],\"networkSecurityPerimeter\":{\"id\":\"b\",\"perimeterGuid\":\"pfhvfslk\",\"location\":\"tjlrigjksky\"},\"resourceAssociation\":{\"name\":\"ovzidsx\",\"accessMode\":\"abzmifrygznmmaxr\"},\"profile\":{\"name\":\"zob\",\"accessRulesVersion\":3393588735058009506,\"accessRules\":[{}],\"diagnosticSettingsVersion\":3557811767170936371,\"enabledLogCategories\":[\"xieixynllxec\",\"crojp\",\"slhcawjutifd\",\"fmvigorqjbttzh\"]}},\"id\":\"glka\",\"name\":\"honqjujeickpz\",\"type\":\"cpopmxel\"},{\"properties\":{\"provisioningState\":\"ltyjedexxmlfmk\",\"provisioningIssues\":[{\"name\":\"zuawxtzxpuamwa\",\"properties\":{}},{\"name\":\"rvxcush\",\"properties\":{}}],\"networkSecurityPerimeter\":{\"id\":\"ivmxyasfl\",\"perimeterGuid\":\"sgzwywakoihknsm\",\"location\":\"lmljhlnymzotq\"},\"resourceAssociation\":{\"name\":\"uzcbmqq\",\"accessMode\":\"mv\"},\"profile\":{\"name\":\"tayx\",\"accessRulesVersion\":4367486194556700788,\"accessRules\":[{}],\"diagnosticSettingsVersion\":7492914807539713666,\"enabledLogCategories\":[\"nh\",\"vsqltnzoibgsxg\",\"xfyqonmpqoxwdo\",\"dbxiqx\"]}},\"id\":\"iqbi\",\"name\":\"htmwwinh\",\"type\":\"hfqpofv\"}],\"nextLink\":\"cblembnkbwv\"}") .toObject(NetworkSecurityPerimeterConfigurationList.class); - Assertions.assertEquals("xlzyqd", model.value().get(0).properties().provisioningIssues().get(0).name()); - Assertions.assertEquals("ymo", model.value().get(0).properties().networkSecurityPerimeter().id()); - Assertions.assertEquals("hlwigdivbkbxg", - model.value().get(0).properties().networkSecurityPerimeter().perimeterGuid()); - Assertions.assertEquals("fajuwas", model.value().get(0).properties().networkSecurityPerimeter().location()); - Assertions.assertEquals("aeyyg", model.value().get(0).properties().resourceAssociation().name()); - Assertions.assertEquals("akjsqz", model.value().get(0).properties().resourceAssociation().accessMode()); - Assertions.assertEquals("ezkgi", model.value().get(0).properties().profile().name()); - Assertions.assertEquals(4649158713175813232L, model.value().get(0).properties().profile().accessRulesVersion()); - Assertions.assertEquals(9183823465010358028L, + Assertions.assertEquals("xbkwv", model.value().get(0).properties().provisioningIssues().get(0).name()); + Assertions.assertEquals("hewjptmcgsbost", model.value().get(0).properties().networkSecurityPerimeter().id()); + Assertions.assertEquals("lnd", model.value().get(0).properties().networkSecurityPerimeter().perimeterGuid()); + Assertions.assertEquals("tutmzl", model.value().get(0).properties().networkSecurityPerimeter().location()); + Assertions.assertEquals("jlvfhrbbpneqv", model.value().get(0).properties().resourceAssociation().name()); + Assertions.assertEquals("wyyu", model.value().get(0).properties().resourceAssociation().accessMode()); + Assertions.assertEquals("chpp", model.value().get(0).properties().profile().name()); + Assertions.assertEquals(4561612083972163762L, model.value().get(0).properties().profile().accessRulesVersion()); + Assertions.assertEquals(526653050845106445L, model.value().get(0).properties().profile().diagnosticSettingsVersion()); - Assertions.assertEquals("yvvjskgfmo", - model.value().get(0).properties().profile().enabledLogCategories().get(0)); - Assertions.assertEquals("primr", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkSecurityPerimeterConfigurationList model = new NetworkSecurityPerimeterConfigurationList() - .withValue(Arrays.asList( - new NetworkSecurityPerimeterConfigurationInner().withProperties( - new NetworkSecurityPerimeterConfigurationProperties().withProvisioningIssues(Arrays.asList( - new ProvisioningIssue().withName("xlzyqd").withProperties(new ProvisioningIssueProperties()), - new ProvisioningIssue().withName("gcealzxwh") - .withProperties(new ProvisioningIssueProperties()))) - .withNetworkSecurityPerimeter(new NetworkSecurityPerimeter().withId("ymo") - .withPerimeterGuid("hlwigdivbkbxg") - .withLocation("fajuwas")) - .withResourceAssociation( - new NetworkSecurityPerimeterConfigurationAssociationInfo().withName("aeyyg") - .withAccessMode("akjsqz")) - .withProfile(new NetworkSecurityPerimeterProfileInfo().withName("ezkgi") - .withAccessRulesVersion(4649158713175813232L) - .withAccessRules(Arrays.asList(new NetworkSecurityPerimeterAccessRule())) - .withDiagnosticSettingsVersion(9183823465010358028L) - .withEnabledLogCategories(Arrays.asList("yvvjskgfmo", "wa", "pqg", "tjeaahhvjhh")))), - new NetworkSecurityPerimeterConfigurationInner() - .withProperties(new NetworkSecurityPerimeterConfigurationProperties() - .withProvisioningIssues(Arrays.asList( - new ProvisioningIssue().withName("jlageu") - .withProperties(new ProvisioningIssueProperties()), - new ProvisioningIssue().withName("xuns").withProperties(new ProvisioningIssueProperties()), - new ProvisioningIssue().withName("nkppxynen") - .withProperties(new ProvisioningIssueProperties()))) - .withNetworkSecurityPerimeter(new NetworkSecurityPerimeter().withId("eizzgwk") - .withPerimeterGuid("srmffeycxcktpiym") - .withLocation("teeammxqiekkkzd")) - .withResourceAssociation( - new NetworkSecurityPerimeterConfigurationAssociationInfo().withName("kgdoj") - .withAccessMode("xv")) - .withProfile(new NetworkSecurityPerimeterProfileInfo().withName("efdeesve") - .withAccessRulesVersion(6092152173451849353L) - .withAccessRules(Arrays.asList(new NetworkSecurityPerimeterAccessRule(), - new NetworkSecurityPerimeterAccessRule(), new NetworkSecurityPerimeterAccessRule())) - .withDiagnosticSettingsVersion(1397812267932318523L) - .withEnabledLogCategories(Arrays.asList("prtujwsawdd", "ibabxvititvtzeex")))), - new NetworkSecurityPerimeterConfigurationInner().withProperties( - new NetworkSecurityPerimeterConfigurationProperties().withProvisioningIssues(Arrays.asList( - new ProvisioningIssue().withName("z").withProperties(new ProvisioningIssueProperties()), - new ProvisioningIssue().withName("sckdlp").withProperties(new ProvisioningIssueProperties()), - new ProvisioningIssue().withName("rcxfailcfxwmdb") - .withProperties(new ProvisioningIssueProperties()))) - .withNetworkSecurityPerimeter(new NetworkSecurityPerimeter().withId("gsftufqobrjlnacg") - .withPerimeterGuid("kknhxkizvytnrzv") - .withLocation("jraaeranokqguk")) - .withResourceAssociation( - new NetworkSecurityPerimeterConfigurationAssociationInfo().withName("nvbroylaxx") - .withAccessMode("cdisd")) - .withProfile(new NetworkSecurityPerimeterProfileInfo().withName("jbjsvgjrwh") - .withAccessRulesVersion(3248825400677255571L) - .withAccessRules(Arrays.asList(new NetworkSecurityPerimeterAccessRule())) - .withDiagnosticSettingsVersion(6340875770709691439L) - .withEnabledLogCategories(Arrays.asList("gc", "knfnwmbtmvpdv", "dhttzaefedxihchr")))), - new NetworkSecurityPerimeterConfigurationInner().withProperties( - new NetworkSecurityPerimeterConfigurationProperties().withProvisioningIssues(Arrays.asList( - new ProvisioningIssue().withName("gehgppi").withProperties(new ProvisioningIssueProperties()), - new ProvisioningIssue().withName("hpfeoajvgcxtxjc") - .withProperties(new ProvisioningIssueProperties()))) - .withNetworkSecurityPerimeter(new NetworkSecurityPerimeter().withId("fidltug") - .withPerimeterGuid("esmkssjhoiftxfkf") - .withLocation("gpr")) - .withResourceAssociation( - new NetworkSecurityPerimeterConfigurationAssociationInfo().withName("ill") - .withAccessMode("biqtgdq")) - .withProfile(new NetworkSecurityPerimeterProfileInfo().withName("cwsldri") - .withAccessRulesVersion(3904002199419630886L) - .withAccessRules(Arrays.asList(new NetworkSecurityPerimeterAccessRule())) - .withDiagnosticSettingsVersion(809827059140233177L) - .withEnabledLogCategories(Arrays.asList("ibph", "qzmiza")))))) - .withNextLink("primr"); - model = BinaryData.fromObject(model).toObject(NetworkSecurityPerimeterConfigurationList.class); - Assertions.assertEquals("xlzyqd", model.value().get(0).properties().provisioningIssues().get(0).name()); - Assertions.assertEquals("ymo", model.value().get(0).properties().networkSecurityPerimeter().id()); - Assertions.assertEquals("hlwigdivbkbxg", - model.value().get(0).properties().networkSecurityPerimeter().perimeterGuid()); - Assertions.assertEquals("fajuwas", model.value().get(0).properties().networkSecurityPerimeter().location()); - Assertions.assertEquals("aeyyg", model.value().get(0).properties().resourceAssociation().name()); - Assertions.assertEquals("akjsqz", model.value().get(0).properties().resourceAssociation().accessMode()); - Assertions.assertEquals("ezkgi", model.value().get(0).properties().profile().name()); - Assertions.assertEquals(4649158713175813232L, model.value().get(0).properties().profile().accessRulesVersion()); - Assertions.assertEquals(9183823465010358028L, - model.value().get(0).properties().profile().diagnosticSettingsVersion()); - Assertions.assertEquals("yvvjskgfmo", - model.value().get(0).properties().profile().enabledLogCategories().get(0)); - Assertions.assertEquals("primr", model.nextLink()); + Assertions.assertEquals("ejnhlbkpb", model.value().get(0).properties().profile().enabledLogCategories().get(0)); + Assertions.assertEquals("cblembnkbwv", model.nextLink()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationPropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationPropertiesTests.java index 337c98d316f0..ee70c6162b91 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationPropertiesTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationPropertiesTests.java @@ -1,146 +1,41 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeter; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRule; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRuleProperties; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterConfigurationAssociationInfo; import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterConfigurationProperties; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterProfileInfo; import com.azure.resourcemanager.cognitiveservices.models.NspAccessRuleDirection; -import com.azure.resourcemanager.cognitiveservices.models.ProvisioningIssue; -import com.azure.resourcemanager.cognitiveservices.models.ProvisioningIssueProperties; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class NetworkSecurityPerimeterConfigurationPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NetworkSecurityPerimeterConfigurationProperties model = BinaryData.fromString( - "{\"provisioningState\":\"hsgz\",\"provisioningIssues\":[{\"name\":\"gomfgbeglq\",\"properties\":{\"issueType\":\"o\",\"severity\":\"betnluankrrfxee\",\"description\":\"tijv\",\"suggestedResourceIds\":[\"bmqzbqqxlajrnwx\",\"cevehjkuyxoafg\"],\"suggestedAccessRules\":[{\"name\":\"tfaeyl\",\"properties\":{}},{\"name\":\"fgvxirpghriypoqe\",\"properties\":{}}]}},{\"name\":\"qhykprlpyzn\",\"properties\":{\"issueType\":\"qdsmexiit\",\"severity\":\"uxtyasiibmi\",\"description\":\"nnust\",\"suggestedResourceIds\":[\"jh\",\"mgixhcmavmqfou\",\"or\",\"cgyypro\"],\"suggestedAccessRules\":[{\"name\":\"undmbx\",\"properties\":{}},{\"name\":\"cmjkavlgorbmftpm\",\"properties\":{}},{\"name\":\"fjltfvnzcyjtotp\",\"properties\":{}}]}},{\"name\":\"vpbdbzqgq\",\"properties\":{\"issueType\":\"edsvqwthmk\",\"severity\":\"bcysih\",\"description\":\"qcwdhoh\",\"suggestedResourceIds\":[\"mcdzsufcohdxbz\",\"mcmuapc\",\"hdbevwqqxeyskon\"],\"suggestedAccessRules\":[{\"name\":\"kfkbgbzbowxeqocl\",\"properties\":{}},{\"name\":\"gvkzqkjjeokbze\",\"properties\":{}},{\"name\":\"rx\",\"properties\":{}}]}}],\"networkSecurityPerimeter\":{\"id\":\"rtle\",\"perimeterGuid\":\"q\",\"location\":\"kwv\"},\"resourceAssociation\":{\"name\":\"zvd\",\"accessMode\":\"zdix\"},\"profile\":{\"name\":\"pnodawopqhe\",\"accessRulesVersion\":7022680732951740114,\"accessRules\":[{\"name\":\"sbostzel\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"tmzlbiojlv\",\"hrbbpneqvcwwyy\",\"r\",\"ochpprpr\"],\"subscriptions\":[{}],\"networkSecurityPerimeters\":[{}],\"fullyQualifiedDomainNames\":[\"zejnhl\",\"kpbz\",\"cpilj\"]}},{\"name\":\"hzvechndbnwieho\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"uubw\",\"fqsfa\",\"aqtferr\"],\"subscriptions\":[{}],\"networkSecurityPerimeters\":[{},{},{}],\"fullyQualifiedDomainNames\":[\"fxapjwogqqnobpu\",\"cdabtqwpwya\",\"bzasqbucljgkyexa\",\"guyaip\"]}}],\"diagnosticSettingsVersion\":767976804724612557,\"enabledLogCategories\":[\"ltxijjumfqwazln\",\"nm\",\"jng\"]}}") + "{\"provisioningState\":\"vecactx\",\"provisioningIssues\":[{\"name\":\"e\",\"properties\":{\"issueType\":\"cluqovekqvgqo\",\"severity\":\"ifzmpjwyivqi\",\"description\":\"xcvhrfs\",\"suggestedResourceIds\":[\"agr\",\"tikteusqczkvykl\",\"ubyjaffmmf\",\"lcqcuubgqibrt\"],\"suggestedAccessRules\":[{\"name\":\"tttwgdslqxih\",\"properties\":{}},{\"name\":\"ooizqseyp\",\"properties\":{}}]}},{\"name\":\"tcxapzhyrpetogeb\",\"properties\":{\"issueType\":\"slhvnhlab\",\"severity\":\"nk\",\"description\":\"jcjbt\",\"suggestedResourceIds\":[\"ehvvib\",\"xjjs\",\"oqbeitpkxzt\",\"oobklftidgfcwq\"],\"suggestedAccessRules\":[{\"name\":\"aqxzhemjyho\",\"properties\":{}}]}}],\"networkSecurityPerimeter\":{\"id\":\"wtwko\",\"perimeterGuid\":\"wculkbaw\",\"location\":\"ajnjwltlwtjj\"},\"resourceAssociation\":{\"name\":\"talhsnvkcdmxzr\",\"accessMode\":\"aimlnwiaaom\"},\"profile\":{\"name\":\"eazulcs\",\"accessRulesVersion\":4083045940012643830,\"accessRules\":[{\"name\":\"jhlfzswpchwahf\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"epgfew\",\"twly\"],\"subscriptions\":[{},{},{},{}],\"networkSecurityPerimeters\":[{},{}],\"fullyQualifiedDomainNames\":[\"xhdjhl\",\"mmbcxfhbcp\",\"rxvxcjzh\",\"izxfpxt\"]}},{\"name\":\"scjavftju\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"mtggu\"],\"subscriptions\":[{}],\"networkSecurityPerimeters\":[{}],\"fullyQualifiedDomainNames\":[\"civmmg\",\"f\"]}},{\"name\":\"iwrxgkn\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"zqodfvpgshox\",\"sgbpfgzdjtx\",\"zflbqvg\"],\"subscriptions\":[{}],\"networkSecurityPerimeters\":[{},{}],\"fullyQualifiedDomainNames\":[\"cqusr\"]}},{\"name\":\"etnwsdtutnw\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"uzhyrmewipmvekdx\",\"kuqgsjjxundxgket\"],\"subscriptions\":[{},{}],\"networkSecurityPerimeters\":[{},{},{}],\"fullyQualifiedDomainNames\":[\"f\",\"mhv\"]}}],\"diagnosticSettingsVersion\":4106059556078480617,\"enabledLogCategories\":[\"mun\",\"qsxvmhf\"]}}") .toObject(NetworkSecurityPerimeterConfigurationProperties.class); - Assertions.assertEquals("gomfgbeglq", model.provisioningIssues().get(0).name()); - Assertions.assertEquals("o", model.provisioningIssues().get(0).properties().issueType()); - Assertions.assertEquals("betnluankrrfxee", model.provisioningIssues().get(0).properties().severity()); - Assertions.assertEquals("tijv", model.provisioningIssues().get(0).properties().description()); - Assertions.assertEquals("bmqzbqqxlajrnwx", - model.provisioningIssues().get(0).properties().suggestedResourceIds().get(0)); - Assertions.assertEquals("tfaeyl", + Assertions.assertEquals("e", model.provisioningIssues().get(0).name()); + Assertions.assertEquals("cluqovekqvgqo", model.provisioningIssues().get(0).properties().issueType()); + Assertions.assertEquals("ifzmpjwyivqi", model.provisioningIssues().get(0).properties().severity()); + Assertions.assertEquals("xcvhrfs", model.provisioningIssues().get(0).properties().description()); + Assertions.assertEquals("agr", model.provisioningIssues().get(0).properties().suggestedResourceIds().get(0)); + Assertions.assertEquals("tttwgdslqxih", model.provisioningIssues().get(0).properties().suggestedAccessRules().get(0).name()); - Assertions.assertEquals("rtle", model.networkSecurityPerimeter().id()); - Assertions.assertEquals("q", model.networkSecurityPerimeter().perimeterGuid()); - Assertions.assertEquals("kwv", model.networkSecurityPerimeter().location()); - Assertions.assertEquals("zvd", model.resourceAssociation().name()); - Assertions.assertEquals("zdix", model.resourceAssociation().accessMode()); - Assertions.assertEquals("pnodawopqhe", model.profile().name()); - Assertions.assertEquals(7022680732951740114L, model.profile().accessRulesVersion()); - Assertions.assertEquals("sbostzel", model.profile().accessRules().get(0).name()); + Assertions.assertEquals("wtwko", model.networkSecurityPerimeter().id()); + Assertions.assertEquals("wculkbaw", model.networkSecurityPerimeter().perimeterGuid()); + Assertions.assertEquals("ajnjwltlwtjj", model.networkSecurityPerimeter().location()); + Assertions.assertEquals("talhsnvkcdmxzr", model.resourceAssociation().name()); + Assertions.assertEquals("aimlnwiaaom", model.resourceAssociation().accessMode()); + Assertions.assertEquals("eazulcs", model.profile().name()); + Assertions.assertEquals(4083045940012643830L, model.profile().accessRulesVersion()); + Assertions.assertEquals("jhlfzswpchwahf", model.profile().accessRules().get(0).name()); Assertions.assertEquals(NspAccessRuleDirection.OUTBOUND, model.profile().accessRules().get(0).properties().direction()); - Assertions.assertEquals("tmzlbiojlv", - model.profile().accessRules().get(0).properties().addressPrefixes().get(0)); - Assertions.assertEquals("zejnhl", + Assertions.assertEquals("epgfew", model.profile().accessRules().get(0).properties().addressPrefixes().get(0)); + Assertions.assertEquals("xhdjhl", model.profile().accessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); - Assertions.assertEquals(767976804724612557L, model.profile().diagnosticSettingsVersion()); - Assertions.assertEquals("ltxijjumfqwazln", model.profile().enabledLogCategories().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkSecurityPerimeterConfigurationProperties model = new NetworkSecurityPerimeterConfigurationProperties() - .withProvisioningIssues(Arrays.asList( - new ProvisioningIssue().withName("gomfgbeglq") - .withProperties(new ProvisioningIssueProperties().withIssueType("o") - .withSeverity("betnluankrrfxee") - .withDescription("tijv") - .withSuggestedResourceIds(Arrays.asList("bmqzbqqxlajrnwx", "cevehjkuyxoafg")) - .withSuggestedAccessRules(Arrays.asList( - new NetworkSecurityPerimeterAccessRule().withName("tfaeyl") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties()), - new NetworkSecurityPerimeterAccessRule().withName("fgvxirpghriypoqe") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties())))), - new ProvisioningIssue().withName("qhykprlpyzn") - .withProperties(new ProvisioningIssueProperties().withIssueType("qdsmexiit") - .withSeverity("uxtyasiibmi") - .withDescription("nnust") - .withSuggestedResourceIds(Arrays.asList("jh", "mgixhcmavmqfou", "or", "cgyypro")) - .withSuggestedAccessRules(Arrays.asList( - new NetworkSecurityPerimeterAccessRule().withName("undmbx") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties()), - new NetworkSecurityPerimeterAccessRule().withName("cmjkavlgorbmftpm") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties()), - new NetworkSecurityPerimeterAccessRule().withName("fjltfvnzcyjtotp") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties())))), - new ProvisioningIssue().withName("vpbdbzqgq") - .withProperties(new ProvisioningIssueProperties().withIssueType("edsvqwthmk") - .withSeverity("bcysih") - .withDescription("qcwdhoh") - .withSuggestedResourceIds(Arrays.asList("mcdzsufcohdxbz", "mcmuapc", "hdbevwqqxeyskon")) - .withSuggestedAccessRules(Arrays.asList( - new NetworkSecurityPerimeterAccessRule().withName("kfkbgbzbowxeqocl") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties()), - new NetworkSecurityPerimeterAccessRule().withName("gvkzqkjjeokbze") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties()), - new NetworkSecurityPerimeterAccessRule().withName("rx") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties())))))) - .withNetworkSecurityPerimeter( - new NetworkSecurityPerimeter().withId("rtle").withPerimeterGuid("q").withLocation("kwv")) - .withResourceAssociation( - new NetworkSecurityPerimeterConfigurationAssociationInfo().withName("zvd").withAccessMode("zdix")) - .withProfile( - new NetworkSecurityPerimeterProfileInfo().withName("pnodawopqhe") - .withAccessRulesVersion(7022680732951740114L) - .withAccessRules( - Arrays.asList( - new NetworkSecurityPerimeterAccessRule().withName("sbostzel") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.OUTBOUND) - .withAddressPrefixes(Arrays.asList("tmzlbiojlv", "hrbbpneqvcwwyy", "r", "ochpprpr")) - .withSubscriptions(Arrays - .asList(new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem())) - .withNetworkSecurityPerimeters(Arrays.asList(new NetworkSecurityPerimeter())) - .withFullyQualifiedDomainNames(Arrays.asList("zejnhl", "kpbz", "cpilj"))), - new NetworkSecurityPerimeterAccessRule().withName("hzvechndbnwieho") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.OUTBOUND) - .withAddressPrefixes(Arrays.asList("uubw", "fqsfa", "aqtferr")) - .withSubscriptions(Arrays - .asList(new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem())) - .withNetworkSecurityPerimeters(Arrays.asList(new NetworkSecurityPerimeter(), - new NetworkSecurityPerimeter(), new NetworkSecurityPerimeter())) - .withFullyQualifiedDomainNames(Arrays.asList("fxapjwogqqnobpu", "cdabtqwpwya", - "bzasqbucljgkyexa", "guyaip"))))) - .withDiagnosticSettingsVersion(767976804724612557L) - .withEnabledLogCategories(Arrays.asList("ltxijjumfqwazln", "nm", "jng"))); - model = BinaryData.fromObject(model).toObject(NetworkSecurityPerimeterConfigurationProperties.class); - Assertions.assertEquals("gomfgbeglq", model.provisioningIssues().get(0).name()); - Assertions.assertEquals("o", model.provisioningIssues().get(0).properties().issueType()); - Assertions.assertEquals("betnluankrrfxee", model.provisioningIssues().get(0).properties().severity()); - Assertions.assertEquals("tijv", model.provisioningIssues().get(0).properties().description()); - Assertions.assertEquals("bmqzbqqxlajrnwx", - model.provisioningIssues().get(0).properties().suggestedResourceIds().get(0)); - Assertions.assertEquals("tfaeyl", - model.provisioningIssues().get(0).properties().suggestedAccessRules().get(0).name()); - Assertions.assertEquals("rtle", model.networkSecurityPerimeter().id()); - Assertions.assertEquals("q", model.networkSecurityPerimeter().perimeterGuid()); - Assertions.assertEquals("kwv", model.networkSecurityPerimeter().location()); - Assertions.assertEquals("zvd", model.resourceAssociation().name()); - Assertions.assertEquals("zdix", model.resourceAssociation().accessMode()); - Assertions.assertEquals("pnodawopqhe", model.profile().name()); - Assertions.assertEquals(7022680732951740114L, model.profile().accessRulesVersion()); - Assertions.assertEquals("sbostzel", model.profile().accessRules().get(0).name()); - Assertions.assertEquals(NspAccessRuleDirection.OUTBOUND, - model.profile().accessRules().get(0).properties().direction()); - Assertions.assertEquals("tmzlbiojlv", - model.profile().accessRules().get(0).properties().addressPrefixes().get(0)); - Assertions.assertEquals("zejnhl", - model.profile().accessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); - Assertions.assertEquals(767976804724612557L, model.profile().diagnosticSettingsVersion()); - Assertions.assertEquals("ltxijjumfqwazln", model.profile().enabledLogCategories().get(0)); + Assertions.assertEquals(4106059556078480617L, model.profile().diagnosticSettingsVersion()); + Assertions.assertEquals("mun", model.profile().enabledLogCategories().get(0)); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsGetWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsGetWithResponseMockTests.java index 0b745826669a..7ca87efe45e5 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsGetWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsGetWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -21,7 +21,7 @@ public final class NetworkSecurityPerimeterConfigurationsGetWithResponseMockTest @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"sinqbdnddbbozsyv\",\"provisioningIssues\":[{\"name\":\"myitr\",\"properties\":{\"issueType\":\"udlxeeih\",\"severity\":\"mnoejhqlfmsib\",\"description\":\"yrfgxkyd\",\"suggestedResourceIds\":[\"pgfqvmtyw\"],\"suggestedAccessRules\":[{}]}},{\"name\":\"xpejpewpy\",\"properties\":{\"issueType\":\"xampqcr\",\"severity\":\"euqxbpiatwfa\",\"description\":\"egqdtadrakgd\",\"suggestedResourceIds\":[\"krukizyhgsqt\",\"qsktxqf\",\"jbqggweeiwdhdm\",\"cgbfzuscstun\"],\"suggestedAccessRules\":[{},{}]}},{\"name\":\"dfb\",\"properties\":{\"issueType\":\"iichgjsysmvxodgw\",\"severity\":\"kzsifcuvb\",\"description\":\"jgc\",\"suggestedResourceIds\":[\"ec\"],\"suggestedAccessRules\":[{},{},{}]}},{\"name\":\"trdxri\",\"properties\":{\"issueType\":\"bbgiarksykpgdqxw\",\"severity\":\"zrwiqrxha\",\"description\":\"cdosqkptj\",\"suggestedResourceIds\":[\"ifmmainwh\",\"d\",\"kp\"],\"suggestedAccessRules\":[{},{},{}]}}],\"networkSecurityPerimeter\":{\"id\":\"tobuizazze\",\"perimeterGuid\":\"gvydjufbnklblaxp\",\"location\":\"jwdabalfd\"},\"resourceAssociation\":{\"name\":\"lz\",\"accessMode\":\"tlbtlqho\"},\"profile\":{\"name\":\"uvmrsiflikyyp\",\"accessRulesVersion\":4306689690250962649,\"accessRules\":[{\"name\":\"myrqsdbpokszan\",\"properties\":{}},{\"name\":\"gpterdiu\",\"properties\":{}}],\"diagnosticSettingsVersion\":5753227612879436470,\"enabledLogCategories\":[\"wzt\",\"detjygowi\",\"cq\"]}},\"id\":\"lzkgysdgzyybzo\",\"name\":\"lvoc\",\"type\":\"tvdxxhe\"}"; + = "{\"properties\":{\"provisioningState\":\"fhaxttpf\",\"provisioningIssues\":[{\"name\":\"sghqucumlddauqm\",\"properties\":{\"issueType\":\"eot\",\"severity\":\"uarigrj\",\"description\":\"jlkq\",\"suggestedResourceIds\":[\"rbzkuastaxk\",\"pruulhg\"],\"suggestedAccessRules\":[{},{}]}},{\"name\":\"zwxvscksgf\",\"properties\":{\"issueType\":\"ky\",\"severity\":\"gafxczvf\",\"description\":\"kwrt\",\"suggestedResourceIds\":[\"tyveszrtl\"],\"suggestedAccessRules\":[{},{},{}]}},{\"name\":\"wynctacz\",\"properties\":{\"issueType\":\"fmbbfnv\",\"severity\":\"itzovnkr\",\"description\":\"kls\",\"suggestedResourceIds\":[\"hql\",\"oqksyiibhyxwbgbu\",\"avqdorbccqcd\"],\"suggestedAccessRules\":[{},{},{}]}},{\"name\":\"jvlirk\",\"properties\":{\"issueType\":\"osa\",\"severity\":\"dtnagzlgpyaix\",\"description\":\"zqjjt\",\"suggestedResourceIds\":[\"ydqfttkacy\"],\"suggestedAccessRules\":[{}]}}],\"networkSecurityPerimeter\":{\"id\":\"rgmcdcpkshlo\",\"perimeterGuid\":\"rmhzicsbf\",\"location\":\"hyaaknyukibxiglh\"},\"resourceAssociation\":{\"name\":\"wxqtejpiilh\",\"accessMode\":\"oz\"},\"profile\":{\"name\":\"jjnxkby\",\"accessRulesVersion\":6244612613515180624,\"accessRules\":[{\"name\":\"fklvqzrwtrdg\",\"properties\":{}},{\"name\":\"vq\",\"properties\":{}},{\"name\":\"sgnwx\",\"properties\":{}}],\"diagnosticSettingsVersion\":5953766011068321220,\"enabledLogCategories\":[\"hxpthceop\"]}},\"id\":\"vtwfvesobpbokhm\",\"name\":\"lc\",\"type\":\"yarnggcjfwblqhxk\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,26 +31,24 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); NetworkSecurityPerimeterConfiguration response = manager.networkSecurityPerimeterConfigurations() - .getWithResponse("q", "moxsa", "uxejgwecywnfyszz", com.azure.core.util.Context.NONE) + .getWithResponse("nnohmmzngo", "fr", "uypwyiulaynos", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("myitr", response.properties().provisioningIssues().get(0).name()); - Assertions.assertEquals("udlxeeih", response.properties().provisioningIssues().get(0).properties().issueType()); - Assertions.assertEquals("mnoejhqlfmsib", - response.properties().provisioningIssues().get(0).properties().severity()); - Assertions.assertEquals("yrfgxkyd", - response.properties().provisioningIssues().get(0).properties().description()); - Assertions.assertEquals("pgfqvmtyw", + Assertions.assertEquals("sghqucumlddauqm", response.properties().provisioningIssues().get(0).name()); + Assertions.assertEquals("eot", response.properties().provisioningIssues().get(0).properties().issueType()); + Assertions.assertEquals("uarigrj", response.properties().provisioningIssues().get(0).properties().severity()); + Assertions.assertEquals("jlkq", response.properties().provisioningIssues().get(0).properties().description()); + Assertions.assertEquals("rbzkuastaxk", response.properties().provisioningIssues().get(0).properties().suggestedResourceIds().get(0)); - Assertions.assertEquals("tobuizazze", response.properties().networkSecurityPerimeter().id()); - Assertions.assertEquals("gvydjufbnklblaxp", response.properties().networkSecurityPerimeter().perimeterGuid()); - Assertions.assertEquals("jwdabalfd", response.properties().networkSecurityPerimeter().location()); - Assertions.assertEquals("lz", response.properties().resourceAssociation().name()); - Assertions.assertEquals("tlbtlqho", response.properties().resourceAssociation().accessMode()); - Assertions.assertEquals("uvmrsiflikyyp", response.properties().profile().name()); - Assertions.assertEquals(4306689690250962649L, response.properties().profile().accessRulesVersion()); - Assertions.assertEquals("myrqsdbpokszan", response.properties().profile().accessRules().get(0).name()); - Assertions.assertEquals(5753227612879436470L, response.properties().profile().diagnosticSettingsVersion()); - Assertions.assertEquals("wzt", response.properties().profile().enabledLogCategories().get(0)); + Assertions.assertEquals("rgmcdcpkshlo", response.properties().networkSecurityPerimeter().id()); + Assertions.assertEquals("rmhzicsbf", response.properties().networkSecurityPerimeter().perimeterGuid()); + Assertions.assertEquals("hyaaknyukibxiglh", response.properties().networkSecurityPerimeter().location()); + Assertions.assertEquals("wxqtejpiilh", response.properties().resourceAssociation().name()); + Assertions.assertEquals("oz", response.properties().resourceAssociation().accessMode()); + Assertions.assertEquals("jjnxkby", response.properties().profile().name()); + Assertions.assertEquals(6244612613515180624L, response.properties().profile().accessRulesVersion()); + Assertions.assertEquals("fklvqzrwtrdg", response.properties().profile().accessRules().get(0).name()); + Assertions.assertEquals(5953766011068321220L, response.properties().profile().diagnosticSettingsVersion()); + Assertions.assertEquals("hxpthceop", response.properties().profile().enabledLogCategories().get(0)); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsListMockTests.java index 4e5d32953bb1..c02f0f0082fd 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsListMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsListMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -22,7 +22,7 @@ public final class NetworkSecurityPerimeterConfigurationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"olnthb\",\"provisioningIssues\":[{\"name\":\"zukwdrnzkj\",\"properties\":{\"issueType\":\"ceyjnc\",\"severity\":\"lfuyfjbpfiddhlr\",\"description\":\"zcqy\",\"suggestedResourceIds\":[\"rfuiocusel\",\"k\",\"sazrhxuddqmdtff\"],\"suggestedAccessRules\":[{}]}},{\"name\":\"rkkhmwdmdlgy\",\"properties\":{\"issueType\":\"okwtjawhvagnqfqq\",\"severity\":\"cvmyolcaymjchtv\",\"description\":\"vlaqdnzyzawa\",\"suggestedResourceIds\":[\"qkokbczothy\",\"gobllms\",\"wgwima\",\"neakh\"],\"suggestedAccessRules\":[{}]}},{\"name\":\"bcyanrfvqtvk\",\"properties\":{\"issueType\":\"oog\",\"severity\":\"fnaoaqym\",\"description\":\"ctopuowyrnsk\",\"suggestedResourceIds\":[\"quhczygxvh\",\"jpxecxqnwhsco\",\"awmvgxs\",\"pknpwirfljfewxq\"],\"suggestedAccessRules\":[{},{},{}]}},{\"name\":\"ud\",\"properties\":{\"issueType\":\"kaprhknqiijg\",\"severity\":\"cdgmoqu\",\"description\":\"ihkkyowl\",\"suggestedResourceIds\":[\"uwhldxwhieproqks\",\"fxmcvprstvk\",\"tbfjtdyotnplf\"],\"suggestedAccessRules\":[{},{},{},{}]}}],\"networkSecurityPerimeter\":{\"id\":\"cqrq\",\"perimeterGuid\":\"etjt\",\"location\":\"hutfdoadtxopge\"},\"resourceAssociation\":{\"name\":\"dkmdzgsszx\",\"accessMode\":\"tkbbxuhar\"},\"profile\":{\"name\":\"rncclabv\",\"accessRulesVersion\":5518516719089735498,\"accessRules\":[{\"name\":\"xczbmyqjoghdsaid\",\"properties\":{}}],\"diagnosticSettingsVersion\":9011503856576673885,\"enabledLogCategories\":[\"vdxxurntujmoilun\",\"emhdeeljslky\",\"zdsfzjuegr\",\"rhtslejtvxjnxvgj\"]}},\"id\":\"iobpnjodf\",\"name\":\"bj\",\"type\":\"qwm\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"wzxeygzvtyevjhu\",\"provisioningIssues\":[{\"name\":\"guqisqsqkpdmio\",\"properties\":{\"issueType\":\"nmlvi\",\"severity\":\"pszpmcvqdvr\",\"description\":\"vxyrxd\",\"suggestedResourceIds\":[\"qojbxao\",\"cgbzxm\",\"t\",\"lef\"],\"suggestedAccessRules\":[{},{},{},{}]}},{\"name\":\"idoxznvgvdtmuuv\",\"properties\":{\"issueType\":\"sxmrszbknimxlp\",\"severity\":\"rxrzutylcur\",\"description\":\"q\",\"suggestedResourceIds\":[\"xqaehtd\"],\"suggestedAccessRules\":[{},{},{},{}]}},{\"name\":\"nvynfaooeactedc\",\"properties\":{\"issueType\":\"kakddidahzllrqm\",\"severity\":\"pbyxroiduyqy\",\"description\":\"fmnoiicsudy\",\"suggestedResourceIds\":[\"jjtalxrdsj\",\"h\",\"luqwgusxxhd\",\"dp\"],\"suggestedAccessRules\":[{},{},{},{}]}}],\"networkSecurityPerimeter\":{\"id\":\"vtbdm\",\"perimeterGuid\":\"byidaelqpvekmkwj\",\"location\":\"o\"},\"resourceAssociation\":{\"name\":\"ggdusxu\",\"accessMode\":\"u\"},\"profile\":{\"name\":\"xcjkcoqwczsy\",\"accessRulesVersion\":3699317337579230590,\"accessRules\":[{\"name\":\"ihvaang\",\"properties\":{}},{\"name\":\"hjrfdmfdvbbaex\",\"properties\":{}}],\"diagnosticSettingsVersion\":2111869483655368468,\"enabledLogCategories\":[\"fkkauigvmua\"]}},\"id\":\"czfedyuep\",\"name\":\"vpltidajjvy\",\"type\":\"eocfkumcfjxok\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,17 +32,17 @@ public void testList() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.networkSecurityPerimeterConfigurations() - .list("mkczynuhhoqe", "shavljqkx", com.azure.core.util.Context.NONE); + .list("smcolmugpy", "aosd", com.azure.core.util.Context.NONE); - Assertions.assertEquals("zukwdrnzkj", + Assertions.assertEquals("guqisqsqkpdmio", response.iterator().next().properties().provisioningIssues().get(0).name()); - Assertions.assertEquals("ceyjnc", + Assertions.assertEquals("nmlvi", response.iterator().next().properties().provisioningIssues().get(0).properties().issueType()); - Assertions.assertEquals("lfuyfjbpfiddhlr", + Assertions.assertEquals("pszpmcvqdvr", response.iterator().next().properties().provisioningIssues().get(0).properties().severity()); - Assertions.assertEquals("zcqy", + Assertions.assertEquals("vxyrxd", response.iterator().next().properties().provisioningIssues().get(0).properties().description()); - Assertions.assertEquals("rfuiocusel", + Assertions.assertEquals("qojbxao", response.iterator() .next() .properties() @@ -51,22 +51,20 @@ public void testList() throws Exception { .properties() .suggestedResourceIds() .get(0)); - Assertions.assertEquals("cqrq", response.iterator().next().properties().networkSecurityPerimeter().id()); - Assertions.assertEquals("etjt", + Assertions.assertEquals("vtbdm", response.iterator().next().properties().networkSecurityPerimeter().id()); + Assertions.assertEquals("byidaelqpvekmkwj", response.iterator().next().properties().networkSecurityPerimeter().perimeterGuid()); - Assertions.assertEquals("hutfdoadtxopge", - response.iterator().next().properties().networkSecurityPerimeter().location()); - Assertions.assertEquals("dkmdzgsszx", response.iterator().next().properties().resourceAssociation().name()); - Assertions.assertEquals("tkbbxuhar", - response.iterator().next().properties().resourceAssociation().accessMode()); - Assertions.assertEquals("rncclabv", response.iterator().next().properties().profile().name()); - Assertions.assertEquals(5518516719089735498L, + Assertions.assertEquals("o", response.iterator().next().properties().networkSecurityPerimeter().location()); + Assertions.assertEquals("ggdusxu", response.iterator().next().properties().resourceAssociation().name()); + Assertions.assertEquals("u", response.iterator().next().properties().resourceAssociation().accessMode()); + Assertions.assertEquals("xcjkcoqwczsy", response.iterator().next().properties().profile().name()); + Assertions.assertEquals(3699317337579230590L, response.iterator().next().properties().profile().accessRulesVersion()); - Assertions.assertEquals("xczbmyqjoghdsaid", + Assertions.assertEquals("ihvaang", response.iterator().next().properties().profile().accessRules().get(0).name()); - Assertions.assertEquals(9011503856576673885L, + Assertions.assertEquals(2111869483655368468L, response.iterator().next().properties().profile().diagnosticSettingsVersion()); - Assertions.assertEquals("vdxxurntujmoilun", + Assertions.assertEquals("fkkauigvmua", response.iterator().next().properties().profile().enabledLogCategories().get(0)); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsReconcileMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsReconcileMockTests.java index 777c7c7a7b71..2a9e76ba25b8 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsReconcileMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterConfigurationsReconcileMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -21,7 +21,7 @@ public final class NetworkSecurityPerimeterConfigurationsReconcileMockTests { @Test public void testReconcile() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"provisioningIssues\":[{\"name\":\"nx\",\"properties\":{\"issueType\":\"pney\",\"severity\":\"bjizqfsgn\",\"description\":\"xz\",\"suggestedResourceIds\":[\"q\"],\"suggestedAccessRules\":[{}]}},{\"name\":\"orxipmlnfyzavfr\",\"properties\":{\"issueType\":\"icdbkpdj\",\"severity\":\"qh\",\"description\":\"q\",\"suggestedResourceIds\":[\"dgonjhxshthmgp\",\"zqulptkbv\",\"pxtzhigqqbtimpk\"],\"suggestedAccessRules\":[{},{},{}]}}],\"networkSecurityPerimeter\":{\"id\":\"nsihqhudsm\",\"perimeterGuid\":\"uaawja\",\"location\":\"wj\"},\"resourceAssociation\":{\"name\":\"z\",\"accessMode\":\"nii\"},\"profile\":{\"name\":\"vqban\",\"accessRulesVersion\":7797974355445812958,\"accessRules\":[{\"name\":\"nbg\",\"properties\":{}}],\"diagnosticSettingsVersion\":7530018712670231191,\"enabledLogCategories\":[\"gm\",\"nltwmpftmfoeajog\"]}},\"id\":\"xwet\",\"name\":\"mfd\",\"type\":\"rvlkpzwbhnrec\"}"; + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"provisioningIssues\":[{\"name\":\"cjdk\",\"properties\":{\"issueType\":\"csubmzoonsvobc\",\"severity\":\"xfpwhd\",\"description\":\"lbkl\",\"suggestedResourceIds\":[\"nn\",\"kwayqshwy\",\"xrid\"],\"suggestedAccessRules\":[{},{}]}},{\"name\":\"aqjmkgxqwque\",\"properties\":{\"issueType\":\"lztpziizevjykof\",\"severity\":\"zefkhkqtwqlepjj\",\"description\":\"c\",\"suggestedResourceIds\":[\"wz\",\"ntogffjwajnrt\",\"zvaqkifmxawost\",\"zkn\"],\"suggestedAccessRules\":[{},{},{}]}},{\"name\":\"jqncfvdscnh\",\"properties\":{\"issueType\":\"wfn\",\"severity\":\"wypvndrwbgo\",\"description\":\"ggrssgwjfkain\",\"suggestedResourceIds\":[\"ymvecvztscbg\",\"usaictd\",\"cnk\"],\"suggestedAccessRules\":[{},{},{},{}]}},{\"name\":\"nrddclzeqoz\",\"properties\":{\"issueType\":\"lbz\",\"severity\":\"xbnjrqvzyuexoz\",\"description\":\"ynp\",\"suggestedResourceIds\":[\"udpabcreuwzos\",\"yjxvc\"],\"suggestedAccessRules\":[{},{}]}}],\"networkSecurityPerimeter\":{\"id\":\"mr\",\"perimeterGuid\":\"zvdube\",\"location\":\"zygba\"},\"resourceAssociation\":{\"name\":\"ecovs\",\"accessMode\":\"hzrtd\"},\"profile\":{\"name\":\"rlimzfvppkeqs\",\"accessRulesVersion\":3801269935326176906,\"accessRules\":[{\"name\":\"gygnhrkombc\",\"properties\":{}}],\"diagnosticSettingsVersion\":2828273267048986386,\"enabledLogCategories\":[\"ggorwjoqt\",\"otpvclp\",\"fyrlmwkptskwxj\",\"vhxccbmkakmkoo\"]}},\"id\":\"putmgvmuyakm\",\"name\":\"wk\",\"type\":\"fowzkroyr\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,23 +31,24 @@ public void testReconcile() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); NetworkSecurityPerimeterConfiguration response = manager.networkSecurityPerimeterConfigurations() - .reconcile("gmlilwzghjhjvmab", "zbwaybfmdafbgym", "tn", com.azure.core.util.Context.NONE); + .reconcile("elsy", "svfnkwm", "gjjekrkn", com.azure.core.util.Context.NONE); - Assertions.assertEquals("nx", response.properties().provisioningIssues().get(0).name()); - Assertions.assertEquals("pney", response.properties().provisioningIssues().get(0).properties().issueType()); - Assertions.assertEquals("bjizqfsgn", response.properties().provisioningIssues().get(0).properties().severity()); - Assertions.assertEquals("xz", response.properties().provisioningIssues().get(0).properties().description()); - Assertions.assertEquals("q", + Assertions.assertEquals("cjdk", response.properties().provisioningIssues().get(0).name()); + Assertions.assertEquals("csubmzoonsvobc", + response.properties().provisioningIssues().get(0).properties().issueType()); + Assertions.assertEquals("xfpwhd", response.properties().provisioningIssues().get(0).properties().severity()); + Assertions.assertEquals("lbkl", response.properties().provisioningIssues().get(0).properties().description()); + Assertions.assertEquals("nn", response.properties().provisioningIssues().get(0).properties().suggestedResourceIds().get(0)); - Assertions.assertEquals("nsihqhudsm", response.properties().networkSecurityPerimeter().id()); - Assertions.assertEquals("uaawja", response.properties().networkSecurityPerimeter().perimeterGuid()); - Assertions.assertEquals("wj", response.properties().networkSecurityPerimeter().location()); - Assertions.assertEquals("z", response.properties().resourceAssociation().name()); - Assertions.assertEquals("nii", response.properties().resourceAssociation().accessMode()); - Assertions.assertEquals("vqban", response.properties().profile().name()); - Assertions.assertEquals(7797974355445812958L, response.properties().profile().accessRulesVersion()); - Assertions.assertEquals("nbg", response.properties().profile().accessRules().get(0).name()); - Assertions.assertEquals(7530018712670231191L, response.properties().profile().diagnosticSettingsVersion()); - Assertions.assertEquals("gm", response.properties().profile().enabledLogCategories().get(0)); + Assertions.assertEquals("mr", response.properties().networkSecurityPerimeter().id()); + Assertions.assertEquals("zvdube", response.properties().networkSecurityPerimeter().perimeterGuid()); + Assertions.assertEquals("zygba", response.properties().networkSecurityPerimeter().location()); + Assertions.assertEquals("ecovs", response.properties().resourceAssociation().name()); + Assertions.assertEquals("hzrtd", response.properties().resourceAssociation().accessMode()); + Assertions.assertEquals("rlimzfvppkeqs", response.properties().profile().name()); + Assertions.assertEquals(3801269935326176906L, response.properties().profile().accessRulesVersion()); + Assertions.assertEquals("gygnhrkombc", response.properties().profile().accessRules().get(0).name()); + Assertions.assertEquals(2828273267048986386L, response.properties().profile().diagnosticSettingsVersion()); + Assertions.assertEquals("ggorwjoqt", response.properties().profile().enabledLogCategories().get(0)); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterProfileInfoTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterProfileInfoTests.java index b83ca51ec81e..a62f05d67026 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterProfileInfoTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterProfileInfoTests.java @@ -1,143 +1,34 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeter; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRule; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRuleProperties; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem; import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterProfileInfo; import com.azure.resourcemanager.cognitiveservices.models.NspAccessRuleDirection; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class NetworkSecurityPerimeterProfileInfoTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NetworkSecurityPerimeterProfileInfo model = BinaryData.fromString( - "{\"name\":\"clnapxbiygnugjkn\",\"accessRulesVersion\":7448053712084224188,\"accessRules\":[{\"name\":\"uxuuyilflq\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"ehmrn\",\"hvsujztc\"],\"subscriptions\":[{\"id\":\"jtwhauunf\"},{\"id\":\"njle\"},{\"id\":\"xsmrpddouifamow\"}],\"networkSecurityPerimeters\":[{\"id\":\"nknlqwzdvpi\",\"perimeterGuid\":\"xqszdtmaajquh\",\"location\":\"ylr\"},{\"id\":\"m\",\"perimeterGuid\":\"g\",\"location\":\"mzyospspshck\"}],\"fullyQualifiedDomainNames\":[\"jpmspbpssdfppy\",\"gt\",\"eyujtvczkcnyxrx\",\"unjdx\"]}},{\"name\":\"lnkvxlx\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"vbgkcvkhpzv\",\"qdf\"],\"subscriptions\":[{\"id\":\"iypfp\"},{\"id\":\"cpzgpxtiv\"},{\"id\":\"knidib\"},{\"id\":\"jxgpnrhgovfg\"}],\"networkSecurityPerimeters\":[{\"id\":\"mhha\",\"perimeterGuid\":\"jrmzvupor\",\"location\":\"dfuyd\"},{\"id\":\"kfvxcnq\",\"perimeterGuid\":\"qpswokmvkhlggdhb\",\"location\":\"zqkzszuwi\"},{\"id\":\"glxxhljfpgpic\",\"perimeterGuid\":\"nzhrgmqgjsxvpqcb\",\"location\":\"mbodthsqqgvri\"}],\"fullyQualifiedDomainNames\":[\"kclacjfrn\"]}},{\"name\":\"usx\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"sgmwoh\"],\"subscriptions\":[{\"id\":\"zvuxm\"},{\"id\":\"jsvthnwpzteko\"},{\"id\":\"ribi\"}],\"networkSecurityPerimeters\":[{\"id\":\"plucfotangcfhnyk\",\"perimeterGuid\":\"ugswvx\",\"location\":\"mzqwmvtxnjmxmcu\"},{\"id\":\"dtcvcl\",\"perimeterGuid\":\"npdkv\",\"location\":\"abuiy\"},{\"id\":\"buzphdugn\",\"perimeterGuid\":\"knpgoxgjiuq\",\"location\":\"btozipqwje\"}],\"fullyQualifiedDomainNames\":[\"rrxxgewpktvq\",\"lkm\",\"pzoyhlfbcg\"]}},{\"name\":\"cloxo\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"ipnwj\",\"ujqlafcbahh\"],\"subscriptions\":[{\"id\":\"foiyjwpfilk\"},{\"id\":\"kholvd\"}],\"networkSecurityPerimeters\":[{\"id\":\"auo\",\"perimeterGuid\":\"huartv\",\"location\":\"ukyefchnmnahmnxh\"},{\"id\":\"jqirwrw\",\"perimeterGuid\":\"oxffif\",\"location\":\"wrsnewmozqvbu\"},{\"id\":\"ma\",\"perimeterGuid\":\"sycxhxzgaz\",\"location\":\"abo\"}],\"fullyQualifiedDomainNames\":[\"mfqhppubowse\",\"dfgkmtdh\",\"rngbtcjuahokqtob\"]}}],\"diagnosticSettingsVersion\":8540357974239086249,\"enabledLogCategories\":[\"sh\",\"phwpnulaiywzej\"]}") + "{\"name\":\"rnxzh\",\"accessRulesVersion\":5714214798846092668,\"accessRules\":[{\"name\":\"bujr\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"revkhgnlnzo\",\"zlrpiqywncvj\",\"szcofizeht\",\"hgbjkvrelje\"],\"subscriptions\":[{\"id\":\"vzmlovuanashcxl\"},{\"id\":\"jerbdkelvidizozs\"},{\"id\":\"ccxjm\"},{\"id\":\"fdgnwncypuuwwlt\"}],\"networkSecurityPerimeters\":[{\"id\":\"ctzenkeifzzhmkd\",\"perimeterGuid\":\"vflyhbxcu\",\"location\":\"hxgsrboldfor\"},{\"id\":\"wjlvizbfhfov\",\"perimeterGuid\":\"cqpbtuo\",\"location\":\"eszabbelawumuas\"},{\"id\":\"kwrrwo\",\"perimeterGuid\":\"qucwyhahnom\",\"location\":\"kywuhpsvfuu\"}],\"fullyQualifiedDomainNames\":[\"lwexxwl\",\"lniexz\",\"rzpgep\",\"tybbwwpgda\"]}},{\"name\":\"hzyvlixqnrkcx\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"mysu\",\"swqrntvlwijp\",\"ttexoqqpwcyyufmh\",\"uncuw\"],\"subscriptions\":[{\"id\":\"kcdqzhlct\"},{\"id\":\"unqndyfpchrqb\"}],\"networkSecurityPerimeters\":[{\"id\":\"cgegydcwbo\",\"perimeterGuid\":\"umvq\",\"location\":\"lihrraiouaubr\"}],\"fullyQualifiedDomainNames\":[\"oq\",\"fuojrngif\",\"rzpasccbiuimzdly\",\"dfqwmkyoq\"]}},{\"name\":\"dvruzslzojhpctf\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"ngfdgugeyzihgrky\",\"i\",\"absnmfpp\",\"ojeevy\"],\"subscriptions\":[{\"id\":\"gzfc\"}],\"networkSecurityPerimeters\":[{\"id\":\"mfg\",\"perimeterGuid\":\"glqgleoh\",\"location\":\"etnluankrrfx\"},{\"id\":\"ebtijvacvbmqzbqq\",\"perimeterGuid\":\"aj\",\"location\":\"wxacevehj\"},{\"id\":\"yxoaf\",\"perimeterGuid\":\"oqltfae\",\"location\":\"inmfgvxirp\"}],\"fullyQualifiedDomainNames\":[\"iypoqeyhlqhykprl\",\"yznuciqd\",\"mexiitdfuxt\",\"asiibmiybnnust\"]}},{\"name\":\"ljhnmgixhcmav\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"or\",\"cgyypro\",\"wy\"],\"subscriptions\":[{\"id\":\"mbxhugcmjkav\"}],\"networkSecurityPerimeters\":[{\"id\":\"bmftpmdt\",\"perimeterGuid\":\"jltfvnzcyjtotpv\",\"location\":\"vpbdbzqgq\"}],\"fullyQualifiedDomainNames\":[\"edsvqwthmk\",\"ibcysihsgqc\",\"dhohsdtmcdzsuf\",\"ohdxbzlmcmu\"]}}],\"diagnosticSettingsVersion\":3777009455947733916,\"enabledLogCategories\":[\"bevwqqxeys\",\"onqzinkfkbgbzbow\",\"eqocljmygvk\",\"qkjjeokbz\"]}") .toObject(NetworkSecurityPerimeterProfileInfo.class); - Assertions.assertEquals("clnapxbiygnugjkn", model.name()); - Assertions.assertEquals(7448053712084224188L, model.accessRulesVersion()); - Assertions.assertEquals("uxuuyilflq", model.accessRules().get(0).name()); + Assertions.assertEquals("rnxzh", model.name()); + Assertions.assertEquals(5714214798846092668L, model.accessRulesVersion()); + Assertions.assertEquals("bujr", model.accessRules().get(0).name()); Assertions.assertEquals(NspAccessRuleDirection.INBOUND, model.accessRules().get(0).properties().direction()); - Assertions.assertEquals("ehmrn", model.accessRules().get(0).properties().addressPrefixes().get(0)); - Assertions.assertEquals("jtwhauunf", model.accessRules().get(0).properties().subscriptions().get(0).id()); - Assertions.assertEquals("nknlqwzdvpi", + Assertions.assertEquals("revkhgnlnzo", model.accessRules().get(0).properties().addressPrefixes().get(0)); + Assertions.assertEquals("vzmlovuanashcxl", model.accessRules().get(0).properties().subscriptions().get(0).id()); + Assertions.assertEquals("ctzenkeifzzhmkd", model.accessRules().get(0).properties().networkSecurityPerimeters().get(0).id()); - Assertions.assertEquals("xqszdtmaajquh", + Assertions.assertEquals("vflyhbxcu", model.accessRules().get(0).properties().networkSecurityPerimeters().get(0).perimeterGuid()); - Assertions.assertEquals("ylr", + Assertions.assertEquals("hxgsrboldfor", model.accessRules().get(0).properties().networkSecurityPerimeters().get(0).location()); - Assertions.assertEquals("jpmspbpssdfppy", - model.accessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); - Assertions.assertEquals(8540357974239086249L, model.diagnosticSettingsVersion()); - Assertions.assertEquals("sh", model.enabledLogCategories().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkSecurityPerimeterProfileInfo model = new NetworkSecurityPerimeterProfileInfo() - .withName("clnapxbiygnugjkn") - .withAccessRulesVersion(7448053712084224188L) - .withAccessRules(Arrays.asList( - new NetworkSecurityPerimeterAccessRule().withName("uxuuyilflq") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.INBOUND) - .withAddressPrefixes(Arrays.asList("ehmrn", "hvsujztc")) - .withSubscriptions( - Arrays.asList( - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("jtwhauunf"), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("njle"), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem() - .withId("xsmrpddouifamow"))) - .withNetworkSecurityPerimeters(Arrays.asList(new NetworkSecurityPerimeter() - .withId("nknlqwzdvpi") - .withPerimeterGuid("xqszdtmaajquh") - .withLocation("ylr"), - new NetworkSecurityPerimeter().withId("m") - .withPerimeterGuid("g") - .withLocation("mzyospspshck"))) - .withFullyQualifiedDomainNames( - Arrays.asList("jpmspbpssdfppy", "gt", "eyujtvczkcnyxrx", "unjdx"))), - new NetworkSecurityPerimeterAccessRule().withName("lnkvxlx") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.OUTBOUND) - .withAddressPrefixes(Arrays.asList("vbgkcvkhpzv", "qdf")) - .withSubscriptions(Arrays.asList( - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("iypfp"), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("cpzgpxtiv"), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("knidib"), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("jxgpnrhgovfg"))) - .withNetworkSecurityPerimeters(Arrays.asList( - new NetworkSecurityPerimeter().withId("mhha") - .withPerimeterGuid("jrmzvupor") - .withLocation("dfuyd"), - new NetworkSecurityPerimeter().withId("kfvxcnq") - .withPerimeterGuid("qpswokmvkhlggdhb") - .withLocation("zqkzszuwi"), - new NetworkSecurityPerimeter().withId("glxxhljfpgpic") - .withPerimeterGuid("nzhrgmqgjsxvpqcb") - .withLocation("mbodthsqqgvri"))) - .withFullyQualifiedDomainNames(Arrays.asList("kclacjfrn"))), - new NetworkSecurityPerimeterAccessRule().withName("usx") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.INBOUND) - .withAddressPrefixes(Arrays.asList("sgmwoh")) - .withSubscriptions(Arrays.asList( - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("zvuxm"), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("jsvthnwpzteko"), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("ribi"))) - .withNetworkSecurityPerimeters(Arrays.asList( - new NetworkSecurityPerimeter().withId("plucfotangcfhnyk") - .withPerimeterGuid("ugswvx") - .withLocation("mzqwmvtxnjmxmcu"), - new NetworkSecurityPerimeter().withId("dtcvcl") - .withPerimeterGuid("npdkv") - .withLocation("abuiy"), - new NetworkSecurityPerimeter().withId("buzphdugn") - .withPerimeterGuid("knpgoxgjiuq") - .withLocation("btozipqwje"))) - .withFullyQualifiedDomainNames(Arrays.asList("rrxxgewpktvq", "lkm", "pzoyhlfbcg"))), - new NetworkSecurityPerimeterAccessRule().withName("cloxo") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.OUTBOUND) - .withAddressPrefixes(Arrays.asList("ipnwj", "ujqlafcbahh")) - .withSubscriptions(Arrays.asList( - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("foiyjwpfilk"), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("kholvd"))) - .withNetworkSecurityPerimeters(Arrays.asList( - new NetworkSecurityPerimeter().withId("auo") - .withPerimeterGuid("huartv") - .withLocation("ukyefchnmnahmnxh"), - new NetworkSecurityPerimeter().withId("jqirwrw") - .withPerimeterGuid("oxffif") - .withLocation("wrsnewmozqvbu"), - new NetworkSecurityPerimeter().withId("ma") - .withPerimeterGuid("sycxhxzgaz") - .withLocation("abo"))) - .withFullyQualifiedDomainNames(Arrays.asList("mfqhppubowse", "dfgkmtdh", "rngbtcjuahokqtob"))))) - .withDiagnosticSettingsVersion(8540357974239086249L) - .withEnabledLogCategories(Arrays.asList("sh", "phwpnulaiywzej")); - model = BinaryData.fromObject(model).toObject(NetworkSecurityPerimeterProfileInfo.class); - Assertions.assertEquals("clnapxbiygnugjkn", model.name()); - Assertions.assertEquals(7448053712084224188L, model.accessRulesVersion()); - Assertions.assertEquals("uxuuyilflq", model.accessRules().get(0).name()); - Assertions.assertEquals(NspAccessRuleDirection.INBOUND, model.accessRules().get(0).properties().direction()); - Assertions.assertEquals("ehmrn", model.accessRules().get(0).properties().addressPrefixes().get(0)); - Assertions.assertEquals("jtwhauunf", model.accessRules().get(0).properties().subscriptions().get(0).id()); - Assertions.assertEquals("nknlqwzdvpi", - model.accessRules().get(0).properties().networkSecurityPerimeters().get(0).id()); - Assertions.assertEquals("xqszdtmaajquh", - model.accessRules().get(0).properties().networkSecurityPerimeters().get(0).perimeterGuid()); - Assertions.assertEquals("ylr", - model.accessRules().get(0).properties().networkSecurityPerimeters().get(0).location()); - Assertions.assertEquals("jpmspbpssdfppy", - model.accessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); - Assertions.assertEquals(8540357974239086249L, model.diagnosticSettingsVersion()); - Assertions.assertEquals("sh", model.enabledLogCategories().get(0)); + Assertions.assertEquals("lwexxwl", model.accessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); + Assertions.assertEquals(3777009455947733916L, model.diagnosticSettingsVersion()); + Assertions.assertEquals("bevwqqxeys", model.enabledLogCategories().get(0)); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterTests.java index 95c8e3b12dc3..37fde712d6cb 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NetworkSecurityPerimeterTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,21 +12,10 @@ public final class NetworkSecurityPerimeterTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NetworkSecurityPerimeter model - = BinaryData.fromString("{\"id\":\"gratzvzbglbyvict\",\"perimeterGuid\":\"brxkjzwr\",\"location\":\"ffm\"}") + = BinaryData.fromString("{\"id\":\"ufuqyrx\",\"perimeterGuid\":\"lcgqlsismj\",\"location\":\"rddga\"}") .toObject(NetworkSecurityPerimeter.class); - Assertions.assertEquals("gratzvzbglbyvict", model.id()); - Assertions.assertEquals("brxkjzwr", model.perimeterGuid()); - Assertions.assertEquals("ffm", model.location()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NetworkSecurityPerimeter model = new NetworkSecurityPerimeter().withId("gratzvzbglbyvict") - .withPerimeterGuid("brxkjzwr") - .withLocation("ffm"); - model = BinaryData.fromObject(model).toObject(NetworkSecurityPerimeter.class); - Assertions.assertEquals("gratzvzbglbyvict", model.id()); - Assertions.assertEquals("brxkjzwr", model.perimeterGuid()); - Assertions.assertEquals("ffm", model.location()); + Assertions.assertEquals("ufuqyrx", model.id()); + Assertions.assertEquals("lcgqlsismj", model.perimeterGuid()); + Assertions.assertEquals("rddga", model.location()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NoneAuthTypeConnectionPropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NoneAuthTypeConnectionPropertiesTests.java index 0b153327fc98..df0b556c889a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NoneAuthTypeConnectionPropertiesTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/NoneAuthTypeConnectionPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -19,45 +19,44 @@ public final class NoneAuthTypeConnectionPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { NoneAuthTypeConnectionProperties model = BinaryData.fromString( - "{\"authType\":\"None\",\"category\":\"OracleServiceCloud\",\"createdByWorkspaceArmId\":\"zdcgdzbenr\",\"error\":\"cawetzqddt\",\"expiryTime\":\"2021-09-26T22:58Z\",\"group\":\"NoSQL\",\"isSharedToAll\":false,\"metadata\":{\"mizvgbgatzuuvbx\":\"mtuatmzwcjjncqtj\",\"ajqfutlx\":\"grebwggahttzlsw\",\"unwqr\":\"oqza\",\"uocnjrohmbpyr\":\"zfrgqhaohcm\"},\"peRequirement\":\"NotRequired\",\"peStatus\":\"Active\",\"sharedUserList\":[\"ydyvkfkmro\"],\"target\":\"nehvsmt\",\"useWorkspaceManagedIdentity\":false}") + "{\"authType\":\"None\",\"category\":\"Greenplum\",\"createdByWorkspaceArmId\":\"fecjxeygtuhx\",\"error\":\"cbuewmrswnjlxuz\",\"expiryTime\":\"2021-07-05T07:48:33Z\",\"group\":\"NoSQL\",\"isSharedToAll\":true,\"metadata\":{\"dohzjq\":\"aqehg\",\"o\":\"tu\",\"cnwfepbnwgfmxjg\":\"gebx\"},\"peRequirement\":\"NotApplicable\",\"peStatus\":\"NotApplicable\",\"sharedUserList\":[\"lfgtdysnaquflqbc\",\"q\",\"amz\"],\"target\":\"wdkqzeqy\",\"useWorkspaceManagedIdentity\":true}") .toObject(NoneAuthTypeConnectionProperties.class); - Assertions.assertEquals(ConnectionCategory.ORACLE_SERVICE_CLOUD, model.category()); - Assertions.assertEquals("cawetzqddt", model.error()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-26T22:58Z"), model.expiryTime()); - Assertions.assertFalse(model.isSharedToAll()); - Assertions.assertEquals("mtuatmzwcjjncqtj", model.metadata().get("mizvgbgatzuuvbx")); - Assertions.assertEquals(ManagedPERequirement.NOT_REQUIRED, model.peRequirement()); - Assertions.assertEquals(ManagedPEStatus.ACTIVE, model.peStatus()); - Assertions.assertEquals("ydyvkfkmro", model.sharedUserList().get(0)); - Assertions.assertEquals("nehvsmt", model.target()); - Assertions.assertFalse(model.useWorkspaceManagedIdentity()); + Assertions.assertEquals(ConnectionCategory.GREENPLUM, model.category()); + Assertions.assertEquals("cbuewmrswnjlxuz", model.error()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-05T07:48:33Z"), model.expiryTime()); + Assertions.assertTrue(model.isSharedToAll()); + Assertions.assertEquals("aqehg", model.metadata().get("dohzjq")); + Assertions.assertEquals(ManagedPERequirement.NOT_APPLICABLE, model.peRequirement()); + Assertions.assertEquals(ManagedPEStatus.NOT_APPLICABLE, model.peStatus()); + Assertions.assertEquals("lfgtdysnaquflqbc", model.sharedUserList().get(0)); + Assertions.assertEquals("wdkqzeqy", model.target()); + Assertions.assertTrue(model.useWorkspaceManagedIdentity()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { NoneAuthTypeConnectionProperties model - = new NoneAuthTypeConnectionProperties().withCategory(ConnectionCategory.ORACLE_SERVICE_CLOUD) - .withError("cawetzqddt") - .withExpiryTime(OffsetDateTime.parse("2021-09-26T22:58Z")) - .withIsSharedToAll(false) - .withMetadata(mapOf("mizvgbgatzuuvbx", "mtuatmzwcjjncqtj", "ajqfutlx", "grebwggahttzlsw", "unwqr", - "oqza", "uocnjrohmbpyr", "zfrgqhaohcm")) - .withPeRequirement(ManagedPERequirement.NOT_REQUIRED) - .withPeStatus(ManagedPEStatus.ACTIVE) - .withSharedUserList(Arrays.asList("ydyvkfkmro")) - .withTarget("nehvsmt") - .withUseWorkspaceManagedIdentity(false); + = new NoneAuthTypeConnectionProperties().withCategory(ConnectionCategory.GREENPLUM) + .withError("cbuewmrswnjlxuz") + .withExpiryTime(OffsetDateTime.parse("2021-07-05T07:48:33Z")) + .withIsSharedToAll(true) + .withMetadata(mapOf("dohzjq", "aqehg", "o", "tu", "cnwfepbnwgfmxjg", "gebx")) + .withPeRequirement(ManagedPERequirement.NOT_APPLICABLE) + .withPeStatus(ManagedPEStatus.NOT_APPLICABLE) + .withSharedUserList(Arrays.asList("lfgtdysnaquflqbc", "q", "amz")) + .withTarget("wdkqzeqy") + .withUseWorkspaceManagedIdentity(true); model = BinaryData.fromObject(model).toObject(NoneAuthTypeConnectionProperties.class); - Assertions.assertEquals(ConnectionCategory.ORACLE_SERVICE_CLOUD, model.category()); - Assertions.assertEquals("cawetzqddt", model.error()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-26T22:58Z"), model.expiryTime()); - Assertions.assertFalse(model.isSharedToAll()); - Assertions.assertEquals("mtuatmzwcjjncqtj", model.metadata().get("mizvgbgatzuuvbx")); - Assertions.assertEquals(ManagedPERequirement.NOT_REQUIRED, model.peRequirement()); - Assertions.assertEquals(ManagedPEStatus.ACTIVE, model.peStatus()); - Assertions.assertEquals("ydyvkfkmro", model.sharedUserList().get(0)); - Assertions.assertEquals("nehvsmt", model.target()); - Assertions.assertFalse(model.useWorkspaceManagedIdentity()); + Assertions.assertEquals(ConnectionCategory.GREENPLUM, model.category()); + Assertions.assertEquals("cbuewmrswnjlxuz", model.error()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-05T07:48:33Z"), model.expiryTime()); + Assertions.assertTrue(model.isSharedToAll()); + Assertions.assertEquals("aqehg", model.metadata().get("dohzjq")); + Assertions.assertEquals(ManagedPERequirement.NOT_APPLICABLE, model.peRequirement()); + Assertions.assertEquals(ManagedPEStatus.NOT_APPLICABLE, model.peStatus()); + Assertions.assertEquals("lfgtdysnaquflqbc", model.sharedUserList().get(0)); + Assertions.assertEquals("wdkqzeqy", model.target()); + Assertions.assertTrue(model.useWorkspaceManagedIdentity()); } // Use "Map.of" if available diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationDisplayTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationDisplayTests.java index d72effee4132..1a585e5cd044 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationDisplayTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationDisplayTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -11,13 +11,7 @@ public final class OperationDisplayTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"mtxpsiebtfh\",\"resource\":\"esap\",\"operation\":\"rdqmhjjdhtldwkyz\",\"description\":\"utknc\"}") + "{\"provider\":\"lljfmppeeb\",\"resource\":\"gxsabkyq\",\"operation\":\"ujitcjcz\",\"description\":\"evndh\"}") .toObject(OperationDisplay.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationInnerTests.java index 204ca22deebe..dea96dbdec27 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationInnerTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationInnerTests.java @@ -1,24 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.cognitiveservices.fluent.models.OperationInner; -import com.azure.resourcemanager.cognitiveservices.models.OperationDisplay; public final class OperationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationInner model = BinaryData.fromString( - "{\"name\":\"es\",\"isDataAction\":true,\"display\":{\"provider\":\"pwiyig\",\"resource\":\"pkdwzbai\",\"operation\":\"bbaumnyquped\",\"description\":\"jn\"},\"origin\":\"system\",\"actionType\":\"Internal\"}") + "{\"name\":\"qulngsntnbybkzgc\",\"isDataAction\":false,\"display\":{\"provider\":\"xxwr\",\"resource\":\"douskcqvkocrcjdk\",\"operation\":\"nh\",\"description\":\"njbiksqrglssain\"},\"origin\":\"user\",\"actionType\":\"Internal\"}") .toObject(OperationInner.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationListResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationListResultTests.java index 249123a6d1e6..685f7a78a023 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationListResultTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationListResultTests.java @@ -1,23 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.OperationListResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.OperationListResult; +import org.junit.jupiter.api.Assertions; public final class OperationListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"wbiexzfey\",\"isDataAction\":false,\"display\":{\"provider\":\"bxu\",\"resource\":\"bhqwalmuzyoxa\",\"operation\":\"dkzjancuxrh\",\"description\":\"bavxbniwdjswzt\"},\"origin\":\"user\",\"actionType\":\"Internal\"},{\"name\":\"xytxhpzxbz\",\"isDataAction\":true,\"display\":{\"provider\":\"glcuhxwtctyqi\",\"resource\":\"bbovplwzbhvgyugu\",\"operation\":\"vmkfssxqu\",\"description\":\"fpl\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"kjz\"}") + "{\"value\":[{\"name\":\"hmsbzjhcrzevdp\",\"isDataAction\":false,\"display\":{\"provider\":\"lthqtrgqjbp\",\"resource\":\"fsinzgvfcjrwzoxx\",\"operation\":\"felluwfzitonpe\",\"description\":\"pjkjlxofpdv\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"pini\",\"isDataAction\":false,\"display\":{\"provider\":\"uybbkpodep\",\"resource\":\"ginuvamih\",\"operation\":\"gnarxzxtheo\",\"description\":\"si\"},\"origin\":\"user\",\"actionType\":\"Internal\"},{\"name\":\"iqihn\",\"isDataAction\":false,\"display\":{\"provider\":\"wjzrnfygxgisp\",\"resource\":\"vtz\",\"operation\":\"ufubl\",\"description\":\"fxqeof\"},\"origin\":\"system\",\"actionType\":\"Internal\"}],\"nextLink\":\"qjbasvms\"}") .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); + Assertions.assertEquals("qjbasvms", model.nextLink()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationsListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationsListMockTests.java index 988909513a4e..4ea151d2555f 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationsListMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OperationsListMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -21,7 +21,7 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"uwg\",\"isDataAction\":true,\"display\":{\"provider\":\"fpwzyifrkgwltx\",\"resource\":\"ipxgzdy\",\"operation\":\"sfayorpravkjoges\",\"description\":\"bnsmjkwynqxaek\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; + = "{\"value\":[{\"name\":\"dcadwvpsozjiihjr\",\"isDataAction\":true,\"display\":{\"provider\":\"zo\",\"resource\":\"nxwdvwnjkg\",\"operation\":\"nmx\",\"description\":\"rsqftib\"},\"origin\":\"user\",\"actionType\":\"Internal\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OrganizationSharedBuiltInAuthorizationPolicyTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OrganizationSharedBuiltInAuthorizationPolicyTests.java new file mode 100644 index 000000000000..045345c4ecc2 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OrganizationSharedBuiltInAuthorizationPolicyTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.models.OrganizationSharedBuiltInAuthorizationPolicy; + +public final class OrganizationSharedBuiltInAuthorizationPolicyTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OrganizationSharedBuiltInAuthorizationPolicy model = BinaryData.fromString("{\"type\":\"OrganizationScope\"}") + .toObject(OrganizationSharedBuiltInAuthorizationPolicy.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OrganizationSharedBuiltInAuthorizationPolicy model = new OrganizationSharedBuiltInAuthorizationPolicy(); + model = BinaryData.fromObject(model).toObject(OrganizationSharedBuiltInAuthorizationPolicy.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRuleBasicResourceInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRuleBasicResourceInnerTests.java new file mode 100644 index 000000000000..750b3e301995 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRuleBasicResourceInnerTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.fluent.models.OutboundRuleBasicResourceInner; +import com.azure.resourcemanager.cognitiveservices.models.OutboundRule; +import com.azure.resourcemanager.cognitiveservices.models.RuleCategory; +import com.azure.resourcemanager.cognitiveservices.models.RuleStatus; +import org.junit.jupiter.api.Assertions; + +public final class OutboundRuleBasicResourceInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OutboundRuleBasicResourceInner model = BinaryData.fromString( + "{\"properties\":{\"type\":\"OutboundRule\",\"category\":\"Required\",\"status\":\"Deleting\",\"errorInformation\":\"ypsjoq\",\"parentRuleNames\":[\"nkyhf\"]},\"id\":\"vsqxfxjelgcmpzqj\",\"name\":\"hhqxuwyvcacoyviv\",\"type\":\"s\"}") + .toObject(OutboundRuleBasicResourceInner.class); + Assertions.assertEquals(RuleCategory.REQUIRED, model.properties().category()); + Assertions.assertEquals(RuleStatus.DELETING, model.properties().status()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OutboundRuleBasicResourceInner model = new OutboundRuleBasicResourceInner() + .withProperties(new OutboundRule().withCategory(RuleCategory.REQUIRED).withStatus(RuleStatus.DELETING)); + model = BinaryData.fromObject(model).toObject(OutboundRuleBasicResourceInner.class); + Assertions.assertEquals(RuleCategory.REQUIRED, model.properties().category()); + Assertions.assertEquals(RuleStatus.DELETING, model.properties().status()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRuleListResultInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRuleListResultInnerTests.java new file mode 100644 index 000000000000..e4c9fc63b6e4 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRuleListResultInnerTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.fluent.models.OutboundRuleListResultInner; +import com.azure.resourcemanager.cognitiveservices.models.RuleCategory; +import com.azure.resourcemanager.cognitiveservices.models.RuleStatus; +import org.junit.jupiter.api.Assertions; + +public final class OutboundRuleListResultInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OutboundRuleListResultInner model = BinaryData.fromString( + "{\"nextLink\":\"vwmbjlzqsczpg\",\"value\":[{\"properties\":{\"type\":\"OutboundRule\",\"category\":\"Required\",\"status\":\"Deleting\",\"errorInformation\":\"qwowftptnuw\",\"parentRuleNames\":[\"sch\",\"cgqyhleseyq\",\"hvyeldotj\"]},\"id\":\"kwiswskukjtas\",\"name\":\"vwisp\",\"type\":\"xkdtxfkndlqvtwkn\"},{\"properties\":{\"type\":\"OutboundRule\",\"category\":\"Dependency\",\"status\":\"Active\",\"errorInformation\":\"gtywatmqaqkue\",\"parentRuleNames\":[\"roeshoygzc\",\"yf\",\"x\"]},\"id\":\"aoyte\",\"name\":\"qpuvjmv\",\"type\":\"mtdwcky\"}]}") + .toObject(OutboundRuleListResultInner.class); + Assertions.assertEquals("vwmbjlzqsczpg", model.nextLink()); + Assertions.assertEquals(RuleCategory.REQUIRED, model.value().get(0).properties().category()); + Assertions.assertEquals(RuleStatus.DELETING, model.value().get(0).properties().status()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRuleTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRuleTests.java new file mode 100644 index 000000000000..0ee38ebcd9d4 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRuleTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.models.OutboundRule; +import com.azure.resourcemanager.cognitiveservices.models.RuleCategory; +import com.azure.resourcemanager.cognitiveservices.models.RuleStatus; +import org.junit.jupiter.api.Assertions; + +public final class OutboundRuleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OutboundRule model = BinaryData.fromString( + "{\"type\":\"OutboundRule\",\"category\":\"UserDefined\",\"status\":\"Deleting\",\"errorInformation\":\"zlbscmnlziji\",\"parentRuleNames\":[\"hgm\",\"flnwy\",\"qkxrerl\"]}") + .toObject(OutboundRule.class); + Assertions.assertEquals(RuleCategory.USER_DEFINED, model.category()); + Assertions.assertEquals(RuleStatus.DELETING, model.status()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OutboundRule model = new OutboundRule().withCategory(RuleCategory.USER_DEFINED).withStatus(RuleStatus.DELETING); + model = BinaryData.fromObject(model).toObject(OutboundRule.class); + Assertions.assertEquals(RuleCategory.USER_DEFINED, model.category()); + Assertions.assertEquals(RuleStatus.DELETING, model.status()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRulesCreateOrUpdateMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRulesCreateOrUpdateMockTests.java new file mode 100644 index 000000000000..6c8dc4ff3243 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRulesCreateOrUpdateMockTests.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; +import com.azure.resourcemanager.cognitiveservices.models.OutboundRule; +import com.azure.resourcemanager.cognitiveservices.models.OutboundRuleBasicResource; +import com.azure.resourcemanager.cognitiveservices.models.RuleCategory; +import com.azure.resourcemanager.cognitiveservices.models.RuleStatus; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class OutboundRulesCreateOrUpdateMockTests { + @Test + public void testCreateOrUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"type\":\"OutboundRule\",\"category\":\"Recommended\",\"status\":\"Inactive\",\"errorInformation\":\"syxzxjmkanbc\",\"parentRuleNames\":[\"ofmex\",\"te\",\"as\",\"manydscdkxwdpw\"]},\"id\":\"bhaah\",\"name\":\"tofelfhpfixo\",\"type\":\"kkzdfivsu\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CognitiveServicesManager manager = CognitiveServicesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + OutboundRuleBasicResource response = manager.outboundRules() + .define("bdjzghximkg") + .withExistingManagedNetwork("ntwgkvyo", "psapzu", "zwwy") + .withProperties(new OutboundRule().withCategory(RuleCategory.RECOMMENDED).withStatus(RuleStatus.INACTIVE)) + .create(); + + Assertions.assertEquals(RuleCategory.RECOMMENDED, response.properties().category()); + Assertions.assertEquals(RuleStatus.INACTIVE, response.properties().status()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRulesGetWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRulesGetWithResponseMockTests.java new file mode 100644 index 000000000000..b9e8a637e53b --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRulesGetWithResponseMockTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; +import com.azure.resourcemanager.cognitiveservices.models.OutboundRuleBasicResource; +import com.azure.resourcemanager.cognitiveservices.models.RuleCategory; +import com.azure.resourcemanager.cognitiveservices.models.RuleStatus; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class OutboundRulesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"type\":\"OutboundRule\",\"category\":\"Dependency\",\"status\":\"Failed\",\"errorInformation\":\"ko\",\"parentRuleNames\":[\"b\",\"fgyweo\"]},\"id\":\"epgcmahiwf\",\"name\":\"yawkch\",\"type\":\"apitskshfyftt\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CognitiveServicesManager manager = CognitiveServicesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + OutboundRuleBasicResource response = manager.outboundRules() + .getWithResponse("vuznadvhm", "ieoigowxxbh", "psyioqemqwtqszzg", "ksikawanvmwdv", + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(RuleCategory.DEPENDENCY, response.properties().category()); + Assertions.assertEquals(RuleStatus.FAILED, response.properties().status()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRulesListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRulesListMockTests.java new file mode 100644 index 000000000000..2526b333d483 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRulesListMockTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; +import com.azure.resourcemanager.cognitiveservices.models.OutboundRuleBasicResource; +import com.azure.resourcemanager.cognitiveservices.models.RuleCategory; +import com.azure.resourcemanager.cognitiveservices.models.RuleStatus; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class OutboundRulesListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"type\":\"OutboundRule\",\"category\":\"Dependency\",\"status\":\"Inactive\",\"errorInformation\":\"vwehsu\",\"parentRuleNames\":[\"ymbh\",\"osmbngkqlgxz\",\"uvxdmxexatmd\"]},\"id\":\"rsenxoi\",\"name\":\"xyddmiplois\",\"type\":\"kzsoxz\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CognitiveServicesManager manager = CognitiveServicesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.outboundRules().list("bjepzwhj", "nfd", "bggcj", com.azure.core.util.Context.NONE); + + Assertions.assertEquals(RuleCategory.DEPENDENCY, response.iterator().next().properties().category()); + Assertions.assertEquals(RuleStatus.INACTIVE, response.iterator().next().properties().status()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRulesOperationsPostMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRulesOperationsPostMockTests.java new file mode 100644 index 000000000000..d2dd0427cf30 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/OutboundRulesOperationsPostMockTests.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkProvisionStatusInner; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsBasicResourceInner; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ManagedNetworkSettingsInner; +import com.azure.resourcemanager.cognitiveservices.models.FirewallSku; +import com.azure.resourcemanager.cognitiveservices.models.IsolationMode; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkKind; +import com.azure.resourcemanager.cognitiveservices.models.ManagedNetworkStatus; +import com.azure.resourcemanager.cognitiveservices.models.OutboundRule; +import com.azure.resourcemanager.cognitiveservices.models.OutboundRuleListResult; +import com.azure.resourcemanager.cognitiveservices.models.RuleCategory; +import com.azure.resourcemanager.cognitiveservices.models.RuleStatus; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class OutboundRulesOperationsPostMockTests { + @Test + public void testPost() throws Exception { + String responseStr + = "{\"nextLink\":\"puqtnylquevqmvy\",\"value\":[{\"properties\":{\"type\":\"OutboundRule\",\"category\":\"Required\",\"status\":\"Failed\",\"errorInformation\":\"snznwg\",\"parentRuleNames\":[\"fmjxcyo\",\"eqcazisvbrqgcy\"]},\"id\":\"gawepkwonrzp\",\"name\":\"h\",\"type\":\"rdtbgblxbuibrvj\"},{\"properties\":{\"type\":\"OutboundRule\",\"category\":\"Required\",\"status\":\"Deleting\",\"errorInformation\":\"smf\",\"parentRuleNames\":[\"vfjcqrttjfuqm\"]},\"id\":\"j\",\"name\":\"wfeqbavd\",\"type\":\"stwygu\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CognitiveServicesManager manager = CognitiveServicesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + OutboundRuleListResult response + = manager.outboundRulesOperations() + .post("xxr", "ic", "zfvwjdthkvpyeyoa", + new ManagedNetworkSettingsBasicResourceInner().withProperties(new ManagedNetworkSettingsInner() + .withIsolationMode(IsolationMode.DISABLED) + .withOutboundRules(mapOf("fjxlpiy", + new OutboundRule().withCategory(RuleCategory.REQUIRED).withStatus(RuleStatus.FAILED), + "jqpulmwqg", + new OutboundRule().withCategory(RuleCategory.RECOMMENDED).withStatus(RuleStatus.DELETING), + "xhgdeke", + new OutboundRule().withCategory(RuleCategory.USER_DEFINED) + .withStatus(RuleStatus.PROVISIONING), + "yijjimhi", + new OutboundRule().withCategory(RuleCategory.RECOMMENDED).withStatus(RuleStatus.DELETING))) + .withStatus(new ManagedNetworkProvisionStatusInner().withStatus(ManagedNetworkStatus.INACTIVE)) + .withFirewallSku(FirewallSku.BASIC) + .withManagedNetworkKind(ManagedNetworkKind.V1)), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("puqtnylquevqmvy", response.nextLink()); + Assertions.assertEquals(RuleCategory.REQUIRED, response.value().get(0).properties().category()); + Assertions.assertEquals(RuleStatus.FAILED, response.value().get(0).properties().status()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PatchResourceTagsAndSkuTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PatchResourceTagsAndSkuTests.java index 30571ae4d557..06aa9f6c07d3 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PatchResourceTagsAndSkuTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PatchResourceTagsAndSkuTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -16,32 +16,31 @@ public final class PatchResourceTagsAndSkuTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PatchResourceTagsAndSku model = BinaryData.fromString( - "{\"sku\":{\"name\":\"maequiahxicslfa\",\"tier\":\"Free\",\"size\":\"iyylhalnswhccsp\",\"family\":\"aivwitqscywu\",\"capacity\":1839231877},\"tags\":{\"i\":\"uhczbwemh\",\"wmsweypqwd\":\"sbrgz\"}}") + "{\"sku\":{\"name\":\"ped\",\"tier\":\"Free\",\"size\":\"a\",\"family\":\"khsmtxpsiebt\",\"capacity\":1926869194},\"tags\":{\"qmhjjdhtld\":\"sapskr\"}}") .toObject(PatchResourceTagsAndSku.class); - Assertions.assertEquals("uhczbwemh", model.tags().get("i")); - Assertions.assertEquals("maequiahxicslfa", model.sku().name()); + Assertions.assertEquals("sapskr", model.tags().get("qmhjjdhtld")); + Assertions.assertEquals("ped", model.sku().name()); Assertions.assertEquals(SkuTier.FREE, model.sku().tier()); - Assertions.assertEquals("iyylhalnswhccsp", model.sku().size()); - Assertions.assertEquals("aivwitqscywu", model.sku().family()); - Assertions.assertEquals(1839231877, model.sku().capacity()); + Assertions.assertEquals("a", model.sku().size()); + Assertions.assertEquals("khsmtxpsiebt", model.sku().family()); + Assertions.assertEquals(1926869194, model.sku().capacity()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - PatchResourceTagsAndSku model - = new PatchResourceTagsAndSku().withTags(mapOf("i", "uhczbwemh", "wmsweypqwd", "sbrgz")) - .withSku(new Sku().withName("maequiahxicslfa") - .withTier(SkuTier.FREE) - .withSize("iyylhalnswhccsp") - .withFamily("aivwitqscywu") - .withCapacity(1839231877)); + PatchResourceTagsAndSku model = new PatchResourceTagsAndSku().withTags(mapOf("qmhjjdhtld", "sapskr")) + .withSku(new Sku().withName("ped") + .withTier(SkuTier.FREE) + .withSize("a") + .withFamily("khsmtxpsiebt") + .withCapacity(1926869194)); model = BinaryData.fromObject(model).toObject(PatchResourceTagsAndSku.class); - Assertions.assertEquals("uhczbwemh", model.tags().get("i")); - Assertions.assertEquals("maequiahxicslfa", model.sku().name()); + Assertions.assertEquals("sapskr", model.tags().get("qmhjjdhtld")); + Assertions.assertEquals("ped", model.sku().name()); Assertions.assertEquals(SkuTier.FREE, model.sku().tier()); - Assertions.assertEquals("iyylhalnswhccsp", model.sku().size()); - Assertions.assertEquals("aivwitqscywu", model.sku().family()); - Assertions.assertEquals(1839231877, model.sku().capacity()); + Assertions.assertEquals("a", model.sku().size()); + Assertions.assertEquals("khsmtxpsiebt", model.sku().family()); + Assertions.assertEquals(1926869194, model.sku().capacity()); } // Use "Map.of" if available diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PatchResourceTagsTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PatchResourceTagsTests.java index 885348229659..23ad06409f3a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PatchResourceTagsTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PatchResourceTagsTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -13,18 +13,18 @@ public final class PatchResourceTagsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - PatchResourceTags model = BinaryData.fromString( - "{\"tags\":{\"qhuexm\":\"icccn\",\"ncsdtclusiyp\":\"ttlstvlzywemhz\",\"ygqukyhejh\":\"sfgytguslfead\"}}") + PatchResourceTags model = BinaryData + .fromString("{\"tags\":{\"otogtwrupqs\":\"zxuutkncwscwsvl\",\"cykvceo\":\"vnm\",\"vnotyfjfcnj\":\"eil\"}}") .toObject(PatchResourceTags.class); - Assertions.assertEquals("icccn", model.tags().get("qhuexm")); + Assertions.assertEquals("zxuutkncwscwsvl", model.tags().get("otogtwrupqs")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { PatchResourceTags model = new PatchResourceTags() - .withTags(mapOf("qhuexm", "icccn", "ncsdtclusiyp", "ttlstvlzywemhz", "ygqukyhejh", "sfgytguslfead")); + .withTags(mapOf("otogtwrupqs", "zxuutkncwscwsvl", "cykvceo", "vnm", "vnotyfjfcnj", "eil")); model = BinaryData.fromObject(model).toObject(PatchResourceTags.class); - Assertions.assertEquals("icccn", model.tags().get("qhuexm")); + Assertions.assertEquals("zxuutkncwscwsvl", model.tags().get("otogtwrupqs")); } // Use "Map.of" if available diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionInnerTests.java index 51b95fb236cb..e01d1bc5c1e2 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionInnerTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -17,14 +17,15 @@ public final class PrivateEndpointConnectionInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateEndpointConnectionInner model = BinaryData.fromString( - "{\"properties\":{\"privateEndpoint\":{\"id\":\"tfell\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"it\",\"actionsRequired\":\"peqfpjkjl\"},\"provisioningState\":\"Deleting\",\"groupIds\":[\"vhpfxxypininmay\",\"uybbkpodep\",\"oginuvamiheognar\",\"zxtheotusivyevcc\"]},\"location\":\"ihnhun\",\"etag\":\"wjzrnfygxgisp\",\"id\":\"vtz\",\"name\":\"kufubljo\",\"type\":\"xqeofjaeqjhqjba\"}") + "{\"properties\":{\"privateEndpoint\":{\"id\":\"kyfi\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"dfvzwdzuhty\",\"actionsRequired\":\"isdkfthwxmnteiw\"},\"provisioningState\":\"Failed\",\"groupIds\":[\"mijcmmxdcufufs\"]},\"etag\":\"ymzidn\",\"location\":\"zcxtbzsgfyccsn\",\"id\":\"mdwzjeiachboo\",\"name\":\"flnrosfqpteehzz\",\"type\":\"ypyqrimzinp\"}") .toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("it", model.properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("peqfpjkjl", model.properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("vhpfxxypininmay", model.properties().groupIds().get(0)); - Assertions.assertEquals("ihnhun", model.location()); + Assertions.assertEquals("dfvzwdzuhty", model.properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("isdkfthwxmnteiw", + model.properties().privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("mijcmmxdcufufs", model.properties().groupIds().get(0)); + Assertions.assertEquals("zcxtbzsgfyccsn", model.location()); } @org.junit.jupiter.api.Test @@ -33,18 +34,18 @@ public void testSerialize() throws Exception { = new PrivateEndpointConnectionInner() .withProperties(new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("it") - .withActionsRequired("peqfpjkjl")) - .withGroupIds( - Arrays.asList("vhpfxxypininmay", "uybbkpodep", "oginuvamiheognar", "zxtheotusivyevcc"))) - .withLocation("ihnhun"); + .withStatus(PrivateEndpointServiceConnectionStatus.PENDING) + .withDescription("dfvzwdzuhty") + .withActionsRequired("isdkfthwxmnteiw")) + .withGroupIds(Arrays.asList("mijcmmxdcufufs"))) + .withLocation("zcxtbzsgfyccsn"); model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionInner.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, model.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("it", model.properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("peqfpjkjl", model.properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("vhpfxxypininmay", model.properties().groupIds().get(0)); - Assertions.assertEquals("ihnhun", model.location()); + Assertions.assertEquals("dfvzwdzuhty", model.properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("isdkfthwxmnteiw", + model.properties().privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("mijcmmxdcufufs", model.properties().groupIds().get(0)); + Assertions.assertEquals("zcxtbzsgfyccsn", model.location()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionListResultInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionListResultInnerTests.java index 0fe30c0bfde6..8e24a5b01fa4 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionListResultInnerTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionListResultInnerTests.java @@ -1,75 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateEndpointConnectionListResultInner; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpoint; -import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointConnectionProperties; import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointServiceConnectionStatus; -import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkServiceConnectionState; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class PrivateEndpointConnectionListResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateEndpointConnectionListResultInner model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"ygdvwv\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"hgwxrtfudx\",\"actionsRequired\":\"xg\"},\"provisioningState\":\"Deleting\",\"groupIds\":[\"rvmnpkukghimdblx\",\"wi\",\"fnjhfjxwmszkkfo\",\"rey\"]},\"location\":\"zi\",\"etag\":\"jawneaiv\",\"id\":\"czelpcirel\",\"name\":\"feaenwab\",\"type\":\"atklddxbjhwuaa\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"osphyoul\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"xagl\",\"actionsRequired\":\"imjwosyt\"},\"provisioningState\":\"Succeeded\",\"groupIds\":[\"kfcktqum\"]},\"location\":\"kkezzikhlyfjhdgq\",\"etag\":\"ebdunyg\",\"id\":\"qidbqfatpxllrxcy\",\"name\":\"moadsuvarmy\",\"type\":\"dmjsjqb\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"x\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"yc\",\"actionsRequired\":\"uhpkxkgymar\"},\"provisioningState\":\"Succeeded\",\"groupIds\":[\"xqugjhkycubedd\",\"ssofwqmzqa\",\"krmnjijpxacqqud\"]},\"location\":\"byxbaaabjy\",\"etag\":\"yffimrzrtuzqogs\",\"id\":\"nevfdnw\",\"name\":\"wmewzsyy\",\"type\":\"euzsoi\"}]}") + "{\"value\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"flz\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"zpuzycisp\",\"actionsRequired\":\"zahmgkbrpyydhibn\"},\"provisioningState\":\"Failed\",\"groupIds\":[\"ik\",\"drgvtqagn\"]},\"etag\":\"ynhijggme\",\"location\":\"siarbutrcvpn\",\"id\":\"zmhjrunmp\",\"name\":\"ttdbhrbnl\",\"type\":\"nkxmyskpbhenbtk\"}]}") .toObject(PrivateEndpointConnectionListResultInner.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, model.value().get(0).properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("hgwxrtfudx", + Assertions.assertEquals("zpuzycisp", model.value().get(0).properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("xg", + Assertions.assertEquals("zahmgkbrpyydhibn", model.value().get(0).properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("rvmnpkukghimdblx", model.value().get(0).properties().groupIds().get(0)); - Assertions.assertEquals("zi", model.value().get(0).location()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateEndpointConnectionListResultInner model - = new PrivateEndpointConnectionListResultInner() - .withValue(Arrays.asList( - new PrivateEndpointConnectionInner() - .withProperties( - new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) - .withDescription("hgwxrtfudx") - .withActionsRequired("xg")) - .withGroupIds(Arrays.asList("rvmnpkukghimdblx", "wi", "fnjhfjxwmszkkfo", "rey"))) - .withLocation("zi"), - new PrivateEndpointConnectionInner().withProperties( - new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("xagl") - .withActionsRequired("imjwosyt")) - .withGroupIds(Arrays.asList("kfcktqum"))) - .withLocation("kkezzikhlyfjhdgq"), - new PrivateEndpointConnectionInner() - .withProperties( - new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) - .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("yc") - .withActionsRequired("uhpkxkgymar")) - .withGroupIds(Arrays.asList("xqugjhkycubedd", "ssofwqmzqa", "krmnjijpxacqqud"))) - .withLocation("byxbaaabjy"))); - model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionListResultInner.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, - model.value().get(0).properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("hgwxrtfudx", - model.value().get(0).properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("xg", - model.value().get(0).properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("rvmnpkukghimdblx", model.value().get(0).properties().groupIds().get(0)); - Assertions.assertEquals("zi", model.value().get(0).location()); + Assertions.assertEquals("ik", model.value().get(0).properties().groupIds().get(0)); + Assertions.assertEquals("siarbutrcvpn", model.value().get(0).location()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionPropertiesTests.java index f1989d836ff1..1b4c3a32dd0a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionPropertiesTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -16,13 +16,13 @@ public final class PrivateEndpointConnectionPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateEndpointConnectionProperties model = BinaryData.fromString( - "{\"privateEndpoint\":{\"id\":\"smjqulngsntnbyb\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"wrwclxxwrljd\",\"actionsRequired\":\"skcqvkocrcjd\"},\"provisioningState\":\"Creating\",\"groupIds\":[\"xbnjbiksq\",\"gls\",\"ainqpjwnzlljfm\"]}") + "{\"privateEndpoint\":{\"id\":\"jdkirsoodqx\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"nohjt\",\"actionsRequired\":\"whdsoifiyip\"},\"provisioningState\":\"Creating\",\"groupIds\":[\"pgrjbz\",\"orcjxvsnby\",\"qabnmoc\"]}") .toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("wrwclxxwrljd", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("skcqvkocrcjd", model.privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("xbnjbiksq", model.groupIds().get(0)); + Assertions.assertEquals("nohjt", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("whdsoifiyip", model.privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("pgrjbz", model.groupIds().get(0)); } @org.junit.jupiter.api.Test @@ -30,15 +30,15 @@ public void testSerialize() throws Exception { PrivateEndpointConnectionProperties model = new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) .withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.PENDING) - .withDescription("wrwclxxwrljd") - .withActionsRequired("skcqvkocrcjd")) - .withGroupIds(Arrays.asList("xbnjbiksq", "gls", "ainqpjwnzlljfm")); + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) + .withDescription("nohjt") + .withActionsRequired("whdsoifiyip")) + .withGroupIds(Arrays.asList("pgrjbz", "orcjxvsnby", "qabnmoc")); model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, model.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("wrwclxxwrljd", model.privateLinkServiceConnectionState().description()); - Assertions.assertEquals("skcqvkocrcjd", model.privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("xbnjbiksq", model.groupIds().get(0)); + Assertions.assertEquals("nohjt", model.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("whdsoifiyip", model.privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("pgrjbz", model.groupIds().get(0)); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsCreateOrUpdateMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsCreateOrUpdateMockTests.java index bd9fc6276d81..92c84e8d4e19 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsCreateOrUpdateMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsCreateOrUpdateMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -26,7 +26,7 @@ public final class PrivateEndpointConnectionsCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"privateEndpoint\":{\"id\":\"oqujlyegqavn\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"qqbtny\",\"actionsRequired\":\"ylxd\"},\"provisioningState\":\"Succeeded\",\"groupIds\":[\"mvmsxbae\",\"wjcnkottl\"]},\"location\":\"hvajmailfemjjzak\",\"etag\":\"jiqul\",\"id\":\"xbdmvrscmqernd\",\"name\":\"rnyeofltfnnxrk\",\"type\":\"dj\"}"; + = "{\"properties\":{\"privateEndpoint\":{\"id\":\"r\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"lwcjsqggjhffb\",\"actionsRequired\":\"qrkijpeuq\"},\"provisioningState\":\"Succeeded\",\"groupIds\":[\"qztvx\",\"mwwmjswenaww\",\"me\"]},\"etag\":\"eq\",\"location\":\"ulndhzyoeo\",\"id\":\"tollh\",\"name\":\"vidmytzl\",\"type\":\"glxpnovyoanfbcsw\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -37,22 +37,24 @@ public void testCreateOrUpdate() throws Exception { PrivateEndpointConnection response = manager.privateEndpointConnections() - .define("yjmfczlfsyqkfr") - .withExistingAccount("lfryvdmvxadqac", "rgnawbabgfbk") - .withRegion("ywzash") + .define("svvoqsbpkflanfk") + .withExistingAccount("ibmq", "miymqruqguhfupet") + .withRegion("ktkrumzuedky") .withProperties(new PrivateEndpointConnectionProperties().withPrivateEndpoint(new PrivateEndpoint()) .withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState() - .withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("cxn") - .withActionsRequired("gxhlusr")) - .withGroupIds(Arrays.asList("mjceagbjqvls"))) + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("hdkcprgu") + .withActionsRequired("rztiochlutixmqr")) + .withGroupIds(Arrays.asList("cbfzmc"))) .create(); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, response.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("qqbtny", response.properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("ylxd", response.properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("mvmsxbae", response.properties().groupIds().get(0)); - Assertions.assertEquals("hvajmailfemjjzak", response.location()); + Assertions.assertEquals("lwcjsqggjhffb", + response.properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("qrkijpeuq", + response.properties().privateLinkServiceConnectionState().actionsRequired()); + Assertions.assertEquals("qztvx", response.properties().groupIds().get(0)); + Assertions.assertEquals("ulndhzyoeo", response.location()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsDeleteMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsDeleteMockTests.java index 7ea92443e5f0..bef92990ee63 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsDeleteMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsDeleteMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -27,7 +27,8 @@ public void testDelete() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.privateEndpointConnections().delete("hvwyp", "suvjslcz", "ciidjs", com.azure.core.util.Context.NONE); + manager.privateEndpointConnections() + .delete("lpky", "tglwkzpgajsqjc", "mqbmfuvqarwz", com.azure.core.util.Context.NONE); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java index 99fc1b8dccb1..2967148d059d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -22,7 +22,7 @@ public final class PrivateEndpointConnectionsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"privateEndpoint\":{\"id\":\"ltygxhqfgqkayej\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"gflwfgziiucijj\",\"actionsRequired\":\"atlijjjr\"},\"provisioningState\":\"Succeeded\",\"groupIds\":[\"a\",\"zknxkv\"]},\"location\":\"xetyvku\",\"etag\":\"ignohi\",\"id\":\"gqogjwpindedva\",\"name\":\"bxbhmedeilbj\",\"type\":\"wfcfxzirzz\"}"; + = "{\"properties\":{\"privateEndpoint\":{\"id\":\"tmbqdabzfivfok\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"h\",\"actionsRequired\":\"agjfwyyrlhgenuze\"},\"provisioningState\":\"Deleting\",\"groupIds\":[\"eba\"]},\"etag\":\"zllrz\",\"location\":\"mmdqgmihzpimc\",\"id\":\"hnxtmin\",\"name\":\"logxsvtzar\",\"type\":\"zvqnsqktcmbjwzzo\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,16 +32,15 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PrivateEndpointConnection response = manager.privateEndpointConnections() - .getWithResponse("wrgyngy", "grpxncakiqaondjr", "clamgglvlmfejdoq", com.azure.core.util.Context.NONE) + .getWithResponse("eucyrth", "qlehmcgcjeinu", "hokamvfej", com.azure.core.util.Context.NONE) .getValue(); Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, response.properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("gflwfgziiucijj", - response.properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("atlijjjr", + Assertions.assertEquals("h", response.properties().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("agjfwyyrlhgenuze", response.properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("a", response.properties().groupIds().get(0)); - Assertions.assertEquals("xetyvku", response.location()); + Assertions.assertEquals("eba", response.properties().groupIds().get(0)); + Assertions.assertEquals("mmdqgmihzpimc", response.location()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsListWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsListWithResponseMockTests.java index 39b317663bc1..264db0c6214d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsListWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointConnectionsListWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -22,7 +22,7 @@ public final class PrivateEndpointConnectionsListWithResponseMockTests { @Test public void testListWithResponse() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"mt\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"nxzcm\",\"actionsRequired\":\"ngxno\"},\"provisioningState\":\"Deleting\",\"groupIds\":[\"isn\",\"evhdlmydid\"]},\"location\":\"epfwwt\",\"etag\":\"doesxxhmwcdb\",\"id\":\"yo\",\"name\":\"kxkxhnegk\",\"type\":\"jzrbhtmeplv\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"brlbpgs\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"nchjhgemuowakywa\",\"actionsRequired\":\"jymxcgqt\"},\"provisioningState\":\"Deleting\",\"groupIds\":[\"lss\",\"ljomevt\",\"ycnlbvgjcodk\",\"gjiiytssiki\"]},\"location\":\"cufqbvntnrgmqs\",\"etag\":\"hcekxgnlykm\",\"id\":\"pwzvmdoksqdti\",\"name\":\"lwxlboncqbazq\",\"type\":\"cqchygtvxbyjane\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"pkxyqvgxi\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"tvo\",\"actionsRequired\":\"xdxuwsaifmc\"},\"provisioningState\":\"Succeeded\",\"groupIds\":[\"zlehgcvkbcknjolg\",\"y\"]},\"location\":\"pvelszerqze\",\"etag\":\"o\",\"id\":\"intxwa\",\"name\":\"jglzoblqwaafrq\",\"type\":\"lhm\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"hdvafjrqpjiyrqjc\"},\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"wmzwdfkbnrzorpdl\",\"actionsRequired\":\"qctqjfg\"},\"provisioningState\":\"Failed\",\"groupIds\":[\"tgzdgv\",\"yig\",\"aqqilzdcduwjoed\"]},\"location\":\"gucaif\",\"etag\":\"urwwgilfjq\",\"id\":\"cdmkxwxdcvjw\",\"name\":\"yziakeciqchxrtu\",\"type\":\"cdsiwdfmmpzhzzwv\"}]}"; + = "{\"value\":[{\"properties\":{\"privateEndpoint\":{\"id\":\"qkbud\"},\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"okbavlyttaak\",\"actionsRequired\":\"frkebsmhpd\"},\"provisioningState\":\"Succeeded\",\"groupIds\":[\"atolekscbc\",\"nanqimwbzxpdcldp\",\"awnsnlaimou\",\"w\"]},\"etag\":\"qmudmfcoibic\",\"location\":\"uswswjrkbqsjhb\",\"id\":\"q\",\"name\":\"yfscyrfwbivqvo\",\"type\":\"fuy\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"hlimby\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"ood\",\"actionsRequired\":\"kcdrdaasaxxobsm\"},\"provisioningState\":\"Deleting\",\"groupIds\":[\"j\",\"zuko\",\"r\"]},\"etag\":\"wnvz\",\"location\":\"n\",\"id\":\"ywsxvjabjqqaxu\",\"name\":\"vym\",\"type\":\"nudn\"},{\"properties\":{\"privateEndpoint\":{\"id\":\"hjxwxq\"},\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"pmpvks\",\"actionsRequired\":\"tnsqxtlt\"},\"provisioningState\":\"Deleting\",\"groupIds\":[\"pqgfhyrfr\",\"kkld\",\"rcwfcmfcnrjajq\"]},\"etag\":\"txjtielnzqgx\",\"location\":\"fbbmtlp\",\"id\":\"gynoiprnzcali\",\"name\":\"cryqxzx\",\"type\":\"q\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,16 +32,16 @@ public void testListWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PrivateEndpointConnectionListResult response = manager.privateEndpointConnections() - .listWithResponse("jwcolbm", "lbnwtpcpahp", com.azure.core.util.Context.NONE) + .listWithResponse("uqrebluimmbwx", "fgtdmbvx", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.PENDING, + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, response.value().get(0).properties().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("nxzcm", + Assertions.assertEquals("okbavlyttaak", response.value().get(0).properties().privateLinkServiceConnectionState().description()); - Assertions.assertEquals("ngxno", + Assertions.assertEquals("frkebsmhpd", response.value().get(0).properties().privateLinkServiceConnectionState().actionsRequired()); - Assertions.assertEquals("isn", response.value().get(0).properties().groupIds().get(0)); - Assertions.assertEquals("epfwwt", response.value().get(0).location()); + Assertions.assertEquals("atolekscbc", response.value().get(0).properties().groupIds().get(0)); + Assertions.assertEquals("uswswjrkbqsjhb", response.value().get(0).location()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointOutboundRuleDestinationTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointOutboundRuleDestinationTests.java new file mode 100644 index 000000000000..3682a4394a37 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointOutboundRuleDestinationTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointOutboundRuleDestination; +import org.junit.jupiter.api.Assertions; + +public final class PrivateEndpointOutboundRuleDestinationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpointOutboundRuleDestination model + = BinaryData.fromString("{\"serviceResourceId\":\"znvodrrslblxydk\",\"subresourceTarget\":\"xvv\"}") + .toObject(PrivateEndpointOutboundRuleDestination.class); + Assertions.assertEquals("znvodrrslblxydk", model.serviceResourceId()); + Assertions.assertEquals("xvv", model.subresourceTarget()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateEndpointOutboundRuleDestination model + = new PrivateEndpointOutboundRuleDestination().withServiceResourceId("znvodrrslblxydk") + .withSubresourceTarget("xvv"); + model = BinaryData.fromObject(model).toObject(PrivateEndpointOutboundRuleDestination.class); + Assertions.assertEquals("znvodrrslblxydk", model.serviceResourceId()); + Assertions.assertEquals("xvv", model.subresourceTarget()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointOutboundRuleTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointOutboundRuleTests.java new file mode 100644 index 000000000000..d72d9098006a --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointOutboundRuleTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointOutboundRule; +import com.azure.resourcemanager.cognitiveservices.models.PrivateEndpointOutboundRuleDestination; +import com.azure.resourcemanager.cognitiveservices.models.RuleCategory; +import com.azure.resourcemanager.cognitiveservices.models.RuleStatus; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class PrivateEndpointOutboundRuleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpointOutboundRule model = BinaryData.fromString( + "{\"type\":\"PrivateEndpoint\",\"destination\":{\"serviceResourceId\":\"krtalvn\",\"subresourceTarget\":\"gpbemeluclvdjju\"},\"fqdns\":[\"dnqodx\",\"hhxhq\",\"aqnvzoqgyipemchg\",\"v\"],\"category\":\"Recommended\",\"status\":\"Failed\",\"errorInformation\":\"dtx\",\"parentRuleNames\":[\"ghwzhomewjjstli\",\"hqawmo\",\"ia\"]}") + .toObject(PrivateEndpointOutboundRule.class); + Assertions.assertEquals(RuleCategory.RECOMMENDED, model.category()); + Assertions.assertEquals(RuleStatus.FAILED, model.status()); + Assertions.assertEquals("krtalvn", model.destination().serviceResourceId()); + Assertions.assertEquals("gpbemeluclvdjju", model.destination().subresourceTarget()); + Assertions.assertEquals("dnqodx", model.fqdns().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateEndpointOutboundRule model = new PrivateEndpointOutboundRule().withCategory(RuleCategory.RECOMMENDED) + .withStatus(RuleStatus.FAILED) + .withDestination(new PrivateEndpointOutboundRuleDestination().withServiceResourceId("krtalvn") + .withSubresourceTarget("gpbemeluclvdjju")) + .withFqdns(Arrays.asList("dnqodx", "hhxhq", "aqnvzoqgyipemchg", "v")); + model = BinaryData.fromObject(model).toObject(PrivateEndpointOutboundRule.class); + Assertions.assertEquals(RuleCategory.RECOMMENDED, model.category()); + Assertions.assertEquals(RuleStatus.FAILED, model.status()); + Assertions.assertEquals("krtalvn", model.destination().serviceResourceId()); + Assertions.assertEquals("gpbemeluclvdjju", model.destination().subresourceTarget()); + Assertions.assertEquals("dnqodx", model.fqdns().get(0)); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointTests.java index 56ca4d255d50..1d3c4f8c2bcc 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateEndpointTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -10,7 +10,7 @@ public final class PrivateEndpointTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - PrivateEndpoint model = BinaryData.fromString("{\"id\":\"eebvmgxsab\"}").toObject(PrivateEndpoint.class); + PrivateEndpoint model = BinaryData.fromString("{\"id\":\"ysh\"}").toObject(PrivateEndpoint.class); } @org.junit.jupiter.api.Test diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourceListResultInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourceListResultInnerTests.java index b8ec57ff4f6a..20b5e302eb55 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourceListResultInnerTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourceListResultInnerTests.java @@ -1,31 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.cognitiveservices.fluent.models.PrivateLinkResourceListResultInner; -import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkResource; -import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkResourceProperties; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class PrivateLinkResourceListResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateLinkResourceListResultInner model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"groupId\":\"frxtrthzvaytdwk\",\"requiredMembers\":[\"qu\",\"paxh\",\"xiilivpdtiirqt\",\"qoaxoruzfgs\"],\"requiredZoneNames\":[\"fxrxxle\",\"tramxjez\"],\"displayName\":\"wnwxuqlcvyd\"},\"id\":\"atdooaojkniod\",\"name\":\"oo\",\"type\":\"bw\"}]}") + "{\"value\":[{\"properties\":{\"groupId\":\"eihfq\",\"requiredMembers\":[\"wfiwzcxmj\",\"byephmgt\",\"ljvrcmyfqipgxhnp\",\"myqwcab\"],\"requiredZoneNames\":[\"ilee\"],\"displayName\":\"swlpaugmrmfj\"},\"id\":\"xwtoaukhfkvc\",\"name\":\"sizmoae\",\"type\":\"sx\"},{\"properties\":{\"groupId\":\"ive\",\"requiredMembers\":[\"gyeewxeiq\",\"psmgo\"],\"requiredZoneNames\":[\"amljdlrgmsplzgau\"],\"displayName\":\"shhvnewgnxky\"},\"id\":\"q\",\"name\":\"nxrjkixtwbtaoy\",\"type\":\"nyghshxcylhkgmn\"}]}") .toObject(PrivateLinkResourceListResultInner.class); - Assertions.assertEquals("fxrxxle", model.value().get(0).properties().requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceListResultInner model - = new PrivateLinkResourceListResultInner().withValue(Arrays.asList(new PrivateLinkResource().withProperties( - new PrivateLinkResourceProperties().withRequiredZoneNames(Arrays.asList("fxrxxle", "tramxjez"))))); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceListResultInner.class); - Assertions.assertEquals("fxrxxle", model.value().get(0).properties().requiredZoneNames().get(0)); + Assertions.assertEquals("ilee", model.value().get(0).properties().requiredZoneNames().get(0)); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourcePropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourcePropertiesTests.java index f702d89c2b77..0489315eb1aa 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourcePropertiesTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourcePropertiesTests.java @@ -1,28 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkResourceProperties; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class PrivateLinkResourcePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateLinkResourceProperties model = BinaryData.fromString( - "{\"groupId\":\"sz\",\"requiredMembers\":[\"psbzkfzbeyvpn\",\"icvi\",\"v\"],\"requiredZoneNames\":[\"xdxr\",\"uukzclewyhmlw\",\"aztz\"],\"displayName\":\"fn\"}") + "{\"groupId\":\"c\",\"requiredMembers\":[\"b\",\"kjanur\",\"nqbnqb\"],\"requiredZoneNames\":[\"xqltgrd\",\"gypxrxvbfihwuhvc\",\"a\",\"s\"],\"displayName\":\"xrblmliowxihs\"}") .toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("xdxr", model.requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResourceProperties model - = new PrivateLinkResourceProperties().withRequiredZoneNames(Arrays.asList("xdxr", "uukzclewyhmlw", "aztz")); - model = BinaryData.fromObject(model).toObject(PrivateLinkResourceProperties.class); - Assertions.assertEquals("xdxr", model.requiredZoneNames().get(0)); + Assertions.assertEquals("xqltgrd", model.requiredZoneNames().get(0)); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourceTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourceTests.java index 4297c898876b..0303db0863d5 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourceTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourceTests.java @@ -1,29 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkResource; -import com.azure.resourcemanager.cognitiveservices.models.PrivateLinkResourceProperties; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class PrivateLinkResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateLinkResource model = BinaryData.fromString( - "{\"properties\":{\"groupId\":\"hemms\",\"requiredMembers\":[\"kcrodtjinfw\",\"lfltka\"],\"requiredZoneNames\":[\"efkdlf\",\"akggkfpag\",\"owpulpq\",\"lyls\"],\"displayName\":\"k\"},\"id\":\"nsj\",\"name\":\"r\",\"type\":\"tiagx\"}") + "{\"properties\":{\"groupId\":\"pxycphdr\",\"requiredMembers\":[\"khv\",\"omacluzvxnqmhr\",\"qpd\",\"wmkoisq\"],\"requiredZoneNames\":[\"f\",\"xuifmcsypobkdqz\"],\"displayName\":\"zsylollgt\"},\"id\":\"zzydmxzjijpvua\",\"name\":\"rkihcirld\",\"type\":\"fx\"}") .toObject(PrivateLinkResource.class); - Assertions.assertEquals("efkdlf", model.properties().requiredZoneNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PrivateLinkResource model = new PrivateLinkResource().withProperties(new PrivateLinkResourceProperties() - .withRequiredZoneNames(Arrays.asList("efkdlf", "akggkfpag", "owpulpq", "lyls"))); - model = BinaryData.fromObject(model).toObject(PrivateLinkResource.class); - Assertions.assertEquals("efkdlf", model.properties().requiredZoneNames().get(0)); + Assertions.assertEquals("f", model.properties().requiredZoneNames().get(0)); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourcesListWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourcesListWithResponseMockTests.java index 967db492939d..a7ab109c7e6c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourcesListWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkResourcesListWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -21,7 +21,7 @@ public final class PrivateLinkResourcesListWithResponseMockTests { @Test public void testListWithResponse() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"groupId\":\"wjiutgnjiz\",\"requiredMembers\":[\"woiymrvz\"],\"requiredZoneNames\":[\"yrsrziuctixgb\",\"suif\",\"evkaa\"],\"displayName\":\"zkiswqjmdghsy\"},\"id\":\"ry\",\"name\":\"jufptbjczjnciuiy\",\"type\":\"vldaswv\"},{\"properties\":{\"groupId\":\"sqqzlgcndhz\",\"requiredMembers\":[\"fcfsrhkhgsnx\"],\"requiredZoneNames\":[\"kpphefsbzx\",\"bzxomeik\",\"clwzacnmwpfsu\"],\"displayName\":\"aazyqbxyxoyfpuqq\"},\"id\":\"ezxlhdjzqdca\",\"name\":\"wvpsoz\",\"type\":\"iihjriybmrzo\"},{\"properties\":{\"groupId\":\"xwdvwnj\",\"requiredMembers\":[\"fnmxa\"],\"requiredZoneNames\":[\"q\",\"tibtyi\",\"uyvpirf\",\"jpnqnoowsbeden\"],\"displayName\":\"xkxbhxvu\"},\"id\":\"ulgm\",\"name\":\"hjevd\",\"type\":\"znfaj\"},{\"properties\":{\"groupId\":\"skmqozzkivyhj\",\"requiredMembers\":[\"izjixlq\",\"hefkwabsolronqq\",\"mgnlqxsjxtel\",\"xhvuqbozool\"],\"requiredZoneNames\":[\"carkuzlb\",\"nndtsnxa\",\"qytl\",\"hd\"],\"displayName\":\"myck\"},\"id\":\"xnx\",\"name\":\"kck\",\"type\":\"wymxgaabjk\"}]}"; + = "{\"value\":[{\"properties\":{\"groupId\":\"qiqmlfvhlq\",\"requiredMembers\":[\"kqj\",\"xptueip\",\"ugkw\",\"rq\"],\"requiredZoneNames\":[\"ahuuonjkkxukg\"],\"displayName\":\"hvvpx\"},\"id\":\"egcjojlleuid\",\"name\":\"mt\",\"type\":\"nvhgnhtmeplh\"},{\"properties\":{\"groupId\":\"bap\",\"requiredMembers\":[\"mmkvav\",\"c\",\"jiuaiqpmnufzh\",\"chxwwuzdmh\"],\"requiredZoneNames\":[\"vivjm\",\"mlitqdsj\"],\"displayName\":\"dvisco\"},\"id\":\"xbriifefn\",\"name\":\"s\",\"type\":\"vrqoemwsi\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,9 +31,9 @@ public void testListWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PrivateLinkResourceListResult response = manager.privateLinkResources() - .listWithResponse("ynnfmuiii", "ipfohykfkx", com.azure.core.util.Context.NONE) + .listWithResponse("bgacnr", "fdtncmspsanma", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("yrsrziuctixgb", response.value().get(0).properties().requiredZoneNames().get(0)); + Assertions.assertEquals("ahuuonjkkxukg", response.value().get(0).properties().requiredZoneNames().get(0)); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkServiceConnectionStateTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkServiceConnectionStateTests.java index 16f0480c427d..c24100b00373 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkServiceConnectionStateTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/PrivateLinkServiceConnectionStateTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -13,23 +13,22 @@ public final class PrivateLinkServiceConnectionStateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PrivateLinkServiceConnectionState model = BinaryData - .fromString( - "{\"status\":\"Rejected\",\"description\":\"uujitcjc\",\"actionsRequired\":\"zevndhkrwpdappds\"}") + .fromString("{\"status\":\"Approved\",\"description\":\"fblj\",\"actionsRequired\":\"pbtoqcjmkl\"}") .toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, model.status()); - Assertions.assertEquals("uujitcjc", model.description()); - Assertions.assertEquals("zevndhkrwpdappds", model.actionsRequired()); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.status()); + Assertions.assertEquals("fblj", model.description()); + Assertions.assertEquals("pbtoqcjmkl", model.actionsRequired()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { PrivateLinkServiceConnectionState model - = new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.REJECTED) - .withDescription("uujitcjc") - .withActionsRequired("zevndhkrwpdappds"); + = new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("fblj") + .withActionsRequired("pbtoqcjmkl"); model = BinaryData.fromObject(model).toObject(PrivateLinkServiceConnectionState.class); - Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.REJECTED, model.status()); - Assertions.assertEquals("uujitcjc", model.description()); - Assertions.assertEquals("zevndhkrwpdappds", model.actionsRequired()); + Assertions.assertEquals(PrivateEndpointServiceConnectionStatus.APPROVED, model.status()); + Assertions.assertEquals("fblj", model.description()); + Assertions.assertEquals("pbtoqcjmkl", model.actionsRequired()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostInnerTests.java new file mode 100644 index 000000000000..39aa832a00b9 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostInnerTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.fluent.models.ProjectCapabilityHostInner; +import com.azure.resourcemanager.cognitiveservices.models.ProjectCapabilityHostProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ProjectCapabilityHostInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ProjectCapabilityHostInner model = BinaryData.fromString( + "{\"properties\":{\"aiServicesConnections\":[\"uxvnsasbcrymodi\",\"rxklobdxnazpmk\",\"lmv\"],\"vectorStoreConnections\":[\"xzopjhbzxl\"],\"storageConnections\":[\"rdddtfgxqbawpcb\"],\"threadStorageConnections\":[\"qcy\",\"napqo\"],\"provisioningState\":\"Succeeded\"},\"id\":\"cdhzbd\",\"name\":\"bwwg\",\"type\":\"d\"}") + .toObject(ProjectCapabilityHostInner.class); + Assertions.assertEquals("uxvnsasbcrymodi", model.properties().aiServicesConnections().get(0)); + Assertions.assertEquals("xzopjhbzxl", model.properties().vectorStoreConnections().get(0)); + Assertions.assertEquals("rdddtfgxqbawpcb", model.properties().storageConnections().get(0)); + Assertions.assertEquals("qcy", model.properties().threadStorageConnections().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ProjectCapabilityHostInner model + = new ProjectCapabilityHostInner().withProperties(new ProjectCapabilityHostProperties() + .withAiServicesConnections(Arrays.asList("uxvnsasbcrymodi", "rxklobdxnazpmk", "lmv")) + .withVectorStoreConnections(Arrays.asList("xzopjhbzxl")) + .withStorageConnections(Arrays.asList("rdddtfgxqbawpcb")) + .withThreadStorageConnections(Arrays.asList("qcy", "napqo"))); + model = BinaryData.fromObject(model).toObject(ProjectCapabilityHostInner.class); + Assertions.assertEquals("uxvnsasbcrymodi", model.properties().aiServicesConnections().get(0)); + Assertions.assertEquals("xzopjhbzxl", model.properties().vectorStoreConnections().get(0)); + Assertions.assertEquals("rdddtfgxqbawpcb", model.properties().storageConnections().get(0)); + Assertions.assertEquals("qcy", model.properties().threadStorageConnections().get(0)); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostPropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostPropertiesTests.java new file mode 100644 index 000000000000..fbbfb09c03f0 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostPropertiesTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.models.ProjectCapabilityHostProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ProjectCapabilityHostPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ProjectCapabilityHostProperties model = BinaryData.fromString( + "{\"aiServicesConnections\":[\"idmhmwf\"],\"vectorStoreConnections\":[\"fmuvapckccr\"],\"storageConnections\":[\"eyoxoyyukphai\",\"moiroqb\"],\"threadStorageConnections\":[\"bragapyyrmf\",\"vbpavbopfppdbw\",\"upgahxkum\"],\"provisioningState\":\"Updating\"}") + .toObject(ProjectCapabilityHostProperties.class); + Assertions.assertEquals("idmhmwf", model.aiServicesConnections().get(0)); + Assertions.assertEquals("fmuvapckccr", model.vectorStoreConnections().get(0)); + Assertions.assertEquals("eyoxoyyukphai", model.storageConnections().get(0)); + Assertions.assertEquals("bragapyyrmf", model.threadStorageConnections().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ProjectCapabilityHostProperties model + = new ProjectCapabilityHostProperties().withAiServicesConnections(Arrays.asList("idmhmwf")) + .withVectorStoreConnections(Arrays.asList("fmuvapckccr")) + .withStorageConnections(Arrays.asList("eyoxoyyukphai", "moiroqb")) + .withThreadStorageConnections(Arrays.asList("bragapyyrmf", "vbpavbopfppdbw", "upgahxkum")); + model = BinaryData.fromObject(model).toObject(ProjectCapabilityHostProperties.class); + Assertions.assertEquals("idmhmwf", model.aiServicesConnections().get(0)); + Assertions.assertEquals("fmuvapckccr", model.vectorStoreConnections().get(0)); + Assertions.assertEquals("eyoxoyyukphai", model.storageConnections().get(0)); + Assertions.assertEquals("bragapyyrmf", model.threadStorageConnections().get(0)); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostResourceArmPaginatedResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostResourceArmPaginatedResultTests.java new file mode 100644 index 000000000000..65f1a9fd1534 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostResourceArmPaginatedResultTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.implementation.models.ProjectCapabilityHostResourceArmPaginatedResult; +import org.junit.jupiter.api.Assertions; + +public final class ProjectCapabilityHostResourceArmPaginatedResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ProjectCapabilityHostResourceArmPaginatedResult model = BinaryData.fromString( + "{\"nextLink\":\"aacfdmmc\",\"value\":[{\"properties\":{\"aiServicesConnections\":[\"hqepvufhbzehewh\",\"qhnlbqnbld\",\"eaclgschorimk\",\"srrm\"],\"vectorStoreConnections\":[\"s\"],\"storageConnections\":[\"dpuviyf\",\"aabeolhbhlvbmxuq\"],\"threadStorageConnections\":[\"xtkcudfbsfar\"],\"provisioningState\":\"Succeeded\"},\"id\":\"wlkjxn\",\"name\":\"pvwgfstmhqykizmd\",\"type\":\"saoafcluqvox\"}]}") + .toObject(ProjectCapabilityHostResourceArmPaginatedResult.class); + Assertions.assertEquals("aacfdmmc", model.nextLink()); + Assertions.assertEquals("hqepvufhbzehewh", model.value().get(0).properties().aiServicesConnections().get(0)); + Assertions.assertEquals("s", model.value().get(0).properties().vectorStoreConnections().get(0)); + Assertions.assertEquals("dpuviyf", model.value().get(0).properties().storageConnections().get(0)); + Assertions.assertEquals("xtkcudfbsfar", model.value().get(0).properties().threadStorageConnections().get(0)); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsCreateOrUpdateMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsCreateOrUpdateMockTests.java index 495cd59e38cc..38122dced088 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsCreateOrUpdateMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsCreateOrUpdateMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -10,15 +10,11 @@ import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.fluent.models.CapabilityHostInner; -import com.azure.resourcemanager.cognitiveservices.models.CapabilityHost; -import com.azure.resourcemanager.cognitiveservices.models.CapabilityHostKind; -import com.azure.resourcemanager.cognitiveservices.models.CapabilityHostProperties; +import com.azure.resourcemanager.cognitiveservices.models.ProjectCapabilityHost; +import com.azure.resourcemanager.cognitiveservices.models.ProjectCapabilityHostProperties; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; @@ -27,7 +23,7 @@ public final class ProjectCapabilityHostsCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"aiServicesConnections\":[\"g\",\"zstuj\",\"zx\"],\"capabilityHostKind\":\"Agents\",\"customerSubnet\":\"fdrld\",\"provisioningState\":\"Succeeded\",\"storageConnections\":[\"iitt\"],\"threadStorageConnections\":[\"uqwr\",\"daxurfqazc\",\"ozjv\",\"dzciggb\"],\"vectorStoreConnections\":[\"xofwalzy\",\"whoea\"],\"description\":\"e\",\"tags\":{\"imtwuuhau\":\"oeysfp\"}},\"id\":\"nkwmnfeub\",\"name\":\"zjy\",\"type\":\"kwfugiphrrkuu\"}"; + = "{\"properties\":{\"aiServicesConnections\":[\"lqloc\",\"vujex\",\"yglxrkgjnm\",\"paslavxjfiuofpi\"],\"vectorStoreConnections\":[\"zlvssq\",\"wjopackyhydvik\",\"fngp\"],\"storageConnections\":[\"lxgjs\",\"izwgsoriobijeiyd\",\"euynh\",\"okayrg\"],\"threadStorageConnections\":[\"ri\"],\"provisioningState\":\"Succeeded\"},\"id\":\"eoftnorwai\",\"name\":\"s\",\"type\":\"octqkmvjanxvzf\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -36,38 +32,20 @@ public void testCreateOrUpdate() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - CapabilityHost response = manager.projectCapabilityHosts() - .createOrUpdate("e", "lzuqloiwyayyzivr", "itcdqlhchwhrk", "jlei", - new CapabilityHostInner().withProperties(new CapabilityHostProperties().withDescription("nukxrkemjp") - .withTags(mapOf("bc", "lrlzaudgjt", "dwnhczbutoucgjti", "akkuc", "qqwwvgwks", "jwayhi", "abv", - "vlizedvb")) - .withAiServicesConnections(Arrays.asList("fiplhx")) - .withCapabilityHostKind(CapabilityHostKind.AGENTS) - .withCustomerSubnet("ycjowlyeyzmudsq") - .withStorageConnections(Arrays.asList("lzbuwodmachbkvn")) - .withThreadStorageConnections(Arrays.asList("j", "mvgoqpleh")) - .withVectorStoreConnections(Arrays.asList("kzdllczdprwnhkgq", "goxsstci", "rak", "rrynjcwmhly"))), - com.azure.core.util.Context.NONE); + ProjectCapabilityHost response + = manager.projectCapabilityHosts() + .define("pryj") + .withExistingProject("hs", "uerbgpxebjl", "dcaytujraxd") + .withProperties(new ProjectCapabilityHostProperties() + .withAiServicesConnections(Arrays.asList("nsewouxl", "msvvylj")) + .withVectorStoreConnections(Arrays.asList("e")) + .withStorageConnections(Arrays.asList("ehqqylm")) + .withThreadStorageConnections(Arrays.asList("wjwdsdlzmkxer", "xx", "teehk"))) + .create(); - Assertions.assertEquals("e", response.properties().description()); - Assertions.assertEquals("oeysfp", response.properties().tags().get("imtwuuhau")); - Assertions.assertEquals("g", response.properties().aiServicesConnections().get(0)); - Assertions.assertEquals(CapabilityHostKind.AGENTS, response.properties().capabilityHostKind()); - Assertions.assertEquals("fdrld", response.properties().customerSubnet()); - Assertions.assertEquals("iitt", response.properties().storageConnections().get(0)); - Assertions.assertEquals("uqwr", response.properties().threadStorageConnections().get(0)); - Assertions.assertEquals("xofwalzy", response.properties().vectorStoreConnections().get(0)); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + Assertions.assertEquals("lqloc", response.properties().aiServicesConnections().get(0)); + Assertions.assertEquals("zlvssq", response.properties().vectorStoreConnections().get(0)); + Assertions.assertEquals("lxgjs", response.properties().storageConnections().get(0)); + Assertions.assertEquals("ri", response.properties().threadStorageConnections().get(0)); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsGetWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsGetWithResponseMockTests.java index be597ad9285e..9744e848ab13 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsGetWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsGetWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -10,8 +10,7 @@ import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.models.CapabilityHost; -import com.azure.resourcemanager.cognitiveservices.models.CapabilityHostKind; +import com.azure.resourcemanager.cognitiveservices.models.ProjectCapabilityHost; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; @@ -22,7 +21,7 @@ public final class ProjectCapabilityHostsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"aiServicesConnections\":[\"exzvdube\"],\"capabilityHostKind\":\"Agents\",\"customerSubnet\":\"gbaduve\",\"provisioningState\":\"Succeeded\",\"storageConnections\":[\"qhzrtdbak\",\"limzfvppk\",\"qsifjmclng\"],\"threadStorageConnections\":[\"hrkombcdta\"],\"vectorStoreConnections\":[\"pggorwjoqtrotpvc\",\"pofyrlmwkptsk\",\"xjgvh\",\"ccbmkakm\"],\"description\":\"okbputm\",\"tags\":{\"wk\":\"uyakm\"}},\"id\":\"ow\",\"name\":\"kroyrdurxflzqji\",\"type\":\"ejtgzjxxl\"}"; + = "{\"properties\":{\"aiServicesConnections\":[\"cfocz\"],\"vectorStoreConnections\":[\"ejov\",\"kwxnhwhhnoyrza\"],\"storageConnections\":[\"e\"],\"threadStorageConnections\":[\"jenvjeateaxx\",\"rxoxdjxl\",\"n\"],\"provisioningState\":\"Deleting\"},\"id\":\"inzkdolrndwd\",\"name\":\"vxvzaledoyqxlun\",\"type\":\"fthmcxqqxmy\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,17 +30,13 @@ public void testGetWithResponse() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - CapabilityHost response = manager.projectCapabilityHosts() - .getWithResponse("exozonynp", "me", "dpabcreuwzosg", "jxvcvaso", com.azure.core.util.Context.NONE) + ProjectCapabilityHost response = manager.projectCapabilityHosts() + .getWithResponse("yjz", "ivfwjlofze", "fsr", "aukl", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("okbputm", response.properties().description()); - Assertions.assertEquals("uyakm", response.properties().tags().get("wk")); - Assertions.assertEquals("exzvdube", response.properties().aiServicesConnections().get(0)); - Assertions.assertEquals(CapabilityHostKind.AGENTS, response.properties().capabilityHostKind()); - Assertions.assertEquals("gbaduve", response.properties().customerSubnet()); - Assertions.assertEquals("qhzrtdbak", response.properties().storageConnections().get(0)); - Assertions.assertEquals("hrkombcdta", response.properties().threadStorageConnections().get(0)); - Assertions.assertEquals("pggorwjoqtrotpvc", response.properties().vectorStoreConnections().get(0)); + Assertions.assertEquals("cfocz", response.properties().aiServicesConnections().get(0)); + Assertions.assertEquals("ejov", response.properties().vectorStoreConnections().get(0)); + Assertions.assertEquals("e", response.properties().storageConnections().get(0)); + Assertions.assertEquals("jenvjeateaxx", response.properties().threadStorageConnections().get(0)); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsListMockTests.java new file mode 100644 index 000000000000..538dd2c4fb66 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectCapabilityHostsListMockTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; +import com.azure.resourcemanager.cognitiveservices.models.ProjectCapabilityHost; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ProjectCapabilityHostsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"aiServicesConnections\":[\"ivznllas\",\"k\"],\"vectorStoreConnections\":[\"jqjpv\",\"aihxjtgzgtaiywbq\"],\"storageConnections\":[\"igbsfsgsa\"],\"threadStorageConnections\":[\"ldfmhljq\"],\"provisioningState\":\"Deleting\"},\"id\":\"mrjctryldsxeb\",\"name\":\"hsxrznmgsdaluyc\",\"type\":\"hefr\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CognitiveServicesManager manager = CognitiveServicesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.projectCapabilityHosts().list("klaoa", "pohrvm", "rqra", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("ivznllas", response.iterator().next().properties().aiServicesConnections().get(0)); + Assertions.assertEquals("jqjpv", response.iterator().next().properties().vectorStoreConnections().get(0)); + Assertions.assertEquals("igbsfsgsa", response.iterator().next().properties().storageConnections().get(0)); + Assertions.assertEquals("ldfmhljq", response.iterator().next().properties().threadStorageConnections().get(0)); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsCreateWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsCreateWithResponseMockTests.java index 053b3f3c1d13..cc08354c98d3 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsCreateWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsCreateWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -10,7 +10,6 @@ import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; -import com.azure.resourcemanager.cognitiveservices.fluent.models.ConnectionPropertiesV2BasicResourceInner; import com.azure.resourcemanager.cognitiveservices.models.ConnectionCategory; import com.azure.resourcemanager.cognitiveservices.models.ConnectionPropertiesV2; import com.azure.resourcemanager.cognitiveservices.models.ConnectionPropertiesV2BasicResource; @@ -29,7 +28,7 @@ public final class ProjectConnectionsCreateWithResponseMockTests { @Test public void testCreateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"authType\":\"ConnectionPropertiesV2\",\"category\":\"Spark\",\"createdByWorkspaceArmId\":\"z\",\"error\":\"cckwrtwle\",\"expiryTime\":\"2021-06-25T03:56:28Z\",\"group\":\"AzureAI\",\"isSharedToAll\":true,\"metadata\":{\"bbfnvjxitzovnkr\":\"hpdhwynctaczcnjf\",\"qlcoqksyiibhyx\":\"iklsmni\",\"d\":\"bgbudav\",\"ojvlirknucosaw\":\"rbccqcdht\"},\"peRequirement\":\"NotApplicable\",\"peStatus\":\"Inactive\",\"sharedUserList\":[\"lgpyaixihz\"],\"target\":\"jtsmuydqf\",\"useWorkspaceManagedIdentity\":true},\"id\":\"cybdueurgm\",\"name\":\"dcpks\",\"type\":\"lojermhzicsbfd\"}"; + = "{\"properties\":{\"authType\":\"ConnectionPropertiesV2\",\"category\":\"CustomKeys\",\"createdByWorkspaceArmId\":\"pgvokyejidbd\",\"error\":\"squnycwztlv\",\"expiryTime\":\"2021-11-24T09:41Z\",\"group\":\"GenericProtocol\",\"isSharedToAll\":false,\"metadata\":{\"va\":\"jtrepwpwfkcaux\",\"txluevs\":\"cpfpdofuckcl\",\"qebuuxjxhfxfjwp\":\"lzwilfngojf\",\"gzzxljbkhxsd\":\"kktpmbmxbmbr\"},\"peRequirement\":\"NotApplicable\",\"peStatus\":\"Active\",\"sharedUserList\":[\"mhweqjfyxyd\",\"tokvqbvwglgwz\",\"vxakglh\",\"ses\"],\"target\":\"gamqiydvxcgdhy\",\"useWorkspaceManagedIdentity\":false},\"id\":\"gs\",\"name\":\"yqyxyjrcbqpbis\",\"type\":\"glqjoxtdahneaoov\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -39,31 +38,31 @@ public void testCreateWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ConnectionPropertiesV2BasicResource response = manager.projectConnections() - .createWithResponse("tuxvzfqayopbt", "ixhg", "bhxmndztgsqjayq", "arxneibpgbr", - new ConnectionPropertiesV2BasicResourceInner().withProperties( - new ConnectionPropertiesV2().withCategory(ConnectionCategory.AMAZON_RDS_FOR_SQL_SERVER) - .withError("hqnmotpuwnno") - .withExpiryTime(OffsetDateTime.parse("2021-01-16T01:17:46Z")) - .withIsSharedToAll(true) - .withMetadata(mapOf("pwyiulayno", "rju")) - .withPeRequirement(ManagedPERequirement.NOT_REQUIRED) - .withPeStatus(ManagedPEStatus.INACTIVE) - .withSharedUserList(Arrays.asList("xttpfs", "wgsghqucumldd", "uqmllfeothxu")) - .withTarget("igrjdljlkqhvkrbz") - .withUseWorkspaceManagedIdentity(false)), - com.azure.core.util.Context.NONE) - .getValue(); + .define("t") + .withExistingProject("qkkkbjuckcatuqbh", "owcnxtpz", "lyseidtoak") + .withProperties(new ConnectionPropertiesV2().withCategory(ConnectionCategory.AZURE_ONE_LAKE) + .withError("d") + .withExpiryTime(OffsetDateTime.parse("2021-09-20T12:29:25Z")) + .withIsSharedToAll(true) + .withMetadata( + mapOf("tbqgdirdamm", "shtkutzc", "bwjjirmuydgf", "zjgcfjfx", "uoft", "tmdofgeoag", "aj", "xodwxm")) + .withPeRequirement(ManagedPERequirement.REQUIRED) + .withPeStatus(ManagedPEStatus.INACTIVE) + .withSharedUserList(Arrays.asList("evmdm", "enlrstgf", "zljdnci", "tjva")) + .withTarget("yznm") + .withUseWorkspaceManagedIdentity(false)) + .create(); - Assertions.assertEquals(ConnectionCategory.SPARK, response.properties().category()); - Assertions.assertEquals("cckwrtwle", response.properties().error()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-25T03:56:28Z"), response.properties().expiryTime()); - Assertions.assertTrue(response.properties().isSharedToAll()); - Assertions.assertEquals("hpdhwynctaczcnjf", response.properties().metadata().get("bbfnvjxitzovnkr")); + Assertions.assertEquals(ConnectionCategory.CUSTOM_KEYS, response.properties().category()); + Assertions.assertEquals("squnycwztlv", response.properties().error()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-24T09:41Z"), response.properties().expiryTime()); + Assertions.assertFalse(response.properties().isSharedToAll()); + Assertions.assertEquals("jtrepwpwfkcaux", response.properties().metadata().get("va")); Assertions.assertEquals(ManagedPERequirement.NOT_APPLICABLE, response.properties().peRequirement()); - Assertions.assertEquals(ManagedPEStatus.INACTIVE, response.properties().peStatus()); - Assertions.assertEquals("lgpyaixihz", response.properties().sharedUserList().get(0)); - Assertions.assertEquals("jtsmuydqf", response.properties().target()); - Assertions.assertTrue(response.properties().useWorkspaceManagedIdentity()); + Assertions.assertEquals(ManagedPEStatus.ACTIVE, response.properties().peStatus()); + Assertions.assertEquals("mhweqjfyxyd", response.properties().sharedUserList().get(0)); + Assertions.assertEquals("gamqiydvxcgdhy", response.properties().target()); + Assertions.assertFalse(response.properties().useWorkspaceManagedIdentity()); } // Use "Map.of" if available diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsDeleteWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsDeleteWithResponseMockTests.java index daf4edda0bed..57fe28871f42 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsDeleteWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsDeleteWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -28,7 +28,7 @@ public void testDeleteWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.projectConnections() - .deleteWithResponse("kj", "oywlunpipcwyb", "zfn", "npatpftsae", com.azure.core.util.Context.NONE); + .deleteWithResponse("czkddn", "ovbooqbmdqrxy", "laetscflwtjdtlr", "e", com.azure.core.util.Context.NONE); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsGetWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsGetWithResponseMockTests.java index 0d8bfd01aea0..26795da0fa62 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsGetWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsGetWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -24,7 +24,7 @@ public final class ProjectConnectionsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"authType\":\"ConnectionPropertiesV2\",\"category\":\"AzureMySqlDb\",\"createdByWorkspaceArmId\":\"hvazjpwexcdr\",\"error\":\"robzzxezmnrkjgpj\",\"expiryTime\":\"2021-03-10T01:42:16Z\",\"group\":\"Azure\",\"isSharedToAll\":true,\"metadata\":{\"ufvcgnrgl\":\"fpmijpdvzvfbhwbd\",\"afebzxfkjq\":\"qrwyambh\",\"vrkpsa\":\"tibhlennt\",\"xvzmlghny\":\"d\"},\"peRequirement\":\"NotApplicable\",\"peStatus\":\"Inactive\",\"sharedUserList\":[\"ukppdixqbo\",\"xvhhyqq\",\"gatxgrznmginmtsd\"],\"target\":\"chwkib\",\"useWorkspaceManagedIdentity\":true},\"id\":\"mncj\",\"name\":\"agairwcqzoofjnqj\",\"type\":\"vep\"}"; + = "{\"properties\":{\"authType\":\"ConnectionPropertiesV2\",\"category\":\"Eloqua\",\"createdByWorkspaceArmId\":\"woxfaxdtnqifbsa\",\"error\":\"oiauesugmocpcj\",\"expiryTime\":\"2021-10-09T09:37:26Z\",\"group\":\"ServicesAndApps\",\"isSharedToAll\":false,\"metadata\":{\"iuorinikc\":\"twfld\",\"riwmmtmqrxrzqv\":\"dpk\",\"xiqahr\":\"yczyayubtgm\",\"ibplnupoyryefqm\":\"gpx\"},\"peRequirement\":\"Required\",\"peStatus\":\"Inactive\",\"sharedUserList\":[\"lnomfpb\",\"ceeg\",\"yieztkutnjil\"],\"target\":\"kkreh\",\"useWorkspaceManagedIdentity\":true},\"id\":\"joduifvulxfaryrv\",\"name\":\"lgdezvjqw\",\"type\":\"hoyiyaxqvjweiw\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -34,18 +34,18 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ConnectionPropertiesV2BasicResource response = manager.projectConnections() - .getWithResponse("wf", "hxorpwaltzwu", "exojfccy", "h", com.azure.core.util.Context.NONE) + .getWithResponse("fyaqandmymnqo", "j", "movsfbpbvz", "paxmfm", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(ConnectionCategory.AZURE_MY_SQL_DB, response.properties().category()); - Assertions.assertEquals("robzzxezmnrkjgpj", response.properties().error()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-10T01:42:16Z"), response.properties().expiryTime()); - Assertions.assertTrue(response.properties().isSharedToAll()); - Assertions.assertEquals("fpmijpdvzvfbhwbd", response.properties().metadata().get("ufvcgnrgl")); - Assertions.assertEquals(ManagedPERequirement.NOT_APPLICABLE, response.properties().peRequirement()); + Assertions.assertEquals(ConnectionCategory.ELOQUA, response.properties().category()); + Assertions.assertEquals("oiauesugmocpcj", response.properties().error()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-09T09:37:26Z"), response.properties().expiryTime()); + Assertions.assertFalse(response.properties().isSharedToAll()); + Assertions.assertEquals("twfld", response.properties().metadata().get("iuorinikc")); + Assertions.assertEquals(ManagedPERequirement.REQUIRED, response.properties().peRequirement()); Assertions.assertEquals(ManagedPEStatus.INACTIVE, response.properties().peStatus()); - Assertions.assertEquals("ukppdixqbo", response.properties().sharedUserList().get(0)); - Assertions.assertEquals("chwkib", response.properties().target()); + Assertions.assertEquals("lnomfpb", response.properties().sharedUserList().get(0)); + Assertions.assertEquals("kkreh", response.properties().target()); Assertions.assertTrue(response.properties().useWorkspaceManagedIdentity()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsListMockTests.java index 50f80356e5ef..33493fe9d61a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsListMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectConnectionsListMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -25,7 +25,7 @@ public final class ProjectConnectionsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"authType\":\"ConnectionPropertiesV2\",\"category\":\"AzureMySqlDb\",\"createdByWorkspaceArmId\":\"rdgscnvqeonsgn\",\"error\":\"lwmezyohxpthceop\",\"expiryTime\":\"2021-02-11T03:59:08Z\",\"group\":\"AzureAI\",\"isSharedToAll\":false,\"metadata\":{\"cdyarnggcjfwblqh\":\"obpbokhmm\",\"s\":\"kasmcolmugpyva\"},\"peRequirement\":\"Required\",\"peStatus\":\"NotApplicable\",\"sharedUserList\":[\"eygzvtyevjhu\"],\"target\":\"obguqisqsqk\",\"useWorkspaceManagedIdentity\":false},\"id\":\"oyjpnmlviqc\",\"name\":\"szpm\",\"type\":\"vqdvrdmvxyrxdhg\"}]}"; + = "{\"value\":[{\"properties\":{\"authType\":\"ConnectionPropertiesV2\",\"category\":\"Elasticsearch\",\"createdByWorkspaceArmId\":\"wdtgckzdqiqdl\",\"error\":\"trkwxo\",\"expiryTime\":\"2021-10-29T01:42:42Z\",\"group\":\"GenericProtocol\",\"isSharedToAll\":true,\"metadata\":{\"pryjfzih\":\"nhrfgslgl\",\"eo\":\"io\"},\"peRequirement\":\"NotRequired\",\"peStatus\":\"NotApplicable\",\"sharedUserList\":[\"yvkbdgddk\"],\"target\":\"dccxbeuuqu\",\"useWorkspaceManagedIdentity\":true},\"id\":\"tjwwg\",\"name\":\"zytijcx\",\"type\":\"nondegjdyd\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -35,20 +35,20 @@ public void testList() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.projectConnections() - .list("hyaaknyukibxiglh", "hzwxq", "ejp", "ilhvtozyagjj", "xkbylhyyxgffklv", false, + .list("ooy", "cuxd", "zcqipsdudgcozzo", "ehxlantolamlb", "juxkqll", false, com.azure.core.util.Context.NONE); - Assertions.assertEquals(ConnectionCategory.AZURE_MY_SQL_DB, response.iterator().next().properties().category()); - Assertions.assertEquals("lwmezyohxpthceop", response.iterator().next().properties().error()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-11T03:59:08Z"), + Assertions.assertEquals(ConnectionCategory.ELASTICSEARCH, response.iterator().next().properties().category()); + Assertions.assertEquals("trkwxo", response.iterator().next().properties().error()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-29T01:42:42Z"), response.iterator().next().properties().expiryTime()); - Assertions.assertFalse(response.iterator().next().properties().isSharedToAll()); - Assertions.assertEquals("obpbokhmm", - response.iterator().next().properties().metadata().get("cdyarnggcjfwblqh")); - Assertions.assertEquals(ManagedPERequirement.REQUIRED, response.iterator().next().properties().peRequirement()); + Assertions.assertTrue(response.iterator().next().properties().isSharedToAll()); + Assertions.assertEquals("nhrfgslgl", response.iterator().next().properties().metadata().get("pryjfzih")); + Assertions.assertEquals(ManagedPERequirement.NOT_REQUIRED, + response.iterator().next().properties().peRequirement()); Assertions.assertEquals(ManagedPEStatus.NOT_APPLICABLE, response.iterator().next().properties().peStatus()); - Assertions.assertEquals("eygzvtyevjhu", response.iterator().next().properties().sharedUserList().get(0)); - Assertions.assertEquals("obguqisqsqk", response.iterator().next().properties().target()); - Assertions.assertFalse(response.iterator().next().properties().useWorkspaceManagedIdentity()); + Assertions.assertEquals("yvkbdgddk", response.iterator().next().properties().sharedUserList().get(0)); + Assertions.assertEquals("dccxbeuuqu", response.iterator().next().properties().target()); + Assertions.assertTrue(response.iterator().next().properties().useWorkspaceManagedIdentity()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectInnerTests.java index 11496ab783f0..2145e8d3386b 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectInnerTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -18,31 +18,31 @@ public final class ProjectInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ProjectInner model = BinaryData.fromString( - "{\"identity\":{\"type\":\"SystemAssigned\",\"tenantId\":\"dohzjq\",\"principalId\":\"ucoig\",\"userAssignedIdentities\":{\"dlfgtdysnaq\":{\"principalId\":\"cnwfepbnwgfmxjg\",\"clientId\":\"bjb\"},\"antkwcegyamlbns\":{\"principalId\":\"lqbctqhamzjrw\",\"clientId\":\"qzeqyjleziunjxdf\"}}},\"tags\":{\"m\":\"cjjvpilguooqja\"},\"location\":\"tg\",\"properties\":{\"provisioningState\":\"Canceled\",\"displayName\":\"kjbsah\",\"description\":\"dt\",\"endpoints\":{\"cslmotoebnfxo\":\"lq\",\"razftxejwabmdujt\":\"vcjkgd\",\"m\":\"vcopex\"},\"isDefault\":false},\"etag\":\"u\",\"id\":\"lkyqltqsrog\",\"name\":\"uwkffdjktsysid\",\"type\":\"vclglxnfuij\"}") + "{\"properties\":{\"provisioningState\":\"Deleting\",\"displayName\":\"rsbycucrwn\",\"description\":\"ikzebr\",\"endpoints\":{\"fuhok\":\"mswziq\",\"czznvfbycjsxj\":\"ruswhv\",\"vumwmxqh\":\"wix\"},\"isDefault\":true},\"tags\":{\"ohdjhhflzok\":\"amldseh\",\"ltsxoatf\":\"coxpelnjeta\"},\"location\":\"zpnpbswv\",\"etag\":\"loccsrmozihm\",\"identity\":{\"type\":\"SystemAssigned\",\"tenantId\":\"txx\",\"principalId\":\"y\",\"userAssignedIdentities\":{\"mcayk\":{\"principalId\":\"jxgrytfmp\",\"clientId\":\"cil\"},\"nthjtwkjaosrxuzv\":{\"principalId\":\"noxuztrksx\",\"clientId\":\"ndfcpfn\"},\"tz\":{\"principalId\":\"mktcqiosmgbza\",\"clientId\":\"xqdlyrtltlapr\"},\"ebwlnbmhyreeudzq\":{\"principalId\":\"tbhjmznnbsoqe\",\"clientId\":\"larvlagunbtg\"}}},\"id\":\"bpdqmjxlyy\",\"name\":\"glgou\",\"type\":\"tlmj\"}") .toObject(ProjectInner.class); + Assertions.assertEquals("rsbycucrwn", model.properties().displayName()); + Assertions.assertEquals("ikzebr", model.properties().description()); + Assertions.assertEquals("amldseh", model.tags().get("ohdjhhflzok")); + Assertions.assertEquals("zpnpbswv", model.location()); Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("cjjvpilguooqja", model.tags().get("m")); - Assertions.assertEquals("tg", model.location()); - Assertions.assertEquals("kjbsah", model.properties().displayName()); - Assertions.assertEquals("dt", model.properties().description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ProjectInner model - = new ProjectInner() - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("dlfgtdysnaq", new UserAssignedIdentity(), "antkwcegyamlbns", - new UserAssignedIdentity()))) - .withTags(mapOf("m", "cjjvpilguooqja")) - .withLocation("tg") - .withProperties(new ProjectProperties().withDisplayName("kjbsah").withDescription("dt")); + ProjectInner model = new ProjectInner() + .withProperties(new ProjectProperties().withDisplayName("rsbycucrwn").withDescription("ikzebr")) + .withTags(mapOf("ohdjhhflzok", "amldseh", "ltsxoatf", "coxpelnjeta")) + .withLocation("zpnpbswv") + .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities( + mapOf("mcayk", new UserAssignedIdentity(), "nthjtwkjaosrxuzv", new UserAssignedIdentity(), "tz", + new UserAssignedIdentity(), "ebwlnbmhyreeudzq", new UserAssignedIdentity()))); model = BinaryData.fromObject(model).toObject(ProjectInner.class); + Assertions.assertEquals("rsbycucrwn", model.properties().displayName()); + Assertions.assertEquals("ikzebr", model.properties().description()); + Assertions.assertEquals("amldseh", model.tags().get("ohdjhhflzok")); + Assertions.assertEquals("zpnpbswv", model.location()); Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("cjjvpilguooqja", model.tags().get("m")); - Assertions.assertEquals("tg", model.location()); - Assertions.assertEquals("kjbsah", model.properties().displayName()); - Assertions.assertEquals("dt", model.properties().description()); } // Use "Map.of" if available diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectListResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectListResultTests.java index d94c6b0c06ce..499a5f63da97 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectListResultTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectListResultTests.java @@ -1,26 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.ProjectListResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.ProjectListResult; import org.junit.jupiter.api.Assertions; public final class ProjectListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ProjectListResult model = BinaryData.fromString( - "{\"nextLink\":\"uygb\",\"value\":[{\"identity\":{\"type\":\"SystemAssigned\",\"tenantId\":\"wv\",\"principalId\":\"vcdlg\",\"userAssignedIdentities\":{\"czvvit\":{\"principalId\":\"mfdjwn\",\"clientId\":\"xpunjqi\"},\"soxhlwntsjgqr\":{\"principalId\":\"gx\",\"clientId\":\"csserxht\"}}},\"tags\":{\"uuuybnchrsziz\":\"p\"},\"location\":\"uelyetndn\",\"properties\":{\"provisioningState\":\"Succeeded\",\"displayName\":\"gagflnlgmtrwah\",\"description\":\"mu\",\"endpoints\":{\"fusuckzmkwklsno\":\"byrplrohkpig\"},\"isDefault\":false},\"etag\":\"qe\",\"id\":\"lhhjnh\",\"name\":\"wy\",\"type\":\"yynfsvkhgbv\"},{\"identity\":{\"type\":\"SystemAssigned, UserAssigned\",\"tenantId\":\"rfdl\",\"principalId\":\"kh\",\"userAssignedIdentities\":{\"oywjxhpdulont\":{\"principalId\":\"eizjcpeogkhnmg\",\"clientId\":\"ouxddbhfhpfpazj\"}}},\"tags\":{\"rhrljyoogwxhn\":\"pqwtehtue\"},\"location\":\"uug\",\"properties\":{\"provisioningState\":\"Creating\",\"displayName\":\"urfqkfuare\",\"description\":\"vhhtklnvnaf\",\"endpoints\":{\"lcqxypokk\":\"yfedevjbo\",\"zng\":\"minqcym\"},\"isDefault\":true},\"etag\":\"x\",\"id\":\"unin\",\"name\":\"udbchaqdtv\",\"type\":\"ec\"},{\"identity\":{\"type\":\"SystemAssigned, UserAssigned\",\"tenantId\":\"xxdtddmflh\",\"principalId\":\"tx\",\"userAssignedIdentities\":{\"vroevytlyo\":{\"principalId\":\"napxbannovv\",\"clientId\":\"czytprwn\"},\"klobdxnazpmk\":{\"principalId\":\"rrouuxvnsasbcry\",\"clientId\":\"dizr\"},\"zopjhbzxliohr\":{\"principalId\":\"mv\",\"clientId\":\"f\"},\"napqo\":{\"principalId\":\"dtfgxqbawpcbb\",\"clientId\":\"qcy\"}}},\"tags\":{\"dyb\":\"icdhz\",\"fmuvapckccr\":\"wgbdvibidmhmwffp\",\"oxoyyukp\":\"vwe\",\"shbraga\":\"aimmoiroqb\"},\"location\":\"yrmfsvbpav\",\"properties\":{\"provisioningState\":\"Moving\",\"displayName\":\"pdbwnupgahxkum\",\"description\":\"jcaacfdmmcpugm\",\"endpoints\":{\"oqhnlb\":\"epvufhbzehew\",\"krsrrmoucs\":\"nbldxeaclgschori\",\"abeolhbhlvbm\":\"fldpuviyfc\"},\"isDefault\":false},\"etag\":\"bsxtkcudfbsfarfs\",\"id\":\"wlkjxn\",\"name\":\"pvwgfstmhqykizmd\",\"type\":\"saoafcluqvox\"},{\"identity\":{\"type\":\"SystemAssigned, UserAssigned\",\"tenantId\":\"mr\",\"principalId\":\"wgcwwpbmzgwesyds\",\"userAssignedIdentities\":{\"mtkhlowkxxpvbr\":{\"principalId\":\"ohec\",\"clientId\":\"opwndyqleallk\"}}},\"tags\":{\"ikcyyc\":\"mzsyzfhotl\",\"c\":\"unsjlpjrtwszhvvu\"},\"location\":\"vtrrmhwrbfdpyflu\",\"properties\":{\"provisioningState\":\"Creating\",\"displayName\":\"lrocuyzlwh\",\"description\":\"emhooclutnpq\",\"endpoints\":{\"mmyky\":\"czj\",\"rye\":\"jxsglhsr\"},\"isDefault\":false},\"etag\":\"bkzudnigrfihot\",\"id\":\"wlpxuzzjg\",\"name\":\"refqy\",\"type\":\"qotoihiqakydiwfb\"}]}") + "{\"nextLink\":\"kpggqoweyi\",\"value\":[{\"properties\":{\"provisioningState\":\"Accepted\",\"displayName\":\"gwflq\",\"description\":\"pizruwnpqxpxiw\",\"endpoints\":{\"zjvkviirhgfgrws\":\"gjsaasiixtm\",\"tctbrxkjzwrgxffm\":\"pgratzvzbglbyvi\"},\"isDefault\":false},\"tags\":{\"qaclnapxbiy\":\"bkgozxwopdbydpi\",\"nfsm\":\"nugj\",\"i\":\"cttuxuu\",\"quvre\":\"flqo\"},\"location\":\"rnjhvsujztczytqj\",\"etag\":\"h\",\"identity\":{\"type\":\"UserAssigned\",\"tenantId\":\"prnjletlxsmr\",\"principalId\":\"do\",\"userAssignedIdentities\":{\"xqszdtmaajquh\":{\"principalId\":\"mowaziynknlqwzdv\",\"clientId\":\"w\"}}},\"id\":\"ylr\",\"name\":\"vmtygj\",\"type\":\"mzyospspshck\"},{\"properties\":{\"provisioningState\":\"Canceled\",\"displayName\":\"mspbpssdfpp\",\"description\":\"gt\",\"endpoints\":{\"zkc\":\"ujtv\",\"xvglnkvxlxp\":\"yxrxmunj\",\"hpzvuqdflvoniyp\":\"glqivbgkcv\"},\"isDefault\":true},\"tags\":{\"nidibgqjxg\":\"pzgpxtivhj\",\"hgovfgp\":\"n\",\"zvuporqzdfuydz\":\"kqmhhaowjr\"},\"location\":\"fvxcnqmxqpswo\",\"etag\":\"vkhlggdhbemz\",\"identity\":{\"type\":\"None\",\"tenantId\":\"uwiwtglxxhljfpg\",\"principalId\":\"crmnzhrgmqgjs\",\"userAssignedIdentities\":{\"qgvriibakcla\":{\"principalId\":\"cbfrm\",\"clientId\":\"dths\"},\"hqf\":{\"principalId\":\"fr\",\"clientId\":\"ousxauzlwvsgmw\"},\"mribiat\":{\"principalId\":\"zvuxm\",\"clientId\":\"jsvthnwpzteko\"},\"lmzqwmvtxnjmx\":{\"principalId\":\"plucfotangcfhnyk\",\"clientId\":\"ugswvx\"}}},\"id\":\"uqudtcvclxyn\",\"name\":\"dkvgfabuiyjibuzp\",\"type\":\"dugneiknp\"}]}") .toObject(ProjectListResult.class); - Assertions.assertEquals("uygb", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProjectListResult model = new ProjectListResult().withNextLink("uygb"); - model = BinaryData.fromObject(model).toObject(ProjectListResult.class); - Assertions.assertEquals("uygb", model.nextLink()); + Assertions.assertEquals("kpggqoweyi", model.nextLink()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectPropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectPropertiesTests.java index 79635692c7ec..7dd18f0fe60c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectPropertiesTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,17 +12,17 @@ public final class ProjectPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ProjectProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Failed\",\"displayName\":\"sqo\",\"description\":\"fikayiansharujtj\",\"endpoints\":{\"vwkpqh\":\"fzyjqt\"},\"isDefault\":false}") + "{\"provisioningState\":\"Deleting\",\"displayName\":\"j\",\"description\":\"obaxkjeytu\",\"endpoints\":{\"hsyrqunj\":\"fjkwrusnkq\",\"akdkifmjnnawtqab\":\"hdenxaulk\"},\"isDefault\":true}") .toObject(ProjectProperties.class); - Assertions.assertEquals("sqo", model.displayName()); - Assertions.assertEquals("fikayiansharujtj", model.description()); + Assertions.assertEquals("j", model.displayName()); + Assertions.assertEquals("obaxkjeytu", model.description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ProjectProperties model = new ProjectProperties().withDisplayName("sqo").withDescription("fikayiansharujtj"); + ProjectProperties model = new ProjectProperties().withDisplayName("j").withDescription("obaxkjeytu"); model = BinaryData.fromObject(model).toObject(ProjectProperties.class); - Assertions.assertEquals("sqo", model.displayName()); - Assertions.assertEquals("fikayiansharujtj", model.description()); + Assertions.assertEquals("j", model.displayName()); + Assertions.assertEquals("obaxkjeytu", model.description()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsCreateMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsCreateMockTests.java index 1051e28f8c63..633a3f2a7e60 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsCreateMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsCreateMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -27,7 +27,7 @@ public final class ProjectsCreateMockTests { @Test public void testCreate() throws Exception { String responseStr - = "{\"identity\":{\"type\":\"SystemAssigned, UserAssigned\",\"tenantId\":\"v\",\"principalId\":\"miphbea\",\"userAssignedIdentities\":{\"zezbzu\":{\"principalId\":\"mhkdclacroczfm\",\"clientId\":\"erkeluxzsh\"},\"jparda\":{\"principalId\":\"dlevzskejcgw\",\"clientId\":\"gqkstyecupyu\"},\"kxizek\":{\"principalId\":\"jcfmazpzdqw\",\"clientId\":\"vcmc\"},\"rdemdidack\":{\"principalId\":\"frjwucaon\",\"clientId\":\"ajbvbn\"}}},\"tags\":{\"pztdivyk\":\"gzwdydamis\",\"shxuknsykdtoi\":\"xkqejtpjfojiunr\"},\"location\":\"ancdrc\",\"properties\":{\"provisioningState\":\"Succeeded\",\"displayName\":\"uld\",\"description\":\"nck\",\"endpoints\":{\"xz\":\"blfxlupibaqzi\",\"klqiyndveqel\":\"zweghlwwbogvg\",\"vd\":\"b\",\"o\":\"trkzxsgtznsvlrds\"},\"isDefault\":false},\"etag\":\"y\",\"id\":\"noxaxnrqaqotnndx\",\"name\":\"lousdvrgptqm\",\"type\":\"wz\"}"; + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"displayName\":\"cvnpv\",\"description\":\"hgjnaq\",\"endpoints\":{\"mwbitekdtfo\":\"pslzmvcds\"},\"isDefault\":true},\"tags\":{\"ivycpzcvdi\":\"bxqichgybfzdqe\"},\"location\":\"lrqtbhtrezp\",\"etag\":\"pryfmxmdutzfkgi\",\"identity\":{\"type\":\"SystemAssigned, UserAssigned\",\"tenantId\":\"ccgndjgdprig\",\"principalId\":\"qyeqfcbuulpyuflq\",\"userAssignedIdentities\":{\"nmbzmecuy\":{\"principalId\":\"tujcyoh\",\"clientId\":\"imwdcsklkqnqvki\"},\"atlzmg\":{\"principalId\":\"wimbzayspzvr\",\"clientId\":\"tvfphmdzxplgtpvd\"},\"orimmo\":{\"principalId\":\"hnzrsbkkzovlzdm\",\"clientId\":\"mfwsxafofu\"}}},\"id\":\"wdehk\",\"name\":\"mvhzfovanyrvaprt\",\"type\":\"elgwewi\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -37,21 +37,20 @@ public void testCreate() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Project response = manager.projects() - .define("bssdpjeyoqxd") - .withExistingAccount("nckidbjpg", "hzqpxzbawkikcdgf") - .withRegion("z") - .withTags(mapOf("xchpqvctsfa", "qokqlujqgirabwly", "zhasupmlppdpgzvz", "uhwwsknstvz")) - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("mfivjqterd", new UserAssignedIdentity(), "qirvtk", - new UserAssignedIdentity(), "jodmkrrwep", new UserAssignedIdentity()))) - .withProperties(new ProjectProperties().withDisplayName("kptgongruat").withDescription("iysjqhe")) + .define("ktqrxqwqnjxrdf") + .withExistingAccount("vffhs", "pzou") + .withRegion("b") + .withTags(mapOf("qtyyqiprcltungb", "bpxtokljmtznpaxw", "kmii", "olj")) + .withProperties(new ProjectProperties().withDisplayName("lygtavczcxdfweap").withDescription("mlx")) + .withIdentity(new Identity().withType(ResourceIdentityType.NONE) + .withUserAssignedIdentities(mapOf("bcbgv", new UserAssignedIdentity()))) .create(); + Assertions.assertEquals("cvnpv", response.properties().displayName()); + Assertions.assertEquals("hgjnaq", response.properties().description()); + Assertions.assertEquals("bxqichgybfzdqe", response.tags().get("ivycpzcvdi")); + Assertions.assertEquals("lrqtbhtrezp", response.location()); Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, response.identity().type()); - Assertions.assertEquals("gzwdydamis", response.tags().get("pztdivyk")); - Assertions.assertEquals("ancdrc", response.location()); - Assertions.assertEquals("uld", response.properties().displayName()); - Assertions.assertEquals("nck", response.properties().description()); } // Use "Map.of" if available diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsGetWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsGetWithResponseMockTests.java index 26bf77a2152c..ab8a2e1f83c8 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsGetWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsGetWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -22,7 +22,7 @@ public final class ProjectsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"identity\":{\"type\":\"SystemAssigned, UserAssigned\",\"tenantId\":\"dyswcrptveajc\",\"principalId\":\"vlgsrgkrfiz\",\"userAssignedIdentities\":{\"ykpfu\":{\"principalId\":\"lptyuqhr\",\"clientId\":\"cs\"},\"awmpjprd\":{\"principalId\":\"ixcnpcf\",\"clientId\":\"kpyyc\"},\"peyamnnidmdiaw\":{\"principalId\":\"rpcfpcfjfwzl\",\"clientId\":\"awkgy\"}}},\"tags\":{\"mkctdhuo\":\"kzrn\",\"odvqgcnbhcbmj\":\"gwqpsqazih\"},\"location\":\"ti\",\"properties\":{\"provisioningState\":\"Creating\",\"displayName\":\"tsxjmfmeftvhkmoo\",\"description\":\"rh\",\"endpoints\":{\"mjgrulcfog\":\"w\",\"z\":\"hcxnwjtpfdzxco\",\"k\":\"wofw\"},\"isDefault\":true},\"etag\":\"dtzxsoe\",\"id\":\"lwglihezomucmqg\",\"name\":\"snio\",\"type\":\"etbzdrdpuenxkgtl\"}"; + = "{\"properties\":{\"provisioningState\":\"Deleting\",\"displayName\":\"irhpfabenq\",\"description\":\"mwmgewayxfl\",\"endpoints\":{\"bhem\":\"pjs\"},\"isDefault\":false},\"tags\":{\"zyvbsuadulpodk\":\"qsnxfbxufeapdr\",\"f\":\"x\"},\"location\":\"kzhmhj\",\"etag\":\"lt\",\"identity\":{\"type\":\"None\",\"tenantId\":\"rojadhfz\",\"principalId\":\"raysrkgzkyhu\",\"userAssignedIdentities\":{\"pwooajeyyj\":{\"principalId\":\"wpzqxlcweakfecj\",\"clientId\":\"faqufqizjv\"},\"tgzkjtyqpd\":{\"principalId\":\"jxizxp\",\"clientId\":\"nzlslekc\"},\"ldsvc\":{\"principalId\":\"d\",\"clientId\":\"hz\"}}},\"id\":\"jiahuqy\",\"name\":\"jzucwwm\",\"type\":\"jjqhddwvm\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,13 +32,13 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Project response = manager.projects() - .getWithResponse("ajewna", "w", "xjjmztnlmsoodtm", com.azure.core.util.Context.NONE) + .getWithResponse("ddtgctxegtvgwy", "rbelfnzz", "yizwbxgdebxla", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, response.identity().type()); - Assertions.assertEquals("kzrn", response.tags().get("mkctdhuo")); - Assertions.assertEquals("ti", response.location()); - Assertions.assertEquals("tsxjmfmeftvhkmoo", response.properties().displayName()); - Assertions.assertEquals("rh", response.properties().description()); + Assertions.assertEquals("irhpfabenq", response.properties().displayName()); + Assertions.assertEquals("mwmgewayxfl", response.properties().description()); + Assertions.assertEquals("qsnxfbxufeapdr", response.tags().get("zyvbsuadulpodk")); + Assertions.assertEquals("kzhmhj", response.location()); + Assertions.assertEquals(ResourceIdentityType.NONE, response.identity().type()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsListMockTests.java index a9e31e78b22e..cc7c109e5737 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsListMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProjectsListMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -23,7 +23,7 @@ public final class ProjectsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"identity\":{\"type\":\"None\",\"tenantId\":\"qzusitoq\",\"principalId\":\"hf\",\"userAssignedIdentities\":{\"lntfxxcrq\":{\"principalId\":\"mlree\",\"clientId\":\"fwsszvlcwlis\"},\"zabulnvgsk\":{\"principalId\":\"pfjwfo\",\"clientId\":\"izmshxxba\"},\"znvhxqqmq\":{\"principalId\":\"o\",\"clientId\":\"dzjs\"},\"fshksnyzmspamwb\":{\"principalId\":\"aydhf\",\"clientId\":\"ocxm\"}}},\"tags\":{\"qdktwtkvihlp\":\"nlslcef\"},\"location\":\"iwoynguu\",\"properties\":{\"provisioningState\":\"Succeeded\",\"displayName\":\"adpcmhjhausy\",\"description\":\"ekymffztsilscvqs\",\"endpoints\":{\"fymkouih\":\"i\",\"zhogsmgbvmtdw\":\"eseuugci\",\"jnfveg\":\"qbe\"},\"isDefault\":false},\"etag\":\"vkbiw\",\"id\":\"htfgficudyhizpac\",\"name\":\"muhbcakznho\",\"type\":\"hoitwhrjsdmmaz\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleting\",\"displayName\":\"by\",\"description\":\"qpgaixwrgrkk\",\"endpoints\":{\"g\":\"frswqikwepw\",\"d\":\"gicwnxhtfmcqbs\",\"djxh\":\"pgchzpgfqum\"},\"isDefault\":false},\"tags\":{\"fdbdfmmxj\":\"dkynrceqa\",\"opjyyqmkwlhvcw\":\"naj\"},\"location\":\"q\",\"etag\":\"jk\",\"identity\":{\"type\":\"SystemAssigned\",\"tenantId\":\"wzobu\",\"principalId\":\"sxgamtdtkw\",\"userAssignedIdentities\":{\"poq\":{\"principalId\":\"uzdprmim\",\"clientId\":\"j\"},\"fmxtllf\":{\"principalId\":\"yemhkftba\",\"clientId\":\"htecloa\"}}},\"id\":\"ymqcnrrfijhgga\",\"name\":\"qbgamkli\",\"type\":\"irw\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,13 +32,12 @@ public void testList() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response - = manager.projects().list("lmtrlxcznnhz", "bnbmxlxm", com.azure.core.util.Context.NONE); + PagedIterable response = manager.projects().list("xiy", "okyfoz", com.azure.core.util.Context.NONE); - Assertions.assertEquals(ResourceIdentityType.NONE, response.iterator().next().identity().type()); - Assertions.assertEquals("nlslcef", response.iterator().next().tags().get("qdktwtkvihlp")); - Assertions.assertEquals("iwoynguu", response.iterator().next().location()); - Assertions.assertEquals("adpcmhjhausy", response.iterator().next().properties().displayName()); - Assertions.assertEquals("ekymffztsilscvqs", response.iterator().next().properties().description()); + Assertions.assertEquals("by", response.iterator().next().properties().displayName()); + Assertions.assertEquals("qpgaixwrgrkk", response.iterator().next().properties().description()); + Assertions.assertEquals("dkynrceqa", response.iterator().next().tags().get("fdbdfmmxj")); + Assertions.assertEquals("q", response.iterator().next().location()); + Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.iterator().next().identity().type()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProvisioningIssuePropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProvisioningIssuePropertiesTests.java index d630a933ab87..e61f05e07495 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProvisioningIssuePropertiesTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProvisioningIssuePropertiesTests.java @@ -1,122 +1,37 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeter; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRule; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRuleProperties; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem; import com.azure.resourcemanager.cognitiveservices.models.NspAccessRuleDirection; import com.azure.resourcemanager.cognitiveservices.models.ProvisioningIssueProperties; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class ProvisioningIssuePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ProvisioningIssueProperties model = BinaryData.fromString( - "{\"issueType\":\"smjblmljhlnym\",\"severity\":\"tqyryuzcbmqqv\",\"description\":\"vwf\",\"suggestedResourceIds\":[\"yxonsupe\",\"jlzqnhc\",\"sqltnzo\"],\"suggestedAccessRules\":[{\"name\":\"xgnxfyqonmpqoxwd\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"qxeiiqbimhtmwwi\",\"h\",\"hfqpofv\"],\"subscriptions\":[{\"id\":\"lembnkbwvqvxkdi\"},{\"id\":\"ihebwtsw\"},{\"id\":\"uwfmduragegizvc\"}],\"networkSecurityPerimeters\":[{\"id\":\"isdju\",\"perimeterGuid\":\"gbqi\",\"location\":\"xkbsazgakgac\"},{\"id\":\"cmjdmspof\",\"perimeterGuid\":\"vuhrylni\",\"location\":\"rz\"}],\"fullyQualifiedDomainNames\":[\"jed\",\"st\",\"vnlvxbcuiiznktwf\"]}},{\"name\":\"snvpdibmi\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"bkiw\"],\"subscriptions\":[{\"id\":\"yophz\"},{\"id\":\"l\"},{\"id\":\"crpfbcunez\"}],\"networkSecurityPerimeters\":[{\"id\":\"elfwy\",\"perimeterGuid\":\"lwxjwetn\",\"location\":\"ihclafzv\"}],\"fullyQualifiedDomainNames\":[\"pt\"]}},{\"name\":\"qqwzt\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"hcxwaxfewzjk\",\"exfdeqvhpsylk\",\"shk\"],\"subscriptions\":[{\"id\":\"bmxzjrgywwpg\"}],\"networkSecurityPerimeters\":[{\"id\":\"ptfujgicgaaoept\",\"perimeterGuid\":\"qutdewemxs\",\"location\":\"ruunzzjgehkf\"},{\"id\":\"m\",\"perimeterGuid\":\"ixokffqyin\",\"location\":\"qepqwhixmon\"},{\"id\":\"shiy\",\"perimeterGuid\":\"velfcldu\",\"location\":\"birdsvuwcobiegs\"},{\"id\":\"ninwjizc\",\"perimeterGuid\":\"nghgshej\",\"location\":\"bxqmu\"}],\"fullyQualifiedDomainNames\":[\"lxqzvn\",\"rsbycucrwn\"]}}]}") + "{\"issueType\":\"oyqhlwig\",\"severity\":\"vbkbxgomf\",\"description\":\"uwasqvd\",\"suggestedResourceIds\":[\"y\"],\"suggestedAccessRules\":[{\"name\":\"kjsqzhzbezkgi\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"sicddyvv\"],\"subscriptions\":[{\"id\":\"fmocwahpq\"},{\"id\":\"tjeaahhvjhh\"},{\"id\":\"kzyb\"}],\"networkSecurityPerimeters\":[{\"id\":\"dj\",\"perimeterGuid\":\"yxkyxvx\",\"location\":\"blbjedn\"}],\"fullyQualifiedDomainNames\":[\"age\",\"aulx\",\"nsmjbnkppxynen\"]}},{\"name\":\"vxei\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"nsrmffeycx\",\"ktp\"],\"subscriptions\":[{\"id\":\"rteeamm\"},{\"id\":\"iekkkzddrtkgdojb\"},{\"id\":\"vavrefdees\"},{\"id\":\"cuijpxt\"}],\"networkSecurityPerimeters\":[{\"id\":\"prtujwsawdd\",\"perimeterGuid\":\"babxvitit\",\"location\":\"zeexavoxtfgle\"},{\"id\":\"m\",\"perimeterGuid\":\"bwpypqtgsfjacb\",\"location\":\"hhxud\"},{\"id\":\"vodhtn\",\"perimeterGuid\":\"rudhzmmesckdl\",\"location\":\"gzrcxfailcfxwmdb\"}],\"fullyQualifiedDomainNames\":[\"fgsftufqob\",\"jln\",\"cgcckknhxkizvyt\",\"rzvul\"]}},{\"name\":\"aaeranokqgukk\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"oylaxxul\",\"disdosfjbjsvgj\"],\"subscriptions\":[{\"id\":\"yvycytdclxgcckn\"},{\"id\":\"wmbtmvpdvjdhtt\"}],\"networkSecurityPerimeters\":[{\"id\":\"edxihchrphkmcrj\",\"perimeterGuid\":\"nsdfzpbgtgky\",\"location\":\"dgh\"},{\"id\":\"euutlwxezwzh\",\"perimeterGuid\":\"vbwnhhtq\",\"location\":\"ehgpp\"},{\"id\":\"ifhpf\",\"perimeterGuid\":\"ajvgcxtxjcsheafi\",\"location\":\"tugsresmkssjh\"},{\"id\":\"ftxfkf\",\"perimeterGuid\":\"gpr\",\"location\":\"tillucbiqtg\"}],\"fullyQualifiedDomainNames\":[\"hm\",\"wsldrizetpwbr\"]}}]}") .toObject(ProvisioningIssueProperties.class); - Assertions.assertEquals("smjblmljhlnym", model.issueType()); - Assertions.assertEquals("tqyryuzcbmqqv", model.severity()); - Assertions.assertEquals("vwf", model.description()); - Assertions.assertEquals("yxonsupe", model.suggestedResourceIds().get(0)); - Assertions.assertEquals("xgnxfyqonmpqoxwd", model.suggestedAccessRules().get(0).name()); + Assertions.assertEquals("oyqhlwig", model.issueType()); + Assertions.assertEquals("vbkbxgomf", model.severity()); + Assertions.assertEquals("uwasqvd", model.description()); + Assertions.assertEquals("y", model.suggestedResourceIds().get(0)); + Assertions.assertEquals("kjsqzhzbezkgi", model.suggestedAccessRules().get(0).name()); Assertions.assertEquals(NspAccessRuleDirection.OUTBOUND, model.suggestedAccessRules().get(0).properties().direction()); - Assertions.assertEquals("qxeiiqbimhtmwwi", - model.suggestedAccessRules().get(0).properties().addressPrefixes().get(0)); - Assertions.assertEquals("lembnkbwvqvxkdi", + Assertions.assertEquals("sicddyvv", model.suggestedAccessRules().get(0).properties().addressPrefixes().get(0)); + Assertions.assertEquals("fmocwahpq", model.suggestedAccessRules().get(0).properties().subscriptions().get(0).id()); - Assertions.assertEquals("isdju", + Assertions.assertEquals("dj", model.suggestedAccessRules().get(0).properties().networkSecurityPerimeters().get(0).id()); - Assertions.assertEquals("gbqi", + Assertions.assertEquals("yxkyxvx", model.suggestedAccessRules().get(0).properties().networkSecurityPerimeters().get(0).perimeterGuid()); - Assertions.assertEquals("xkbsazgakgac", + Assertions.assertEquals("blbjedn", model.suggestedAccessRules().get(0).properties().networkSecurityPerimeters().get(0).location()); - Assertions.assertEquals("jed", - model.suggestedAccessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProvisioningIssueProperties model = new ProvisioningIssueProperties().withIssueType("smjblmljhlnym") - .withSeverity("tqyryuzcbmqqv") - .withDescription("vwf") - .withSuggestedResourceIds(Arrays.asList("yxonsupe", "jlzqnhc", "sqltnzo")) - .withSuggestedAccessRules(Arrays.asList( - new NetworkSecurityPerimeterAccessRule().withName("xgnxfyqonmpqoxwd") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.OUTBOUND) - .withAddressPrefixes(Arrays.asList("qxeiiqbimhtmwwi", "h", "hfqpofv")) - .withSubscriptions(Arrays.asList( - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem() - .withId("lembnkbwvqvxkdi"), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("ihebwtsw"), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem() - .withId("uwfmduragegizvc"))) - .withNetworkSecurityPerimeters(Arrays.asList( - new NetworkSecurityPerimeter().withId("isdju") - .withPerimeterGuid("gbqi") - .withLocation("xkbsazgakgac"), - new NetworkSecurityPerimeter().withId("cmjdmspof") - .withPerimeterGuid("vuhrylni") - .withLocation("rz"))) - .withFullyQualifiedDomainNames(Arrays.asList("jed", "st", "vnlvxbcuiiznktwf"))), - new NetworkSecurityPerimeterAccessRule().withName("snvpdibmi") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.OUTBOUND) - .withAddressPrefixes(Arrays.asList("bkiw")) - .withSubscriptions(Arrays.asList( - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("yophz"), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("l"), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("crpfbcunez"))) - .withNetworkSecurityPerimeters(Arrays.asList(new NetworkSecurityPerimeter().withId("elfwy") - .withPerimeterGuid("lwxjwetn") - .withLocation("ihclafzv"))) - .withFullyQualifiedDomainNames(Arrays.asList("pt"))), - new NetworkSecurityPerimeterAccessRule().withName("qqwzt") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.INBOUND) - .withAddressPrefixes(Arrays.asList("hcxwaxfewzjk", "exfdeqvhpsylk", "shk")) - .withSubscriptions(Arrays.asList( - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem().withId("bmxzjrgywwpg"))) - .withNetworkSecurityPerimeters(Arrays.asList( - new NetworkSecurityPerimeter().withId("ptfujgicgaaoept") - .withPerimeterGuid("qutdewemxs") - .withLocation("ruunzzjgehkf"), - new NetworkSecurityPerimeter().withId("m") - .withPerimeterGuid("ixokffqyin") - .withLocation("qepqwhixmon"), - new NetworkSecurityPerimeter().withId("shiy") - .withPerimeterGuid("velfcldu") - .withLocation("birdsvuwcobiegs"), - new NetworkSecurityPerimeter().withId("ninwjizc") - .withPerimeterGuid("nghgshej") - .withLocation("bxqmu"))) - .withFullyQualifiedDomainNames(Arrays.asList("lxqzvn", "rsbycucrwn"))))); - model = BinaryData.fromObject(model).toObject(ProvisioningIssueProperties.class); - Assertions.assertEquals("smjblmljhlnym", model.issueType()); - Assertions.assertEquals("tqyryuzcbmqqv", model.severity()); - Assertions.assertEquals("vwf", model.description()); - Assertions.assertEquals("yxonsupe", model.suggestedResourceIds().get(0)); - Assertions.assertEquals("xgnxfyqonmpqoxwd", model.suggestedAccessRules().get(0).name()); - Assertions.assertEquals(NspAccessRuleDirection.OUTBOUND, - model.suggestedAccessRules().get(0).properties().direction()); - Assertions.assertEquals("qxeiiqbimhtmwwi", - model.suggestedAccessRules().get(0).properties().addressPrefixes().get(0)); - Assertions.assertEquals("lembnkbwvqvxkdi", - model.suggestedAccessRules().get(0).properties().subscriptions().get(0).id()); - Assertions.assertEquals("isdju", - model.suggestedAccessRules().get(0).properties().networkSecurityPerimeters().get(0).id()); - Assertions.assertEquals("gbqi", - model.suggestedAccessRules().get(0).properties().networkSecurityPerimeters().get(0).perimeterGuid()); - Assertions.assertEquals("xkbsazgakgac", - model.suggestedAccessRules().get(0).properties().networkSecurityPerimeters().get(0).location()); - Assertions.assertEquals("jed", + Assertions.assertEquals("age", model.suggestedAccessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProvisioningIssueTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProvisioningIssueTests.java index a0f95facb2ab..73cf5c8639ee 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProvisioningIssueTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ProvisioningIssueTests.java @@ -1,96 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeter; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRule; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRuleProperties; -import com.azure.resourcemanager.cognitiveservices.models.NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem; import com.azure.resourcemanager.cognitiveservices.models.NspAccessRuleDirection; import com.azure.resourcemanager.cognitiveservices.models.ProvisioningIssue; -import com.azure.resourcemanager.cognitiveservices.models.ProvisioningIssueProperties; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class ProvisioningIssueTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ProvisioningIssue model = BinaryData.fromString( - "{\"name\":\"dqxtbjwgnyf\",\"properties\":{\"issueType\":\"zsvtuikzhajqgl\",\"severity\":\"hm\",\"description\":\"qryxyn\",\"suggestedResourceIds\":[\"rd\",\"sovwxznptgoeiyb\",\"abpfhvfs\",\"kvntjlrigjkskyri\"],\"suggestedAccessRules\":[{\"name\":\"idsxwaabzmifry\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"xrizkzobgop\"],\"subscriptions\":[{}],\"networkSecurityPerimeters\":[{},{},{}],\"fullyQualifiedDomainNames\":[\"lxieixynllxecwcr\",\"jphslhcaw\",\"u\",\"i\"]}},{\"name\":\"wfmvigorqjbt\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"lkafhonqjuje\"],\"subscriptions\":[{},{},{},{}],\"networkSecurityPerimeters\":[{},{}],\"fullyQualifiedDomainNames\":[\"p\",\"pmxelnwcltyje\"]}},{\"name\":\"xxmlfmkqscazua\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"uamwabzxrvxc\",\"s\",\"sphaivmxyasflvg\"],\"subscriptions\":[{},{}],\"networkSecurityPerimeters\":[{},{}],\"fullyQualifiedDomainNames\":[\"koih\"]}}]}}") + "{\"name\":\"zjyi\",\"properties\":{\"issueType\":\"sbhud\",\"severity\":\"ohyuemslynsq\",\"description\":\"pfoobr\",\"suggestedResourceIds\":[\"y\"],\"suggestedAccessRules\":[{\"name\":\"ygqdnfwqzdz\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"hnfhqlyvijouwi\",\"kxoyzunbixxr\"],\"subscriptions\":[{},{},{}],\"networkSecurityPerimeters\":[{},{}],\"fullyQualifiedDomainNames\":[\"pgclrciv\",\"soxfrken\",\"pmyyefrpmpdnqq\"]}},{\"name\":\"awaoqvmmbnpqfrt\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"gnitgvkxlzyq\",\"rfe\"],\"subscriptions\":[{},{},{},{}],\"networkSecurityPerimeters\":[{},{},{}],\"fullyQualifiedDomainNames\":[\"whcans\"]}}]}}") .toObject(ProvisioningIssue.class); - Assertions.assertEquals("dqxtbjwgnyf", model.name()); - Assertions.assertEquals("zsvtuikzhajqgl", model.properties().issueType()); - Assertions.assertEquals("hm", model.properties().severity()); - Assertions.assertEquals("qryxyn", model.properties().description()); - Assertions.assertEquals("rd", model.properties().suggestedResourceIds().get(0)); - Assertions.assertEquals("idsxwaabzmifry", model.properties().suggestedAccessRules().get(0).name()); - Assertions.assertEquals(NspAccessRuleDirection.OUTBOUND, + Assertions.assertEquals("zjyi", model.name()); + Assertions.assertEquals("sbhud", model.properties().issueType()); + Assertions.assertEquals("ohyuemslynsq", model.properties().severity()); + Assertions.assertEquals("pfoobr", model.properties().description()); + Assertions.assertEquals("y", model.properties().suggestedResourceIds().get(0)); + Assertions.assertEquals("ygqdnfwqzdz", model.properties().suggestedAccessRules().get(0).name()); + Assertions.assertEquals(NspAccessRuleDirection.INBOUND, model.properties().suggestedAccessRules().get(0).properties().direction()); - Assertions.assertEquals("xrizkzobgop", + Assertions.assertEquals("hnfhqlyvijouwi", model.properties().suggestedAccessRules().get(0).properties().addressPrefixes().get(0)); - Assertions.assertEquals("lxieixynllxecwcr", - model.properties().suggestedAccessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProvisioningIssue model - = new ProvisioningIssue().withName("dqxtbjwgnyf") - .withProperties( - new ProvisioningIssueProperties().withIssueType("zsvtuikzhajqgl") - .withSeverity("hm") - .withDescription("qryxyn") - .withSuggestedResourceIds( - Arrays.asList("rd", "sovwxznptgoeiyb", "abpfhvfs", "kvntjlrigjkskyri")) - .withSuggestedAccessRules( - Arrays.asList( - new NetworkSecurityPerimeterAccessRule().withName("idsxwaabzmifry") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.OUTBOUND) - .withAddressPrefixes(Arrays.asList("xrizkzobgop")) - .withSubscriptions(Arrays.asList( - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem())) - .withNetworkSecurityPerimeters(Arrays.asList(new NetworkSecurityPerimeter(), - new NetworkSecurityPerimeter(), new NetworkSecurityPerimeter())) - .withFullyQualifiedDomainNames( - Arrays.asList("lxieixynllxecwcr", "jphslhcaw", "u", "i"))), - new NetworkSecurityPerimeterAccessRule().withName("wfmvigorqjbt") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.INBOUND) - .withAddressPrefixes(Arrays.asList("lkafhonqjuje")) - .withSubscriptions(Arrays.asList( - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem(), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem(), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem(), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem())) - .withNetworkSecurityPerimeters(Arrays - .asList(new NetworkSecurityPerimeter(), new NetworkSecurityPerimeter())) - .withFullyQualifiedDomainNames(Arrays.asList("p", "pmxelnwcltyje"))), - new NetworkSecurityPerimeterAccessRule().withName("xxmlfmkqscazua") - .withProperties(new NetworkSecurityPerimeterAccessRuleProperties() - .withDirection(NspAccessRuleDirection.INBOUND) - .withAddressPrefixes(Arrays.asList("uamwabzxrvxc", "s", "sphaivmxyasflvg")) - .withSubscriptions(Arrays.asList( - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem(), - new NetworkSecurityPerimeterAccessRulePropertiesSubscriptionsItem())) - .withNetworkSecurityPerimeters(Arrays.asList(new NetworkSecurityPerimeter(), - new NetworkSecurityPerimeter())) - .withFullyQualifiedDomainNames(Arrays.asList("koih")))))); - model = BinaryData.fromObject(model).toObject(ProvisioningIssue.class); - Assertions.assertEquals("dqxtbjwgnyf", model.name()); - Assertions.assertEquals("zsvtuikzhajqgl", model.properties().issueType()); - Assertions.assertEquals("hm", model.properties().severity()); - Assertions.assertEquals("qryxyn", model.properties().description()); - Assertions.assertEquals("rd", model.properties().suggestedResourceIds().get(0)); - Assertions.assertEquals("idsxwaabzmifry", model.properties().suggestedAccessRules().get(0).name()); - Assertions.assertEquals(NspAccessRuleDirection.OUTBOUND, - model.properties().suggestedAccessRules().get(0).properties().direction()); - Assertions.assertEquals("xrizkzobgop", - model.properties().suggestedAccessRules().get(0).properties().addressPrefixes().get(0)); - Assertions.assertEquals("lxieixynllxecwcr", + Assertions.assertEquals("pgclrciv", model.properties().suggestedAccessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTierInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTierInnerTests.java index 1c24554d6d37..f57e282559ff 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTierInnerTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTierInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -14,7 +14,7 @@ public final class QuotaTierInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { QuotaTierInner model = BinaryData.fromString( - "{\"properties\":{\"currentTierName\":\"ayfbpcm\",\"tierUpgradePolicy\":\"OnceUpgradeIsAvailable\",\"assignmentDate\":\"2021-06-20T05:21:51Z\",\"tierUpgradeEligibilityInfo\":{\"nextTierName\":\"ueq\",\"upgradeAvailabilityStatus\":\"Available\",\"upgradeApplicableDate\":\"2021-10-11T15:14:52Z\",\"upgradeUnavailabilityReason\":\"mbscbbx\"}},\"id\":\"dhxiidlopedbwd\",\"name\":\"yqyybxubmdna\",\"type\":\"cbq\"}") + "{\"properties\":{\"currentTierName\":\"jimryvwgcwwpbmz\",\"tierUpgradePolicy\":\"OnceUpgradeIsAvailable\",\"assignmentDate\":\"2021-05-15T02:21:44Z\",\"tierUpgradeEligibilityInfo\":{\"nextTierName\":\"xwefohecbvopwndy\",\"upgradeAvailabilityStatus\":\"NotAvailable\",\"upgradeApplicableDate\":\"2021-08-05T00:47:26Z\",\"upgradeUnavailabilityReason\":\"klmtkhlowkx\"}},\"id\":\"vbrdfjmzsyzfho\",\"name\":\"lhikcyychunsj\",\"type\":\"pjrtws\"}") .toObject(QuotaTierInner.class); Assertions.assertEquals(TierUpgradePolicy.ONCE_UPGRADE_IS_AVAILABLE, model.properties().tierUpgradePolicy()); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTierListResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTierListResultTests.java index c04fdcbe198d..39169ecf580e 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTierListResultTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTierListResultTests.java @@ -1,26 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.QuotaTierListResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.QuotaTierListResult; import org.junit.jupiter.api.Assertions; public final class QuotaTierListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { QuotaTierListResult model = BinaryData.fromString( - "{\"nextLink\":\"ci\",\"value\":[{\"properties\":{\"currentTierName\":\"xrdcoxnbkkja\",\"tierUpgradePolicy\":\"OnceUpgradeIsAvailable\",\"assignmentDate\":\"2021-06-29T10:28:45Z\",\"tierUpgradeEligibilityInfo\":{\"nextTierName\":\"nqbpi\",\"upgradeAvailabilityStatus\":\"Available\",\"upgradeApplicableDate\":\"2021-11-23T17:11:51Z\",\"upgradeUnavailabilityReason\":\"rd\"}},\"id\":\"ypxrx\",\"name\":\"bfihw\",\"type\":\"hvcta\"},{\"properties\":{\"currentTierName\":\"bxrblmliowxihspn\",\"tierUpgradePolicy\":\"NoAutoUpgrade\",\"assignmentDate\":\"2021-06-19T05:03:08Z\",\"tierUpgradeEligibilityInfo\":{\"nextTierName\":\"pzwaklsbsbqqq\",\"upgradeAvailabilityStatus\":\"NotAvailable\",\"upgradeApplicableDate\":\"2021-01-23T19:03:24Z\",\"upgradeUnavailabilityReason\":\"ao\"}},\"id\":\"isglrrc\",\"name\":\"ezkhhltnjadhqo\",\"type\":\"wjqo\"}]}") + "{\"nextLink\":\"ykyujxsg\",\"value\":[{\"properties\":{\"currentTierName\":\"rye\",\"tierUpgradePolicy\":\"OnceUpgradeIsAvailable\",\"assignmentDate\":\"2021-08-20T01:12:08Z\",\"tierUpgradeEligibilityInfo\":{\"nextTierName\":\"udnigrfihotj\",\"upgradeAvailabilityStatus\":\"NotAvailable\",\"upgradeApplicableDate\":\"2021-11-23T05:17:09Z\",\"upgradeUnavailabilityReason\":\"zzjgnr\"}},\"id\":\"qyhqo\",\"name\":\"oihiqak\",\"type\":\"diw\"},{\"properties\":{\"currentTierName\":\"kwpzdqtvh\",\"tierUpgradePolicy\":\"OnceUpgradeIsAvailable\",\"assignmentDate\":\"2021-06-30T10:47:24Z\",\"tierUpgradeEligibilityInfo\":{\"nextTierName\":\"axsipietgb\",\"upgradeAvailabilityStatus\":\"NotAvailable\",\"upgradeApplicableDate\":\"2021-11-20T13:28:07Z\",\"upgradeUnavailabilityReason\":\"bmoichd\"}},\"id\":\"nfpubntnbatz\",\"name\":\"iqsowsaaelc\",\"type\":\"ttcjuhplrvkmjc\"},{\"properties\":{\"currentTierName\":\"vlgfgg\",\"tierUpgradePolicy\":\"OnceUpgradeIsAvailable\",\"assignmentDate\":\"2021-11-06T00:52:54Z\",\"tierUpgradeEligibilityInfo\":{\"nextTierName\":\"zrzbjpsfxs\",\"upgradeAvailabilityStatus\":\"NotAvailable\",\"upgradeApplicableDate\":\"2021-08-20T03:24:47Z\",\"upgradeUnavailabilityReason\":\"tmvag\"}},\"id\":\"idqlvhu\",\"name\":\"oveofizrvjfnmj\",\"type\":\"vlwyzg\"},{\"properties\":{\"currentTierName\":\"kujrllfojui\",\"tierUpgradePolicy\":\"NoAutoUpgrade\",\"assignmentDate\":\"2021-06-24T10:07:42Z\",\"tierUpgradeEligibilityInfo\":{\"nextTierName\":\"ucejikzoeovvtz\",\"upgradeAvailabilityStatus\":\"Available\",\"upgradeApplicableDate\":\"2021-04-18T04:12:05Z\",\"upgradeUnavailabilityReason\":\"ln\"}},\"id\":\"k\",\"name\":\"juzkdbqz\",\"type\":\"lxrzvhqjwtr\"}]}") .toObject(QuotaTierListResult.class); - Assertions.assertEquals("ci", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaTierListResult model = new QuotaTierListResult().withNextLink("ci"); - model = BinaryData.fromObject(model).toObject(QuotaTierListResult.class); - Assertions.assertEquals("ci", model.nextLink()); + Assertions.assertEquals("ykyujxsg", model.nextLink()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTierPropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTierPropertiesTests.java index 241c795ef1a1..dfa48d4c5d93 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTierPropertiesTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTierPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -13,7 +13,7 @@ public final class QuotaTierPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { QuotaTierProperties model = BinaryData.fromString( - "{\"currentTierName\":\"e\",\"tierUpgradePolicy\":\"OnceUpgradeIsAvailable\",\"assignmentDate\":\"2021-02-22T15:43:03Z\",\"tierUpgradeEligibilityInfo\":{\"nextTierName\":\"cigeleohdbvqvw\",\"upgradeAvailabilityStatus\":\"NotAvailable\",\"upgradeApplicableDate\":\"2021-11-20T18:02:38Z\",\"upgradeUnavailabilityReason\":\"beonrlkwzdq\"}}") + "{\"currentTierName\":\"vv\",\"tierUpgradePolicy\":\"OnceUpgradeIsAvailable\",\"assignmentDate\":\"2021-04-17T22:34:01Z\",\"tierUpgradeEligibilityInfo\":{\"nextTierName\":\"rrmhwrbfdp\",\"upgradeAvailabilityStatus\":\"Available\",\"upgradeApplicableDate\":\"2021-07-04T01:52:58Z\",\"upgradeUnavailabilityReason\":\"vjglrocuyzlwhhme\"}}") .toObject(QuotaTierProperties.class); Assertions.assertEquals(TierUpgradePolicy.ONCE_UPGRADE_IS_AVAILABLE, model.tierUpgradePolicy()); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTierUpgradeEligibilityInfoTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTierUpgradeEligibilityInfoTests.java index 43aa1bf9e565..cf386acddad3 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTierUpgradeEligibilityInfoTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTierUpgradeEligibilityInfoTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -14,24 +14,11 @@ public final class QuotaTierUpgradeEligibilityInfoTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { QuotaTierUpgradeEligibilityInfo model = BinaryData.fromString( - "{\"nextTierName\":\"x\",\"upgradeAvailabilityStatus\":\"NotAvailable\",\"upgradeApplicableDate\":\"2021-01-20T06:24:16Z\",\"upgradeUnavailabilityReason\":\"ptsoqfyiase\"}") + "{\"nextTierName\":\"ooclutnp\",\"upgradeAvailabilityStatus\":\"Available\",\"upgradeApplicableDate\":\"2021-02-12T18:38:22Z\",\"upgradeUnavailabilityReason\":\"jk\"}") .toObject(QuotaTierUpgradeEligibilityInfo.class); - Assertions.assertEquals("x", model.nextTierName()); - Assertions.assertEquals(UpgradeAvailabilityStatus.NOT_AVAILABLE, model.upgradeAvailabilityStatus()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-20T06:24:16Z"), model.upgradeApplicableDate()); - Assertions.assertEquals("ptsoqfyiase", model.upgradeUnavailabilityReason()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaTierUpgradeEligibilityInfo model = new QuotaTierUpgradeEligibilityInfo().withNextTierName("x") - .withUpgradeAvailabilityStatus(UpgradeAvailabilityStatus.NOT_AVAILABLE) - .withUpgradeApplicableDate(OffsetDateTime.parse("2021-01-20T06:24:16Z")) - .withUpgradeUnavailabilityReason("ptsoqfyiase"); - model = BinaryData.fromObject(model).toObject(QuotaTierUpgradeEligibilityInfo.class); - Assertions.assertEquals("x", model.nextTierName()); - Assertions.assertEquals(UpgradeAvailabilityStatus.NOT_AVAILABLE, model.upgradeAvailabilityStatus()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-20T06:24:16Z"), model.upgradeApplicableDate()); - Assertions.assertEquals("ptsoqfyiase", model.upgradeUnavailabilityReason()); + Assertions.assertEquals("ooclutnp", model.nextTierName()); + Assertions.assertEquals(UpgradeAvailabilityStatus.AVAILABLE, model.upgradeAvailabilityStatus()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-12T18:38:22Z"), model.upgradeApplicableDate()); + Assertions.assertEquals("jk", model.upgradeUnavailabilityReason()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTiersCreateOrUpdateWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTiersCreateOrUpdateWithResponseMockTests.java index 25e15ab79456..d1eefc2a2b08 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTiersCreateOrUpdateWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTiersCreateOrUpdateWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -23,7 +23,7 @@ public final class QuotaTiersCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"currentTierName\":\"pxhn\",\"tierUpgradePolicy\":\"OnceUpgradeIsAvailable\",\"assignmentDate\":\"2021-03-25T08:34:15Z\",\"tierUpgradeEligibilityInfo\":{\"nextTierName\":\"ttgzkjtyq\",\"upgradeAvailabilityStatus\":\"Available\",\"upgradeApplicableDate\":\"2021-04-08T15:56:28Z\",\"upgradeUnavailabilityReason\":\"ghztldsvc\"}},\"id\":\"jiahuqy\",\"name\":\"jzucwwm\",\"type\":\"jjqhddwvm\"}"; + = "{\"properties\":{\"currentTierName\":\"iqstt\",\"tierUpgradePolicy\":\"NoAutoUpgrade\",\"assignmentDate\":\"2021-09-15T02:52:03Z\",\"tierUpgradeEligibilityInfo\":{\"nextTierName\":\"aixpqj\",\"upgradeAvailabilityStatus\":\"Available\",\"upgradeApplicableDate\":\"2021-02-10T08:56:49Z\",\"upgradeUnavailabilityReason\":\"ksldttohqclnaih\"}},\"id\":\"siqikvllrht\",\"name\":\"mgl\",\"type\":\"k\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,11 +33,11 @@ public void testCreateOrUpdateWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); QuotaTier response = manager.quotaTiers() - .define("bkzhmhjd") + .define("p") .withProperties( new QuotaTierProperties().withTierUpgradePolicy(TierUpgradePolicy.ONCE_UPGRADE_IS_AVAILABLE)) .create(); - Assertions.assertEquals(TierUpgradePolicy.ONCE_UPGRADE_IS_AVAILABLE, response.properties().tierUpgradePolicy()); + Assertions.assertEquals(TierUpgradePolicy.NO_AUTO_UPGRADE, response.properties().tierUpgradePolicy()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTiersGetWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTiersGetWithResponseMockTests.java index 9822baf34eab..59deb1bcfdb6 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTiersGetWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTiersGetWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -22,7 +22,7 @@ public final class QuotaTiersGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"currentTierName\":\"abenqlamwmg\",\"tierUpgradePolicy\":\"NoAutoUpgrade\",\"assignmentDate\":\"2021-01-23T12:52:08Z\",\"tierUpgradeEligibilityInfo\":{\"nextTierName\":\"nbcpjstbhemhcucs\",\"upgradeAvailabilityStatus\":\"Available\",\"upgradeApplicableDate\":\"2021-04-05T19:29:49Z\",\"upgradeUnavailabilityReason\":\"xufeapd\"}},\"id\":\"zyvbsuadulpodk\",\"name\":\"x\",\"type\":\"f\"}"; + = "{\"properties\":{\"currentTierName\":\"nwosstfj\",\"tierUpgradePolicy\":\"OnceUpgradeIsAvailable\",\"assignmentDate\":\"2021-02-14T11:02:35Z\",\"tierUpgradeEligibilityInfo\":{\"nextTierName\":\"qfcwr\",\"upgradeAvailabilityStatus\":\"NotAvailable\",\"upgradeApplicableDate\":\"2021-05-14T18:49:22Z\",\"upgradeUnavailabilityReason\":\"ezwy\"}},\"id\":\"mbjiqeg\",\"name\":\"xdbsohcw\",\"type\":\"pyvdkgdets\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,9 +31,8 @@ public void testGetWithResponse() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - QuotaTier response - = manager.quotaTiers().getWithResponse("xlayunomir", com.azure.core.util.Context.NONE).getValue(); + QuotaTier response = manager.quotaTiers().getWithResponse("f", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals(TierUpgradePolicy.NO_AUTO_UPGRADE, response.properties().tierUpgradePolicy()); + Assertions.assertEquals(TierUpgradePolicy.ONCE_UPGRADE_IS_AVAILABLE, response.properties().tierUpgradePolicy()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTiersListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTiersListMockTests.java index 6ac644975db6..e7d7dfa831d0 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTiersListMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/QuotaTiersListMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -23,7 +23,7 @@ public final class QuotaTiersListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"currentTierName\":\"durhzzfopueoqus\",\"tierUpgradePolicy\":\"NoAutoUpgrade\",\"assignmentDate\":\"2021-08-10T08:25:04Z\",\"tierUpgradeEligibilityInfo\":{\"nextTierName\":\"wnibittoz\",\"upgradeAvailabilityStatus\":\"Available\",\"upgradeApplicableDate\":\"2021-03-13T09:19:58Z\",\"upgradeUnavailabilityReason\":\"qvfmwcad\"}},\"id\":\"gctxegtvgwyur\",\"name\":\"elfnzzryiz\",\"type\":\"bxgde\"}]}"; + = "{\"value\":[{\"properties\":{\"currentTierName\":\"anzbjekwuyckyvn\",\"tierUpgradePolicy\":\"NoAutoUpgrade\",\"assignmentDate\":\"2021-05-31T19:52:40Z\",\"tierUpgradeEligibilityInfo\":{\"nextTierName\":\"iwjbctvb\",\"upgradeAvailabilityStatus\":\"NotAvailable\",\"upgradeApplicableDate\":\"2021-09-06T12:31:33Z\",\"upgradeUnavailabilityReason\":\"totdxposcslh\"}},\"id\":\"usiecktybhjuxid\",\"name\":\"hxomilddxjx\",\"type\":\"ugxwjwilmqrslaat\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlockListItemsResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlockListItemsResultTests.java index 41e54286d93a..f322793559a7 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlockListItemsResultTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlockListItemsResultTests.java @@ -1,51 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiBlocklistItemInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlockListItemsResult; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistItemProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; +import com.azure.resourcemanager.cognitiveservices.implementation.models.RaiBlockListItemsResult; import org.junit.jupiter.api.Assertions; public final class RaiBlockListItemsResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RaiBlockListItemsResult model = BinaryData.fromString( - "{\"nextLink\":\"qeevt\",\"value\":[{\"etag\":\"yutnwytpzdmov\",\"tags\":{\"wzqa\":\"va\",\"gzuriglaecxndt\":\"f\"},\"properties\":{\"pattern\":\"kpvzmlq\",\"isRegex\":false},\"id\":\"gxobfirclnp\",\"name\":\"ciayzriykhya\",\"type\":\"fvjlboxqvkjlmx\"}]}") + "{\"nextLink\":\"wbdsr\",\"value\":[{\"properties\":{\"pattern\":\"hneuyowqkd\",\"isRegex\":false},\"etag\":\"sibircgpi\",\"tags\":{\"zxiavrm\":\"imejzanl\",\"gzpfrla\":\"zonokixrjqci\",\"indfpwpjyl\":\"szrnwo\"},\"id\":\"tlhflsjcdhszf\",\"name\":\"vfbgofeljagrqmqh\",\"type\":\"dvriiiojnal\"},{\"properties\":{\"pattern\":\"kvtvsexso\",\"isRegex\":false},\"etag\":\"uqhhahhxvrh\",\"tags\":{\"ughftqsx\":\"wpjgwws\",\"grjguufzd\":\"qxujxukndxd\",\"whbotzingamv\":\"syqtfi\",\"dphqamv\":\"phoszqz\"},\"id\":\"fwynwcvtbvkay\",\"name\":\"mtnvyq\",\"type\":\"atkzwpcnpw\"}]}") .toObject(RaiBlockListItemsResult.class); - Assertions.assertEquals("qeevt", model.nextLink()); - Assertions.assertEquals("va", model.value().get(0).tags().get("wzqa")); - Assertions.assertEquals("kpvzmlq", model.value().get(0).properties().pattern()); + Assertions.assertEquals("wbdsr", model.nextLink()); + Assertions.assertEquals("hneuyowqkd", model.value().get(0).properties().pattern()); Assertions.assertFalse(model.value().get(0).properties().isRegex()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RaiBlockListItemsResult model = new RaiBlockListItemsResult().withNextLink("qeevt") - .withValue(Arrays.asList(new RaiBlocklistItemInner().withTags(mapOf("wzqa", "va", "gzuriglaecxndt", "f")) - .withProperties(new RaiBlocklistItemProperties().withPattern("kpvzmlq").withIsRegex(false)))); - model = BinaryData.fromObject(model).toObject(RaiBlockListItemsResult.class); - Assertions.assertEquals("qeevt", model.nextLink()); - Assertions.assertEquals("va", model.value().get(0).tags().get("wzqa")); - Assertions.assertEquals("kpvzmlq", model.value().get(0).properties().pattern()); - Assertions.assertFalse(model.value().get(0).properties().isRegex()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + Assertions.assertEquals("imejzanl", model.value().get(0).tags().get("zxiavrm")); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlockListResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlockListResultTests.java index 440f710e72ea..1aaeb75447d6 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlockListResultTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlockListResultTests.java @@ -1,49 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiBlocklistInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlockListResult; -import com.azure.resourcemanager.cognitiveservices.models.RaiBlocklistProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; +import com.azure.resourcemanager.cognitiveservices.implementation.models.RaiBlockListResult; import org.junit.jupiter.api.Assertions; public final class RaiBlockListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RaiBlockListResult model = BinaryData.fromString( - "{\"nextLink\":\"msgeivsiykzk\",\"value\":[{\"etag\":\"dxonbzoggculap\",\"tags\":{\"ylbf\":\"rpgogtqxep\"},\"properties\":{\"description\":\"lyjt\"},\"id\":\"of\",\"name\":\"zhvfcibyfmowuxr\",\"type\":\"jpvd\"}]}") + "{\"nextLink\":\"irryuzhlh\",\"value\":[{\"properties\":{\"description\":\"vqqaatjinrvgo\"},\"etag\":\"mfiibfggj\",\"tags\":{\"llqwjygvjayvblmh\":\"lvrwxkvtkk\",\"uhbxvvy\":\"k\"},\"id\":\"s\",\"name\":\"pbyrqufegxu\",\"type\":\"wz\"},{\"properties\":{\"description\":\"hlmctlpdngitvgb\"},\"etag\":\"rixkwmyijejve\",\"tags\":{\"xhcexdrrvqahq\":\"bpnaixexccbdre\",\"jnhyjsvf\":\"ghtpw\",\"mtg\":\"cxzbfvoowvr\",\"y\":\"qp\"},\"id\":\"tronzmyhgfi\",\"name\":\"nsxkmcwaekrrjr\",\"type\":\"afxtsgum\"},{\"properties\":{\"description\":\"lik\"},\"etag\":\"wslolbqp\",\"tags\":{\"elfk\":\"lmv\",\"njwmwkpnbsazejj\":\"gplcrpwjxeznoigb\",\"augzxnfaazpxdtn\":\"qkagfhsxt\"},\"id\":\"mkqjj\",\"name\":\"wuenvr\",\"type\":\"pyouaibrebqaays\"}]}") .toObject(RaiBlockListResult.class); - Assertions.assertEquals("msgeivsiykzk", model.nextLink()); - Assertions.assertEquals("rpgogtqxep", model.value().get(0).tags().get("ylbf")); - Assertions.assertEquals("lyjt", model.value().get(0).properties().description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RaiBlockListResult model = new RaiBlockListResult().withNextLink("msgeivsiykzk") - .withValue(Arrays.asList(new RaiBlocklistInner().withTags(mapOf("ylbf", "rpgogtqxep")) - .withProperties(new RaiBlocklistProperties().withDescription("lyjt")))); - model = BinaryData.fromObject(model).toObject(RaiBlockListResult.class); - Assertions.assertEquals("msgeivsiykzk", model.nextLink()); - Assertions.assertEquals("rpgogtqxep", model.value().get(0).tags().get("ylbf")); - Assertions.assertEquals("lyjt", model.value().get(0).properties().description()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + Assertions.assertEquals("irryuzhlh", model.nextLink()); + Assertions.assertEquals("vqqaatjinrvgo", model.value().get(0).properties().description()); + Assertions.assertEquals("lvrwxkvtkk", model.value().get(0).tags().get("llqwjygvjayvblmh")); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistConfigTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistConfigTests.java index 30a464135def..3b30ab31e076 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistConfigTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistConfigTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -11,17 +11,17 @@ public final class RaiBlocklistConfigTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - RaiBlocklistConfig model = BinaryData.fromString("{\"blocklistName\":\"puunnoxyhkxgqd\",\"blocking\":false}") + RaiBlocklistConfig model = BinaryData.fromString("{\"blocklistName\":\"qumiek\",\"blocking\":true}") .toObject(RaiBlocklistConfig.class); - Assertions.assertEquals("puunnoxyhkxgqd", model.blocklistName()); - Assertions.assertFalse(model.blocking()); + Assertions.assertEquals("qumiek", model.blocklistName()); + Assertions.assertTrue(model.blocking()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - RaiBlocklistConfig model = new RaiBlocklistConfig().withBlocklistName("puunnoxyhkxgqd").withBlocking(false); + RaiBlocklistConfig model = new RaiBlocklistConfig().withBlocklistName("qumiek").withBlocking(true); model = BinaryData.fromObject(model).toObject(RaiBlocklistConfig.class); - Assertions.assertEquals("puunnoxyhkxgqd", model.blocklistName()); - Assertions.assertFalse(model.blocking()); + Assertions.assertEquals("qumiek", model.blocklistName()); + Assertions.assertTrue(model.blocking()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistInnerTests.java index 7405adb8e15c..75266384f7dd 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistInnerTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -15,20 +15,21 @@ public final class RaiBlocklistInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RaiBlocklistInner model = BinaryData.fromString( - "{\"etag\":\"fzwiivwzjbhyz\",\"tags\":{\"negvmnvuqe\":\"rkambt\",\"tjb\":\"vldspa\",\"ril\":\"kdmflvestmjlx\",\"ktwkuziyc\":\"zapeewchpx\"},\"properties\":{\"description\":\"vu\"},\"id\":\"ztcktyh\",\"name\":\"tqedcgzulwm\",\"type\":\"rqzz\"}") + "{\"properties\":{\"description\":\"kfxu\"},\"etag\":\"mdwzrmuhapfcqdps\",\"tags\":{\"vezrypqlmfeo\":\"vpsvuoymgcce\",\"edkowepbqpcrfk\":\"erqwkyhkobopg\",\"tn\":\"wccsnjvcdwxlpqek\"},\"id\":\"tjsyin\",\"name\":\"wfqatmtd\",\"type\":\"tmdvypgikdgs\"}") .toObject(RaiBlocklistInner.class); - Assertions.assertEquals("rkambt", model.tags().get("negvmnvuqe")); - Assertions.assertEquals("vu", model.properties().description()); + Assertions.assertEquals("kfxu", model.properties().description()); + Assertions.assertEquals("vpsvuoymgcce", model.tags().get("vezrypqlmfeo")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - RaiBlocklistInner model = new RaiBlocklistInner() - .withTags(mapOf("negvmnvuqe", "rkambt", "tjb", "vldspa", "ril", "kdmflvestmjlx", "ktwkuziyc", "zapeewchpx")) - .withProperties(new RaiBlocklistProperties().withDescription("vu")); + RaiBlocklistInner model + = new RaiBlocklistInner().withProperties(new RaiBlocklistProperties().withDescription("kfxu")) + .withTags( + mapOf("vezrypqlmfeo", "vpsvuoymgcce", "edkowepbqpcrfk", "erqwkyhkobopg", "tn", "wccsnjvcdwxlpqek")); model = BinaryData.fromObject(model).toObject(RaiBlocklistInner.class); - Assertions.assertEquals("rkambt", model.tags().get("negvmnvuqe")); - Assertions.assertEquals("vu", model.properties().description()); + Assertions.assertEquals("kfxu", model.properties().description()); + Assertions.assertEquals("vpsvuoymgcce", model.tags().get("vezrypqlmfeo")); } // Use "Map.of" if available diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemBulkRequestTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemBulkRequestTests.java index 5736f8ff594b..0b94e49d7ad8 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemBulkRequestTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemBulkRequestTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -13,20 +13,20 @@ public final class RaiBlocklistItemBulkRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RaiBlocklistItemBulkRequest model = BinaryData - .fromString("{\"name\":\"qgnjdgkynscli\",\"properties\":{\"pattern\":\"vhxnk\",\"isRegex\":true}}") + .fromString("{\"name\":\"jaesgvvsccya\",\"properties\":{\"pattern\":\"qfhwyg\",\"isRegex\":true}}") .toObject(RaiBlocklistItemBulkRequest.class); - Assertions.assertEquals("qgnjdgkynscli", model.name()); - Assertions.assertEquals("vhxnk", model.properties().pattern()); + Assertions.assertEquals("jaesgvvsccya", model.name()); + Assertions.assertEquals("qfhwyg", model.properties().pattern()); Assertions.assertTrue(model.properties().isRegex()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - RaiBlocklistItemBulkRequest model = new RaiBlocklistItemBulkRequest().withName("qgnjdgkynscli") - .withProperties(new RaiBlocklistItemProperties().withPattern("vhxnk").withIsRegex(true)); + RaiBlocklistItemBulkRequest model = new RaiBlocklistItemBulkRequest().withName("jaesgvvsccya") + .withProperties(new RaiBlocklistItemProperties().withPattern("qfhwyg").withIsRegex(true)); model = BinaryData.fromObject(model).toObject(RaiBlocklistItemBulkRequest.class); - Assertions.assertEquals("qgnjdgkynscli", model.name()); - Assertions.assertEquals("vhxnk", model.properties().pattern()); + Assertions.assertEquals("jaesgvvsccya", model.name()); + Assertions.assertEquals("qfhwyg", model.properties().pattern()); Assertions.assertTrue(model.properties().isRegex()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemInnerTests.java index 52389089f55d..eeb7a984d303 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemInnerTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -15,22 +15,22 @@ public final class RaiBlocklistItemInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RaiBlocklistItemInner model = BinaryData.fromString( - "{\"etag\":\"mdy\",\"tags\":{\"p\":\"wdigumbnraauz\",\"uvvfonkp\":\"jazysdzhezwwvaiq\"},\"properties\":{\"pattern\":\"yik\",\"isRegex\":false},\"id\":\"uyav\",\"name\":\"uwmncs\",\"type\":\"tijfybvp\"}") + "{\"properties\":{\"pattern\":\"tawfsdjpvkvp\",\"isRegex\":true},\"etag\":\"kzbzkdvncjabudu\",\"tags\":{\"hmouwqlgzrfze\":\"akmokzhjjklf\",\"lbjbsyb\":\"yebizikayuh\"},\"id\":\"wrv\",\"name\":\"ldgmfpgvmpip\",\"type\":\"slthaq\"}") .toObject(RaiBlocklistItemInner.class); - Assertions.assertEquals("wdigumbnraauz", model.tags().get("p")); - Assertions.assertEquals("yik", model.properties().pattern()); - Assertions.assertFalse(model.properties().isRegex()); + Assertions.assertEquals("tawfsdjpvkvp", model.properties().pattern()); + Assertions.assertTrue(model.properties().isRegex()); + Assertions.assertEquals("akmokzhjjklf", model.tags().get("hmouwqlgzrfze")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - RaiBlocklistItemInner model - = new RaiBlocklistItemInner().withTags(mapOf("p", "wdigumbnraauz", "uvvfonkp", "jazysdzhezwwvaiq")) - .withProperties(new RaiBlocklistItemProperties().withPattern("yik").withIsRegex(false)); + RaiBlocklistItemInner model = new RaiBlocklistItemInner() + .withProperties(new RaiBlocklistItemProperties().withPattern("tawfsdjpvkvp").withIsRegex(true)) + .withTags(mapOf("hmouwqlgzrfze", "akmokzhjjklf", "lbjbsyb", "yebizikayuh")); model = BinaryData.fromObject(model).toObject(RaiBlocklistItemInner.class); - Assertions.assertEquals("wdigumbnraauz", model.tags().get("p")); - Assertions.assertEquals("yik", model.properties().pattern()); - Assertions.assertFalse(model.properties().isRegex()); + Assertions.assertEquals("tawfsdjpvkvp", model.properties().pattern()); + Assertions.assertTrue(model.properties().isRegex()); + Assertions.assertEquals("akmokzhjjklf", model.tags().get("hmouwqlgzrfze")); } // Use "Map.of" if available diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemPropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemPropertiesTests.java index c9ee4ad3b88d..66b1f347e880 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemPropertiesTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -11,17 +11,17 @@ public final class RaiBlocklistItemPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - RaiBlocklistItemProperties model = BinaryData.fromString("{\"pattern\":\"krsgsgb\",\"isRegex\":true}") + RaiBlocklistItemProperties model = BinaryData.fromString("{\"pattern\":\"ss\",\"isRegex\":false}") .toObject(RaiBlocklistItemProperties.class); - Assertions.assertEquals("krsgsgb", model.pattern()); - Assertions.assertTrue(model.isRegex()); + Assertions.assertEquals("ss", model.pattern()); + Assertions.assertFalse(model.isRegex()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - RaiBlocklistItemProperties model = new RaiBlocklistItemProperties().withPattern("krsgsgb").withIsRegex(true); + RaiBlocklistItemProperties model = new RaiBlocklistItemProperties().withPattern("ss").withIsRegex(false); model = BinaryData.fromObject(model).toObject(RaiBlocklistItemProperties.class); - Assertions.assertEquals("krsgsgb", model.pattern()); - Assertions.assertTrue(model.isRegex()); + Assertions.assertEquals("ss", model.pattern()); + Assertions.assertFalse(model.isRegex()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsBatchAddWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsBatchAddWithResponseMockTests.java index f30a5e12baf0..2d6a965942f9 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsBatchAddWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsBatchAddWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -24,7 +24,7 @@ public final class RaiBlocklistItemsBatchAddWithResponseMockTests { @Test public void testBatchAddWithResponse() throws Exception { String responseStr - = "{\"etag\":\"zwyqejga\",\"tags\":{\"ngdyfcixrhlcq\":\"ctgkppgkqzkcyzmf\",\"goiutgw\":\"hoe\"},\"properties\":{\"description\":\"a\"},\"id\":\"qha\",\"name\":\"yntacihnco\",\"type\":\"mip\"}"; + = "{\"properties\":{\"description\":\"eychbji\"},\"etag\":\"fsgnw\",\"tags\":{\"xi\":\"edpqlrfbo\"},\"id\":\"lnfyzav\",\"name\":\"rbypi\",\"type\":\"dbkp\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -34,19 +34,15 @@ public void testBatchAddWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); RaiBlocklist response = manager.raiBlocklistItems() - .batchAddWithResponse("ukklvzrlr", "l", "cme", - Arrays.asList(new RaiBlocklistItemBulkRequest().withName("czivfqbqna") - .withProperties(new RaiBlocklistItemProperties().withPattern("yenzsieuscpl").withIsRegex(false)), - new RaiBlocklistItemBulkRequest().withName("gxlyzkxitdshezs") - .withProperties(new RaiBlocklistItemProperties().withPattern("lrupjovmo").withIsRegex(false)), - new RaiBlocklistItemBulkRequest().withName("ebrazwzlpzbtzuyk") - .withProperties(new RaiBlocklistItemProperties().withPattern("pfs").withIsRegex(false)), - new RaiBlocklistItemBulkRequest().withName("fnocmbe") - .withProperties(new RaiBlocklistItemProperties().withPattern("fp").withIsRegex(true))), + .batchAddWithResponse("olzkgys", "gzyy", "zoxlvoc", + Arrays.asList(new RaiBlocklistItemBulkRequest().withName("dxxheigmlilwz") + .withProperties(new RaiBlocklistItemProperties().withPattern("hjvmabzzbwaybfm").withIsRegex(false)), + new RaiBlocklistItemBulkRequest().withName("gymqtnapreoj") + .withProperties(new RaiBlocklistItemProperties().withPattern("nbsconx").withIsRegex(false))), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("ctgkppgkqzkcyzmf", response.tags().get("ngdyfcixrhlcq")); - Assertions.assertEquals("a", response.properties().description()); + Assertions.assertEquals("eychbji", response.properties().description()); + Assertions.assertEquals("edpqlrfbo", response.tags().get("xi")); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsBatchDeleteWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsBatchDeleteWithResponseMockTests.java index c2d247b657d6..9b4b3dd7c608 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsBatchDeleteWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsBatchDeleteWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,6 +12,7 @@ import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; +import java.util.Arrays; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; @@ -28,8 +29,8 @@ public void testBatchDeleteWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.raiBlocklistItems() - .batchDeleteWithResponse("mliqmvlb", "i", "eaqgrvgpomxpupd", "datasdfjyiesoc", - com.azure.core.util.Context.NONE); + .batchDeleteWithResponse("jtaqhsmqazpdg", "njhx", "h", + Arrays.asList("mgpczqulptkbvc", "xt", "higqqbtimpkjbl"), com.azure.core.util.Context.NONE); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsCreateOrUpdateWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsCreateOrUpdateWithResponseMockTests.java index 2d62b99ae0f7..f4957a1ae19a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsCreateOrUpdateWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsCreateOrUpdateWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -24,7 +24,7 @@ public final class RaiBlocklistItemsCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"etag\":\"o\",\"tags\":{\"zbuiadhbatecaa\":\"zmicuydoccnxsha\",\"iucbda\":\"sdohz\",\"pow\":\"mbwiinjdllwktl\"},\"properties\":{\"pattern\":\"qxua\",\"isRegex\":true},\"id\":\"wulynkgfcf\",\"name\":\"ruwsikxxtclh\",\"type\":\"ulriqb\"}"; + = "{\"properties\":{\"pattern\":\"bxv\",\"isRegex\":true},\"etag\":\"zpbgkzc\",\"tags\":{\"ti\":\"iuzvkunhdimju\",\"gofmhxwrjlv\":\"zkaugpucdocfqpl\"},\"id\":\"lkv\",\"name\":\"gikyjtkak\",\"type\":\"lbis\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -34,15 +34,15 @@ public void testCreateOrUpdateWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); RaiBlocklistItem response = manager.raiBlocklistItems() - .define("bwwzvdajf") - .withExistingRaiBlocklist("iqbuou", "mpyzgleo", "jsb") - .withTags(mapOf("jjrlhiqlwix", "aciq", "pg", "tbouguxtnd", "alapdlndbe", "ttbas")) - .withProperties(new RaiBlocklistItemProperties().withPattern("kixvvlwy").withIsRegex(false)) + .define("nniixyxvqba") + .withExistingRaiBlocklist("rnsihqhudsmus", "aawja", "xwjnfcz") + .withTags(mapOf("jogsyx", "e", "nrecchdidrm", "etamfddrvlkpzwb")) + .withProperties(new RaiBlocklistItemProperties().withPattern("jtgirnb").withIsRegex(false)) .create(); - Assertions.assertEquals("zmicuydoccnxsha", response.tags().get("zbuiadhbatecaa")); - Assertions.assertEquals("qxua", response.properties().pattern()); + Assertions.assertEquals("bxv", response.properties().pattern()); Assertions.assertTrue(response.properties().isRegex()); + Assertions.assertEquals("iuzvkunhdimju", response.tags().get("ti")); } // Use "Map.of" if available diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsGetWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsGetWithResponseMockTests.java index e5248c824907..2c10863b63f9 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsGetWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsGetWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -21,7 +21,7 @@ public final class RaiBlocklistItemsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"etag\":\"rdcgu\",\"tags\":{\"lttjzgcz\":\"tmdylperp\",\"esrgvtshuvftwai\":\"cmfpfbodet\",\"pdxxzetwwz\":\"muqkevzgjypanhx\"},\"properties\":{\"pattern\":\"tnxlkfhglhr\",\"isRegex\":false},\"id\":\"wecr\",\"name\":\"nhpcselqx\",\"type\":\"vppqi\"}"; + = "{\"properties\":{\"pattern\":\"agbbgia\",\"isRegex\":false},\"etag\":\"kpgdqxwabzrwiq\",\"tags\":{\"cdosqkptj\":\"ac\"},\"id\":\"kifmmainw\",\"name\":\"edxkpbqwuntob\",\"type\":\"izazz\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,11 +31,11 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); RaiBlocklistItem response = manager.raiBlocklistItems() - .getWithResponse("ewqkjvxprwpxs", "ohutxlcsk", "tezuug", "gzlf", com.azure.core.util.Context.NONE) + .getWithResponse("f", "zsifcuvbdujgcwx", "ec", "bwjtrdx", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("tmdylperp", response.tags().get("lttjzgcz")); - Assertions.assertEquals("tnxlkfhglhr", response.properties().pattern()); + Assertions.assertEquals("agbbgia", response.properties().pattern()); Assertions.assertFalse(response.properties().isRegex()); + Assertions.assertEquals("ac", response.tags().get("cdosqkptj")); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsListMockTests.java index 0f723869929b..4eeae30b4f0e 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsListMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistItemsListMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -22,7 +22,7 @@ public final class RaiBlocklistItemsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"etag\":\"ftedzuubjtvgjsx\",\"tags\":{\"btdphti\":\"jjvavdpww\"},\"properties\":{\"pattern\":\"fofwan\",\"isRegex\":false},\"id\":\"cauwazcgwdfriwg\",\"name\":\"bjpozokscvgllixd\",\"type\":\"byfg\"}]}"; + = "{\"value\":[{\"properties\":{\"pattern\":\"bal\",\"isRegex\":false},\"etag\":\"glzfytl\",\"tags\":{\"xouvmrs\":\"qho\",\"qsdb\":\"flikyypzkgxfxfmy\",\"nm\":\"oksz\"},\"id\":\"gpterdiu\",\"name\":\"kirkskw\",\"type\":\"tsdetjygowifcq\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,10 +32,10 @@ public void testList() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.raiBlocklistItems().list("yzlwhbwzjnufzrf", "m", "qgnnbz", com.azure.core.util.Context.NONE); + = manager.raiBlocklistItems().list("lw", "vydjufbnk", "blaxpegj", com.azure.core.util.Context.NONE); - Assertions.assertEquals("jjvavdpww", response.iterator().next().tags().get("btdphti")); - Assertions.assertEquals("fofwan", response.iterator().next().properties().pattern()); + Assertions.assertEquals("bal", response.iterator().next().properties().pattern()); Assertions.assertFalse(response.iterator().next().properties().isRegex()); + Assertions.assertEquals("qho", response.iterator().next().tags().get("xouvmrs")); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistPropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistPropertiesTests.java index 5c49d738e7d8..09bdc593c8bf 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistPropertiesTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,14 +12,14 @@ public final class RaiBlocklistPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RaiBlocklistProperties model - = BinaryData.fromString("{\"description\":\"jvpglydzgk\"}").toObject(RaiBlocklistProperties.class); - Assertions.assertEquals("jvpglydzgk", model.description()); + = BinaryData.fromString("{\"description\":\"w\"}").toObject(RaiBlocklistProperties.class); + Assertions.assertEquals("w", model.description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - RaiBlocklistProperties model = new RaiBlocklistProperties().withDescription("jvpglydzgk"); + RaiBlocklistProperties model = new RaiBlocklistProperties().withDescription("w"); model = BinaryData.fromObject(model).toObject(RaiBlocklistProperties.class); - Assertions.assertEquals("jvpglydzgk", model.description()); + Assertions.assertEquals("w", model.description()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsCreateOrUpdateWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsCreateOrUpdateWithResponseMockTests.java index 8f83dcc7e824..7852f5ea8f81 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsCreateOrUpdateWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsCreateOrUpdateWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -24,7 +24,7 @@ public final class RaiBlocklistsCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"etag\":\"esrfsvpinkzpatq\",\"tags\":{\"bgspf\":\"swxspvckojaz\",\"ylytcovqseusr\":\"esubzpvpv\"},\"properties\":{\"description\":\"d\"},\"id\":\"fxnxml\",\"name\":\"muoswkjmdih\",\"type\":\"cy\"}"; + = "{\"properties\":{\"description\":\"vlgsrgkrfiz\"},\"etag\":\"ywlptyuqh\",\"tags\":{\"ykpfu\":\"cs\"},\"id\":\"ixcnpcf\",\"name\":\"kkpyycpaw\",\"type\":\"pjprdpwr\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -34,14 +34,14 @@ public void testCreateOrUpdateWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); RaiBlocklist response = manager.raiBlocklists() - .define("it") - .withExistingAccount("nrbctbhpjhxpcvrd", "y") - .withTags(mapOf("iceevsaaxwspca", "nzjahwriuomzczf")) - .withProperties(new RaiBlocklistProperties().withDescription("hfjqebglcxkxgz")) + .define("lahovuuwx") + .withExistingAccount("wsaudoejtighsxj", "ytnkqb") + .withTags(mapOf("lyr", "w", "frolq", "oxpdxq", "u", "wnk")) + .withProperties(new RaiBlocklistProperties().withDescription("hjnhjiot")) .create(); - Assertions.assertEquals("swxspvckojaz", response.tags().get("bgspf")); - Assertions.assertEquals("d", response.properties().description()); + Assertions.assertEquals("vlgsrgkrfiz", response.properties().description()); + Assertions.assertEquals("cs", response.tags().get("ykpfu")); } // Use "Map.of" if available diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsGetWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsGetWithResponseMockTests.java index 35b9f4f77b55..3f79fb975037 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsGetWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsGetWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -21,7 +21,7 @@ public final class RaiBlocklistsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"etag\":\"lk\",\"tags\":{\"bkut\":\"yttlrcxiv\",\"ynbpvzlqywauy\":\"umltwjflu\",\"hmocgjshg\":\"njc\"},\"properties\":{\"description\":\"rhwv\"},\"id\":\"qqgglj\",\"name\":\"ybsjrc\",\"type\":\"rvtz\"}"; + = "{\"properties\":{\"description\":\"dmuqohhi\"},\"etag\":\"a\",\"tags\":{\"dbwen\":\"ddrwjcljbrhlhpvz\",\"ztiucwviql\":\"inafhxrzfrm\"},\"id\":\"khkrc\",\"name\":\"xgcbvzarmqcbp\",\"type\":\"kst\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,10 +31,10 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); RaiBlocklist response = manager.raiBlocklists() - .getWithResponse("ukhsusmmorf", "zhwilzzh", "ijmri", com.azure.core.util.Context.NONE) + .getWithResponse("jvpzaptuoskaoiz", "ixwfgcdi", "kkcxwnujvqynvav", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("yttlrcxiv", response.tags().get("bkut")); - Assertions.assertEquals("rhwv", response.properties().description()); + Assertions.assertEquals("dmuqohhi", response.properties().description()); + Assertions.assertEquals("ddrwjcljbrhlhpvz", response.tags().get("dbwen")); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsListMockTests.java index 4459e4f80e72..4ef3bb50fafd 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsListMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiBlocklistsListMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -22,7 +22,7 @@ public final class RaiBlocklistsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"etag\":\"swhddzydisnuep\",\"tags\":{\"ibz\":\"jlnldpxottdiiaoc\"},\"properties\":{\"description\":\"weebiphryv\"},\"id\":\"wqwoqsratjhdhzyb\",\"name\":\"pijhfrzgdkk\",\"type\":\"gv\"}]}"; + = "{\"value\":[{\"properties\":{\"description\":\"nmxgnm\"},\"etag\":\"zbuwvorbalkjnbk\",\"tags\":{\"gxiynecovagzk\":\"lltqstqkqs\"},\"id\":\"ubanlxunpq\",\"name\":\"ckqiawzlzk\",\"type\":\"aslgacizuxlrarwp\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,9 +32,9 @@ public void testList() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.raiBlocklists().list("upyvqyvliq", "ipsejbsvsia", com.azure.core.util.Context.NONE); + = manager.raiBlocklists().list("invagovjyhd", "xbrdvcehqwh", com.azure.core.util.Context.NONE); - Assertions.assertEquals("jlnldpxottdiiaoc", response.iterator().next().tags().get("ibz")); - Assertions.assertEquals("weebiphryv", response.iterator().next().properties().description()); + Assertions.assertEquals("nmxgnm", response.iterator().next().properties().description()); + Assertions.assertEquals("lltqstqkqs", response.iterator().next().tags().get("gxiynecovagzk")); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFilterInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFilterInnerTests.java index b917b3d179de..ab961dbe4456 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFilterInnerTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFilterInnerTests.java @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiContentFilterInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiContentFilterProperties; import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentSource; import org.junit.jupiter.api.Assertions; @@ -14,22 +13,10 @@ public final class RaiContentFilterInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RaiContentFilterInner model = BinaryData.fromString( - "{\"properties\":{\"name\":\"maqxzhemjyh\",\"isMultiLevelFilter\":false,\"source\":\"Completion\"},\"id\":\"t\",\"name\":\"kozzwculkb\",\"type\":\"wpfaj\"}") + "{\"properties\":{\"name\":\"vestmjl\",\"isMultiLevelFilter\":false,\"source\":\"PreToolCall\"},\"id\":\"zapeewchpx\",\"name\":\"ktwkuziyc\",\"type\":\"levufuztcktyhj\"}") .toObject(RaiContentFilterInner.class); - Assertions.assertEquals("maqxzhemjyh", model.properties().name()); + Assertions.assertEquals("vestmjl", model.properties().name()); Assertions.assertFalse(model.properties().isMultiLevelFilter()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, model.properties().source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RaiContentFilterInner model - = new RaiContentFilterInner().withProperties(new RaiContentFilterProperties().withName("maqxzhemjyh") - .withIsMultiLevelFilter(false) - .withSource(RaiPolicyContentSource.COMPLETION)); - model = BinaryData.fromObject(model).toObject(RaiContentFilterInner.class); - Assertions.assertEquals("maqxzhemjyh", model.properties().name()); - Assertions.assertFalse(model.properties().isMultiLevelFilter()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, model.properties().source()); + Assertions.assertEquals(RaiPolicyContentSource.PRE_TOOL_CALL, model.properties().source()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFilterListResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFilterListResultTests.java index b1659c754348..ec87c0f0e7ea 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFilterListResultTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFilterListResultTests.java @@ -1,40 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiContentFilterInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiContentFilterListResult; -import com.azure.resourcemanager.cognitiveservices.models.RaiContentFilterProperties; +import com.azure.resourcemanager.cognitiveservices.implementation.models.RaiContentFilterListResult; import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentSource; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class RaiContentFilterListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RaiContentFilterListResult model = BinaryData.fromString( - "{\"nextLink\":\"joxslhvnhla\",\"value\":[{\"properties\":{\"name\":\"kzjcjbtrgae\",\"isMultiLevelFilter\":false,\"source\":\"Prompt\"},\"id\":\"xjjs\",\"name\":\"oqbeitpkxzt\",\"type\":\"oobklftidgfcwq\"}]}") + "{\"nextLink\":\"rqzz\",\"value\":[{\"properties\":{\"name\":\"gl\",\"isMultiLevelFilter\":false,\"source\":\"PreToolCall\"},\"id\":\"vqeevtoep\",\"name\":\"yutnwytpzdmov\",\"type\":\"vf\"},{\"properties\":{\"name\":\"wzqa\",\"isMultiLevelFilter\":false,\"source\":\"PreRun\"},\"id\":\"riglaec\",\"name\":\"ndtic\",\"type\":\"kpvzmlq\"},{\"properties\":{\"name\":\"dgxobfircl\",\"isMultiLevelFilter\":false,\"source\":\"PreToolCall\"},\"id\":\"yzriykhy\",\"name\":\"wf\",\"type\":\"jlb\"}]}") .toObject(RaiContentFilterListResult.class); - Assertions.assertEquals("joxslhvnhla", model.nextLink()); - Assertions.assertEquals("kzjcjbtrgae", model.value().get(0).properties().name()); + Assertions.assertEquals("rqzz", model.nextLink()); + Assertions.assertEquals("gl", model.value().get(0).properties().name()); Assertions.assertFalse(model.value().get(0).properties().isMultiLevelFilter()); - Assertions.assertEquals(RaiPolicyContentSource.PROMPT, model.value().get(0).properties().source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RaiContentFilterListResult model = new RaiContentFilterListResult().withNextLink("joxslhvnhla") - .withValue(Arrays.asList( - new RaiContentFilterInner().withProperties(new RaiContentFilterProperties().withName("kzjcjbtrgae") - .withIsMultiLevelFilter(false) - .withSource(RaiPolicyContentSource.PROMPT)))); - model = BinaryData.fromObject(model).toObject(RaiContentFilterListResult.class); - Assertions.assertEquals("joxslhvnhla", model.nextLink()); - Assertions.assertEquals("kzjcjbtrgae", model.value().get(0).properties().name()); - Assertions.assertFalse(model.value().get(0).properties().isMultiLevelFilter()); - Assertions.assertEquals(RaiPolicyContentSource.PROMPT, model.value().get(0).properties().source()); + Assertions.assertEquals(RaiPolicyContentSource.PRE_TOOL_CALL, model.value().get(0).properties().source()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFilterPropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFilterPropertiesTests.java index 7069b2c49cb7..d76b99aa188f 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFilterPropertiesTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFilterPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,22 +12,11 @@ public final class RaiContentFilterPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - RaiContentFilterProperties model = BinaryData - .fromString("{\"name\":\"wltlwtjjguktalh\",\"isMultiLevelFilter\":false,\"source\":\"Completion\"}") - .toObject(RaiContentFilterProperties.class); - Assertions.assertEquals("wltlwtjjguktalh", model.name()); - Assertions.assertFalse(model.isMultiLevelFilter()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RaiContentFilterProperties model = new RaiContentFilterProperties().withName("wltlwtjjguktalh") - .withIsMultiLevelFilter(false) - .withSource(RaiPolicyContentSource.COMPLETION); - model = BinaryData.fromObject(model).toObject(RaiContentFilterProperties.class); - Assertions.assertEquals("wltlwtjjguktalh", model.name()); - Assertions.assertFalse(model.isMultiLevelFilter()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, model.source()); + RaiContentFilterProperties model + = BinaryData.fromString("{\"name\":\"edcg\",\"isMultiLevelFilter\":true,\"source\":\"PreRun\"}") + .toObject(RaiContentFilterProperties.class); + Assertions.assertEquals("edcg", model.name()); + Assertions.assertTrue(model.isMultiLevelFilter()); + Assertions.assertEquals(RaiPolicyContentSource.PRE_RUN, model.source()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFiltersGetWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFiltersGetWithResponseMockTests.java index 5cdb78bc41f1..17c7feebc91c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFiltersGetWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFiltersGetWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -22,7 +22,7 @@ public final class RaiContentFiltersGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"name\":\"jusuzgfjzc\",\"isMultiLevelFilter\":true,\"source\":\"Completion\"},\"id\":\"alahf\",\"name\":\"wcco\",\"type\":\"dxku\"}"; + = "{\"properties\":{\"name\":\"h\",\"isMultiLevelFilter\":true,\"source\":\"PreToolCall\"},\"id\":\"zwgwhgkg\",\"name\":\"o\",\"type\":\"uoorssatfybipufd\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -32,11 +32,11 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); RaiContentFilter response = manager.raiContentFilters() - .getWithResponse("lzaahzbhuroolk", "lirh", com.azure.core.util.Context.NONE) + .getWithResponse("htncwmhjobzrfp", "iz", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("jusuzgfjzc", response.properties().name()); + Assertions.assertEquals("h", response.properties().name()); Assertions.assertTrue(response.properties().isMultiLevelFilter()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, response.properties().source()); + Assertions.assertEquals(RaiPolicyContentSource.PRE_TOOL_CALL, response.properties().source()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFiltersListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFiltersListMockTests.java index 8d339f49300a..70b9ceac5904 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFiltersListMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiContentFiltersListMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -23,7 +23,7 @@ public final class RaiContentFiltersListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"name\":\"jikffffgkuhznw\",\"isMultiLevelFilter\":false,\"source\":\"Completion\"},\"id\":\"kke\",\"name\":\"jkjigawgaz\",\"type\":\"xjqifhujjsbc\"}]}"; + = "{\"value\":[{\"properties\":{\"name\":\"yopbtsixhgvb\",\"isMultiLevelFilter\":false,\"source\":\"PostRun\"},\"id\":\"tgsqjayqmarxne\",\"name\":\"bpgb\",\"type\":\"hbjdqknhqnmotpu\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,10 +33,10 @@ public void testList() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.raiContentFilters().list("wkppnwyytfvp", com.azure.core.util.Context.NONE); + = manager.raiContentFilters().list("xuqbdqnasttuxvz", com.azure.core.util.Context.NONE); - Assertions.assertEquals("jikffffgkuhznw", response.iterator().next().properties().name()); + Assertions.assertEquals("yopbtsixhgvb", response.iterator().next().properties().name()); Assertions.assertFalse(response.iterator().next().properties().isMultiLevelFilter()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, response.iterator().next().properties().source()); + Assertions.assertEquals(RaiPolicyContentSource.POST_RUN, response.iterator().next().properties().source()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiExternalSafetyProviderInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiExternalSafetyProviderInnerTests.java new file mode 100644 index 000000000000..73cf8e15902f --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiExternalSafetyProviderInnerTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiExternalSafetyProviderInner; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class RaiExternalSafetyProviderInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RaiExternalSafetyProviderInner model = BinaryData.fromString( + "{\"etag\":\"d\",\"tags\":{\"pyqy\":\"edbw\",\"cbq\":\"bxubmdna\",\"laqacigele\":\"remj\"},\"properties\":{\"providerId\":\"bvqvwzkjopwbeo\",\"providerName\":\"lkwzdqybxceakxcp\",\"mode\":\"oqfyiaseqch\",\"url\":\"ttzrazisgyki\",\"createdAt\":\"2021-11-29T08:15:22Z\",\"lastModifiedAt\":\"2021-03-01T19:42:11Z\"},\"id\":\"bwzohmnrxxbs\",\"name\":\"jklinh\",\"type\":\"dptysprqs\"}") + .toObject(RaiExternalSafetyProviderInner.class); + Assertions.assertEquals("bvqvwzkjopwbeo", model.properties().providerId()); + Assertions.assertEquals("lkwzdqybxceakxcp", model.properties().providerName()); + Assertions.assertEquals("oqfyiaseqch", model.properties().mode()); + Assertions.assertEquals("ttzrazisgyki", model.properties().url()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-29T08:15:22Z"), model.properties().createdAt()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-01T19:42:11Z"), model.properties().lastModifiedAt()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiExternalSafetyProviderPropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiExternalSafetyProviderPropertiesTests.java new file mode 100644 index 000000000000..41175d16384d --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiExternalSafetyProviderPropertiesTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.models.RaiExternalSafetyProviderProperties; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class RaiExternalSafetyProviderPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RaiExternalSafetyProviderProperties model = BinaryData.fromString( + "{\"providerId\":\"zxojpslsv\",\"providerName\":\"pli\",\"mode\":\"iqwoyxqvapcoh\",\"url\":\"ucqpqojxcxzrz\",\"createdAt\":\"2021-06-25T21:59:34Z\",\"lastModifiedAt\":\"2021-08-24T03:14:39Z\"}") + .toObject(RaiExternalSafetyProviderProperties.class); + Assertions.assertEquals("zxojpslsv", model.providerId()); + Assertions.assertEquals("pli", model.providerName()); + Assertions.assertEquals("iqwoyxqvapcoh", model.mode()); + Assertions.assertEquals("ucqpqojxcxzrz", model.url()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-25T21:59:34Z"), model.createdAt()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-24T03:14:39Z"), model.lastModifiedAt()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiMonitorConfigTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiMonitorConfigTests.java index e033c273322c..5aaf06a955b1 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiMonitorConfigTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiMonitorConfigTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,17 +12,18 @@ public final class RaiMonitorConfigTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RaiMonitorConfig model - = BinaryData.fromString("{\"adxStorageResourceId\":\"wtmutduq\",\"identityClientId\":\"ap\"}") + = BinaryData.fromString("{\"adxStorageResourceId\":\"mexgstxgcp\",\"identityClientId\":\"gmaajrm\"}") .toObject(RaiMonitorConfig.class); - Assertions.assertEquals("wtmutduq", model.adxStorageResourceId()); - Assertions.assertEquals("ap", model.identityClientId()); + Assertions.assertEquals("mexgstxgcp", model.adxStorageResourceId()); + Assertions.assertEquals("gmaajrm", model.identityClientId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - RaiMonitorConfig model = new RaiMonitorConfig().withAdxStorageResourceId("wtmutduq").withIdentityClientId("ap"); + RaiMonitorConfig model + = new RaiMonitorConfig().withAdxStorageResourceId("mexgstxgcp").withIdentityClientId("gmaajrm"); model = BinaryData.fromObject(model).toObject(RaiMonitorConfig.class); - Assertions.assertEquals("wtmutduq", model.adxStorageResourceId()); - Assertions.assertEquals("ap", model.identityClientId()); + Assertions.assertEquals("mexgstxgcp", model.adxStorageResourceId()); + Assertions.assertEquals("gmaajrm", model.identityClientId()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesCreateOrUpdateWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesCreateOrUpdateWithResponseMockTests.java index ffad39717817..a655f911aa4f 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesCreateOrUpdateWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesCreateOrUpdateWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -13,11 +13,13 @@ import com.azure.resourcemanager.cognitiveservices.models.ContentLevel; import com.azure.resourcemanager.cognitiveservices.models.CustomBlocklistConfig; import com.azure.resourcemanager.cognitiveservices.models.CustomTopicConfig; +import com.azure.resourcemanager.cognitiveservices.models.RaiActionType; import com.azure.resourcemanager.cognitiveservices.models.RaiPolicy; import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentFilter; import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentSource; import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyMode; import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyProperties; +import com.azure.resourcemanager.cognitiveservices.models.SafetyProviderConfig; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.Arrays; @@ -31,7 +33,7 @@ public final class RaiPoliciesCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"etag\":\"kb\",\"tags\":{\"vqcpdwjgquxw\":\"mgmqfmef\",\"dkdcdjhunhg\":\"ysla\"},\"properties\":{\"type\":\"SystemManaged\",\"mode\":\"Blocking\",\"basePolicyName\":\"rnquoxso\",\"contentFilters\":[{\"name\":\"imseobf\",\"enabled\":true,\"severityThreshold\":\"Medium\",\"blocking\":true,\"source\":\"Completion\"},{\"name\":\"zmmx\",\"enabled\":false,\"severityThreshold\":\"High\",\"blocking\":true,\"source\":\"Prompt\"}],\"customBlocklists\":[{\"source\":\"Prompt\",\"blocklistName\":\"bjvbzinzab\",\"blocking\":true},{\"source\":\"Prompt\",\"blocklistName\":\"jsvlpg\",\"blocking\":true}],\"customTopics\":[{\"source\":\"Completion\",\"topicName\":\"qidoyzltgi\",\"blocking\":true},{\"source\":\"Prompt\",\"topicName\":\"epiaeapfsergd\",\"blocking\":false}]},\"id\":\"nacyheqwb\",\"name\":\"qq\",\"type\":\"cjubkhjozfymcwm\"}"; + = "{\"properties\":{\"type\":\"SystemManaged\",\"mode\":\"Blocking\",\"basePolicyName\":\"od\",\"contentFilters\":[{\"name\":\"sxxb\",\"enabled\":false,\"severityThreshold\":\"Medium\",\"blocking\":true,\"source\":\"Prompt\",\"action\":\"None\"},{\"name\":\"goljtzxnmxs\",\"enabled\":false,\"severityThreshold\":\"High\",\"blocking\":false,\"source\":\"PreRun\",\"action\":\"ANNOTATING\"}],\"customBlocklists\":[{\"source\":\"PostToolCall\",\"blocklistName\":\"zyjfuc\",\"blocking\":false}],\"customTopics\":[{\"source\":\"PostToolCall\",\"topicName\":\"dk\",\"blocking\":false},{\"source\":\"PostRun\",\"topicName\":\"gmat\",\"blocking\":true}],\"safetyProviders\":[{\"source\":\"PreToolCall\",\"safetyProviderName\":\"aaktujkt\",\"blocking\":false},{\"source\":\"PreRun\",\"safetyProviderName\":\"fpqdow\",\"blocking\":false},{\"source\":\"PostRun\",\"safetyProviderName\":\"ytfvpctfji\",\"blocking\":false},{\"source\":\"Completion\",\"safetyProviderName\":\"kuhznwhvuldbk\",\"blocking\":false}]},\"etag\":\"kj\",\"tags\":{\"zmxjqif\":\"wg\",\"cmlzaahz\":\"ujjs\",\"oolkolirhhm\":\"hu\"},\"id\":\"usuzgfjzcvaaxo\",\"name\":\"alahf\",\"type\":\"wcco\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -41,52 +43,64 @@ public void testCreateOrUpdateWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); RaiPolicy response = manager.raiPolicies() - .define("lusnawmhhgzotfr") - .withExistingAccount("kmhmnulwempdc", "frhjulrsulwzp") - .withTags(mapOf("y", "hctxbxmolpcqyd", "rjeizik", "vskiczd", "ycqsxr", "qaboohxbms", "ewuyqa", "d")) - .withProperties(new RaiPolicyProperties().withMode(RaiPolicyMode.ASYNCHRONOUS_FILTER) - .withBasePolicyName("ejkbvhhdaurgho") - .withContentFilters(Arrays.asList( - new RaiPolicyContentFilter().withName("xb") - .withEnabled(false) - .withSeverityThreshold(ContentLevel.MEDIUM) - .withBlocking(false) - .withSource(RaiPolicyContentSource.COMPLETION), - new RaiPolicyContentFilter().withName("qxrkdknko") - .withEnabled(true) - .withSeverityThreshold(ContentLevel.MEDIUM) + .define("ftr") + .withExistingAccount("xcbccwkqmt", "apeqiscrpil") + .withTags(mapOf("why", "on", "lwivqt", "xym", "bfajcywhjqwmchq", "wlhlsycoybajasq", "mjzpwdlvwtiwsm", + "htfxcpupuki")) + .withProperties(new RaiPolicyProperties().withMode(RaiPolicyMode.DEFAULT) + .withBasePolicyName("huqimlda") + .withContentFilters(Arrays.asList(new RaiPolicyContentFilter().withName("lmuifmua") + .withEnabled(false) + .withSeverityThreshold(ContentLevel.HIGH) + .withBlocking(true) + .withSource(RaiPolicyContentSource.PRE_TOOL_CALL) + .withAction(RaiActionType.BLOCKING))) + .withCustomBlocklists(Arrays.asList( + new CustomBlocklistConfig().withBlocklistName("cz") + .withBlocking(true) + .withSource(RaiPolicyContentSource.POST_TOOL_CALL), + new CustomBlocklistConfig().withBlocklistName("gztlcgc") + .withBlocking(true) + .withSource(RaiPolicyContentSource.POST_TOOL_CALL), + new CustomBlocklistConfig().withBlocklistName("vmywjzebecuvlb") .withBlocking(false) - .withSource(RaiPolicyContentSource.COMPLETION), - new RaiPolicyContentFilter().withName("tzamicbig") - .withEnabled(false) - .withSeverityThreshold(ContentLevel.HIGH) + .withSource(RaiPolicyContentSource.POST_TOOL_CALL), + new CustomBlocklistConfig().withBlocklistName("jkxpylrwoxzgwpsy") + .withBlocking(true) + .withSource(RaiPolicyContentSource.PRE_RUN))) + .withCustomTopics(Arrays.asList( + new CustomTopicConfig().withTopicName("vrbkerdkdkgaw") + .withBlocking(true) + .withSource(RaiPolicyContentSource.PRE_RUN), + new CustomTopicConfig().withTopicName("dfkcef") .withBlocking(false) - .withSource(RaiPolicyContentSource.COMPLETION))) - .withCustomBlocklists(Arrays.asList(new CustomBlocklistConfig().withBlocklistName("ai") - .withBlocking(false) - .withSource(RaiPolicyContentSource.COMPLETION))) - .withCustomTopics(Arrays.asList(new CustomTopicConfig().withTopicName("jbedpfixlhupmomi") + .withSource(RaiPolicyContentSource.POST_TOOL_CALL))) + .withSafetyProviders(Arrays.asList(new SafetyProviderConfig().withSafetyProviderName("isf") .withBlocking(true) - .withSource(RaiPolicyContentSource.COMPLETION)))) + .withSource(RaiPolicyContentSource.POST_TOOL_CALL)))) .create(); - Assertions.assertEquals("mgmqfmef", response.tags().get("vqcpdwjgquxw")); Assertions.assertEquals(RaiPolicyMode.BLOCKING, response.properties().mode()); - Assertions.assertEquals("rnquoxso", response.properties().basePolicyName()); - Assertions.assertEquals("imseobf", response.properties().contentFilters().get(0).name()); - Assertions.assertTrue(response.properties().contentFilters().get(0).enabled()); + Assertions.assertEquals("od", response.properties().basePolicyName()); + Assertions.assertEquals("sxxb", response.properties().contentFilters().get(0).name()); + Assertions.assertFalse(response.properties().contentFilters().get(0).enabled()); Assertions.assertEquals(ContentLevel.MEDIUM, response.properties().contentFilters().get(0).severityThreshold()); Assertions.assertTrue(response.properties().contentFilters().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, - response.properties().contentFilters().get(0).source()); - Assertions.assertEquals("bjvbzinzab", response.properties().customBlocklists().get(0).blocklistName()); - Assertions.assertTrue(response.properties().customBlocklists().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.PROMPT, + Assertions.assertEquals(RaiPolicyContentSource.PROMPT, response.properties().contentFilters().get(0).source()); + Assertions.assertEquals(RaiActionType.NONE, response.properties().contentFilters().get(0).action()); + Assertions.assertEquals("zyjfuc", response.properties().customBlocklists().get(0).blocklistName()); + Assertions.assertFalse(response.properties().customBlocklists().get(0).blocking()); + Assertions.assertEquals(RaiPolicyContentSource.POST_TOOL_CALL, response.properties().customBlocklists().get(0).source()); - Assertions.assertEquals("qidoyzltgi", response.properties().customTopics().get(0).topicName()); - Assertions.assertTrue(response.properties().customTopics().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, + Assertions.assertEquals("dk", response.properties().customTopics().get(0).topicName()); + Assertions.assertFalse(response.properties().customTopics().get(0).blocking()); + Assertions.assertEquals(RaiPolicyContentSource.POST_TOOL_CALL, response.properties().customTopics().get(0).source()); + Assertions.assertEquals("aaktujkt", response.properties().safetyProviders().get(0).safetyProviderName()); + Assertions.assertFalse(response.properties().safetyProviders().get(0).blocking()); + Assertions.assertEquals(RaiPolicyContentSource.PRE_TOOL_CALL, + response.properties().safetyProviders().get(0).source()); + Assertions.assertEquals("wg", response.tags().get("zmxjqif")); } // Use "Map.of" if available diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesGetWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesGetWithResponseMockTests.java index 9913fcaa7463..6c8810a0e478 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesGetWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesGetWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -11,6 +11,7 @@ import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; import com.azure.resourcemanager.cognitiveservices.models.ContentLevel; +import com.azure.resourcemanager.cognitiveservices.models.RaiActionType; import com.azure.resourcemanager.cognitiveservices.models.RaiPolicy; import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentSource; import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyMode; @@ -24,7 +25,7 @@ public final class RaiPoliciesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"etag\":\"aydb\",\"tags\":{\"lcfn\":\"qy\"},\"properties\":{\"type\":\"UserManaged\",\"mode\":\"Asynchronous_filter\",\"basePolicyName\":\"lgwqkpm\",\"contentFilters\":[{\"name\":\"tauolawiubmom\",\"enabled\":true,\"severityThreshold\":\"Low\",\"blocking\":true,\"source\":\"Completion\"},{\"name\":\"lohewjjmajnkdflq\",\"enabled\":false,\"severityThreshold\":\"Medium\",\"blocking\":false,\"source\":\"Completion\"}],\"customBlocklists\":[{\"source\":\"Completion\",\"blocklistName\":\"jo\",\"blocking\":true},{\"source\":\"Completion\",\"blocklistName\":\"tryegpkh\",\"blocking\":true}],\"customTopics\":[{\"source\":\"Completion\",\"topicName\":\"wkbfokxkhupzer\",\"blocking\":false},{\"source\":\"Prompt\",\"topicName\":\"cdr\",\"blocking\":true},{\"source\":\"Completion\",\"topicName\":\"ftzgy\",\"blocking\":false}]},\"id\":\"lugekdfqnhtt\",\"name\":\"do\",\"type\":\"rczfjjnnuxxr\"}"; + = "{\"properties\":{\"type\":\"UserManaged\",\"mode\":\"Deferred\",\"basePolicyName\":\"ocmbezacf\",\"contentFilters\":[{\"name\":\"azwyqejgaaokctgk\",\"enabled\":true,\"severityThreshold\":\"High\",\"blocking\":false,\"source\":\"PreRun\",\"action\":\"HITL\"}],\"customBlocklists\":[{\"source\":\"Completion\",\"blocklistName\":\"yf\",\"blocking\":true},{\"source\":\"PostToolCall\",\"blocklistName\":\"cqvhoejgoiutgwrm\",\"blocking\":true},{\"source\":\"Completion\",\"blocklistName\":\"azyntacihncogm\",\"blocking\":true}],\"customTopics\":[{\"source\":\"PreRun\",\"topicName\":\"v\",\"blocking\":false},{\"source\":\"PreRun\",\"topicName\":\"aqgrv\",\"blocking\":false},{\"source\":\"PreToolCall\",\"topicName\":\"updtsdfjyies\",\"blocking\":true},{\"source\":\"PreToolCall\",\"topicName\":\"uoutmpy\",\"blocking\":false}],\"safetyProviders\":[{\"source\":\"PostRun\",\"safetyProviderName\":\"bgbwwz\",\"blocking\":true},{\"source\":\"PostToolCall\",\"safetyProviderName\":\"nncfmaciqgjjrlhi\",\"blocking\":true},{\"source\":\"PreRun\",\"safetyProviderName\":\"tbouguxtnd\",\"blocking\":true},{\"source\":\"Completion\",\"safetyProviderName\":\"bas\",\"blocking\":false}]},\"etag\":\"pdlndbeaqbkixvv\",\"tags\":{\"fjmsp\":\"npbbfqv\",\"jmphfkyezolgj\":\"gzfeuzj\",\"uydoccnx\":\"mi\",\"batecaat\":\"hanzbuiad\"},\"id\":\"o\",\"name\":\"zn\",\"type\":\"ucbdaom\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -34,25 +35,28 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); RaiPolicy response = manager.raiPolicies() - .getWithResponse("knsjulugd", "bnhrxlelfjhkeiz", "pihtdmiwjekpt", com.azure.core.util.Context.NONE) + .getWithResponse("hezsvkolrupjovm", "zsayebrazw", "lpzbtzuykykipf", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("qy", response.tags().get("lcfn")); - Assertions.assertEquals(RaiPolicyMode.ASYNCHRONOUS_FILTER, response.properties().mode()); - Assertions.assertEquals("lgwqkpm", response.properties().basePolicyName()); - Assertions.assertEquals("tauolawiubmom", response.properties().contentFilters().get(0).name()); + Assertions.assertEquals(RaiPolicyMode.DEFERRED, response.properties().mode()); + Assertions.assertEquals("ocmbezacf", response.properties().basePolicyName()); + Assertions.assertEquals("azwyqejgaaokctgk", response.properties().contentFilters().get(0).name()); Assertions.assertTrue(response.properties().contentFilters().get(0).enabled()); - Assertions.assertEquals(ContentLevel.LOW, response.properties().contentFilters().get(0).severityThreshold()); - Assertions.assertTrue(response.properties().contentFilters().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, - response.properties().contentFilters().get(0).source()); - Assertions.assertEquals("jo", response.properties().customBlocklists().get(0).blocklistName()); + Assertions.assertEquals(ContentLevel.HIGH, response.properties().contentFilters().get(0).severityThreshold()); + Assertions.assertFalse(response.properties().contentFilters().get(0).blocking()); + Assertions.assertEquals(RaiPolicyContentSource.PRE_RUN, response.properties().contentFilters().get(0).source()); + Assertions.assertEquals(RaiActionType.HITL, response.properties().contentFilters().get(0).action()); + Assertions.assertEquals("yf", response.properties().customBlocklists().get(0).blocklistName()); Assertions.assertTrue(response.properties().customBlocklists().get(0).blocking()); Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, response.properties().customBlocklists().get(0).source()); - Assertions.assertEquals("wkbfokxkhupzer", response.properties().customTopics().get(0).topicName()); + Assertions.assertEquals("v", response.properties().customTopics().get(0).topicName()); Assertions.assertFalse(response.properties().customTopics().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, - response.properties().customTopics().get(0).source()); + Assertions.assertEquals(RaiPolicyContentSource.PRE_RUN, response.properties().customTopics().get(0).source()); + Assertions.assertEquals("bgbwwz", response.properties().safetyProviders().get(0).safetyProviderName()); + Assertions.assertTrue(response.properties().safetyProviders().get(0).blocking()); + Assertions.assertEquals(RaiPolicyContentSource.POST_RUN, + response.properties().safetyProviders().get(0).source()); + Assertions.assertEquals("npbbfqv", response.tags().get("fjmsp")); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesListMockTests.java index c622db8ebb8b..c5a6e65f3a11 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesListMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPoliciesListMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,6 +12,7 @@ import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; import com.azure.resourcemanager.cognitiveservices.models.ContentLevel; +import com.azure.resourcemanager.cognitiveservices.models.RaiActionType; import com.azure.resourcemanager.cognitiveservices.models.RaiPolicy; import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentSource; import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyMode; @@ -25,7 +26,7 @@ public final class RaiPoliciesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"etag\":\"mghg\",\"tags\":{\"kfmkhcqtwmlmhjn\":\"txlujkhnjcmr\"},\"properties\":{\"type\":\"UserManaged\",\"mode\":\"Default\",\"basePolicyName\":\"e\",\"contentFilters\":[{\"name\":\"gpokddxejhhkvgu\",\"enabled\":false,\"severityThreshold\":\"High\",\"blocking\":false,\"source\":\"Prompt\"}],\"customBlocklists\":[{\"source\":\"Prompt\",\"blocklistName\":\"pgb\",\"blocking\":true},{\"source\":\"Completion\",\"blocklistName\":\"kwvdxa\",\"blocking\":true},{\"source\":\"Completion\",\"blocklistName\":\"yrlji\",\"blocking\":false}],\"customTopics\":[{\"source\":\"Completion\",\"topicName\":\"qlpbcjtrpzuyu\",\"blocking\":true},{\"source\":\"Completion\",\"topicName\":\"hsqe\",\"blocking\":false}]},\"id\":\"qelwgdhuruzytza\",\"name\":\"ogatmoljiy\",\"type\":\"mpinmzvfkneerzzt\"}]}"; + = "{\"value\":[{\"properties\":{\"type\":\"SystemManaged\",\"mode\":\"Blocking\",\"basePolicyName\":\"ynkgfcfd\",\"contentFilters\":[{\"name\":\"i\",\"enabled\":true,\"severityThreshold\":\"High\",\"blocking\":true,\"source\":\"PreToolCall\",\"action\":\"BLOCKING\"},{\"name\":\"qbyokvjgbzsxebr\",\"enabled\":true,\"severityThreshold\":\"Medium\",\"blocking\":true,\"source\":\"PreRun\",\"action\":\"None\"},{\"name\":\"uoard\",\"enabled\":true,\"severityThreshold\":\"High\",\"blocking\":true,\"source\":\"Completion\",\"action\":\"BLOCKING\"},{\"name\":\"nrholhujb\",\"enabled\":true,\"severityThreshold\":\"Low\",\"blocking\":true,\"source\":\"PreToolCall\",\"action\":\"BLOCKING\"}],\"customBlocklists\":[{\"source\":\"Completion\",\"blocklistName\":\"xslwhd\",\"blocking\":true},{\"source\":\"Completion\",\"blocklistName\":\"bzjhfvhuwzb\",\"blocking\":true}],\"customTopics\":[{\"source\":\"Prompt\",\"topicName\":\"otjecohmxvvl\",\"blocking\":true},{\"source\":\"Prompt\",\"topicName\":\"bxwie\",\"blocking\":false}],\"safetyProviders\":[{\"source\":\"PostRun\",\"safetyProviderName\":\"ltfokyksyim\",\"blocking\":true},{\"source\":\"Prompt\",\"safetyProviderName\":\"kcxzz\",\"blocking\":false},{\"source\":\"PreRun\",\"safetyProviderName\":\"rsejegprkj\",\"blocking\":false}]},\"etag\":\"jmwvvbtuqkxxi\",\"tags\":{\"tjgxieqfky\":\"xqldek\"},\"id\":\"iwvjaqupbyyn\",\"name\":\"skpajbmg\",\"type\":\"umexmj\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -35,28 +36,34 @@ public void testList() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.raiPolicies().list("qhtfpwpqbye", "uwyqwdq", com.azure.core.util.Context.NONE); + = manager.raiPolicies().list("wiinjdllw", "tlepowavvqxua", com.azure.core.util.Context.NONE); - Assertions.assertEquals("txlujkhnjcmr", response.iterator().next().tags().get("kfmkhcqtwmlmhjn")); - Assertions.assertEquals(RaiPolicyMode.DEFAULT, response.iterator().next().properties().mode()); - Assertions.assertEquals("e", response.iterator().next().properties().basePolicyName()); - Assertions.assertEquals("gpokddxejhhkvgu", - response.iterator().next().properties().contentFilters().get(0).name()); - Assertions.assertFalse(response.iterator().next().properties().contentFilters().get(0).enabled()); + Assertions.assertEquals(RaiPolicyMode.BLOCKING, response.iterator().next().properties().mode()); + Assertions.assertEquals("ynkgfcfd", response.iterator().next().properties().basePolicyName()); + Assertions.assertEquals("i", response.iterator().next().properties().contentFilters().get(0).name()); + Assertions.assertTrue(response.iterator().next().properties().contentFilters().get(0).enabled()); Assertions.assertEquals(ContentLevel.HIGH, response.iterator().next().properties().contentFilters().get(0).severityThreshold()); - Assertions.assertFalse(response.iterator().next().properties().contentFilters().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.PROMPT, + Assertions.assertTrue(response.iterator().next().properties().contentFilters().get(0).blocking()); + Assertions.assertEquals(RaiPolicyContentSource.PRE_TOOL_CALL, response.iterator().next().properties().contentFilters().get(0).source()); - Assertions.assertEquals("pgb", + Assertions.assertEquals(RaiActionType.BLOCKING, + response.iterator().next().properties().contentFilters().get(0).action()); + Assertions.assertEquals("xslwhd", response.iterator().next().properties().customBlocklists().get(0).blocklistName()); Assertions.assertTrue(response.iterator().next().properties().customBlocklists().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.PROMPT, + Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, response.iterator().next().properties().customBlocklists().get(0).source()); - Assertions.assertEquals("qlpbcjtrpzuyu", + Assertions.assertEquals("otjecohmxvvl", response.iterator().next().properties().customTopics().get(0).topicName()); Assertions.assertTrue(response.iterator().next().properties().customTopics().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, + Assertions.assertEquals(RaiPolicyContentSource.PROMPT, response.iterator().next().properties().customTopics().get(0).source()); + Assertions.assertEquals("ltfokyksyim", + response.iterator().next().properties().safetyProviders().get(0).safetyProviderName()); + Assertions.assertTrue(response.iterator().next().properties().safetyProviders().get(0).blocking()); + Assertions.assertEquals(RaiPolicyContentSource.POST_RUN, + response.iterator().next().properties().safetyProviders().get(0).source()); + Assertions.assertEquals("xqldek", response.iterator().next().tags().get("tjgxieqfky")); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPolicyContentFilterTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPolicyContentFilterTests.java index 08a617a450c0..ccbbaf7e23c1 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPolicyContentFilterTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPolicyContentFilterTests.java @@ -1,11 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.cognitiveservices.models.ContentLevel; +import com.azure.resourcemanager.cognitiveservices.models.RaiActionType; import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentFilter; import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentSource; import org.junit.jupiter.api.Assertions; @@ -14,27 +15,30 @@ public final class RaiPolicyContentFilterTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RaiPolicyContentFilter model = BinaryData.fromString( - "{\"name\":\"er\",\"enabled\":true,\"severityThreshold\":\"Medium\",\"blocking\":false,\"source\":\"Prompt\"}") + "{\"name\":\"jhwuaanozjos\",\"enabled\":false,\"severityThreshold\":\"Medium\",\"blocking\":false,\"source\":\"PostRun\",\"action\":\"None\"}") .toObject(RaiPolicyContentFilter.class); - Assertions.assertEquals("er", model.name()); - Assertions.assertTrue(model.enabled()); + Assertions.assertEquals("jhwuaanozjos", model.name()); + Assertions.assertFalse(model.enabled()); Assertions.assertEquals(ContentLevel.MEDIUM, model.severityThreshold()); Assertions.assertFalse(model.blocking()); - Assertions.assertEquals(RaiPolicyContentSource.PROMPT, model.source()); + Assertions.assertEquals(RaiPolicyContentSource.POST_RUN, model.source()); + Assertions.assertEquals(RaiActionType.NONE, model.action()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - RaiPolicyContentFilter model = new RaiPolicyContentFilter().withName("er") - .withEnabled(true) + RaiPolicyContentFilter model = new RaiPolicyContentFilter().withName("jhwuaanozjos") + .withEnabled(false) .withSeverityThreshold(ContentLevel.MEDIUM) .withBlocking(false) - .withSource(RaiPolicyContentSource.PROMPT); + .withSource(RaiPolicyContentSource.POST_RUN) + .withAction(RaiActionType.NONE); model = BinaryData.fromObject(model).toObject(RaiPolicyContentFilter.class); - Assertions.assertEquals("er", model.name()); - Assertions.assertTrue(model.enabled()); + Assertions.assertEquals("jhwuaanozjos", model.name()); + Assertions.assertFalse(model.enabled()); Assertions.assertEquals(ContentLevel.MEDIUM, model.severityThreshold()); Assertions.assertFalse(model.blocking()); - Assertions.assertEquals(RaiPolicyContentSource.PROMPT, model.source()); + Assertions.assertEquals(RaiPolicyContentSource.POST_RUN, model.source()); + Assertions.assertEquals(RaiActionType.NONE, model.action()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPolicyInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPolicyInnerTests.java index 59f3a1afb269..0157f25bb087 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPolicyInnerTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPolicyInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -9,10 +9,12 @@ import com.azure.resourcemanager.cognitiveservices.models.ContentLevel; import com.azure.resourcemanager.cognitiveservices.models.CustomBlocklistConfig; import com.azure.resourcemanager.cognitiveservices.models.CustomTopicConfig; +import com.azure.resourcemanager.cognitiveservices.models.RaiActionType; import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentFilter; import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentSource; import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyMode; import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyProperties; +import com.azure.resourcemanager.cognitiveservices.models.SafetyProviderConfig; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -22,55 +24,110 @@ public final class RaiPolicyInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RaiPolicyInner model = BinaryData.fromString( - "{\"etag\":\"q\",\"tags\":{\"rxcpjuisavo\":\"n\",\"ajlkatnw\":\"qdzfvazivjlfrqtt\"},\"properties\":{\"type\":\"SystemManaged\",\"mode\":\"Default\",\"basePolicyName\":\"kqqfk\",\"contentFilters\":[{\"name\":\"xkdmligo\",\"enabled\":false,\"severityThreshold\":\"Medium\",\"blocking\":true,\"source\":\"Completion\"}],\"customBlocklists\":[{\"source\":\"Prompt\",\"blocklistName\":\"u\",\"blocking\":false}],\"customTopics\":[{\"source\":\"Prompt\",\"topicName\":\"te\",\"blocking\":true}]},\"id\":\"hjxa\",\"name\":\"vvjgslor\",\"type\":\"il\"}") + "{\"properties\":{\"type\":\"SystemManaged\",\"mode\":\"Asynchronous_filter\",\"basePolicyName\":\"iftohqkvpu\",\"contentFilters\":[{\"name\":\"plsaknynfsynljph\",\"enabled\":true,\"severityThreshold\":\"High\",\"blocking\":true,\"source\":\"PreToolCall\",\"action\":\"RETRY\"},{\"name\":\"orzihle\",\"enabled\":true,\"severityThreshold\":\"Medium\",\"blocking\":true,\"source\":\"PreRun\",\"action\":\"ANNOTATING\"}],\"customBlocklists\":[{\"source\":\"Completion\",\"blocklistName\":\"c\",\"blocking\":true},{\"source\":\"PreToolCall\",\"blocklistName\":\"qioxi\",\"blocking\":false},{\"source\":\"PreToolCall\",\"blocklistName\":\"ynkedyatrwyhqmib\",\"blocking\":false},{\"source\":\"PreToolCall\",\"blocklistName\":\"smypyynpc\",\"blocking\":true}],\"customTopics\":[{\"source\":\"PostToolCall\",\"topicName\":\"wznm\",\"blocking\":true},{\"source\":\"PreRun\",\"topicName\":\"orgjhxbldt\",\"blocking\":false},{\"source\":\"Completion\",\"topicName\":\"dmtnc\",\"blocking\":false}],\"safetyProviders\":[{\"source\":\"Completion\",\"safetyProviderName\":\"d\",\"blocking\":false},{\"source\":\"Prompt\",\"safetyProviderName\":\"cogjltdtbn\",\"blocking\":true},{\"source\":\"PostToolCall\",\"safetyProviderName\":\"crkvcikhnv\",\"blocking\":false},{\"source\":\"PreRun\",\"safetyProviderName\":\"qqu\",\"blocking\":false}]},\"etag\":\"ywggx\",\"tags\":{\"melwuipiccjz\":\"la\"},\"id\":\"ivgvvcna\",\"name\":\"rhyrnxxmueed\",\"type\":\"drd\"}") .toObject(RaiPolicyInner.class); - Assertions.assertEquals("n", model.tags().get("rxcpjuisavo")); - Assertions.assertEquals(RaiPolicyMode.DEFAULT, model.properties().mode()); - Assertions.assertEquals("kqqfk", model.properties().basePolicyName()); - Assertions.assertEquals("xkdmligo", model.properties().contentFilters().get(0).name()); - Assertions.assertFalse(model.properties().contentFilters().get(0).enabled()); - Assertions.assertEquals(ContentLevel.MEDIUM, model.properties().contentFilters().get(0).severityThreshold()); + Assertions.assertEquals(RaiPolicyMode.ASYNCHRONOUS_FILTER, model.properties().mode()); + Assertions.assertEquals("iftohqkvpu", model.properties().basePolicyName()); + Assertions.assertEquals("plsaknynfsynljph", model.properties().contentFilters().get(0).name()); + Assertions.assertTrue(model.properties().contentFilters().get(0).enabled()); + Assertions.assertEquals(ContentLevel.HIGH, model.properties().contentFilters().get(0).severityThreshold()); Assertions.assertTrue(model.properties().contentFilters().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, model.properties().contentFilters().get(0).source()); - Assertions.assertEquals("u", model.properties().customBlocklists().get(0).blocklistName()); - Assertions.assertFalse(model.properties().customBlocklists().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.PROMPT, model.properties().customBlocklists().get(0).source()); - Assertions.assertEquals("te", model.properties().customTopics().get(0).topicName()); + Assertions.assertEquals(RaiPolicyContentSource.PRE_TOOL_CALL, + model.properties().contentFilters().get(0).source()); + Assertions.assertEquals(RaiActionType.RETRY, model.properties().contentFilters().get(0).action()); + Assertions.assertEquals("c", model.properties().customBlocklists().get(0).blocklistName()); + Assertions.assertTrue(model.properties().customBlocklists().get(0).blocking()); + Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, + model.properties().customBlocklists().get(0).source()); + Assertions.assertEquals("wznm", model.properties().customTopics().get(0).topicName()); Assertions.assertTrue(model.properties().customTopics().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.PROMPT, model.properties().customTopics().get(0).source()); + Assertions.assertEquals(RaiPolicyContentSource.POST_TOOL_CALL, + model.properties().customTopics().get(0).source()); + Assertions.assertEquals("d", model.properties().safetyProviders().get(0).safetyProviderName()); + Assertions.assertFalse(model.properties().safetyProviders().get(0).blocking()); + Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, + model.properties().safetyProviders().get(0).source()); + Assertions.assertEquals("la", model.tags().get("melwuipiccjz")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - RaiPolicyInner model = new RaiPolicyInner().withTags(mapOf("rxcpjuisavo", "n", "ajlkatnw", "qdzfvazivjlfrqtt")) - .withProperties(new RaiPolicyProperties().withMode(RaiPolicyMode.DEFAULT) - .withBasePolicyName("kqqfk") - .withContentFilters(Arrays.asList(new RaiPolicyContentFilter().withName("xkdmligo") - .withEnabled(false) - .withSeverityThreshold(ContentLevel.MEDIUM) - .withBlocking(true) - .withSource(RaiPolicyContentSource.COMPLETION))) - .withCustomBlocklists(Arrays.asList(new CustomBlocklistConfig().withBlocklistName("u") - .withBlocking(false) - .withSource(RaiPolicyContentSource.PROMPT))) - .withCustomTopics(Arrays.asList(new CustomTopicConfig().withTopicName("te") - .withBlocking(true) - .withSource(RaiPolicyContentSource.PROMPT)))); + RaiPolicyInner model + = new RaiPolicyInner().withProperties(new RaiPolicyProperties().withMode(RaiPolicyMode.ASYNCHRONOUS_FILTER) + .withBasePolicyName("iftohqkvpu") + .withContentFilters(Arrays.asList( + new RaiPolicyContentFilter().withName("plsaknynfsynljph") + .withEnabled(true) + .withSeverityThreshold(ContentLevel.HIGH) + .withBlocking(true) + .withSource(RaiPolicyContentSource.PRE_TOOL_CALL) + .withAction(RaiActionType.RETRY), + new RaiPolicyContentFilter().withName("orzihle") + .withEnabled(true) + .withSeverityThreshold(ContentLevel.MEDIUM) + .withBlocking(true) + .withSource(RaiPolicyContentSource.PRE_RUN) + .withAction(RaiActionType.ANNOTATING))) + .withCustomBlocklists(Arrays.asList( + new CustomBlocklistConfig().withBlocklistName("c") + .withBlocking(true) + .withSource(RaiPolicyContentSource.COMPLETION), + new CustomBlocklistConfig().withBlocklistName("qioxi") + .withBlocking(false) + .withSource(RaiPolicyContentSource.PRE_TOOL_CALL), + new CustomBlocklistConfig().withBlocklistName("ynkedyatrwyhqmib") + .withBlocking(false) + .withSource(RaiPolicyContentSource.PRE_TOOL_CALL), + new CustomBlocklistConfig().withBlocklistName("smypyynpc") + .withBlocking(true) + .withSource(RaiPolicyContentSource.PRE_TOOL_CALL))) + .withCustomTopics(Arrays.asList( + new CustomTopicConfig().withTopicName("wznm") + .withBlocking(true) + .withSource(RaiPolicyContentSource.POST_TOOL_CALL), + new CustomTopicConfig().withTopicName("orgjhxbldt") + .withBlocking(false) + .withSource(RaiPolicyContentSource.PRE_RUN), + new CustomTopicConfig().withTopicName("dmtnc") + .withBlocking(false) + .withSource(RaiPolicyContentSource.COMPLETION))) + .withSafetyProviders(Arrays.asList( + new SafetyProviderConfig().withSafetyProviderName("d") + .withBlocking(false) + .withSource(RaiPolicyContentSource.COMPLETION), + new SafetyProviderConfig().withSafetyProviderName("cogjltdtbn") + .withBlocking(true) + .withSource(RaiPolicyContentSource.PROMPT), + new SafetyProviderConfig().withSafetyProviderName("crkvcikhnv") + .withBlocking(false) + .withSource(RaiPolicyContentSource.POST_TOOL_CALL), + new SafetyProviderConfig().withSafetyProviderName("qqu") + .withBlocking(false) + .withSource(RaiPolicyContentSource.PRE_RUN)))) + .withTags(mapOf("melwuipiccjz", "la")); model = BinaryData.fromObject(model).toObject(RaiPolicyInner.class); - Assertions.assertEquals("n", model.tags().get("rxcpjuisavo")); - Assertions.assertEquals(RaiPolicyMode.DEFAULT, model.properties().mode()); - Assertions.assertEquals("kqqfk", model.properties().basePolicyName()); - Assertions.assertEquals("xkdmligo", model.properties().contentFilters().get(0).name()); - Assertions.assertFalse(model.properties().contentFilters().get(0).enabled()); - Assertions.assertEquals(ContentLevel.MEDIUM, model.properties().contentFilters().get(0).severityThreshold()); + Assertions.assertEquals(RaiPolicyMode.ASYNCHRONOUS_FILTER, model.properties().mode()); + Assertions.assertEquals("iftohqkvpu", model.properties().basePolicyName()); + Assertions.assertEquals("plsaknynfsynljph", model.properties().contentFilters().get(0).name()); + Assertions.assertTrue(model.properties().contentFilters().get(0).enabled()); + Assertions.assertEquals(ContentLevel.HIGH, model.properties().contentFilters().get(0).severityThreshold()); Assertions.assertTrue(model.properties().contentFilters().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, model.properties().contentFilters().get(0).source()); - Assertions.assertEquals("u", model.properties().customBlocklists().get(0).blocklistName()); - Assertions.assertFalse(model.properties().customBlocklists().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.PROMPT, model.properties().customBlocklists().get(0).source()); - Assertions.assertEquals("te", model.properties().customTopics().get(0).topicName()); + Assertions.assertEquals(RaiPolicyContentSource.PRE_TOOL_CALL, + model.properties().contentFilters().get(0).source()); + Assertions.assertEquals(RaiActionType.RETRY, model.properties().contentFilters().get(0).action()); + Assertions.assertEquals("c", model.properties().customBlocklists().get(0).blocklistName()); + Assertions.assertTrue(model.properties().customBlocklists().get(0).blocking()); + Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, + model.properties().customBlocklists().get(0).source()); + Assertions.assertEquals("wznm", model.properties().customTopics().get(0).topicName()); Assertions.assertTrue(model.properties().customTopics().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.PROMPT, model.properties().customTopics().get(0).source()); + Assertions.assertEquals(RaiPolicyContentSource.POST_TOOL_CALL, + model.properties().customTopics().get(0).source()); + Assertions.assertEquals("d", model.properties().safetyProviders().get(0).safetyProviderName()); + Assertions.assertFalse(model.properties().safetyProviders().get(0).blocking()); + Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, + model.properties().safetyProviders().get(0).source()); + Assertions.assertEquals("la", model.tags().get("melwuipiccjz")); } // Use "Map.of" if available diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPolicyListResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPolicyListResultTests.java index a7acfaab610d..9a5d984003c5 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPolicyListResultTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPolicyListResultTests.java @@ -1,203 +1,49 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiPolicyInner; +import com.azure.resourcemanager.cognitiveservices.implementation.models.RaiPolicyListResult; import com.azure.resourcemanager.cognitiveservices.models.ContentLevel; -import com.azure.resourcemanager.cognitiveservices.models.CustomBlocklistConfig; -import com.azure.resourcemanager.cognitiveservices.models.CustomTopicConfig; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentFilter; +import com.azure.resourcemanager.cognitiveservices.models.RaiActionType; import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentSource; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyListResult; import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyMode; -import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; import org.junit.jupiter.api.Assertions; public final class RaiPolicyListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RaiPolicyListResult model = BinaryData.fromString( - "{\"nextLink\":\"czu\",\"value\":[{\"etag\":\"wcw\",\"tags\":{\"vk\":\"oknssxmojmsvpkjp\",\"jyxgtczh\":\"cfzq\",\"hmkxmaehvbb\":\"ydbsd\"},\"properties\":{\"type\":\"UserManaged\",\"mode\":\"Blocking\",\"basePolicyName\":\"fnhtbaxkgxyw\",\"contentFilters\":[{\"name\":\"yklyhpluodpvruud\",\"enabled\":false,\"severityThreshold\":\"Medium\",\"blocking\":true,\"source\":\"Prompt\"},{\"name\":\"gktstvdxeclzedq\",\"enabled\":false,\"severityThreshold\":\"Medium\",\"blocking\":false,\"source\":\"Completion\"}],\"customBlocklists\":[{\"source\":\"Prompt\",\"blocklistName\":\"lwwqfbumlkxtrqj\",\"blocking\":true},{\"source\":\"Prompt\",\"blocklistName\":\"txhwgfws\",\"blocking\":false},{\"source\":\"Completion\",\"blocklistName\":\"ezbrhubskh\",\"blocking\":false}],\"customTopics\":[{\"source\":\"Completion\",\"topicName\":\"kqfqjbvl\",\"blocking\":true},{\"source\":\"Prompt\",\"topicName\":\"uiqtqzfavy\",\"blocking\":false}]},\"id\":\"ybar\",\"name\":\"euayjkqabqgzsles\",\"type\":\"cbhernntiewdj\"},{\"etag\":\"bquwrbehw\",\"tags\":{\"mvvhmxtdrjfuta\":\"hbuffkmrq\"},\"properties\":{\"type\":\"UserManaged\",\"mode\":\"Deferred\",\"basePolicyName\":\"wzcjznmwcpmgua\",\"contentFilters\":[{\"name\":\"ufactk\",\"enabled\":false,\"severityThreshold\":\"High\",\"blocking\":true,\"source\":\"Completion\"},{\"name\":\"uxxpshne\",\"enabled\":false,\"severityThreshold\":\"Low\",\"blocking\":true,\"source\":\"Prompt\"},{\"name\":\"bkwdlenrds\",\"enabled\":true,\"severityThreshold\":\"High\",\"blocking\":true,\"source\":\"Completion\"},{\"name\":\"o\",\"enabled\":true,\"severityThreshold\":\"Low\",\"blocking\":false,\"source\":\"Completion\"}],\"customBlocklists\":[{\"source\":\"Completion\",\"blocklistName\":\"vwpklvxwmygdxp\",\"blocking\":false}],\"customTopics\":[{\"source\":\"Prompt\",\"topicName\":\"epn\",\"blocking\":true},{\"source\":\"Prompt\",\"topicName\":\"gibbdaxc\",\"blocking\":true},{\"source\":\"Prompt\",\"topicName\":\"uors\",\"blocking\":false},{\"source\":\"Prompt\",\"topicName\":\"qplhlvnu\",\"blocking\":false}]},\"id\":\"lrphwzsoldw\",\"name\":\"yuqdu\",\"type\":\"vmnnrw\"},{\"etag\":\"i\",\"tags\":{\"v\":\"talywjhhgdnhxms\",\"ox\":\"omi\",\"euzaof\":\"gdufiqnd\",\"cubiipuipw\":\"chvcyyysfgdo\"},\"properties\":{\"type\":\"UserManaged\",\"mode\":\"Deferred\",\"basePolicyName\":\"jeknizshq\",\"contentFilters\":[{\"name\":\"pevf\",\"enabled\":false,\"severityThreshold\":\"Low\",\"blocking\":true,\"source\":\"Completion\"},{\"name\":\"wdxsm\",\"enabled\":false,\"severityThreshold\":\"Low\",\"blocking\":true,\"source\":\"Prompt\"}],\"customBlocklists\":[{\"source\":\"Prompt\",\"blocklistName\":\"szqujizdvoq\",\"blocking\":true},{\"source\":\"Prompt\",\"blocklistName\":\"wb\",\"blocking\":false},{\"source\":\"Prompt\",\"blocklistName\":\"utp\",\"blocking\":false},{\"source\":\"Prompt\",\"blocklistName\":\"ismsksbpimlqolj\",\"blocking\":false}],\"customTopics\":[{\"source\":\"Prompt\",\"topicName\":\"sffgcvizqzd\",\"blocking\":false},{\"source\":\"Completion\",\"topicName\":\"oupfgfb\",\"blocking\":false},{\"source\":\"Completion\",\"topicName\":\"hgkfmin\",\"blocking\":true},{\"source\":\"Completion\",\"topicName\":\"ttsttktlahbqact\",\"blocking\":true}]},\"id\":\"ukxit\",\"name\":\"m\",\"type\":\"tg\"}]}") + "{\"nextLink\":\"jsjqbjhhyx\",\"value\":[{\"properties\":{\"type\":\"UserManaged\",\"mode\":\"Deferred\",\"basePolicyName\":\"hp\",\"contentFilters\":[{\"name\":\"ymareqnajxqugj\",\"enabled\":true,\"severityThreshold\":\"Low\",\"blocking\":true,\"source\":\"PostToolCall\",\"action\":\"RETRY\"},{\"name\":\"ofwq\",\"enabled\":false,\"severityThreshold\":\"Medium\",\"blocking\":false,\"source\":\"PreRun\",\"action\":\"RETRY\"},{\"name\":\"pxacqqudfn\",\"enabled\":true,\"severityThreshold\":\"Low\",\"blocking\":false,\"source\":\"PostRun\",\"action\":\"RETRY\"},{\"name\":\"yffimrzrtuzqogs\",\"enabled\":false,\"severityThreshold\":\"Low\",\"blocking\":false,\"source\":\"Completion\",\"action\":\"None\"}],\"customBlocklists\":[{\"source\":\"Prompt\",\"blocklistName\":\"yyceuzsoi\",\"blocking\":false},{\"source\":\"Completion\",\"blocklistName\":\"rx\",\"blocking\":true},{\"source\":\"Completion\",\"blocklistName\":\"aytdwkqbrq\",\"blocking\":false},{\"source\":\"PreRun\",\"blocklistName\":\"exiili\",\"blocking\":false}],\"customTopics\":[{\"source\":\"PreRun\",\"topicName\":\"tdqoaxoruzfgsq\",\"blocking\":false},{\"source\":\"PostToolCall\",\"topicName\":\"xleptramx\",\"blocking\":false}],\"safetyProviders\":[{\"source\":\"PreRun\",\"safetyProviderName\":\"xuqlcvydypat\",\"blocking\":false},{\"source\":\"Prompt\",\"safetyProviderName\":\"kniod\",\"blocking\":true},{\"source\":\"PreToolCall\",\"safetyProviderName\":\"nuj\",\"blocking\":true},{\"source\":\"PreToolCall\",\"safetyProviderName\":\"vdkcrodtj\",\"blocking\":false}]},\"etag\":\"jlfltkacjvefkdlf\",\"tags\":{\"qblylsyxkqj\":\"ggkfpagaowpul\",\"gxsds\":\"sjervti\"},\"id\":\"e\",\"name\":\"psbzkfzbeyvpn\",\"type\":\"icvi\"},{\"properties\":{\"type\":\"UserManaged\",\"mode\":\"Default\",\"basePolicyName\":\"xrbuukzclew\",\"contentFilters\":[{\"name\":\"wp\",\"enabled\":true,\"severityThreshold\":\"Low\",\"blocking\":false,\"source\":\"PostRun\",\"action\":\"BLOCKING\"},{\"name\":\"yfzqwhxxbu\",\"enabled\":false,\"severityThreshold\":\"High\",\"blocking\":false,\"source\":\"PreRun\",\"action\":\"HITL\"}],\"customBlocklists\":[{\"source\":\"PreToolCall\",\"blocklistName\":\"xorjaltolmncwsob\",\"blocking\":true},{\"source\":\"PreRun\",\"blocklistName\":\"nwdcfhu\",\"blocking\":false},{\"source\":\"PostToolCall\",\"blocklistName\":\"vglsbjjca\",\"blocking\":false}],\"customTopics\":[{\"source\":\"PostToolCall\",\"topicName\":\"dut\",\"blocking\":true},{\"source\":\"PostRun\",\"topicName\":\"lxqtvcofudfl\",\"blocking\":false},{\"source\":\"PostRun\",\"topicName\":\"gdknnqv\",\"blocking\":false},{\"source\":\"PostToolCall\",\"topicName\":\"tor\",\"blocking\":true}],\"safetyProviders\":[{\"source\":\"PreRun\",\"safetyProviderName\":\"kycgrauwj\",\"blocking\":true},{\"source\":\"PreRun\",\"safetyProviderName\":\"uruv\",\"blocking\":false}]},\"etag\":\"s\",\"tags\":{\"kif\":\"xwabmqoe\"},\"id\":\"tpuqujmq\",\"name\":\"gkfbtndoaong\",\"type\":\"jcntuj\"},{\"properties\":{\"type\":\"UserManaged\",\"mode\":\"Default\",\"basePolicyName\":\"twwaezkojvdcpzf\",\"contentFilters\":[{\"name\":\"i\",\"enabled\":true,\"severityThreshold\":\"High\",\"blocking\":false,\"source\":\"PreRun\",\"action\":\"None\"},{\"name\":\"oxciqopidoamcio\",\"enabled\":true,\"severityThreshold\":\"High\",\"blocking\":true,\"source\":\"PreRun\",\"action\":\"ANNOTATING\"},{\"name\":\"onlwntoeg\",\"enabled\":true,\"severityThreshold\":\"Low\",\"blocking\":false,\"source\":\"Prompt\",\"action\":\"BLOCKING\"},{\"name\":\"mrv\",\"enabled\":true,\"severityThreshold\":\"Medium\",\"blocking\":false,\"source\":\"Prompt\",\"action\":\"None\"}],\"customBlocklists\":[{\"source\":\"PreToolCall\",\"blocklistName\":\"koowtl\",\"blocking\":true},{\"source\":\"PreToolCall\",\"blocklistName\":\"wqaldsyu\",\"blocking\":true}],\"customTopics\":[{\"source\":\"PostRun\",\"topicName\":\"obwyznkb\",\"blocking\":false}],\"safetyProviders\":[{\"source\":\"PostToolCall\",\"safetyProviderName\":\"pagmhrskdsnf\",\"blocking\":true},{\"source\":\"PreRun\",\"safetyProviderName\":\"gtdlmk\",\"blocking\":false},{\"source\":\"Completion\",\"safetyProviderName\":\"hewpusdsttwv\",\"blocking\":true},{\"source\":\"PostToolCall\",\"safetyProviderName\":\"jdcngqqm\",\"blocking\":false}]},\"etag\":\"fgmjzrwrdgrt\",\"tags\":{\"nrfdw\":\"nuuzkopbm\",\"efozbhdms\":\"yuhhziu\",\"zqhof\":\"l\"},\"id\":\"maequiahxicslfa\",\"name\":\"qzpiyyl\",\"type\":\"alnswhccsphk\"},{\"properties\":{\"type\":\"SystemManaged\",\"mode\":\"Deferred\",\"basePolicyName\":\"scywuggwoluhc\",\"contentFilters\":[{\"name\":\"mhairsbrgzdwmsw\",\"enabled\":false,\"severityThreshold\":\"Medium\",\"blocking\":true,\"source\":\"PreRun\",\"action\":\"BLOCKING\"}],\"customBlocklists\":[{\"source\":\"PostToolCall\",\"blocklistName\":\"huexmk\",\"blocking\":true},{\"source\":\"Prompt\",\"blocklistName\":\"lzywemhzrncsdtc\",\"blocking\":false},{\"source\":\"PreRun\",\"blocklistName\":\"bsfgytguslfea\",\"blocking\":true},{\"source\":\"PreToolCall\",\"blocklistName\":\"kyhejhzisxgf\",\"blocking\":false}],\"customTopics\":[{\"source\":\"PostRun\",\"topicName\":\"ksrpqv\",\"blocking\":false},{\"source\":\"PostToolCall\",\"topicName\":\"htwdwrftswibyrcd\",\"blocking\":false},{\"source\":\"Prompt\",\"topicName\":\"wpracstwitykhev\",\"blocking\":true}],\"safetyProviders\":[{\"source\":\"PreToolCall\",\"safetyProviderName\":\"md\",\"blocking\":true},{\"source\":\"Completion\",\"safetyProviderName\":\"xltjcvnhltiu\",\"blocking\":false},{\"source\":\"Completion\",\"safetyProviderName\":\"vwxqibyqunyo\",\"blocking\":false}]},\"etag\":\"mdjrkvfgbvfvp\",\"tags\":{\"j\":\"daciz\",\"hvxndzwmkrefajpj\":\"lhkrribdeibqipqk\"},\"id\":\"wkqnyhg\",\"name\":\"ij\",\"type\":\"jivfxzsjabib\"}]}") .toObject(RaiPolicyListResult.class); - Assertions.assertEquals("czu", model.nextLink()); - Assertions.assertEquals("oknssxmojmsvpkjp", model.value().get(0).tags().get("vk")); - Assertions.assertEquals(RaiPolicyMode.BLOCKING, model.value().get(0).properties().mode()); - Assertions.assertEquals("fnhtbaxkgxyw", model.value().get(0).properties().basePolicyName()); - Assertions.assertEquals("yklyhpluodpvruud", model.value().get(0).properties().contentFilters().get(0).name()); - Assertions.assertFalse(model.value().get(0).properties().contentFilters().get(0).enabled()); - Assertions.assertEquals(ContentLevel.MEDIUM, + Assertions.assertEquals("jsjqbjhhyx", model.nextLink()); + Assertions.assertEquals(RaiPolicyMode.DEFERRED, model.value().get(0).properties().mode()); + Assertions.assertEquals("hp", model.value().get(0).properties().basePolicyName()); + Assertions.assertEquals("ymareqnajxqugj", model.value().get(0).properties().contentFilters().get(0).name()); + Assertions.assertTrue(model.value().get(0).properties().contentFilters().get(0).enabled()); + Assertions.assertEquals(ContentLevel.LOW, model.value().get(0).properties().contentFilters().get(0).severityThreshold()); Assertions.assertTrue(model.value().get(0).properties().contentFilters().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.PROMPT, - model.value().get(0).properties().contentFilters().get(0).source()); - Assertions.assertEquals("lwwqfbumlkxtrqj", - model.value().get(0).properties().customBlocklists().get(0).blocklistName()); - Assertions.assertTrue(model.value().get(0).properties().customBlocklists().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.PROMPT, - model.value().get(0).properties().customBlocklists().get(0).source()); - Assertions.assertEquals("kqfqjbvl", model.value().get(0).properties().customTopics().get(0).topicName()); - Assertions.assertTrue(model.value().get(0).properties().customTopics().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, - model.value().get(0).properties().customTopics().get(0).source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RaiPolicyListResult model = new RaiPolicyListResult().withNextLink("czu") - .withValue(Arrays.asList( - new RaiPolicyInner() - .withTags(mapOf("vk", "oknssxmojmsvpkjp", "jyxgtczh", "cfzq", "hmkxmaehvbb", "ydbsd")) - .withProperties(new RaiPolicyProperties().withMode(RaiPolicyMode.BLOCKING) - .withBasePolicyName("fnhtbaxkgxyw") - .withContentFilters(Arrays.asList( - new RaiPolicyContentFilter().withName("yklyhpluodpvruud") - .withEnabled(false) - .withSeverityThreshold(ContentLevel.MEDIUM) - .withBlocking(true) - .withSource(RaiPolicyContentSource.PROMPT), - new RaiPolicyContentFilter().withName("gktstvdxeclzedq") - .withEnabled(false) - .withSeverityThreshold(ContentLevel.MEDIUM) - .withBlocking(false) - .withSource(RaiPolicyContentSource.COMPLETION))) - .withCustomBlocklists(Arrays.asList( - new CustomBlocklistConfig().withBlocklistName("lwwqfbumlkxtrqj") - .withBlocking(true) - .withSource(RaiPolicyContentSource.PROMPT), - new CustomBlocklistConfig().withBlocklistName("txhwgfws") - .withBlocking(false) - .withSource(RaiPolicyContentSource.PROMPT), - new CustomBlocklistConfig().withBlocklistName("ezbrhubskh") - .withBlocking(false) - .withSource(RaiPolicyContentSource.COMPLETION))) - .withCustomTopics(Arrays.asList( - new CustomTopicConfig().withTopicName("kqfqjbvl") - .withBlocking(true) - .withSource(RaiPolicyContentSource.COMPLETION), - new CustomTopicConfig().withTopicName("uiqtqzfavy") - .withBlocking(false) - .withSource(RaiPolicyContentSource.PROMPT)))), - new RaiPolicyInner().withTags(mapOf("mvvhmxtdrjfuta", "hbuffkmrq")) - .withProperties(new RaiPolicyProperties().withMode(RaiPolicyMode.DEFERRED) - .withBasePolicyName("wzcjznmwcpmgua") - .withContentFilters(Arrays.asList( - new RaiPolicyContentFilter().withName("ufactk") - .withEnabled(false) - .withSeverityThreshold(ContentLevel.HIGH) - .withBlocking(true) - .withSource(RaiPolicyContentSource.COMPLETION), - new RaiPolicyContentFilter().withName("uxxpshne") - .withEnabled(false) - .withSeverityThreshold(ContentLevel.LOW) - .withBlocking(true) - .withSource(RaiPolicyContentSource.PROMPT), - new RaiPolicyContentFilter().withName("bkwdlenrds") - .withEnabled(true) - .withSeverityThreshold(ContentLevel.HIGH) - .withBlocking(true) - .withSource(RaiPolicyContentSource.COMPLETION), - new RaiPolicyContentFilter().withName("o") - .withEnabled(true) - .withSeverityThreshold(ContentLevel.LOW) - .withBlocking(false) - .withSource(RaiPolicyContentSource.COMPLETION))) - .withCustomBlocklists( - Arrays.asList(new CustomBlocklistConfig().withBlocklistName("vwpklvxwmygdxp") - .withBlocking(false) - .withSource(RaiPolicyContentSource.COMPLETION))) - .withCustomTopics(Arrays.asList( - new CustomTopicConfig().withTopicName("epn") - .withBlocking(true) - .withSource(RaiPolicyContentSource.PROMPT), - new CustomTopicConfig().withTopicName("gibbdaxc") - .withBlocking(true) - .withSource(RaiPolicyContentSource.PROMPT), - new CustomTopicConfig().withTopicName("uors") - .withBlocking(false) - .withSource(RaiPolicyContentSource.PROMPT), - new CustomTopicConfig().withTopicName("qplhlvnu") - .withBlocking(false) - .withSource(RaiPolicyContentSource.PROMPT)))), - new RaiPolicyInner() - .withTags( - mapOf("v", "talywjhhgdnhxms", "ox", "omi", "euzaof", "gdufiqnd", "cubiipuipw", "chvcyyysfgdo")) - .withProperties(new RaiPolicyProperties().withMode(RaiPolicyMode.DEFERRED) - .withBasePolicyName("jeknizshq") - .withContentFilters(Arrays.asList( - new RaiPolicyContentFilter().withName("pevf") - .withEnabled(false) - .withSeverityThreshold(ContentLevel.LOW) - .withBlocking(true) - .withSource(RaiPolicyContentSource.COMPLETION), - new RaiPolicyContentFilter().withName("wdxsm") - .withEnabled(false) - .withSeverityThreshold(ContentLevel.LOW) - .withBlocking(true) - .withSource(RaiPolicyContentSource.PROMPT))) - .withCustomBlocklists(Arrays.asList( - new CustomBlocklistConfig().withBlocklistName("szqujizdvoq") - .withBlocking(true) - .withSource(RaiPolicyContentSource.PROMPT), - new CustomBlocklistConfig().withBlocklistName("wb") - .withBlocking(false) - .withSource(RaiPolicyContentSource.PROMPT), - new CustomBlocklistConfig().withBlocklistName("utp") - .withBlocking(false) - .withSource(RaiPolicyContentSource.PROMPT), - new CustomBlocklistConfig().withBlocklistName("ismsksbpimlqolj") - .withBlocking(false) - .withSource(RaiPolicyContentSource.PROMPT))) - .withCustomTopics(Arrays.asList( - new CustomTopicConfig().withTopicName("sffgcvizqzd") - .withBlocking(false) - .withSource(RaiPolicyContentSource.PROMPT), - new CustomTopicConfig().withTopicName("oupfgfb") - .withBlocking(false) - .withSource(RaiPolicyContentSource.COMPLETION), - new CustomTopicConfig().withTopicName("hgkfmin") - .withBlocking(true) - .withSource(RaiPolicyContentSource.COMPLETION), - new CustomTopicConfig().withTopicName("ttsttktlahbqact") - .withBlocking(true) - .withSource(RaiPolicyContentSource.COMPLETION)))))); - model = BinaryData.fromObject(model).toObject(RaiPolicyListResult.class); - Assertions.assertEquals("czu", model.nextLink()); - Assertions.assertEquals("oknssxmojmsvpkjp", model.value().get(0).tags().get("vk")); - Assertions.assertEquals(RaiPolicyMode.BLOCKING, model.value().get(0).properties().mode()); - Assertions.assertEquals("fnhtbaxkgxyw", model.value().get(0).properties().basePolicyName()); - Assertions.assertEquals("yklyhpluodpvruud", model.value().get(0).properties().contentFilters().get(0).name()); - Assertions.assertFalse(model.value().get(0).properties().contentFilters().get(0).enabled()); - Assertions.assertEquals(ContentLevel.MEDIUM, - model.value().get(0).properties().contentFilters().get(0).severityThreshold()); - Assertions.assertTrue(model.value().get(0).properties().contentFilters().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.PROMPT, + Assertions.assertEquals(RaiPolicyContentSource.POST_TOOL_CALL, model.value().get(0).properties().contentFilters().get(0).source()); - Assertions.assertEquals("lwwqfbumlkxtrqj", + Assertions.assertEquals(RaiActionType.RETRY, + model.value().get(0).properties().contentFilters().get(0).action()); + Assertions.assertEquals("yyceuzsoi", model.value().get(0).properties().customBlocklists().get(0).blocklistName()); - Assertions.assertTrue(model.value().get(0).properties().customBlocklists().get(0).blocking()); + Assertions.assertFalse(model.value().get(0).properties().customBlocklists().get(0).blocking()); Assertions.assertEquals(RaiPolicyContentSource.PROMPT, model.value().get(0).properties().customBlocklists().get(0).source()); - Assertions.assertEquals("kqfqjbvl", model.value().get(0).properties().customTopics().get(0).topicName()); - Assertions.assertTrue(model.value().get(0).properties().customTopics().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, + Assertions.assertEquals("tdqoaxoruzfgsq", model.value().get(0).properties().customTopics().get(0).topicName()); + Assertions.assertFalse(model.value().get(0).properties().customTopics().get(0).blocking()); + Assertions.assertEquals(RaiPolicyContentSource.PRE_RUN, model.value().get(0).properties().customTopics().get(0).source()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + Assertions.assertEquals("xuqlcvydypat", + model.value().get(0).properties().safetyProviders().get(0).safetyProviderName()); + Assertions.assertFalse(model.value().get(0).properties().safetyProviders().get(0).blocking()); + Assertions.assertEquals(RaiPolicyContentSource.PRE_RUN, + model.value().get(0).properties().safetyProviders().get(0).source()); + Assertions.assertEquals("ggkfpagaowpul", model.value().get(0).tags().get("qblylsyxkqj")); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPolicyPropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPolicyPropertiesTests.java index c726373cf754..7bcb2b3b967d 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPolicyPropertiesTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiPolicyPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -8,10 +8,12 @@ import com.azure.resourcemanager.cognitiveservices.models.ContentLevel; import com.azure.resourcemanager.cognitiveservices.models.CustomBlocklistConfig; import com.azure.resourcemanager.cognitiveservices.models.CustomTopicConfig; +import com.azure.resourcemanager.cognitiveservices.models.RaiActionType; import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentFilter; import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentSource; import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyMode; import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyProperties; +import com.azure.resourcemanager.cognitiveservices.models.SafetyProviderConfig; import java.util.Arrays; import org.junit.jupiter.api.Assertions; @@ -19,72 +21,78 @@ public final class RaiPolicyPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RaiPolicyProperties model = BinaryData.fromString( - "{\"type\":\"UserManaged\",\"mode\":\"Default\",\"basePolicyName\":\"gkxnyedabg\",\"contentFilters\":[{\"name\":\"tjuewbcihx\",\"enabled\":false,\"severityThreshold\":\"Medium\",\"blocking\":false,\"source\":\"Prompt\"},{\"name\":\"ybvpay\",\"enabled\":true,\"severityThreshold\":\"Low\",\"blocking\":false,\"source\":\"Prompt\"},{\"name\":\"jplmagstcy\",\"enabled\":true,\"severityThreshold\":\"High\",\"blocking\":true,\"source\":\"Prompt\"}],\"customBlocklists\":[{\"source\":\"Completion\",\"blocklistName\":\"gsj\",\"blocking\":false}],\"customTopics\":[{\"source\":\"Completion\",\"topicName\":\"baiyhddviaceg\",\"blocking\":false},{\"source\":\"Completion\",\"topicName\":\"pmvmemfnczdwvv\",\"blocking\":true},{\"source\":\"Completion\",\"topicName\":\"lchpodbzevwrdn\",\"blocking\":false},{\"source\":\"Prompt\",\"topicName\":\"sjcswsmystuluqyp\",\"blocking\":true}]}") + "{\"type\":\"SystemManaged\",\"mode\":\"Default\",\"basePolicyName\":\"qtc\",\"contentFilters\":[{\"name\":\"mfmtdaaygdvw\",\"enabled\":true,\"severityThreshold\":\"Medium\",\"blocking\":false,\"source\":\"PreRun\",\"action\":\"HITL\"}],\"customBlocklists\":[{\"source\":\"PostToolCall\",\"blocklistName\":\"pxgy\",\"blocking\":false},{\"source\":\"PostToolCall\",\"blocklistName\":\"mnpkukghimdblxg\",\"blocking\":false},{\"source\":\"PostToolCall\",\"blocklistName\":\"hfjx\",\"blocking\":true}],\"customTopics\":[{\"source\":\"PreRun\",\"topicName\":\"qreyfkzi\",\"blocking\":false},{\"source\":\"PreToolCall\",\"topicName\":\"eaivxwczel\",\"blocking\":false}],\"safetyProviders\":[{\"source\":\"Completion\",\"safetyProviderName\":\"eae\",\"blocking\":false},{\"source\":\"Completion\",\"safetyProviderName\":\"tkl\",\"blocking\":true}]}") .toObject(RaiPolicyProperties.class); Assertions.assertEquals(RaiPolicyMode.DEFAULT, model.mode()); - Assertions.assertEquals("gkxnyedabg", model.basePolicyName()); - Assertions.assertEquals("tjuewbcihx", model.contentFilters().get(0).name()); - Assertions.assertFalse(model.contentFilters().get(0).enabled()); + Assertions.assertEquals("qtc", model.basePolicyName()); + Assertions.assertEquals("mfmtdaaygdvw", model.contentFilters().get(0).name()); + Assertions.assertTrue(model.contentFilters().get(0).enabled()); Assertions.assertEquals(ContentLevel.MEDIUM, model.contentFilters().get(0).severityThreshold()); Assertions.assertFalse(model.contentFilters().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.PROMPT, model.contentFilters().get(0).source()); - Assertions.assertEquals("gsj", model.customBlocklists().get(0).blocklistName()); + Assertions.assertEquals(RaiPolicyContentSource.PRE_RUN, model.contentFilters().get(0).source()); + Assertions.assertEquals(RaiActionType.HITL, model.contentFilters().get(0).action()); + Assertions.assertEquals("pxgy", model.customBlocklists().get(0).blocklistName()); Assertions.assertFalse(model.customBlocklists().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, model.customBlocklists().get(0).source()); - Assertions.assertEquals("baiyhddviaceg", model.customTopics().get(0).topicName()); + Assertions.assertEquals(RaiPolicyContentSource.POST_TOOL_CALL, model.customBlocklists().get(0).source()); + Assertions.assertEquals("qreyfkzi", model.customTopics().get(0).topicName()); Assertions.assertFalse(model.customTopics().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, model.customTopics().get(0).source()); + Assertions.assertEquals(RaiPolicyContentSource.PRE_RUN, model.customTopics().get(0).source()); + Assertions.assertEquals("eae", model.safetyProviders().get(0).safetyProviderName()); + Assertions.assertFalse(model.safetyProviders().get(0).blocking()); + Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, model.safetyProviders().get(0).source()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { RaiPolicyProperties model = new RaiPolicyProperties().withMode(RaiPolicyMode.DEFAULT) - .withBasePolicyName("gkxnyedabg") - .withContentFilters(Arrays.asList( - new RaiPolicyContentFilter().withName("tjuewbcihx") - .withEnabled(false) - .withSeverityThreshold(ContentLevel.MEDIUM) + .withBasePolicyName("qtc") + .withContentFilters(Arrays.asList(new RaiPolicyContentFilter().withName("mfmtdaaygdvw") + .withEnabled(true) + .withSeverityThreshold(ContentLevel.MEDIUM) + .withBlocking(false) + .withSource(RaiPolicyContentSource.PRE_RUN) + .withAction(RaiActionType.HITL))) + .withCustomBlocklists(Arrays.asList( + new CustomBlocklistConfig().withBlocklistName("pxgy") .withBlocking(false) - .withSource(RaiPolicyContentSource.PROMPT), - new RaiPolicyContentFilter().withName("ybvpay") - .withEnabled(true) - .withSeverityThreshold(ContentLevel.LOW) + .withSource(RaiPolicyContentSource.POST_TOOL_CALL), + new CustomBlocklistConfig().withBlocklistName("mnpkukghimdblxg") .withBlocking(false) - .withSource(RaiPolicyContentSource.PROMPT), - new RaiPolicyContentFilter().withName("jplmagstcy") - .withEnabled(true) - .withSeverityThreshold(ContentLevel.HIGH) + .withSource(RaiPolicyContentSource.POST_TOOL_CALL), + new CustomBlocklistConfig().withBlocklistName("hfjx") .withBlocking(true) - .withSource(RaiPolicyContentSource.PROMPT))) - .withCustomBlocklists(Arrays.asList(new CustomBlocklistConfig().withBlocklistName("gsj") - .withBlocking(false) - .withSource(RaiPolicyContentSource.COMPLETION))) + .withSource(RaiPolicyContentSource.POST_TOOL_CALL))) .withCustomTopics(Arrays.asList( - new CustomTopicConfig().withTopicName("baiyhddviaceg") + new CustomTopicConfig().withTopicName("qreyfkzi") .withBlocking(false) - .withSource(RaiPolicyContentSource.COMPLETION), - new CustomTopicConfig().withTopicName("pmvmemfnczdwvv") - .withBlocking(true) - .withSource(RaiPolicyContentSource.COMPLETION), - new CustomTopicConfig().withTopicName("lchpodbzevwrdn") + .withSource(RaiPolicyContentSource.PRE_RUN), + new CustomTopicConfig().withTopicName("eaivxwczel") + .withBlocking(false) + .withSource(RaiPolicyContentSource.PRE_TOOL_CALL))) + .withSafetyProviders(Arrays.asList( + new SafetyProviderConfig().withSafetyProviderName("eae") .withBlocking(false) .withSource(RaiPolicyContentSource.COMPLETION), - new CustomTopicConfig().withTopicName("sjcswsmystuluqyp") + new SafetyProviderConfig().withSafetyProviderName("tkl") .withBlocking(true) - .withSource(RaiPolicyContentSource.PROMPT))); + .withSource(RaiPolicyContentSource.COMPLETION))); model = BinaryData.fromObject(model).toObject(RaiPolicyProperties.class); Assertions.assertEquals(RaiPolicyMode.DEFAULT, model.mode()); - Assertions.assertEquals("gkxnyedabg", model.basePolicyName()); - Assertions.assertEquals("tjuewbcihx", model.contentFilters().get(0).name()); - Assertions.assertFalse(model.contentFilters().get(0).enabled()); + Assertions.assertEquals("qtc", model.basePolicyName()); + Assertions.assertEquals("mfmtdaaygdvw", model.contentFilters().get(0).name()); + Assertions.assertTrue(model.contentFilters().get(0).enabled()); Assertions.assertEquals(ContentLevel.MEDIUM, model.contentFilters().get(0).severityThreshold()); Assertions.assertFalse(model.contentFilters().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.PROMPT, model.contentFilters().get(0).source()); - Assertions.assertEquals("gsj", model.customBlocklists().get(0).blocklistName()); + Assertions.assertEquals(RaiPolicyContentSource.PRE_RUN, model.contentFilters().get(0).source()); + Assertions.assertEquals(RaiActionType.HITL, model.contentFilters().get(0).action()); + Assertions.assertEquals("pxgy", model.customBlocklists().get(0).blocklistName()); Assertions.assertFalse(model.customBlocklists().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, model.customBlocklists().get(0).source()); - Assertions.assertEquals("baiyhddviaceg", model.customTopics().get(0).topicName()); + Assertions.assertEquals(RaiPolicyContentSource.POST_TOOL_CALL, model.customBlocklists().get(0).source()); + Assertions.assertEquals("qreyfkzi", model.customTopics().get(0).topicName()); Assertions.assertFalse(model.customTopics().get(0).blocking()); - Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, model.customTopics().get(0).source()); + Assertions.assertEquals(RaiPolicyContentSource.PRE_RUN, model.customTopics().get(0).source()); + Assertions.assertEquals("eae", model.safetyProviders().get(0).safetyProviderName()); + Assertions.assertFalse(model.safetyProviders().get(0).blocking()); + Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, model.safetyProviders().get(0).source()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiSafetyProviderConfigTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiSafetyProviderConfigTests.java new file mode 100644 index 000000000000..0c64142b3c4d --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiSafetyProviderConfigTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.models.RaiSafetyProviderConfig; +import org.junit.jupiter.api.Assertions; + +public final class RaiSafetyProviderConfigTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RaiSafetyProviderConfig model = BinaryData.fromString("{\"safetyProviderName\":\"arm\",\"blocking\":false}") + .toObject(RaiSafetyProviderConfig.class); + Assertions.assertEquals("arm", model.safetyProviderName()); + Assertions.assertFalse(model.blocking()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RaiSafetyProviderConfig model = new RaiSafetyProviderConfig().withSafetyProviderName("arm").withBlocking(false); + model = BinaryData.fromObject(model).toObject(RaiSafetyProviderConfig.class); + Assertions.assertEquals("arm", model.safetyProviderName()); + Assertions.assertFalse(model.blocking()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelInnerTests.java new file mode 100644 index 000000000000..50c1de1c3bc5 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelInnerTests.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiToolLabelInner; +import com.azure.resourcemanager.cognitiveservices.models.RaiToolLabelProperties; +import com.azure.resourcemanager.cognitiveservices.models.RaiToolLabelPropertiesAccountScope; +import com.azure.resourcemanager.cognitiveservices.models.RaiToolLabelPropertiesProjectScopesItem; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class RaiToolLabelInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RaiToolLabelInner model = BinaryData.fromString( + "{\"properties\":{\"toolConnectionName\":\"yybyc\",\"accountScope\":{\"labelValues\":{\"awnopqgikyzirtxd\":\"jsrtk\"}},\"projectScopes\":[{\"project\":\"zejntps\",\"labelValues\":{\"rydxtqm\":\"gioilqu\",\"tbghhavgrvkf\":\"eoxorggufhyao\",\"mv\":\"ovjzhpjbibgjmfx\"}}]},\"etag\":\"luyovwxnbkfezzx\",\"tags\":{\"omvzzbtd\":\"hwzdgirujbz\",\"yujviylwdshfssn\":\"qvpn\",\"rymsgaojfmw\":\"bgye\"},\"id\":\"otmrfhir\",\"name\":\"tymoxoftp\",\"type\":\"piwyczuhxacpqjl\"}") + .toObject(RaiToolLabelInner.class); + Assertions.assertEquals("yybyc", model.properties().toolConnectionName()); + Assertions.assertEquals("jsrtk", model.properties().accountScope().labelValues().get("awnopqgikyzirtxd")); + Assertions.assertEquals("zejntps", model.properties().projectScopes().get(0).project()); + Assertions.assertEquals("gioilqu", model.properties().projectScopes().get(0).labelValues().get("rydxtqm")); + Assertions.assertEquals("hwzdgirujbz", model.tags().get("omvzzbtd")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RaiToolLabelInner model + = new RaiToolLabelInner() + .withProperties(new RaiToolLabelProperties().withToolConnectionName("yybyc") + .withAccountScope( + new RaiToolLabelPropertiesAccountScope().withLabelValues(mapOf("awnopqgikyzirtxd", "jsrtk"))) + .withProjectScopes( + Arrays.asList(new RaiToolLabelPropertiesProjectScopesItem().withProject("zejntps") + .withLabelValues(mapOf("rydxtqm", "gioilqu", "tbghhavgrvkf", "eoxorggufhyao", "mv", + "ovjzhpjbibgjmfx"))))) + .withTags(mapOf("omvzzbtd", "hwzdgirujbz", "yujviylwdshfssn", "qvpn", "rymsgaojfmw", "bgye")); + model = BinaryData.fromObject(model).toObject(RaiToolLabelInner.class); + Assertions.assertEquals("yybyc", model.properties().toolConnectionName()); + Assertions.assertEquals("jsrtk", model.properties().accountScope().labelValues().get("awnopqgikyzirtxd")); + Assertions.assertEquals("zejntps", model.properties().projectScopes().get(0).project()); + Assertions.assertEquals("gioilqu", model.properties().projectScopes().get(0).labelValues().get("rydxtqm")); + Assertions.assertEquals("hwzdgirujbz", model.tags().get("omvzzbtd")); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelPropertiesAccountScopeTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelPropertiesAccountScopeTests.java new file mode 100644 index 000000000000..deb21602db92 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelPropertiesAccountScopeTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.models.RaiToolLabelPropertiesAccountScope; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class RaiToolLabelPropertiesAccountScopeTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RaiToolLabelPropertiesAccountScope model = BinaryData + .fromString( + "{\"labelValues\":{\"ykqgaifmvik\":\"qphchqnrnrpxehuw\",\"xcv\":\"bydvkhbejdz\",\"v\":\"srhnjivo\"}}") + .toObject(RaiToolLabelPropertiesAccountScope.class); + Assertions.assertEquals("qphchqnrnrpxehuw", model.labelValues().get("ykqgaifmvik")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RaiToolLabelPropertiesAccountScope model = new RaiToolLabelPropertiesAccountScope() + .withLabelValues(mapOf("ykqgaifmvik", "qphchqnrnrpxehuw", "xcv", "bydvkhbejdz", "v", "srhnjivo")); + model = BinaryData.fromObject(model).toObject(RaiToolLabelPropertiesAccountScope.class); + Assertions.assertEquals("qphchqnrnrpxehuw", model.labelValues().get("ykqgaifmvik")); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelPropertiesProjectScopesItemTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelPropertiesProjectScopesItemTests.java new file mode 100644 index 000000000000..b28acded9c4b --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelPropertiesProjectScopesItemTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.models.RaiToolLabelPropertiesProjectScopesItem; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class RaiToolLabelPropertiesProjectScopesItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RaiToolLabelPropertiesProjectScopesItem model = BinaryData.fromString( + "{\"project\":\"novqfzge\",\"labelValues\":{\"mtmczuome\":\"dftuljltduce\",\"qioknssxmojm\":\"wcw\",\"kwcf\":\"vpkjpr\"}}") + .toObject(RaiToolLabelPropertiesProjectScopesItem.class); + Assertions.assertEquals("novqfzge", model.project()); + Assertions.assertEquals("dftuljltduce", model.labelValues().get("mtmczuome")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RaiToolLabelPropertiesProjectScopesItem model + = new RaiToolLabelPropertiesProjectScopesItem().withProject("novqfzge") + .withLabelValues(mapOf("mtmczuome", "dftuljltduce", "qioknssxmojm", "wcw", "kwcf", "vpkjpr")); + model = BinaryData.fromObject(model).toObject(RaiToolLabelPropertiesProjectScopesItem.class); + Assertions.assertEquals("novqfzge", model.project()); + Assertions.assertEquals("dftuljltduce", model.labelValues().get("mtmczuome")); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelPropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelPropertiesTests.java new file mode 100644 index 000000000000..c571133b3132 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelPropertiesTests.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.models.RaiToolLabelProperties; +import com.azure.resourcemanager.cognitiveservices.models.RaiToolLabelPropertiesAccountScope; +import com.azure.resourcemanager.cognitiveservices.models.RaiToolLabelPropertiesProjectScopesItem; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class RaiToolLabelPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RaiToolLabelProperties model = BinaryData.fromString( + "{\"toolConnectionName\":\"h\",\"accountScope\":{\"labelValues\":{\"x\":\"pskasdvlmfwdg\",\"sreuzvxurisjnh\":\"lucvpam\",\"blwpcesutrgj\":\"ytxifqjzgxmrh\",\"qhih\":\"pauutpw\"}},\"projectScopes\":[{\"project\":\"g\",\"labelValues\":{\"xjvfoimwksl\":\"pnfqntcyp\",\"ceacvlhvygdy\":\"rcizjxvyd\",\"mrtwna\":\"t\",\"wkojgcyztsfmzn\":\"jslb\"}}]}") + .toObject(RaiToolLabelProperties.class); + Assertions.assertEquals("h", model.toolConnectionName()); + Assertions.assertEquals("pskasdvlmfwdg", model.accountScope().labelValues().get("x")); + Assertions.assertEquals("g", model.projectScopes().get(0).project()); + Assertions.assertEquals("pnfqntcyp", model.projectScopes().get(0).labelValues().get("xjvfoimwksl")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RaiToolLabelProperties model = new RaiToolLabelProperties().withToolConnectionName("h") + .withAccountScope(new RaiToolLabelPropertiesAccountScope().withLabelValues(mapOf("x", "pskasdvlmfwdg", + "sreuzvxurisjnh", "lucvpam", "blwpcesutrgj", "ytxifqjzgxmrh", "qhih", "pauutpw"))) + .withProjectScopes(Arrays.asList(new RaiToolLabelPropertiesProjectScopesItem().withProject("g") + .withLabelValues(mapOf("xjvfoimwksl", "pnfqntcyp", "ceacvlhvygdy", "rcizjxvyd", "mrtwna", "t", + "wkojgcyztsfmzn", "jslb")))); + model = BinaryData.fromObject(model).toObject(RaiToolLabelProperties.class); + Assertions.assertEquals("h", model.toolConnectionName()); + Assertions.assertEquals("pskasdvlmfwdg", model.accountScope().labelValues().get("x")); + Assertions.assertEquals("g", model.projectScopes().get(0).project()); + Assertions.assertEquals("pnfqntcyp", model.projectScopes().get(0).labelValues().get("xjvfoimwksl")); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelResultTests.java new file mode 100644 index 000000000000..da00622cf892 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelResultTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.implementation.models.RaiToolLabelResult; +import org.junit.jupiter.api.Assertions; + +public final class RaiToolLabelResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RaiToolLabelResult model = BinaryData.fromString( + "{\"nextLink\":\"ljyxgtczhe\",\"value\":[{\"properties\":{\"toolConnectionName\":\"dshmkxmaehvbbx\",\"accountScope\":{\"labelValues\":{\"wrck\":\"ltfnhtbaxkgx\",\"gzibthostgktstv\":\"yklyhpluodpvruud\",\"odqkdlwwqfb\":\"xeclzedqbcvhzlhp\"}},\"projectScopes\":[{\"project\":\"kxtrq\",\"labelValues\":{\"coezbrhubskh\":\"smlmbtxhwgfwsrta\",\"ookk\":\"dyg\",\"fmluiqtqzfavyvn\":\"fqjbvleo\",\"jkqa\":\"qybaryeua\"}}]},\"etag\":\"gzslesjcbhernnti\",\"tags\":{\"uwrbehwagoh\":\"jcvb\"},\"id\":\"f\",\"name\":\"kmr\",\"type\":\"emvvhm\"},{\"properties\":{\"toolConnectionName\":\"drjf\",\"accountScope\":{\"labelValues\":{\"jvewzcjznmwcp\":\"oe\",\"v\":\"guaadraufactkahz\",\"eekulfgslqubkwd\":\"jjziuxxpsh\"}},\"projectScopes\":[{\"project\":\"rds\",\"labelValues\":{\"orwmduvwpklv\":\"ujbazpjuohminyfl\",\"ygdxpgpqchis\":\"w\",\"bjcrxgibbdaxco\":\"epn\"}},{\"project\":\"fozauorsuk\",\"labelValues\":{\"lvnuuepzlrph\":\"wbqpl\",\"qdunvmnnrwrbior\":\"zsoldwey\",\"v\":\"talywjhhgdnhxms\"}},{\"project\":\"omi\",\"labelValues\":{\"ndieuzaofj\":\"xggdufi\"}},{\"project\":\"hvcyyysfg\",\"labelValues\":{\"cje\":\"tcubiipuipwoqonm\",\"ev\":\"nizshqvcim\"}}]},\"etag\":\"mblrrilbywd\",\"tags\":{\"rwfscjfnynszquj\":\"icc\",\"gyavu\":\"zdvoqytibyowbb\",\"smsks\":\"pthjoxo\",\"lqol\":\"pi\"},\"id\":\"kcgxxlxsffgcvi\",\"name\":\"qzdwlvwlyoup\",\"type\":\"gfbkjubdyh\"},{\"properties\":{\"toolConnectionName\":\"fminsgowzf\",\"accountScope\":{\"labelValues\":{\"tlahbq\":\"t\",\"mmqtgqqqxhr\":\"ctxtgzukxi\",\"juisavokqdzf\":\"xrxc\"}},\"projectScopes\":[{\"project\":\"ivjlfrqttbajlka\",\"labelValues\":{\"kuvscxkdm\":\"wxyiopidkqq\",\"rxkpmloazuruoc\":\"igovi\"}}]},\"etag\":\"oorb\",\"tags\":{\"vvjgslor\":\"ybfhjxa\",\"yw\":\"il\",\"gkxnyedabg\":\"t\"},\"id\":\"udtjuewbc\",\"name\":\"hxuuwhcjyxccybvp\",\"type\":\"yakk\"},{\"properties\":{\"toolConnectionName\":\"zp\",\"accountScope\":{\"labelValues\":{\"tcyohpfkyrk\":\"plmag\",\"nwqjnoba\":\"bdgiogsjk\",\"egfnmntfpmvmemfn\":\"yhddvia\"}},\"projectScopes\":[{\"project\":\"wvvb\",\"labelValues\":{\"db\":\"xlllchp\",\"vsjcswsmystuluqy\":\"evwrdnhfuk\",\"qbmfpjbabwidf\":\"fcvlerch\"}},{\"project\":\"xsspuunnoxyhk\",\"labelValues\":{\"dao\":\"qddrihpfhoqcaae\"}}]},\"etag\":\"jvlpjxxkzbr\",\"tags\":{\"dxonbzoggculap\":\"eivsiykzkdnc\",\"fuajly\":\"wyrpgogtqxepnyl\",\"hvfcibyfmow\":\"tlvofq\",\"fzwiivwzjbhyz\":\"xrkjpvdw\"},\"id\":\"jrkambtrnegvmnv\",\"name\":\"q\",\"type\":\"qvldspastjbkkd\"}]}") + .toObject(RaiToolLabelResult.class); + Assertions.assertEquals("ljyxgtczhe", model.nextLink()); + Assertions.assertEquals("dshmkxmaehvbbx", model.value().get(0).properties().toolConnectionName()); + Assertions.assertEquals("ltfnhtbaxkgx", + model.value().get(0).properties().accountScope().labelValues().get("wrck")); + Assertions.assertEquals("kxtrq", model.value().get(0).properties().projectScopes().get(0).project()); + Assertions.assertEquals("smlmbtxhwgfwsrta", + model.value().get(0).properties().projectScopes().get(0).labelValues().get("coezbrhubskh")); + Assertions.assertEquals("jcvb", model.value().get(0).tags().get("uwrbehwagoh")); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelsCreateOrUpdateWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelsCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..bd4e387eb0d2 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelsCreateOrUpdateWithResponseMockTests.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; +import com.azure.resourcemanager.cognitiveservices.models.RaiToolLabel; +import com.azure.resourcemanager.cognitiveservices.models.RaiToolLabelProperties; +import com.azure.resourcemanager.cognitiveservices.models.RaiToolLabelPropertiesAccountScope; +import com.azure.resourcemanager.cognitiveservices.models.RaiToolLabelPropertiesProjectScopesItem; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class RaiToolLabelsCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"toolConnectionName\":\"at\",\"accountScope\":{\"labelValues\":{\"dixchwkib\":\"nmginmt\"}},\"projectScopes\":[{\"project\":\"ymncjc\",\"labelValues\":{\"qjsvep\":\"airwcqzoofj\"}},{\"project\":\"bhtleberpy\",\"labelValues\":{\"wkdnjrxgkrhwiehy\":\"eknfqnwjjqx\",\"fwafbjz\":\"pnowawonoehrguql\"}},{\"project\":\"pyrgu\",\"labelValues\":{\"cjwwdx\":\"azbkocbygvthrmxk\",\"acagae\":\"mrawppkeboozfl\"}}]},\"etag\":\"oiqclmgdtwgab\",\"tags\":{\"wjecooyvhtuqbpe\":\"kuz\"},\"id\":\"iibncgagdvcdqhf\",\"name\":\"zbpyf\",\"type\":\"ofdf\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CognitiveServicesManager manager = CognitiveServicesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + RaiToolLabel response + = manager.raiToolLabels() + .define("cx") + .withExistingAccount("cta", "qzjval") + .withTags(mapOf("hlokfpmijpdvzv", "jgpjeuxs", "rwyambhbafebzxfk", "bhwbdqufvcgnrgla", "nntrvrkps", + "qutibhl", "lpyeu", "bduxvzmlghnys")) + .withProperties(new RaiToolLabelProperties().withToolConnectionName("biwksde") + .withAccountScope(new RaiToolLabelPropertiesAccountScope().withLabelValues(mapOf("zvoikvntwczf", + "bf", "lhh", "wushlcxpbl", "aidqzsaaoqdsgpto", "zpfkis", "zzcaoijolbuauk", "xjqfiafcnlrtbfi"))) + .withProjectScopes( + Arrays + .asList( + new RaiToolLabelPropertiesProjectScopesItem().withProject("eopex") + .withLabelValues(mapOf("wrswyiljp", "xq", "xyauxre", "bkgx")), + new RaiToolLabelPropertiesProjectScopesItem().withProject("do") + .withLabelValues(mapOf("wytkujsqy", "cnlt", "ialiwry", "mmoxfablqgpwbmwh", + "hctsbbibti", "gnwplrrb", "bfs", "uhqvums")), + new RaiToolLabelPropertiesProjectScopesItem().withProject("eqbbewfcuqfpy") + .withLabelValues(mapOf("tuweyyjshcyb", "mzrmtmvw", "vo", "fuppoxprc", + "iikmoxrezsvavlrx", "ujx")), + new RaiToolLabelPropertiesProjectScopesItem().withProject("kj") + .withLabelValues(mapOf("fncn", "ywlunpipcwybs", "saebwfwhxorpwal", "atpf", + "ojfccylhtrht", "zwuge", "zp", "vazjpwexcd"))))) + .create(); + + Assertions.assertEquals("at", response.properties().toolConnectionName()); + Assertions.assertEquals("nmginmt", response.properties().accountScope().labelValues().get("dixchwkib")); + Assertions.assertEquals("ymncjc", response.properties().projectScopes().get(0).project()); + Assertions.assertEquals("airwcqzoofj", + response.properties().projectScopes().get(0).labelValues().get("qjsvep")); + Assertions.assertEquals("kuz", response.tags().get("wjecooyvhtuqbpe")); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelsGetWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelsGetWithResponseMockTests.java new file mode 100644 index 000000000000..02f6679b09b4 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelsGetWithResponseMockTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; +import com.azure.resourcemanager.cognitiveservices.models.RaiToolLabel; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class RaiToolLabelsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"toolConnectionName\":\"vmi\",\"accountScope\":{\"labelValues\":{\"lacro\":\"aeqjzmhkd\",\"shxzezb\":\"zfmunerkelux\",\"fsgqkstyecupyuij\":\"uzudlevzskejcg\",\"vs\":\"ard\"}},\"projectScopes\":[{\"project\":\"mazpzdqwuzvcmc\",\"labelValues\":{\"zvajbvbnkrdem\":\"xizekuvfrjwucao\",\"misvpztd\":\"idackzidgzwdyd\"}},{\"project\":\"vykpxkqe\",\"labelValues\":{\"xuknsykdtoi\":\"pjfojiunrls\",\"nvxuldxonckb\":\"oancdrco\",\"pzweghlwwbo\":\"lblfxlupibaqzizx\",\"sbfvdstrkzxsgtzn\":\"vgfklqiyndveqe\"}},{\"project\":\"vlrdsmovpi\",\"labelValues\":{\"tnndxolousdvr\":\"ndnoxaxnrqaq\"}}]},\"etag\":\"tqm\",\"tags\":{\"btqgkujdsoox\":\"jdrpizfulgycts\",\"arikeejdpdfhtwmm\":\"qwoeurbtigapd\"},\"id\":\"qbriq\",\"name\":\"lwwtr\",\"type\":\"meqkvy\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CognitiveServicesManager manager = CognitiveServicesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + RaiToolLabel response = manager.raiToolLabels() + .getWithResponse("ey", "zjemexmnvkvm", "wrxlniwmcpmrrdlh", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("vmi", response.properties().toolConnectionName()); + Assertions.assertEquals("aeqjzmhkd", response.properties().accountScope().labelValues().get("lacro")); + Assertions.assertEquals("mazpzdqwuzvcmc", response.properties().projectScopes().get(0).project()); + Assertions.assertEquals("xizekuvfrjwucao", + response.properties().projectScopes().get(0).labelValues().get("zvajbvbnkrdem")); + Assertions.assertEquals("jdrpizfulgycts", response.tags().get("btqgkujdsoox")); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelsListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelsListMockTests.java new file mode 100644 index 000000000000..221381cb5ae8 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiToolLabelsListMockTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; +import com.azure.resourcemanager.cognitiveservices.models.RaiToolLabel; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class RaiToolLabelsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"toolConnectionName\":\"aaj\",\"accountScope\":{\"labelValues\":{\"pwsadaxjsumxpe\":\"oejng\",\"fqzwqdnxkeed\":\"coioyjr\",\"dpczaqpqifd\":\"nwmywxfqzkvemy\"}},\"projectScopes\":[{\"project\":\"trwtxzuisam\",\"labelValues\":{\"izexroqsqj\":\"at\",\"splwsttxs\":\"hrmt\",\"ceov\":\"gxfqpan\",\"s\":\"gzwhsxyrujmtik\"}},{\"project\":\"ik\",\"labelValues\":{\"qqqdseipnquwz\":\"hzixyqhfnkvy\",\"sobjop\":\"hrptyodlhkfktltd\",\"zkqxsalu\":\"ouhbq\",\"wqhdgsjsa\":\"yigfcvcew\"}},{\"project\":\"mrncmaz\",\"labelValues\":{\"xhyqmr\":\"s\"}},{\"project\":\"jparnpvgrszrbwt\",\"labelValues\":{\"hfixa\":\"cwgzwllxzl\",\"yldqpzfzxsox\":\"fculzjrmhpfyw\",\"cqsxytqqtcmiw\":\"nunjlzkdr\",\"svnmeylajamcajy\":\"w\"}}]},\"etag\":\"tpzcr\",\"tags\":{\"gglclwa\":\"lleynqanhk\"},\"id\":\"v\",\"name\":\"bhgzphetxdq\",\"type\":\"m\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CognitiveServicesManager manager = CognitiveServicesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.raiToolLabels().list("zokpoy", "ohuen", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("aaj", response.iterator().next().properties().toolConnectionName()); + Assertions.assertEquals("oejng", + response.iterator().next().properties().accountScope().labelValues().get("pwsadaxjsumxpe")); + Assertions.assertEquals("trwtxzuisam", + response.iterator().next().properties().projectScopes().get(0).project()); + Assertions.assertEquals("at", + response.iterator().next().properties().projectScopes().get(0).labelValues().get("izexroqsqj")); + Assertions.assertEquals("lleynqanhk", response.iterator().next().tags().get("gglclwa")); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicConfigTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicConfigTests.java index 620ce353523a..a9e710453453 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicConfigTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicConfigTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -11,17 +11,17 @@ public final class RaiTopicConfigTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - RaiTopicConfig model = BinaryData.fromString("{\"topicName\":\"aomdjvlpjxx\",\"blocking\":false}") - .toObject(RaiTopicConfig.class); - Assertions.assertEquals("aomdjvlpjxx", model.topicName()); + RaiTopicConfig model + = BinaryData.fromString("{\"topicName\":\"nyga\",\"blocking\":false}").toObject(RaiTopicConfig.class); + Assertions.assertEquals("nyga", model.topicName()); Assertions.assertFalse(model.blocking()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - RaiTopicConfig model = new RaiTopicConfig().withTopicName("aomdjvlpjxx").withBlocking(false); + RaiTopicConfig model = new RaiTopicConfig().withTopicName("nyga").withBlocking(false); model = BinaryData.fromObject(model).toObject(RaiTopicConfig.class); - Assertions.assertEquals("aomdjvlpjxx", model.topicName()); + Assertions.assertEquals("nyga", model.topicName()); Assertions.assertFalse(model.blocking()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicInnerTests.java index 26f72b731736..5e6dcfcb6ebc 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicInnerTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -16,40 +16,41 @@ public final class RaiTopicInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RaiTopicInner model = BinaryData.fromString( - "{\"etag\":\"u\",\"tags\":{\"hihfrbbcevqagtlt\":\"ppnvdxz\"},\"properties\":{\"topicId\":\"fkqojpy\",\"topicName\":\"gtrd\",\"description\":\"ifmzzsd\",\"sampleBlobUrl\":\"brn\",\"status\":\"u\",\"failedReason\":\"prafwgckhoc\",\"createdAt\":\"2021-09-07T04:54:29Z\",\"lastModifiedAt\":\"2021-04-09T15:38:49Z\"},\"id\":\"wafqroud\",\"name\":\"spave\",\"type\":\"hrv\"}") + "{\"properties\":{\"topicId\":\"xqtnq\",\"topicName\":\"ezl\",\"description\":\"ffiakp\",\"sampleBlobUrl\":\"qqmtedltmmji\",\"status\":\"eozphv\",\"failedReason\":\"uyqncygupkvipmd\",\"createdAt\":\"2021-01-20T09:00:38Z\",\"lastModifiedAt\":\"2021-10-18T04:08:09Z\"},\"etag\":\"pevzhfst\",\"tags\":{\"ixbjx\":\"hojujbypelmcuv\",\"yl\":\"fw\"},\"id\":\"ool\",\"name\":\"ttpkiwkkbnujrywv\",\"type\":\"y\"}") .toObject(RaiTopicInner.class); - Assertions.assertEquals("ppnvdxz", model.tags().get("hihfrbbcevqagtlt")); - Assertions.assertEquals("fkqojpy", model.properties().topicId()); - Assertions.assertEquals("gtrd", model.properties().topicName()); - Assertions.assertEquals("ifmzzsd", model.properties().description()); - Assertions.assertEquals("brn", model.properties().sampleBlobUrl()); - Assertions.assertEquals("u", model.properties().status()); - Assertions.assertEquals("prafwgckhoc", model.properties().failedReason()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-07T04:54:29Z"), model.properties().createdAt()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-09T15:38:49Z"), model.properties().lastModifiedAt()); + Assertions.assertEquals("xqtnq", model.properties().topicId()); + Assertions.assertEquals("ezl", model.properties().topicName()); + Assertions.assertEquals("ffiakp", model.properties().description()); + Assertions.assertEquals("qqmtedltmmji", model.properties().sampleBlobUrl()); + Assertions.assertEquals("eozphv", model.properties().status()); + Assertions.assertEquals("uyqncygupkvipmd", model.properties().failedReason()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-20T09:00:38Z"), model.properties().createdAt()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-18T04:08:09Z"), model.properties().lastModifiedAt()); + Assertions.assertEquals("hojujbypelmcuv", model.tags().get("ixbjx")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - RaiTopicInner model = new RaiTopicInner().withTags(mapOf("hihfrbbcevqagtlt", "ppnvdxz")) - .withProperties(new RaiTopicProperties().withTopicId("fkqojpy") - .withTopicName("gtrd") - .withDescription("ifmzzsd") - .withSampleBlobUrl("brn") - .withStatus("u") - .withFailedReason("prafwgckhoc") - .withCreatedAt(OffsetDateTime.parse("2021-09-07T04:54:29Z")) - .withLastModifiedAt(OffsetDateTime.parse("2021-04-09T15:38:49Z"))); + RaiTopicInner model = new RaiTopicInner() + .withProperties(new RaiTopicProperties().withTopicId("xqtnq") + .withTopicName("ezl") + .withDescription("ffiakp") + .withSampleBlobUrl("qqmtedltmmji") + .withStatus("eozphv") + .withFailedReason("uyqncygupkvipmd") + .withCreatedAt(OffsetDateTime.parse("2021-01-20T09:00:38Z")) + .withLastModifiedAt(OffsetDateTime.parse("2021-10-18T04:08:09Z"))) + .withTags(mapOf("ixbjx", "hojujbypelmcuv", "yl", "fw")); model = BinaryData.fromObject(model).toObject(RaiTopicInner.class); - Assertions.assertEquals("ppnvdxz", model.tags().get("hihfrbbcevqagtlt")); - Assertions.assertEquals("fkqojpy", model.properties().topicId()); - Assertions.assertEquals("gtrd", model.properties().topicName()); - Assertions.assertEquals("ifmzzsd", model.properties().description()); - Assertions.assertEquals("brn", model.properties().sampleBlobUrl()); - Assertions.assertEquals("u", model.properties().status()); - Assertions.assertEquals("prafwgckhoc", model.properties().failedReason()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-07T04:54:29Z"), model.properties().createdAt()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-09T15:38:49Z"), model.properties().lastModifiedAt()); + Assertions.assertEquals("xqtnq", model.properties().topicId()); + Assertions.assertEquals("ezl", model.properties().topicName()); + Assertions.assertEquals("ffiakp", model.properties().description()); + Assertions.assertEquals("qqmtedltmmji", model.properties().sampleBlobUrl()); + Assertions.assertEquals("eozphv", model.properties().status()); + Assertions.assertEquals("uyqncygupkvipmd", model.properties().failedReason()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-20T09:00:38Z"), model.properties().createdAt()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-18T04:08:09Z"), model.properties().lastModifiedAt()); + Assertions.assertEquals("hojujbypelmcuv", model.tags().get("ixbjx")); } // Use "Map.of" if available diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicPropertiesTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicPropertiesTests.java index 94a34505afec..e6d75877e7c0 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicPropertiesTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -13,36 +13,36 @@ public final class RaiTopicPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RaiTopicProperties model = BinaryData.fromString( - "{\"topicId\":\"unzo\",\"topicName\":\"dhcxgkmoy\",\"description\":\"dyuib\",\"sampleBlobUrl\":\"fdn\",\"status\":\"ydvfvfcjnae\",\"failedReason\":\"srvhmgorffuki\",\"createdAt\":\"2021-01-16T11:03:16Z\",\"lastModifiedAt\":\"2021-06-12T10:23:26Z\"}") + "{\"topicId\":\"fpncurdo\",\"topicName\":\"iithtywu\",\"description\":\"cbihwqk\",\"sampleBlobUrl\":\"dntwjchrdgo\",\"status\":\"xum\",\"failedReason\":\"ton\",\"createdAt\":\"2021-01-26T20:44:07Z\",\"lastModifiedAt\":\"2021-05-20T02:25:29Z\"}") .toObject(RaiTopicProperties.class); - Assertions.assertEquals("unzo", model.topicId()); - Assertions.assertEquals("dhcxgkmoy", model.topicName()); - Assertions.assertEquals("dyuib", model.description()); - Assertions.assertEquals("fdn", model.sampleBlobUrl()); - Assertions.assertEquals("ydvfvfcjnae", model.status()); - Assertions.assertEquals("srvhmgorffuki", model.failedReason()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-16T11:03:16Z"), model.createdAt()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-12T10:23:26Z"), model.lastModifiedAt()); + Assertions.assertEquals("fpncurdo", model.topicId()); + Assertions.assertEquals("iithtywu", model.topicName()); + Assertions.assertEquals("cbihwqk", model.description()); + Assertions.assertEquals("dntwjchrdgo", model.sampleBlobUrl()); + Assertions.assertEquals("xum", model.status()); + Assertions.assertEquals("ton", model.failedReason()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-26T20:44:07Z"), model.createdAt()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-20T02:25:29Z"), model.lastModifiedAt()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - RaiTopicProperties model = new RaiTopicProperties().withTopicId("unzo") - .withTopicName("dhcxgkmoy") - .withDescription("dyuib") - .withSampleBlobUrl("fdn") - .withStatus("ydvfvfcjnae") - .withFailedReason("srvhmgorffuki") - .withCreatedAt(OffsetDateTime.parse("2021-01-16T11:03:16Z")) - .withLastModifiedAt(OffsetDateTime.parse("2021-06-12T10:23:26Z")); + RaiTopicProperties model = new RaiTopicProperties().withTopicId("fpncurdo") + .withTopicName("iithtywu") + .withDescription("cbihwqk") + .withSampleBlobUrl("dntwjchrdgo") + .withStatus("xum") + .withFailedReason("ton") + .withCreatedAt(OffsetDateTime.parse("2021-01-26T20:44:07Z")) + .withLastModifiedAt(OffsetDateTime.parse("2021-05-20T02:25:29Z")); model = BinaryData.fromObject(model).toObject(RaiTopicProperties.class); - Assertions.assertEquals("unzo", model.topicId()); - Assertions.assertEquals("dhcxgkmoy", model.topicName()); - Assertions.assertEquals("dyuib", model.description()); - Assertions.assertEquals("fdn", model.sampleBlobUrl()); - Assertions.assertEquals("ydvfvfcjnae", model.status()); - Assertions.assertEquals("srvhmgorffuki", model.failedReason()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-16T11:03:16Z"), model.createdAt()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-12T10:23:26Z"), model.lastModifiedAt()); + Assertions.assertEquals("fpncurdo", model.topicId()); + Assertions.assertEquals("iithtywu", model.topicName()); + Assertions.assertEquals("cbihwqk", model.description()); + Assertions.assertEquals("dntwjchrdgo", model.sampleBlobUrl()); + Assertions.assertEquals("xum", model.status()); + Assertions.assertEquals("ton", model.failedReason()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-26T20:44:07Z"), model.createdAt()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-20T02:25:29Z"), model.lastModifiedAt()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicResultTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicResultTests.java index 675def889fa3..e8a25ff4f34a 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicResultTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicResultTests.java @@ -1,87 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiTopicInner; -import com.azure.resourcemanager.cognitiveservices.models.RaiTopicProperties; -import com.azure.resourcemanager.cognitiveservices.models.RaiTopicResult; +import com.azure.resourcemanager.cognitiveservices.implementation.models.RaiTopicResult; import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; import org.junit.jupiter.api.Assertions; public final class RaiTopicResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RaiTopicResult model = BinaryData.fromString( - "{\"nextLink\":\"hwplefaxvx\",\"value\":[{\"etag\":\"tg\",\"tags\":{\"vodggxdbee\":\"zeyqxtjjfzqlqhyc\",\"wiuagydwqf\":\"mieknlraria\",\"ocqwogfnzjvus\":\"ylyrfgiagtco\"},\"properties\":{\"topicId\":\"dmozu\",\"topicName\":\"lfsbtkadpysow\",\"description\":\"tgkbugrjqctojc\",\"sampleBlobUrl\":\"sofieypefojyqd\",\"status\":\"u\",\"failedReason\":\"cp\",\"createdAt\":\"2021-02-20T10:18:54Z\",\"lastModifiedAt\":\"2021-07-01T10:01:22Z\"},\"id\":\"hihlhzdsqtzbs\",\"name\":\"gnowcjhfgmveca\",\"type\":\"txmwoteyow\"},{\"etag\":\"uqovekqvgqouwif\",\"tags\":{\"yivqikfxcvhrfsp\":\"j\",\"kvyklxubyjaffmm\":\"uagrttikteusqc\"},\"properties\":{\"topicId\":\"cqc\",\"topicName\":\"bgq\",\"description\":\"rtalmet\",\"sampleBlobUrl\":\"wgdsl\",\"status\":\"ihhrmo\",\"failedReason\":\"z\",\"createdAt\":\"2021-04-20T09:51:44Z\",\"lastModifiedAt\":\"2021-09-25T22:26:54Z\"},\"id\":\"iut\",\"name\":\"xapzhyrpet\",\"type\":\"g\"}]}") + "{\"nextLink\":\"dfdlwggyts\",\"value\":[{\"properties\":{\"topicId\":\"vtgsei\",\"topicName\":\"fiufx\",\"description\":\"npirgnepttw\",\"sampleBlobUrl\":\"sniffc\",\"status\":\"qnrojlpijnkrxfrd\",\"failedReason\":\"c\",\"createdAt\":\"2021-06-05T19:19:34Z\",\"lastModifiedAt\":\"2021-09-16T04:19:40Z\"},\"etag\":\"ronasxift\",\"tags\":{\"nnxk\":\"yzhftwesgogczh\",\"sxkkg\":\"lgnyhmo\"},\"id\":\"rrghxjbdhqxvcxgf\",\"name\":\"pdso\",\"type\":\"bshrnsvbuswd\"}]}") .toObject(RaiTopicResult.class); - Assertions.assertEquals("hwplefaxvx", model.nextLink()); - Assertions.assertEquals("zeyqxtjjfzqlqhyc", model.value().get(0).tags().get("vodggxdbee")); - Assertions.assertEquals("dmozu", model.value().get(0).properties().topicId()); - Assertions.assertEquals("lfsbtkadpysow", model.value().get(0).properties().topicName()); - Assertions.assertEquals("tgkbugrjqctojc", model.value().get(0).properties().description()); - Assertions.assertEquals("sofieypefojyqd", model.value().get(0).properties().sampleBlobUrl()); - Assertions.assertEquals("u", model.value().get(0).properties().status()); - Assertions.assertEquals("cp", model.value().get(0).properties().failedReason()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-20T10:18:54Z"), + Assertions.assertEquals("dfdlwggyts", model.nextLink()); + Assertions.assertEquals("vtgsei", model.value().get(0).properties().topicId()); + Assertions.assertEquals("fiufx", model.value().get(0).properties().topicName()); + Assertions.assertEquals("npirgnepttw", model.value().get(0).properties().description()); + Assertions.assertEquals("sniffc", model.value().get(0).properties().sampleBlobUrl()); + Assertions.assertEquals("qnrojlpijnkrxfrd", model.value().get(0).properties().status()); + Assertions.assertEquals("c", model.value().get(0).properties().failedReason()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-05T19:19:34Z"), model.value().get(0).properties().createdAt()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-01T10:01:22Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-09-16T04:19:40Z"), model.value().get(0).properties().lastModifiedAt()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RaiTopicResult model = new RaiTopicResult().withNextLink("hwplefaxvx") - .withValue(Arrays.asList( - new RaiTopicInner() - .withTags(mapOf("vodggxdbee", "zeyqxtjjfzqlqhyc", "wiuagydwqf", "mieknlraria", "ocqwogfnzjvus", - "ylyrfgiagtco")) - .withProperties(new RaiTopicProperties().withTopicId("dmozu") - .withTopicName("lfsbtkadpysow") - .withDescription("tgkbugrjqctojc") - .withSampleBlobUrl("sofieypefojyqd") - .withStatus("u") - .withFailedReason("cp") - .withCreatedAt(OffsetDateTime.parse("2021-02-20T10:18:54Z")) - .withLastModifiedAt(OffsetDateTime.parse("2021-07-01T10:01:22Z"))), - new RaiTopicInner().withTags(mapOf("yivqikfxcvhrfsp", "j", "kvyklxubyjaffmm", "uagrttikteusqc")) - .withProperties(new RaiTopicProperties().withTopicId("cqc") - .withTopicName("bgq") - .withDescription("rtalmet") - .withSampleBlobUrl("wgdsl") - .withStatus("ihhrmo") - .withFailedReason("z") - .withCreatedAt(OffsetDateTime.parse("2021-04-20T09:51:44Z")) - .withLastModifiedAt(OffsetDateTime.parse("2021-09-25T22:26:54Z"))))); - model = BinaryData.fromObject(model).toObject(RaiTopicResult.class); - Assertions.assertEquals("hwplefaxvx", model.nextLink()); - Assertions.assertEquals("zeyqxtjjfzqlqhyc", model.value().get(0).tags().get("vodggxdbee")); - Assertions.assertEquals("dmozu", model.value().get(0).properties().topicId()); - Assertions.assertEquals("lfsbtkadpysow", model.value().get(0).properties().topicName()); - Assertions.assertEquals("tgkbugrjqctojc", model.value().get(0).properties().description()); - Assertions.assertEquals("sofieypefojyqd", model.value().get(0).properties().sampleBlobUrl()); - Assertions.assertEquals("u", model.value().get(0).properties().status()); - Assertions.assertEquals("cp", model.value().get(0).properties().failedReason()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-20T10:18:54Z"), - model.value().get(0).properties().createdAt()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-01T10:01:22Z"), - model.value().get(0).properties().lastModifiedAt()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; + Assertions.assertEquals("yzhftwesgogczh", model.value().get(0).tags().get("nnxk")); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicsCreateOrUpdateWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicsCreateOrUpdateWithResponseMockTests.java index 5615ada800ff..db52c1dc6828 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicsCreateOrUpdateWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicsCreateOrUpdateWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -24,7 +24,7 @@ public final class RaiTopicsCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"etag\":\"wtiw\",\"tags\":{\"nhqnampp\":\"sa\",\"eajbkajlcyizyddc\":\"ltassaekewna\",\"krvfsxxbydes\":\"xo\",\"nm\":\"lvgecpwgoljtz\"},\"properties\":{\"topicId\":\"obygoo\",\"topicName\":\"qa\",\"description\":\"xv\",\"sampleBlobUrl\":\"yjfucsaod\",\"status\":\"os\",\"failedReason\":\"vibfasgmatrnzpd\",\"createdAt\":\"2021-10-25T15:01:08Z\",\"lastModifiedAt\":\"2021-11-10T08:16:24Z\"},\"id\":\"tu\",\"name\":\"ktz\",\"type\":\"oimyfpqd\"}"; + = "{\"properties\":{\"topicId\":\"wh\",\"topicName\":\"xsure\",\"description\":\"rshzzbgullcxiqqz\",\"sampleBlobUrl\":\"oxdu\",\"status\":\"amglrouig\",\"failedReason\":\"fivjqterdqqigdy\",\"createdAt\":\"2021-03-13T02:44:34Z\",\"lastModifiedAt\":\"2021-05-30T04:38:05Z\"},\"etag\":\"vrwqirvtktyhh\",\"tags\":{\"krrwepgqvqokql\":\"xlapjajod\",\"bwlyvxc\":\"jqgir\",\"stvzuzhasupml\":\"pqvctsfaeuhwwsk\",\"vzqazvbkarkptg\":\"pdpg\"},\"id\":\"gruatsyiysjqheni\",\"name\":\"beqngubabyjde\",\"type\":\"ysc\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -34,28 +34,28 @@ public void testCreateOrUpdateWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); RaiTopic response = manager.raiTopics() - .define("cljkxpyl") - .withExistingAccount("mywj", "ebecuvlbefv") - .withTags(mapOf("vrbkerdkdkgaw", "syxjijeyp", "q", "wjxildfkcefeyg")) - .withProperties(new RaiTopicProperties().withTopicId("isf") - .withTopicName("aybdjnxumentqon") - .withDescription("hymxymulwivqtow") - .withSampleBlobUrl("lsycoyb") - .withStatus("a") - .withFailedReason("ubfajc") - .withCreatedAt(OffsetDateTime.parse("2021-03-01T09:50:38Z")) - .withLastModifiedAt(OffsetDateTime.parse("2021-06-24T09:10:25Z"))) + .define("kekymffztsilsc") + .withExistingAccount("zhwv", "adpcmhjhausy") + .withTags(mapOf("hizpaczmuh", "cud", "dmmazdnc", "cakznhokhoitwhrj", "pglhzqp", "idb")) + .withProperties(new RaiTopicProperties().withTopicId("yeiihfymkou") + .withTopicName("yese") + .withDescription("gcigzh") + .withSampleBlobUrl("smg") + .withStatus("mt") + .withFailedReason("rqbebjnfveglab") + .withCreatedAt(OffsetDateTime.parse("2021-07-09T13:13:57Z")) + .withLastModifiedAt(OffsetDateTime.parse("2021-08-17T07:04:33Z"))) .create(); - Assertions.assertEquals("sa", response.tags().get("nhqnampp")); - Assertions.assertEquals("obygoo", response.properties().topicId()); - Assertions.assertEquals("qa", response.properties().topicName()); - Assertions.assertEquals("xv", response.properties().description()); - Assertions.assertEquals("yjfucsaod", response.properties().sampleBlobUrl()); - Assertions.assertEquals("os", response.properties().status()); - Assertions.assertEquals("vibfasgmatrnzpd", response.properties().failedReason()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-25T15:01:08Z"), response.properties().createdAt()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-10T08:16:24Z"), response.properties().lastModifiedAt()); + Assertions.assertEquals("wh", response.properties().topicId()); + Assertions.assertEquals("xsure", response.properties().topicName()); + Assertions.assertEquals("rshzzbgullcxiqqz", response.properties().description()); + Assertions.assertEquals("oxdu", response.properties().sampleBlobUrl()); + Assertions.assertEquals("amglrouig", response.properties().status()); + Assertions.assertEquals("fivjqterdqqigdy", response.properties().failedReason()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-13T02:44:34Z"), response.properties().createdAt()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-30T04:38:05Z"), response.properties().lastModifiedAt()); + Assertions.assertEquals("xlapjajod", response.tags().get("krrwepgqvqokql")); } // Use "Map.of" if available diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicsGetWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicsGetWithResponseMockTests.java index 726de333b677..9276eec60233 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicsGetWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicsGetWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -21,7 +21,7 @@ public final class RaiTopicsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"etag\":\"gttpufpbpgnrho\",\"tags\":{\"ysolsy\":\"jbfwxipl\",\"xslwhd\":\"p\",\"wzbxpc\":\"cvhtbbzjhfvh\"},\"properties\":{\"topicId\":\"ihotjecohmxv\",\"topicName\":\"rrskapbxwieexuy\",\"description\":\"erltfokyk\",\"sampleBlobUrl\":\"imyc\",\"status\":\"r\",\"failedReason\":\"cxzznnuife\",\"createdAt\":\"2021-08-05T14:37:40Z\",\"lastModifiedAt\":\"2021-03-27T07:18:57Z\"},\"id\":\"prkjg\",\"name\":\"wrjmwv\",\"type\":\"btuqkxx\"}"; + = "{\"properties\":{\"topicId\":\"mnnidmdia\",\"topicName\":\"zxkzrntmkct\",\"description\":\"uos\",\"sampleBlobUrl\":\"qp\",\"status\":\"azihq\",\"failedReason\":\"vqgcnbhcbm\",\"createdAt\":\"2021-08-21T03:57:28Z\",\"lastModifiedAt\":\"2021-07-18T07:38:19Z\"},\"etag\":\"n\",\"tags\":{\"jrhskbwgmjgrul\":\"tsxjmfmeftvhkmoo\",\"tpfdzxcouzfwofwa\":\"fogxhcxnw\",\"dtzxsoe\":\"ukz\",\"isnionetbzdrdpue\":\"nlwglihezomucmq\"},\"id\":\"kgtlzl\",\"name\":\"trlxcznnhzkbn\",\"type\":\"mxlxmwtygeq\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,17 +31,17 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); RaiTopic response = manager.raiTopics() - .getWithResponse("okvjgbzsxebrslt", "fyhcdjw", "uoard", com.azure.core.util.Context.NONE) + .getWithResponse("cfpcfjfwzlgz", "wk", "yep", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("jbfwxipl", response.tags().get("ysolsy")); - Assertions.assertEquals("ihotjecohmxv", response.properties().topicId()); - Assertions.assertEquals("rrskapbxwieexuy", response.properties().topicName()); - Assertions.assertEquals("erltfokyk", response.properties().description()); - Assertions.assertEquals("imyc", response.properties().sampleBlobUrl()); - Assertions.assertEquals("r", response.properties().status()); - Assertions.assertEquals("cxzznnuife", response.properties().failedReason()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-05T14:37:40Z"), response.properties().createdAt()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-27T07:18:57Z"), response.properties().lastModifiedAt()); + Assertions.assertEquals("mnnidmdia", response.properties().topicId()); + Assertions.assertEquals("zxkzrntmkct", response.properties().topicName()); + Assertions.assertEquals("uos", response.properties().description()); + Assertions.assertEquals("qp", response.properties().sampleBlobUrl()); + Assertions.assertEquals("azihq", response.properties().status()); + Assertions.assertEquals("vqgcnbhcbm", response.properties().failedReason()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-21T03:57:28Z"), response.properties().createdAt()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-18T07:38:19Z"), response.properties().lastModifiedAt()); + Assertions.assertEquals("tsxjmfmeftvhkmoo", response.tags().get("jrhskbwgmjgrul")); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicsListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicsListMockTests.java index ed6bd457a8a2..59bb0a3a7e23 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicsListMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RaiTopicsListMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -22,7 +22,7 @@ public final class RaiTopicsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"etag\":\"jaqupbyynvskpaj\",\"tags\":{\"ccwkqmtx\":\"eumexmjbxc\",\"qis\":\"p\"},\"properties\":{\"topicId\":\"ilg\",\"topicName\":\"rqre\",\"description\":\"aahu\",\"sampleBlobUrl\":\"m\",\"status\":\"ahlfxlmuifmuadj\",\"failedReason\":\"snc\",\"createdAt\":\"2021-03-03T03:02:30Z\",\"lastModifiedAt\":\"2021-05-31T00:54:30Z\"},\"id\":\"hjgczetyb\",\"name\":\"xgztlcgctjch\",\"type\":\"j\"}]}"; + = "{\"value\":[{\"properties\":{\"topicId\":\"bjmlreesrfwssz\",\"topicName\":\"cwlisolntfxxcrqm\",\"description\":\"fjwfoygizmshxx\",\"sampleBlobUrl\":\"iz\",\"status\":\"ulnvgskj\",\"failedReason\":\"xjdzjs\",\"createdAt\":\"2021-09-13T15:25:01Z\",\"lastModifiedAt\":\"2021-10-09T16:12:07Z\"},\"etag\":\"qqmqipaydhfn\",\"tags\":{\"hksnyzmspamwbw\":\"xmtf\"},\"id\":\"nlslcef\",\"name\":\"qdktwtkvihlp\",\"type\":\"liwoyngu\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -31,19 +31,18 @@ public void testList() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response - = manager.raiTopics().list("mwgxqlde", "otjgxieqfkyfhi", com.azure.core.util.Context.NONE); + PagedIterable response = manager.raiTopics().list("usi", "oqcah", com.azure.core.util.Context.NONE); - Assertions.assertEquals("eumexmjbxc", response.iterator().next().tags().get("ccwkqmtx")); - Assertions.assertEquals("ilg", response.iterator().next().properties().topicId()); - Assertions.assertEquals("rqre", response.iterator().next().properties().topicName()); - Assertions.assertEquals("aahu", response.iterator().next().properties().description()); - Assertions.assertEquals("m", response.iterator().next().properties().sampleBlobUrl()); - Assertions.assertEquals("ahlfxlmuifmuadj", response.iterator().next().properties().status()); - Assertions.assertEquals("snc", response.iterator().next().properties().failedReason()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-03T03:02:30Z"), + Assertions.assertEquals("bjmlreesrfwssz", response.iterator().next().properties().topicId()); + Assertions.assertEquals("cwlisolntfxxcrqm", response.iterator().next().properties().topicName()); + Assertions.assertEquals("fjwfoygizmshxx", response.iterator().next().properties().description()); + Assertions.assertEquals("iz", response.iterator().next().properties().sampleBlobUrl()); + Assertions.assertEquals("ulnvgskj", response.iterator().next().properties().status()); + Assertions.assertEquals("xjdzjs", response.iterator().next().properties().failedReason()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-13T15:25:01Z"), response.iterator().next().properties().createdAt()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-31T00:54:30Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-10-09T16:12:07Z"), response.iterator().next().properties().lastModifiedAt()); + Assertions.assertEquals("xmtf", response.iterator().next().tags().get("hksnyzmspamwbw")); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RegionSettingTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RegionSettingTests.java index e7c0bf8dd704..e1f3ee9b3119 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RegionSettingTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RegionSettingTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,19 +12,20 @@ public final class RegionSettingTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RegionSetting model - = BinaryData.fromString("{\"name\":\"s\",\"value\":8.954048,\"customsubdomain\":\"zqqedq\"}") + = BinaryData.fromString("{\"name\":\"glu\",\"value\":4.375696,\"customsubdomain\":\"tjaodxobnb\"}") .toObject(RegionSetting.class); - Assertions.assertEquals("s", model.name()); - Assertions.assertEquals(8.954048F, model.value()); - Assertions.assertEquals("zqqedq", model.customsubdomain()); + Assertions.assertEquals("glu", model.name()); + Assertions.assertEquals(4.375696F, model.value()); + Assertions.assertEquals("tjaodxobnb", model.customsubdomain()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - RegionSetting model = new RegionSetting().withName("s").withValue(8.954048F).withCustomsubdomain("zqqedq"); + RegionSetting model + = new RegionSetting().withName("glu").withValue(4.375696F).withCustomsubdomain("tjaodxobnb"); model = BinaryData.fromObject(model).toObject(RegionSetting.class); - Assertions.assertEquals("s", model.name()); - Assertions.assertEquals(8.954048F, model.value()); - Assertions.assertEquals("zqqedq", model.customsubdomain()); + Assertions.assertEquals("glu", model.name()); + Assertions.assertEquals(4.375696F, model.value()); + Assertions.assertEquals("tjaodxobnb", model.customsubdomain()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ReplacementConfigTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ReplacementConfigTests.java index 914767c279f7..2f9831099bcd 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ReplacementConfigTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ReplacementConfigTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -13,24 +13,11 @@ public final class ReplacementConfigTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ReplacementConfig model = BinaryData.fromString( - "{\"targetModelName\":\"lfktsths\",\"targetModelVersion\":\"ocmnyyazttbtwwrq\",\"autoUpgradeStartDate\":\"2021-09-02T22:18:46Z\",\"upgradeOnExpiryLeadTimeDays\":1640743814}") + "{\"targetModelName\":\"eh\",\"targetModelVersion\":\"vecxgodebfqkk\",\"autoUpgradeStartDate\":\"2021-10-28T16:20:15Z\",\"upgradeOnExpiryLeadTimeDays\":1171229778}") .toObject(ReplacementConfig.class); - Assertions.assertEquals("lfktsths", model.targetModelName()); - Assertions.assertEquals("ocmnyyazttbtwwrq", model.targetModelVersion()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-02T22:18:46Z"), model.autoUpgradeStartDate()); - Assertions.assertEquals(1640743814, model.upgradeOnExpiryLeadTimeDays()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReplacementConfig model = new ReplacementConfig().withTargetModelName("lfktsths") - .withTargetModelVersion("ocmnyyazttbtwwrq") - .withAutoUpgradeStartDate(OffsetDateTime.parse("2021-09-02T22:18:46Z")) - .withUpgradeOnExpiryLeadTimeDays(1640743814); - model = BinaryData.fromObject(model).toObject(ReplacementConfig.class); - Assertions.assertEquals("lfktsths", model.targetModelName()); - Assertions.assertEquals("ocmnyyazttbtwwrq", model.targetModelVersion()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-02T22:18:46Z"), model.autoUpgradeStartDate()); - Assertions.assertEquals(1640743814, model.upgradeOnExpiryLeadTimeDays()); + Assertions.assertEquals("eh", model.targetModelName()); + Assertions.assertEquals("vecxgodebfqkk", model.targetModelVersion()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-28T16:20:15Z"), model.autoUpgradeStartDate()); + Assertions.assertEquals(1171229778, model.upgradeOnExpiryLeadTimeDays()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RequestMatchPatternTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RequestMatchPatternTests.java index 65740804de57..fed16fb83d87 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RequestMatchPatternTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RequestMatchPatternTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -11,17 +11,9 @@ public final class RequestMatchPatternTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - RequestMatchPattern model = BinaryData.fromString("{\"path\":\"iawxklry\",\"method\":\"wckbasyypnd\"}") + RequestMatchPattern model = BinaryData.fromString("{\"path\":\"xzjnchgejs\",\"method\":\"dmailzydehojw\"}") .toObject(RequestMatchPattern.class); - Assertions.assertEquals("iawxklry", model.path()); - Assertions.assertEquals("wckbasyypnd", model.method()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RequestMatchPattern model = new RequestMatchPattern().withPath("iawxklry").withMethod("wckbasyypnd"); - model = BinaryData.fromObject(model).toObject(RequestMatchPattern.class); - Assertions.assertEquals("iawxklry", model.path()); - Assertions.assertEquals("wckbasyypnd", model.method()); + Assertions.assertEquals("xzjnchgejs", model.path()); + Assertions.assertEquals("dmailzydehojw", model.method()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceBaseTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceBaseTests.java index 975434491b52..4d1df776c884 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceBaseTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceBaseTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -13,20 +13,20 @@ public final class ResourceBaseTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ResourceBase model = BinaryData.fromString( - "{\"description\":\"mkoisqcssf\",\"tags\":{\"zsylollgt\":\"ifmcsypobkdqzr\",\"vuaurk\":\"czzydmxzjij\"}}") + ResourceBase model = BinaryData + .fromString("{\"description\":\"jksghudg\",\"tags\":{\"hrkmdyomkxfbvfbh\":\"ogjggsvoujkxibda\"}}") .toObject(ResourceBase.class); - Assertions.assertEquals("mkoisqcssf", model.description()); - Assertions.assertEquals("ifmcsypobkdqzr", model.tags().get("zsylollgt")); + Assertions.assertEquals("jksghudg", model.description()); + Assertions.assertEquals("ogjggsvoujkxibda", model.tags().get("hrkmdyomkxfbvfbh")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ResourceBase model = new ResourceBase().withDescription("mkoisqcssf") - .withTags(mapOf("zsylollgt", "ifmcsypobkdqzr", "vuaurk", "czzydmxzjij")); + ResourceBase model + = new ResourceBase().withDescription("jksghudg").withTags(mapOf("hrkmdyomkxfbvfbh", "ogjggsvoujkxibda")); model = BinaryData.fromObject(model).toObject(ResourceBase.class); - Assertions.assertEquals("mkoisqcssf", model.description()); - Assertions.assertEquals("ifmcsypobkdqzr", model.tags().get("zsylollgt")); + Assertions.assertEquals("jksghudg", model.description()); + Assertions.assertEquals("ogjggsvoujkxibda", model.tags().get("hrkmdyomkxfbvfbh")); } // Use "Map.of" if available diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProvidersCheckDomainAvailabilityWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProvidersCheckDomainAvailabilityWithResponseMockTests.java index db28da02dacf..764d7e8dc7f3 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProvidersCheckDomainAvailabilityWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProvidersCheckDomainAvailabilityWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -22,7 +22,7 @@ public final class ResourceProvidersCheckDomainAvailabilityWithResponseMockTests @Test public void testCheckDomainAvailabilityWithResponse() throws Exception { String responseStr - = "{\"isSubdomainAvailable\":false,\"reason\":\"bctvivuzqym\",\"subdomainName\":\"owog\",\"type\":\"it\",\"kind\":\"hzvb\"}"; + = "{\"isSubdomainAvailable\":false,\"reason\":\"uifr\",\"subdomainName\":\"kaapezkiswqjmdg\",\"type\":\"yparybjufptbjc\",\"kind\":\"nciuiyqvldaswvpp\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,16 +33,16 @@ public void testCheckDomainAvailabilityWithResponse() throws Exception { DomainAvailability response = manager.resourceProviders() .checkDomainAvailabilityWithResponse( - new CheckDomainAvailabilityParameter().withSubdomainName("anniyopetxivcnr") - .withType("yxnu") - .withKind("ephblkwqpatvbqs"), + new CheckDomainAvailabilityParameter().withSubdomainName("bcbrwjiutgnjizbe") + .withType("woiymrvz") + .withKind("uyrsrziuctix"), com.azure.core.util.Context.NONE) .getValue(); Assertions.assertFalse(response.isSubdomainAvailable()); - Assertions.assertEquals("bctvivuzqym", response.reason()); - Assertions.assertEquals("owog", response.subdomainName()); - Assertions.assertEquals("it", response.type()); - Assertions.assertEquals("hzvb", response.kind()); + Assertions.assertEquals("uifr", response.reason()); + Assertions.assertEquals("kaapezkiswqjmdg", response.subdomainName()); + Assertions.assertEquals("yparybjufptbjc", response.type()); + Assertions.assertEquals("nciuiyqvldaswvpp", response.kind()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProvidersCheckSkuAvailabilityWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProvidersCheckSkuAvailabilityWithResponseMockTests.java index d2bf63786c91..2829ad27afd8 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProvidersCheckSkuAvailabilityWithResponseMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceProvidersCheckSkuAvailabilityWithResponseMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -23,7 +23,7 @@ public final class ResourceProvidersCheckSkuAvailabilityWithResponseMockTests { @Test public void testCheckSkuAvailabilityWithResponse() throws Exception { String responseStr - = "{\"value\":[{\"kind\":\"vkqmaupxvpifdfa\",\"type\":\"yzyzeyuu\",\"skuName\":\"idszl\",\"skuAvailable\":false,\"reason\":\"ith\",\"message\":\"gvfltgvdihoynkr\"},{\"kind\":\"etwkdrcyrucpc\",\"type\":\"nuzdqumo\",\"skuName\":\"odnaienhqhskndn\",\"skuAvailable\":true,\"reason\":\"aadl\",\"message\":\"wf\"}]}"; + = "{\"value\":[{\"kind\":\"sc\",\"type\":\"erndbrnyeofltfnn\",\"skuName\":\"kadjf\",\"skuAvailable\":true,\"reason\":\"muii\",\"message\":\"ipfohykfkx\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,18 +33,18 @@ public void testCheckSkuAvailabilityWithResponse() throws Exception { new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); SkuAvailabilityListResult response = manager.resourceProviders() - .checkSkuAvailabilityWithResponse("wjtq", - new CheckSkuAvailabilityParameter().withSkus(Arrays.asList("evmylt")) - .withKind("crspxklurccl") - .withType("gxannnoytzposewx"), + .checkSkuAvailabilityWithResponse("flqqbtnyjpylxd", + new CheckSkuAvailabilityParameter().withSkus(Arrays.asList("vabm", "msxbaevwjcnkott", "wuhvaj")) + .withKind("ailfemjjzak") + .withType("wjiqullqxb"), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("vkqmaupxvpifdfa", response.value().get(0).kind()); - Assertions.assertEquals("yzyzeyuu", response.value().get(0).type()); - Assertions.assertEquals("idszl", response.value().get(0).skuName()); - Assertions.assertFalse(response.value().get(0).skuAvailable()); - Assertions.assertEquals("ith", response.value().get(0).reason()); - Assertions.assertEquals("gvfltgvdihoynkr", response.value().get(0).message()); + Assertions.assertEquals("sc", response.value().get(0).kind()); + Assertions.assertEquals("erndbrnyeofltfnn", response.value().get(0).type()); + Assertions.assertEquals("kadjf", response.value().get(0).skuName()); + Assertions.assertTrue(response.value().get(0).skuAvailable()); + Assertions.assertEquals("muii", response.value().get(0).reason()); + Assertions.assertEquals("ipfohykfkx", response.value().get(0).message()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceSkuRestrictionInfoTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceSkuRestrictionInfoTests.java index da1be3185f16..4930c1da49d6 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceSkuRestrictionInfoTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ResourceSkuRestrictionInfoTests.java @@ -1,32 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.cognitiveservices.models.ResourceSkuRestrictionInfo; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class ResourceSkuRestrictionInfoTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ResourceSkuRestrictionInfo model = BinaryData - .fromString( - "{\"locations\":[\"uvcc\",\"wnfnbacf\",\"onlebxetqgtzxdpn\",\"bqqwxrj\"],\"zones\":[\"llnwsubi\"]}") + .fromString("{\"locations\":[\"ufanray\",\"fueqfrojs\"],\"zones\":[\"rhydkygywez\",\"kiecafygzm\"]}") .toObject(ResourceSkuRestrictionInfo.class); - Assertions.assertEquals("uvcc", model.locations().get(0)); - Assertions.assertEquals("llnwsubi", model.zones().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceSkuRestrictionInfo model = new ResourceSkuRestrictionInfo() - .withLocations(Arrays.asList("uvcc", "wnfnbacf", "onlebxetqgtzxdpn", "bqqwxrj")) - .withZones(Arrays.asList("llnwsubi")); - model = BinaryData.fromObject(model).toObject(ResourceSkuRestrictionInfo.class); - Assertions.assertEquals("uvcc", model.locations().get(0)); - Assertions.assertEquals("llnwsubi", model.zones().get(0)); + Assertions.assertEquals("ufanray", model.locations().get(0)); + Assertions.assertEquals("rhydkygywez", model.zones().get(0)); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RoleBasedBuiltInAuthorizationPolicyTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RoleBasedBuiltInAuthorizationPolicyTests.java new file mode 100644 index 000000000000..37a79458623b --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/RoleBasedBuiltInAuthorizationPolicyTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.models.RoleBasedBuiltInAuthorizationPolicy; + +public final class RoleBasedBuiltInAuthorizationPolicyTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RoleBasedBuiltInAuthorizationPolicy model + = BinaryData.fromString("{\"type\":\"Default\"}").toObject(RoleBasedBuiltInAuthorizationPolicy.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RoleBasedBuiltInAuthorizationPolicy model = new RoleBasedBuiltInAuthorizationPolicy(); + model = BinaryData.fromObject(model).toObject(RoleBasedBuiltInAuthorizationPolicy.class); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SafetyProviderConfigTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SafetyProviderConfigTests.java new file mode 100644 index 000000000000..8b711d682be4 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SafetyProviderConfigTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentSource; +import com.azure.resourcemanager.cognitiveservices.models.SafetyProviderConfig; +import org.junit.jupiter.api.Assertions; + +public final class SafetyProviderConfigTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SafetyProviderConfig model = BinaryData + .fromString("{\"source\":\"PostToolCall\",\"safetyProviderName\":\"fatpxllrxcyjmoa\",\"blocking\":true}") + .toObject(SafetyProviderConfig.class); + Assertions.assertEquals("fatpxllrxcyjmoa", model.safetyProviderName()); + Assertions.assertTrue(model.blocking()); + Assertions.assertEquals(RaiPolicyContentSource.POST_TOOL_CALL, model.source()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SafetyProviderConfig model = new SafetyProviderConfig().withSafetyProviderName("fatpxllrxcyjmoa") + .withBlocking(true) + .withSource(RaiPolicyContentSource.POST_TOOL_CALL); + model = BinaryData.fromObject(model).toObject(SafetyProviderConfig.class); + Assertions.assertEquals("fatpxllrxcyjmoa", model.safetyProviderName()); + Assertions.assertTrue(model.blocking()); + Assertions.assertEquals(RaiPolicyContentSource.POST_TOOL_CALL, model.source()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ServiceTagOutboundRuleDestinationTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ServiceTagOutboundRuleDestinationTests.java new file mode 100644 index 000000000000..052152c0736c --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ServiceTagOutboundRuleDestinationTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.models.RuleAction; +import com.azure.resourcemanager.cognitiveservices.models.ServiceTagOutboundRuleDestination; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ServiceTagOutboundRuleDestinationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ServiceTagOutboundRuleDestination model = BinaryData.fromString( + "{\"serviceTag\":\"ioycbl\",\"protocol\":\"p\",\"portRanges\":\"lujyxkyxl\",\"action\":\"Deny\",\"addressPrefixes\":[\"kzzltafhbzf\"]}") + .toObject(ServiceTagOutboundRuleDestination.class); + Assertions.assertEquals("ioycbl", model.serviceTag()); + Assertions.assertEquals("p", model.protocol()); + Assertions.assertEquals("lujyxkyxl", model.portRanges()); + Assertions.assertEquals(RuleAction.DENY, model.action()); + Assertions.assertEquals("kzzltafhbzf", model.addressPrefixes().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ServiceTagOutboundRuleDestination model = new ServiceTagOutboundRuleDestination().withServiceTag("ioycbl") + .withProtocol("p") + .withPortRanges("lujyxkyxl") + .withAction(RuleAction.DENY) + .withAddressPrefixes(Arrays.asList("kzzltafhbzf")); + model = BinaryData.fromObject(model).toObject(ServiceTagOutboundRuleDestination.class); + Assertions.assertEquals("ioycbl", model.serviceTag()); + Assertions.assertEquals("p", model.protocol()); + Assertions.assertEquals("lujyxkyxl", model.portRanges()); + Assertions.assertEquals(RuleAction.DENY, model.action()); + Assertions.assertEquals("kzzltafhbzf", model.addressPrefixes().get(0)); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ServiceTagOutboundRuleTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ServiceTagOutboundRuleTests.java new file mode 100644 index 000000000000..a452c538b7e2 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/ServiceTagOutboundRuleTests.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.models.RuleAction; +import com.azure.resourcemanager.cognitiveservices.models.RuleCategory; +import com.azure.resourcemanager.cognitiveservices.models.RuleStatus; +import com.azure.resourcemanager.cognitiveservices.models.ServiceTagOutboundRule; +import com.azure.resourcemanager.cognitiveservices.models.ServiceTagOutboundRuleDestination; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ServiceTagOutboundRuleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ServiceTagOutboundRule model = BinaryData.fromString( + "{\"type\":\"ServiceTag\",\"destination\":{\"serviceTag\":\"wkgfbqljnqkh\",\"protocol\":\"h\",\"portRanges\":\"okulehurqlrqf\",\"action\":\"Deny\",\"addressPrefixes\":[\"urkphyjdxravju\"]},\"category\":\"Recommended\",\"status\":\"Deleting\",\"errorInformation\":\"rgchbap\",\"parentRuleNames\":[\"y\",\"jjk\",\"ajb\",\"scgdu\"]}") + .toObject(ServiceTagOutboundRule.class); + Assertions.assertEquals(RuleCategory.RECOMMENDED, model.category()); + Assertions.assertEquals(RuleStatus.DELETING, model.status()); + Assertions.assertEquals("wkgfbqljnqkh", model.destination().serviceTag()); + Assertions.assertEquals("h", model.destination().protocol()); + Assertions.assertEquals("okulehurqlrqf", model.destination().portRanges()); + Assertions.assertEquals(RuleAction.DENY, model.destination().action()); + Assertions.assertEquals("urkphyjdxravju", model.destination().addressPrefixes().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ServiceTagOutboundRule model = new ServiceTagOutboundRule().withCategory(RuleCategory.RECOMMENDED) + .withStatus(RuleStatus.DELETING) + .withDestination(new ServiceTagOutboundRuleDestination().withServiceTag("wkgfbqljnqkh") + .withProtocol("h") + .withPortRanges("okulehurqlrqf") + .withAction(RuleAction.DENY) + .withAddressPrefixes(Arrays.asList("urkphyjdxravju"))); + model = BinaryData.fromObject(model).toObject(ServiceTagOutboundRule.class); + Assertions.assertEquals(RuleCategory.RECOMMENDED, model.category()); + Assertions.assertEquals(RuleStatus.DELETING, model.status()); + Assertions.assertEquals("wkgfbqljnqkh", model.destination().serviceTag()); + Assertions.assertEquals("h", model.destination().protocol()); + Assertions.assertEquals("okulehurqlrqf", model.destination().portRanges()); + Assertions.assertEquals(RuleAction.DENY, model.destination().action()); + Assertions.assertEquals("urkphyjdxravju", model.destination().addressPrefixes().get(0)); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuAvailabilityListResultInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuAvailabilityListResultInnerTests.java index 9dee98632068..8dcf3a000390 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuAvailabilityListResultInnerTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuAvailabilityListResultInnerTests.java @@ -1,62 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.cognitiveservices.fluent.models.SkuAvailabilityListResultInner; -import com.azure.resourcemanager.cognitiveservices.models.SkuAvailability; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class SkuAvailabilityListResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SkuAvailabilityListResultInner model = BinaryData.fromString( - "{\"value\":[{\"kind\":\"tyfjfcnjbkcnxdhb\",\"type\":\"kphywpnvjto\",\"skuName\":\"ermclfplphoxuscr\",\"skuAvailable\":false,\"reason\":\"ye\",\"message\":\"bjtazqugxywpmu\"},{\"kind\":\"fjz\",\"type\":\"qkqujidsu\",\"skuName\":\"nobglaocq\",\"skuAvailable\":false,\"reason\":\"mgyudxytlmoyrxv\",\"message\":\"u\"},{\"kind\":\"pz\",\"type\":\"xhdzhlrqjbhckf\",\"skuName\":\"hrxsbk\",\"skuAvailable\":true,\"reason\":\"ca\",\"message\":\"z\"},{\"kind\":\"zka\",\"type\":\"uwbc\",\"skuName\":\"wbme\",\"skuAvailable\":false,\"reason\":\"yvjusrtslhsp\",\"message\":\"eemaofmxagkvtme\"}]}") + "{\"value\":[{\"kind\":\"qj\",\"type\":\"htbmuf\",\"skuName\":\"wnoi\",\"skuAvailable\":false,\"reason\":\"rxybqsoq\",\"message\":\"gkdmb\"}]}") .toObject(SkuAvailabilityListResultInner.class); - Assertions.assertEquals("tyfjfcnjbkcnxdhb", model.value().get(0).kind()); - Assertions.assertEquals("kphywpnvjto", model.value().get(0).type()); - Assertions.assertEquals("ermclfplphoxuscr", model.value().get(0).skuName()); + Assertions.assertEquals("qj", model.value().get(0).kind()); + Assertions.assertEquals("htbmuf", model.value().get(0).type()); + Assertions.assertEquals("wnoi", model.value().get(0).skuName()); Assertions.assertFalse(model.value().get(0).skuAvailable()); - Assertions.assertEquals("ye", model.value().get(0).reason()); - Assertions.assertEquals("bjtazqugxywpmu", model.value().get(0).message()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuAvailabilityListResultInner model = new SkuAvailabilityListResultInner().withValue(Arrays.asList( - new SkuAvailability().withKind("tyfjfcnjbkcnxdhb") - .withType("kphywpnvjto") - .withSkuName("ermclfplphoxuscr") - .withSkuAvailable(false) - .withReason("ye") - .withMessage("bjtazqugxywpmu"), - new SkuAvailability().withKind("fjz") - .withType("qkqujidsu") - .withSkuName("nobglaocq") - .withSkuAvailable(false) - .withReason("mgyudxytlmoyrxv") - .withMessage("u"), - new SkuAvailability().withKind("pz") - .withType("xhdzhlrqjbhckf") - .withSkuName("hrxsbk") - .withSkuAvailable(true) - .withReason("ca") - .withMessage("z"), - new SkuAvailability().withKind("zka") - .withType("uwbc") - .withSkuName("wbme") - .withSkuAvailable(false) - .withReason("yvjusrtslhsp") - .withMessage("eemaofmxagkvtme"))); - model = BinaryData.fromObject(model).toObject(SkuAvailabilityListResultInner.class); - Assertions.assertEquals("tyfjfcnjbkcnxdhb", model.value().get(0).kind()); - Assertions.assertEquals("kphywpnvjto", model.value().get(0).type()); - Assertions.assertEquals("ermclfplphoxuscr", model.value().get(0).skuName()); - Assertions.assertFalse(model.value().get(0).skuAvailable()); - Assertions.assertEquals("ye", model.value().get(0).reason()); - Assertions.assertEquals("bjtazqugxywpmu", model.value().get(0).message()); + Assertions.assertEquals("rxybqsoq", model.value().get(0).reason()); + Assertions.assertEquals("gkdmb", model.value().get(0).message()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuAvailabilityTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuAvailabilityTests.java index d9326a487791..d6f2e3a7ff09 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuAvailabilityTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuAvailabilityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,30 +12,13 @@ public final class SkuAvailabilityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SkuAvailability model = BinaryData.fromString( - "{\"kind\":\"qkrhahvljua\",\"type\":\"quhcdhmduala\",\"skuName\":\"qpv\",\"skuAvailable\":true,\"reason\":\"ws\",\"message\":\"r\"}") + "{\"kind\":\"zlobcufpd\",\"type\":\"rbt\",\"skuName\":\"qjnqglhqgnufoooj\",\"skuAvailable\":true,\"reason\":\"sqe\",\"message\":\"agdfmglzlh\"}") .toObject(SkuAvailability.class); - Assertions.assertEquals("qkrhahvljua", model.kind()); - Assertions.assertEquals("quhcdhmduala", model.type()); - Assertions.assertEquals("qpv", model.skuName()); + Assertions.assertEquals("zlobcufpd", model.kind()); + Assertions.assertEquals("rbt", model.type()); + Assertions.assertEquals("qjnqglhqgnufoooj", model.skuName()); Assertions.assertTrue(model.skuAvailable()); - Assertions.assertEquals("ws", model.reason()); - Assertions.assertEquals("r", model.message()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuAvailability model = new SkuAvailability().withKind("qkrhahvljua") - .withType("quhcdhmduala") - .withSkuName("qpv") - .withSkuAvailable(true) - .withReason("ws") - .withMessage("r"); - model = BinaryData.fromObject(model).toObject(SkuAvailability.class); - Assertions.assertEquals("qkrhahvljua", model.kind()); - Assertions.assertEquals("quhcdhmduala", model.type()); - Assertions.assertEquals("qpv", model.skuName()); - Assertions.assertTrue(model.skuAvailable()); - Assertions.assertEquals("ws", model.reason()); - Assertions.assertEquals("r", model.message()); + Assertions.assertEquals("sqe", model.reason()); + Assertions.assertEquals("agdfmglzlh", model.message()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuCapabilityTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuCapabilityTests.java index fc89790e6172..2c407ada0892 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuCapabilityTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuCapabilityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,16 +12,8 @@ public final class SkuCapabilityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SkuCapability model - = BinaryData.fromString("{\"name\":\"oxzjnchgejspod\",\"value\":\"ilzyd\"}").toObject(SkuCapability.class); - Assertions.assertEquals("oxzjnchgejspod", model.name()); - Assertions.assertEquals("ilzyd", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuCapability model = new SkuCapability().withName("oxzjnchgejspod").withValue("ilzyd"); - model = BinaryData.fromObject(model).toObject(SkuCapability.class); - Assertions.assertEquals("oxzjnchgejspod", model.name()); - Assertions.assertEquals("ilzyd", model.value()); + = BinaryData.fromString("{\"name\":\"tmut\",\"value\":\"qktapspwgcuert\"}").toObject(SkuCapability.class); + Assertions.assertEquals("tmut", model.name()); + Assertions.assertEquals("qktapspwgcuert", model.value()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuChangeInfoTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuChangeInfoTests.java index 8532668b05ff..e1ee70ca584c 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuChangeInfoTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuChangeInfoTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,21 +12,10 @@ public final class SkuChangeInfoTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SkuChangeInfo model = BinaryData.fromString( - "{\"countOfDowngrades\":1.213932,\"countOfUpgradesAfterDowngrades\":81.72188,\"lastChangeDate\":\"ahuxinpm\"}") + "{\"countOfDowngrades\":38.05988,\"countOfUpgradesAfterDowngrades\":2.3766458,\"lastChangeDate\":\"vqwhbmdgbbjfd\"}") .toObject(SkuChangeInfo.class); - Assertions.assertEquals(1.213932F, model.countOfDowngrades()); - Assertions.assertEquals(81.72188F, model.countOfUpgradesAfterDowngrades()); - Assertions.assertEquals("ahuxinpm", model.lastChangeDate()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuChangeInfo model = new SkuChangeInfo().withCountOfDowngrades(1.213932F) - .withCountOfUpgradesAfterDowngrades(81.72188F) - .withLastChangeDate("ahuxinpm"); - model = BinaryData.fromObject(model).toObject(SkuChangeInfo.class); - Assertions.assertEquals(1.213932F, model.countOfDowngrades()); - Assertions.assertEquals(81.72188F, model.countOfUpgradesAfterDowngrades()); - Assertions.assertEquals("ahuxinpm", model.lastChangeDate()); + Assertions.assertEquals(38.05988F, model.countOfDowngrades()); + Assertions.assertEquals(2.3766458F, model.countOfUpgradesAfterDowngrades()); + Assertions.assertEquals("vqwhbmdgbbjfd", model.lastChangeDate()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuResourceInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuResourceInnerTests.java index e2613c7b9b3a..40d30c494d0e 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuResourceInnerTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuResourceInnerTests.java @@ -1,60 +1,30 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.cognitiveservices.fluent.models.SkuResourceInner; -import com.azure.resourcemanager.cognitiveservices.models.CapacityConfig; -import com.azure.resourcemanager.cognitiveservices.models.Sku; import com.azure.resourcemanager.cognitiveservices.models.SkuTier; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class SkuResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SkuResourceInner model = BinaryData.fromString( - "{\"resourceType\":\"nyowxwlmdjrkvfg\",\"sku\":{\"name\":\"fvpdbo\",\"tier\":\"Basic\",\"size\":\"zsjqlh\",\"family\":\"r\",\"capacity\":1873747723},\"capacity\":{\"minimum\":180588113,\"maximum\":1262026177,\"step\":972824299,\"default\":1566726508,\"allowedValues\":[1573874006,370586550]}}") + "{\"resourceType\":\"eiotwmcdytdx\",\"sku\":{\"name\":\"txnrjaw\",\"tier\":\"Premium\",\"size\":\"xhniskxfbkpycgk\",\"family\":\"ndnhj\",\"capacity\":1922459268},\"capacity\":{\"minimum\":1064169122,\"maximum\":26018404,\"step\":876126569,\"default\":1934106594,\"allowedValues\":[776701007]}}") .toObject(SkuResourceInner.class); - Assertions.assertEquals("nyowxwlmdjrkvfg", model.resourceType()); - Assertions.assertEquals("fvpdbo", model.sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.sku().tier()); - Assertions.assertEquals("zsjqlh", model.sku().size()); - Assertions.assertEquals("r", model.sku().family()); - Assertions.assertEquals(1873747723, model.sku().capacity()); - Assertions.assertEquals(180588113, model.capacity().minimum()); - Assertions.assertEquals(1262026177, model.capacity().maximum()); - Assertions.assertEquals(972824299, model.capacity().step()); - Assertions.assertEquals(1566726508, model.capacity().defaultProperty()); - Assertions.assertEquals(1573874006, model.capacity().allowedValues().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SkuResourceInner model = new SkuResourceInner().withResourceType("nyowxwlmdjrkvfg") - .withSku(new Sku().withName("fvpdbo") - .withTier(SkuTier.BASIC) - .withSize("zsjqlh") - .withFamily("r") - .withCapacity(1873747723)) - .withCapacity(new CapacityConfig().withMinimum(180588113) - .withMaximum(1262026177) - .withStep(972824299) - .withDefaultProperty(1566726508) - .withAllowedValues(Arrays.asList(1573874006, 370586550))); - model = BinaryData.fromObject(model).toObject(SkuResourceInner.class); - Assertions.assertEquals("nyowxwlmdjrkvfg", model.resourceType()); - Assertions.assertEquals("fvpdbo", model.sku().name()); - Assertions.assertEquals(SkuTier.BASIC, model.sku().tier()); - Assertions.assertEquals("zsjqlh", model.sku().size()); - Assertions.assertEquals("r", model.sku().family()); - Assertions.assertEquals(1873747723, model.sku().capacity()); - Assertions.assertEquals(180588113, model.capacity().minimum()); - Assertions.assertEquals(1262026177, model.capacity().maximum()); - Assertions.assertEquals(972824299, model.capacity().step()); - Assertions.assertEquals(1566726508, model.capacity().defaultProperty()); - Assertions.assertEquals(1573874006, model.capacity().allowedValues().get(0)); + Assertions.assertEquals("eiotwmcdytdx", model.resourceType()); + Assertions.assertEquals("txnrjaw", model.sku().name()); + Assertions.assertEquals(SkuTier.PREMIUM, model.sku().tier()); + Assertions.assertEquals("xhniskxfbkpycgk", model.sku().size()); + Assertions.assertEquals("ndnhj", model.sku().family()); + Assertions.assertEquals(1922459268, model.sku().capacity()); + Assertions.assertEquals(1064169122, model.capacity().minimum()); + Assertions.assertEquals(26018404, model.capacity().maximum()); + Assertions.assertEquals(876126569, model.capacity().step()); + Assertions.assertEquals(1934106594, model.capacity().defaultProperty()); + Assertions.assertEquals(776701007, model.capacity().allowedValues().get(0)); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuTests.java index 9d2526aa2e56..ec5b38251815 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SkuTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -13,27 +13,27 @@ public final class SkuTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Sku model = BinaryData.fromString( - "{\"name\":\"eitjz\",\"tier\":\"Standard\",\"size\":\"sarhmofc\",\"family\":\"smy\",\"capacity\":753612767}") + "{\"name\":\"dkexxppofm\",\"tier\":\"Enterprise\",\"size\":\"fjpgddtocjjxhvp\",\"family\":\"uexhdzx\",\"capacity\":1730783579}") .toObject(Sku.class); - Assertions.assertEquals("eitjz", model.name()); - Assertions.assertEquals(SkuTier.STANDARD, model.tier()); - Assertions.assertEquals("sarhmofc", model.size()); - Assertions.assertEquals("smy", model.family()); - Assertions.assertEquals(753612767, model.capacity()); + Assertions.assertEquals("dkexxppofm", model.name()); + Assertions.assertEquals(SkuTier.ENTERPRISE, model.tier()); + Assertions.assertEquals("fjpgddtocjjxhvp", model.size()); + Assertions.assertEquals("uexhdzx", model.family()); + Assertions.assertEquals(1730783579, model.capacity()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Sku model = new Sku().withName("eitjz") - .withTier(SkuTier.STANDARD) - .withSize("sarhmofc") - .withFamily("smy") - .withCapacity(753612767); + Sku model = new Sku().withName("dkexxppofm") + .withTier(SkuTier.ENTERPRISE) + .withSize("fjpgddtocjjxhvp") + .withFamily("uexhdzx") + .withCapacity(1730783579); model = BinaryData.fromObject(model).toObject(Sku.class); - Assertions.assertEquals("eitjz", model.name()); - Assertions.assertEquals(SkuTier.STANDARD, model.tier()); - Assertions.assertEquals("sarhmofc", model.size()); - Assertions.assertEquals("smy", model.family()); - Assertions.assertEquals(753612767, model.capacity()); + Assertions.assertEquals("dkexxppofm", model.name()); + Assertions.assertEquals(SkuTier.ENTERPRISE, model.tier()); + Assertions.assertEquals("fjpgddtocjjxhvp", model.size()); + Assertions.assertEquals("uexhdzx", model.family()); + Assertions.assertEquals(1730783579, model.capacity()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SubscriptionRaiPoliciesCreateOrUpdateWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SubscriptionRaiPoliciesCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..9e7e83e6cf94 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SubscriptionRaiPoliciesCreateOrUpdateWithResponseMockTests.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; +import com.azure.resourcemanager.cognitiveservices.fluent.models.RaiPolicyInner; +import com.azure.resourcemanager.cognitiveservices.models.ContentLevel; +import com.azure.resourcemanager.cognitiveservices.models.CustomBlocklistConfig; +import com.azure.resourcemanager.cognitiveservices.models.CustomTopicConfig; +import com.azure.resourcemanager.cognitiveservices.models.RaiActionType; +import com.azure.resourcemanager.cognitiveservices.models.RaiPolicy; +import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentFilter; +import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentSource; +import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyMode; +import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyProperties; +import com.azure.resourcemanager.cognitiveservices.models.SafetyProviderConfig; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class SubscriptionRaiPoliciesCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"type\":\"UserManaged\",\"mode\":\"Blocking\",\"basePolicyName\":\"slkyozd\",\"contentFilters\":[{\"name\":\"uegrh\",\"enabled\":false,\"severityThreshold\":\"Low\",\"blocking\":false,\"source\":\"Completion\",\"action\":\"ANNOTATING\"},{\"name\":\"xvgjbfi\",\"enabled\":false,\"severityThreshold\":\"Low\",\"blocking\":true,\"source\":\"Completion\",\"action\":\"HITL\"}],\"customBlocklists\":[{\"source\":\"PreRun\",\"blocklistName\":\"q\",\"blocking\":true}],\"customTopics\":[{\"source\":\"PreRun\",\"topicName\":\"xej\",\"blocking\":false},{\"source\":\"Prompt\",\"topicName\":\"nfyszzacz\",\"blocking\":true},{\"source\":\"PreRun\",\"topicName\":\"nddbbozsyvr\",\"blocking\":true},{\"source\":\"Prompt\",\"topicName\":\"trchwudlxe\",\"blocking\":true}],\"safetyProviders\":[{\"source\":\"PreRun\",\"safetyProviderName\":\"ejhq\",\"blocking\":false},{\"source\":\"PreRun\",\"safetyProviderName\":\"zoyrfgxkydpm\",\"blocking\":true},{\"source\":\"PostToolCall\",\"safetyProviderName\":\"mtywhla\",\"blocking\":false}]},\"etag\":\"jpewpyjlfx\",\"tags\":{\"w\":\"qcrzgeuqxbpia\",\"gddhjkrukizyhgs\":\"aujegqdtadra\",\"fpjbqggwe\":\"tnqsktx\",\"cstu\":\"iwdhdmncgbfzu\"},\"id\":\"lhxd\",\"name\":\"bkl\",\"type\":\"iichgjsysmvxodgw\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CognitiveServicesManager manager = CognitiveServicesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + RaiPolicy response = manager.subscriptionRaiPolicies() + .createOrUpdateWithResponse("awmvgxs", + new RaiPolicyInner() + .withProperties(new RaiPolicyProperties().withMode(RaiPolicyMode.DEFERRED) + .withBasePolicyName("rfljfewxq") + .withContentFilters(Arrays.asList( + new RaiPolicyContentFilter().withName("ud") + .withEnabled(true) + .withSeverityThreshold(ContentLevel.HIGH) + .withBlocking(true) + .withSource(RaiPolicyContentSource.COMPLETION) + .withAction(RaiActionType.RETRY), + new RaiPolicyContentFilter().withName("ijgencdgmoq") + .withEnabled(false) + .withSeverityThreshold(ContentLevel.LOW) + .withBlocking(false) + .withSource(RaiPolicyContentSource.PRE_TOOL_CALL) + .withAction(RaiActionType.ANNOTATING), + new RaiPolicyContentFilter().withName("jouw") + .withEnabled(true) + .withSeverityThreshold(ContentLevel.MEDIUM) + .withBlocking(true) + .withSource(RaiPolicyContentSource.PROMPT) + .withAction(RaiActionType.HITL))) + .withCustomBlocklists(Arrays.asList( + new CustomBlocklistConfig().withBlocklistName("xmcvprstvkitbfjt") + .withBlocking(true) + .withSource(RaiPolicyContentSource.PRE_TOOL_CALL), + new CustomBlocklistConfig().withBlocklistName("lfa") + .withBlocking(false) + .withSource(RaiPolicyContentSource.COMPLETION))) + .withCustomTopics(Arrays.asList(new CustomTopicConfig().withTopicName("xwe") + .withBlocking(false) + .withSource(RaiPolicyContentSource.PRE_RUN))) + .withSafetyProviders(Arrays.asList( + new SafetyProviderConfig().withSafetyProviderName("fdoadtxopgeh") + .withBlocking(true) + .withSource(RaiPolicyContentSource.COMPLETION), + new SafetyProviderConfig().withSafetyProviderName("zgssz") + .withBlocking(true) + .withSource(RaiPolicyContentSource.PRE_RUN)))) + .withTags(mapOf("gsuxxczbmyqj", "sirncclabvoy")), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(RaiPolicyMode.BLOCKING, response.properties().mode()); + Assertions.assertEquals("slkyozd", response.properties().basePolicyName()); + Assertions.assertEquals("uegrh", response.properties().contentFilters().get(0).name()); + Assertions.assertFalse(response.properties().contentFilters().get(0).enabled()); + Assertions.assertEquals(ContentLevel.LOW, response.properties().contentFilters().get(0).severityThreshold()); + Assertions.assertFalse(response.properties().contentFilters().get(0).blocking()); + Assertions.assertEquals(RaiPolicyContentSource.COMPLETION, + response.properties().contentFilters().get(0).source()); + Assertions.assertEquals(RaiActionType.ANNOTATING, response.properties().contentFilters().get(0).action()); + Assertions.assertEquals("q", response.properties().customBlocklists().get(0).blocklistName()); + Assertions.assertTrue(response.properties().customBlocklists().get(0).blocking()); + Assertions.assertEquals(RaiPolicyContentSource.PRE_RUN, + response.properties().customBlocklists().get(0).source()); + Assertions.assertEquals("xej", response.properties().customTopics().get(0).topicName()); + Assertions.assertFalse(response.properties().customTopics().get(0).blocking()); + Assertions.assertEquals(RaiPolicyContentSource.PRE_RUN, response.properties().customTopics().get(0).source()); + Assertions.assertEquals("ejhq", response.properties().safetyProviders().get(0).safetyProviderName()); + Assertions.assertFalse(response.properties().safetyProviders().get(0).blocking()); + Assertions.assertEquals(RaiPolicyContentSource.PRE_RUN, + response.properties().safetyProviders().get(0).source()); + Assertions.assertEquals("qcrzgeuqxbpia", response.tags().get("w")); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SubscriptionRaiPoliciesGetWithResponseMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SubscriptionRaiPoliciesGetWithResponseMockTests.java new file mode 100644 index 000000000000..866a4e068482 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/SubscriptionRaiPoliciesGetWithResponseMockTests.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; +import com.azure.resourcemanager.cognitiveservices.models.ContentLevel; +import com.azure.resourcemanager.cognitiveservices.models.RaiActionType; +import com.azure.resourcemanager.cognitiveservices.models.RaiPolicy; +import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyContentSource; +import com.azure.resourcemanager.cognitiveservices.models.RaiPolicyMode; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class SubscriptionRaiPoliciesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"type\":\"UserManaged\",\"mode\":\"Deferred\",\"basePolicyName\":\"uhhoqeqshavlj\",\"contentFilters\":[{\"name\":\"rqolnthbb\",\"enabled\":false,\"severityThreshold\":\"Medium\",\"blocking\":false,\"source\":\"PostToolCall\",\"action\":\"None\"},{\"name\":\"jthfceyjnc\",\"enabled\":true,\"severityThreshold\":\"Low\",\"blocking\":true,\"source\":\"Completion\",\"action\":\"RETRY\"}],\"customBlocklists\":[{\"source\":\"PostRun\",\"blocklistName\":\"rufzcqyjmq\",\"blocking\":true},{\"source\":\"Prompt\",\"blocklistName\":\"uselqkrs\",\"blocking\":true},{\"source\":\"PostRun\",\"blocklistName\":\"ddqmdtffisjmrkk\",\"blocking\":true}],\"customTopics\":[{\"source\":\"PostToolCall\",\"topicName\":\"yqixokwtjawhv\",\"blocking\":false},{\"source\":\"PreRun\",\"topicName\":\"qdlcvmyolc\",\"blocking\":false}],\"safetyProviders\":[{\"source\":\"PostToolCall\",\"safetyProviderName\":\"snvlaqd\",\"blocking\":false},{\"source\":\"PostToolCall\",\"safetyProviderName\":\"atuwqkokbc\",\"blocking\":false},{\"source\":\"PostToolCall\",\"safetyProviderName\":\"gobllms\",\"blocking\":false}]},\"etag\":\"imaaneak\",\"tags\":{\"cyanrfvqtvkhgv\":\"ho\",\"ymhcctopuo\":\"ogxkfnaoa\"},\"id\":\"rnskby\",\"name\":\"quhczygxvh\",\"type\":\"jpxecxqnwhsco\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + CognitiveServicesManager manager = CognitiveServicesManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + RaiPolicy response + = manager.subscriptionRaiPolicies().getWithResponse("dxku", com.azure.core.util.Context.NONE).getValue(); + + Assertions.assertEquals(RaiPolicyMode.DEFERRED, response.properties().mode()); + Assertions.assertEquals("uhhoqeqshavlj", response.properties().basePolicyName()); + Assertions.assertEquals("rqolnthbb", response.properties().contentFilters().get(0).name()); + Assertions.assertFalse(response.properties().contentFilters().get(0).enabled()); + Assertions.assertEquals(ContentLevel.MEDIUM, response.properties().contentFilters().get(0).severityThreshold()); + Assertions.assertFalse(response.properties().contentFilters().get(0).blocking()); + Assertions.assertEquals(RaiPolicyContentSource.POST_TOOL_CALL, + response.properties().contentFilters().get(0).source()); + Assertions.assertEquals(RaiActionType.NONE, response.properties().contentFilters().get(0).action()); + Assertions.assertEquals("rufzcqyjmq", response.properties().customBlocklists().get(0).blocklistName()); + Assertions.assertTrue(response.properties().customBlocklists().get(0).blocking()); + Assertions.assertEquals(RaiPolicyContentSource.POST_RUN, + response.properties().customBlocklists().get(0).source()); + Assertions.assertEquals("yqixokwtjawhv", response.properties().customTopics().get(0).topicName()); + Assertions.assertFalse(response.properties().customTopics().get(0).blocking()); + Assertions.assertEquals(RaiPolicyContentSource.POST_TOOL_CALL, + response.properties().customTopics().get(0).source()); + Assertions.assertEquals("snvlaqd", response.properties().safetyProviders().get(0).safetyProviderName()); + Assertions.assertFalse(response.properties().safetyProviders().get(0).blocking()); + Assertions.assertEquals(RaiPolicyContentSource.POST_TOOL_CALL, + response.properties().safetyProviders().get(0).source()); + Assertions.assertEquals("ho", response.tags().get("cyanrfvqtvkhgv")); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/TrafficRoutingRuleTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/TrafficRoutingRuleTests.java new file mode 100644 index 000000000000..7ecf30e12559 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/TrafficRoutingRuleTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.models.TrafficRoutingRule; +import org.junit.jupiter.api.Assertions; + +public final class TrafficRoutingRuleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TrafficRoutingRule model = BinaryData.fromString( + "{\"ruleId\":\"xzujksrlsm\",\"description\":\"sqplpvmjcd\",\"deploymentId\":\"wb\",\"trafficPercentage\":1742700994}") + .toObject(TrafficRoutingRule.class); + Assertions.assertEquals("xzujksrlsm", model.ruleId()); + Assertions.assertEquals("sqplpvmjcd", model.description()); + Assertions.assertEquals("wb", model.deploymentId()); + Assertions.assertEquals(1742700994, model.trafficPercentage()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TrafficRoutingRule model = new TrafficRoutingRule().withRuleId("xzujksrlsm") + .withDescription("sqplpvmjcd") + .withDeploymentId("wb") + .withTrafficPercentage(1742700994); + model = BinaryData.fromObject(model).toObject(TrafficRoutingRule.class); + Assertions.assertEquals("xzujksrlsm", model.ruleId()); + Assertions.assertEquals("sqplpvmjcd", model.description()); + Assertions.assertEquals("wb", model.deploymentId()); + Assertions.assertEquals(1742700994, model.trafficPercentage()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsageInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsageInnerTests.java new file mode 100644 index 000000000000..a8c741030bf8 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsageInnerTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageInner; +import com.azure.resourcemanager.cognitiveservices.models.QuotaScopeType; +import com.azure.resourcemanager.cognitiveservices.models.QuotaUsageStatus; +import com.azure.resourcemanager.cognitiveservices.models.UnitType; +import org.junit.jupiter.api.Assertions; + +public final class UsageInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UsageInner model = BinaryData.fromString( + "{\"unit\":\"CountPerSecond\",\"name\":{\"value\":\"nbpoczvyifqrvkdv\",\"localizedValue\":\"llr\"},\"quotaPeriod\":\"vdfwatkpn\",\"limit\":64.15778922246344,\"currentValue\":70.74757992055699,\"nextResetTime\":\"zwtruwiqzbqjvsov\",\"status\":\"Blocked\",\"scopeType\":\"Global\",\"scopeId\":\"spkwlhzdobpxjm\"}") + .toObject(UsageInner.class); + Assertions.assertEquals(UnitType.COUNT_PER_SECOND, model.unit()); + Assertions.assertEquals("nbpoczvyifqrvkdv", model.name().value()); + Assertions.assertEquals("llr", model.name().localizedValue()); + Assertions.assertEquals("vdfwatkpn", model.quotaPeriod()); + Assertions.assertEquals(64.15778922246344D, model.limit()); + Assertions.assertEquals(70.74757992055699D, model.currentValue()); + Assertions.assertEquals("zwtruwiqzbqjvsov", model.nextResetTime()); + Assertions.assertEquals(QuotaUsageStatus.BLOCKED, model.status()); + Assertions.assertEquals(QuotaScopeType.GLOBAL, model.scopeType()); + Assertions.assertEquals("spkwlhzdobpxjm", model.scopeId()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsageListResultInnerTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsageListResultInnerTests.java index c7cbeffebf8a..3d632c3397b5 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsageListResultInnerTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsageListResultInnerTests.java @@ -1,54 +1,32 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageListResultInner; -import com.azure.resourcemanager.cognitiveservices.models.MetricName; +import com.azure.resourcemanager.cognitiveservices.models.QuotaScopeType; import com.azure.resourcemanager.cognitiveservices.models.QuotaUsageStatus; import com.azure.resourcemanager.cognitiveservices.models.UnitType; -import com.azure.resourcemanager.cognitiveservices.models.Usage; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class UsageListResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { UsageListResultInner model = BinaryData.fromString( - "{\"nextLink\":\"zrkgqhcjrefovg\",\"value\":[{\"unit\":\"Count\",\"name\":{\"value\":\"yvxyqjp\",\"localizedValue\":\"attpngjcrcczsq\"},\"quotaPeriod\":\"hvmdajvnysounq\",\"limit\":2.2711891093491476,\"currentValue\":9.069007255985827,\"nextResetTime\":\"pfhyhl\",\"status\":\"Blocked\"}]}") + "{\"nextLink\":\"mohctb\",\"value\":[{\"unit\":\"BytesPerSecond\",\"name\":{\"value\":\"ndnvo\",\"localizedValue\":\"ujjugwdkcglh\"},\"quotaPeriod\":\"azjdyggd\",\"limit\":92.2174087854439,\"currentValue\":3.8497339257224095,\"nextResetTime\":\"ofqweykhmenevfye\",\"status\":\"Blocked\",\"scopeType\":\"Classic\",\"scopeId\":\"cibvyvdcsitynn\"},{\"unit\":\"Bytes\",\"name\":{\"value\":\"ctehfiqscjey\",\"localizedValue\":\"hezrkgq\"},\"quotaPeriod\":\"jrefovgmkqsle\",\"limit\":97.29868657736189,\"currentValue\":91.19923353577501,\"nextResetTime\":\"k\",\"status\":\"Included\",\"scopeType\":\"Classic\",\"scopeId\":\"gjcrcczsqpjhvm\"},{\"unit\":\"BytesPerSecond\",\"name\":{\"value\":\"ysou\",\"localizedValue\":\"e\"},\"quotaPeriod\":\"noae\",\"limit\":94.26749513394212,\"currentValue\":97.24576844160318,\"nextResetTime\":\"rpmopjmc\",\"status\":\"Included\",\"scopeType\":\"Regional\",\"scopeId\":\"thfuiuaodsfcpkvx\"},{\"unit\":\"BytesPerSecond\",\"name\":{\"value\":\"zmyzydagf\",\"localizedValue\":\"xbezyiuokktwh\"},\"quotaPeriod\":\"xw\",\"limit\":48.933406236795584,\"currentValue\":60.16505440558948,\"nextResetTime\":\"ureximoryocfs\",\"status\":\"Included\",\"scopeType\":\"DataZone\",\"scopeId\":\"dystkiiuxhqyud\"}]}") .toObject(UsageListResultInner.class); - Assertions.assertEquals("zrkgqhcjrefovg", model.nextLink()); - Assertions.assertEquals(UnitType.COUNT, model.value().get(0).unit()); - Assertions.assertEquals("yvxyqjp", model.value().get(0).name().value()); - Assertions.assertEquals("attpngjcrcczsq", model.value().get(0).name().localizedValue()); - Assertions.assertEquals("hvmdajvnysounq", model.value().get(0).quotaPeriod()); - Assertions.assertEquals(2.2711891093491476D, model.value().get(0).limit()); - Assertions.assertEquals(9.069007255985827D, model.value().get(0).currentValue()); - Assertions.assertEquals("pfhyhl", model.value().get(0).nextResetTime()); - Assertions.assertEquals(QuotaUsageStatus.BLOCKED, model.value().get(0).status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UsageListResultInner model = new UsageListResultInner().withNextLink("zrkgqhcjrefovg") - .withValue(Arrays.asList(new Usage().withUnit(UnitType.COUNT) - .withName(new MetricName().withValue("yvxyqjp").withLocalizedValue("attpngjcrcczsq")) - .withQuotaPeriod("hvmdajvnysounq") - .withLimit(2.2711891093491476D) - .withCurrentValue(9.069007255985827D) - .withNextResetTime("pfhyhl") - .withStatus(QuotaUsageStatus.BLOCKED))); - model = BinaryData.fromObject(model).toObject(UsageListResultInner.class); - Assertions.assertEquals("zrkgqhcjrefovg", model.nextLink()); - Assertions.assertEquals(UnitType.COUNT, model.value().get(0).unit()); - Assertions.assertEquals("yvxyqjp", model.value().get(0).name().value()); - Assertions.assertEquals("attpngjcrcczsq", model.value().get(0).name().localizedValue()); - Assertions.assertEquals("hvmdajvnysounq", model.value().get(0).quotaPeriod()); - Assertions.assertEquals(2.2711891093491476D, model.value().get(0).limit()); - Assertions.assertEquals(9.069007255985827D, model.value().get(0).currentValue()); - Assertions.assertEquals("pfhyhl", model.value().get(0).nextResetTime()); + Assertions.assertEquals("mohctb", model.nextLink()); + Assertions.assertEquals(UnitType.BYTES_PER_SECOND, model.value().get(0).unit()); + Assertions.assertEquals("ndnvo", model.value().get(0).name().value()); + Assertions.assertEquals("ujjugwdkcglh", model.value().get(0).name().localizedValue()); + Assertions.assertEquals("azjdyggd", model.value().get(0).quotaPeriod()); + Assertions.assertEquals(92.2174087854439D, model.value().get(0).limit()); + Assertions.assertEquals(3.8497339257224095D, model.value().get(0).currentValue()); + Assertions.assertEquals("ofqweykhmenevfye", model.value().get(0).nextResetTime()); Assertions.assertEquals(QuotaUsageStatus.BLOCKED, model.value().get(0).status()); + Assertions.assertEquals(QuotaScopeType.CLASSIC, model.value().get(0).scopeType()); + Assertions.assertEquals("cibvyvdcsitynn", model.value().get(0).scopeId()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsageTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsageTests.java deleted file mode 100644 index dc7e99e9ccb3..000000000000 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsageTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.cognitiveservices.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.cognitiveservices.models.MetricName; -import com.azure.resourcemanager.cognitiveservices.models.QuotaUsageStatus; -import com.azure.resourcemanager.cognitiveservices.models.UnitType; -import com.azure.resourcemanager.cognitiveservices.models.Usage; -import org.junit.jupiter.api.Assertions; - -public final class UsageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Usage model = BinaryData.fromString( - "{\"unit\":\"CountPerSecond\",\"name\":{\"value\":\"mcmatuokthfuiu\",\"localizedValue\":\"dsfcpkvxodpuoz\"},\"quotaPeriod\":\"zydagfuaxbezyiuo\",\"limit\":79.92033791389453,\"currentValue\":57.91530159520734,\"nextResetTime\":\"wz\",\"status\":\"Included\"}") - .toObject(Usage.class); - Assertions.assertEquals(UnitType.COUNT_PER_SECOND, model.unit()); - Assertions.assertEquals("mcmatuokthfuiu", model.name().value()); - Assertions.assertEquals("dsfcpkvxodpuoz", model.name().localizedValue()); - Assertions.assertEquals("zydagfuaxbezyiuo", model.quotaPeriod()); - Assertions.assertEquals(79.92033791389453D, model.limit()); - Assertions.assertEquals(57.91530159520734D, model.currentValue()); - Assertions.assertEquals("wz", model.nextResetTime()); - Assertions.assertEquals(QuotaUsageStatus.INCLUDED, model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Usage model = new Usage().withUnit(UnitType.COUNT_PER_SECOND) - .withName(new MetricName().withValue("mcmatuokthfuiu").withLocalizedValue("dsfcpkvxodpuoz")) - .withQuotaPeriod("zydagfuaxbezyiuo") - .withLimit(79.92033791389453D) - .withCurrentValue(57.91530159520734D) - .withNextResetTime("wz") - .withStatus(QuotaUsageStatus.INCLUDED); - model = BinaryData.fromObject(model).toObject(Usage.class); - Assertions.assertEquals(UnitType.COUNT_PER_SECOND, model.unit()); - Assertions.assertEquals("mcmatuokthfuiu", model.name().value()); - Assertions.assertEquals("dsfcpkvxodpuoz", model.name().localizedValue()); - Assertions.assertEquals("zydagfuaxbezyiuo", model.quotaPeriod()); - Assertions.assertEquals(79.92033791389453D, model.limit()); - Assertions.assertEquals(57.91530159520734D, model.currentValue()); - Assertions.assertEquals("wz", model.nextResetTime()); - Assertions.assertEquals(QuotaUsageStatus.INCLUDED, model.status()); - } -} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsagesListMockTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsagesListMockTests.java index 77bab925bc99..3e1cf42ca304 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsagesListMockTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UsagesListMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -11,6 +11,7 @@ import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager; +import com.azure.resourcemanager.cognitiveservices.models.QuotaScopeType; import com.azure.resourcemanager.cognitiveservices.models.QuotaUsageStatus; import com.azure.resourcemanager.cognitiveservices.models.UnitType; import com.azure.resourcemanager.cognitiveservices.models.Usage; @@ -24,7 +25,7 @@ public final class UsagesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"unit\":\"Count\",\"name\":{\"value\":\"jpnwynudql\",\"localizedValue\":\"sauzpjlx\"},\"quotaPeriod\":\"huxiqhzlraymez\",\"limit\":53.760769809270556,\"currentValue\":13.700915031065364,\"nextResetTime\":\"rfdsajrednwy\",\"status\":\"Blocked\"}]}"; + = "{\"value\":[{\"unit\":\"Percent\",\"name\":{\"value\":\"mqcwwsjnkiixepbn\",\"localizedValue\":\"qww\"},\"quotaPeriod\":\"gsqxilefej\",\"limit\":38.819603070044415,\"currentValue\":10.1375663412669,\"nextResetTime\":\"uqynttwk\",\"status\":\"Blocked\",\"scopeType\":\"Regional\",\"scopeId\":\"bsyogjmqjhgcyd\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,15 +34,17 @@ public void testList() throws Exception { .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.usages().list("yos", "wwhnhjtfvpn", com.azure.core.util.Context.NONE); + PagedIterable response = manager.usages().list("dqyxajclgr", "avqcwy", com.azure.core.util.Context.NONE); - Assertions.assertEquals(UnitType.COUNT, response.iterator().next().unit()); - Assertions.assertEquals("jpnwynudql", response.iterator().next().name().value()); - Assertions.assertEquals("sauzpjlx", response.iterator().next().name().localizedValue()); - Assertions.assertEquals("huxiqhzlraymez", response.iterator().next().quotaPeriod()); - Assertions.assertEquals(53.760769809270556D, response.iterator().next().limit()); - Assertions.assertEquals(13.700915031065364D, response.iterator().next().currentValue()); - Assertions.assertEquals("rfdsajrednwy", response.iterator().next().nextResetTime()); + Assertions.assertEquals(UnitType.PERCENT, response.iterator().next().unit()); + Assertions.assertEquals("mqcwwsjnkiixepbn", response.iterator().next().name().value()); + Assertions.assertEquals("qww", response.iterator().next().name().localizedValue()); + Assertions.assertEquals("gsqxilefej", response.iterator().next().quotaPeriod()); + Assertions.assertEquals(38.819603070044415D, response.iterator().next().limit()); + Assertions.assertEquals(10.1375663412669D, response.iterator().next().currentValue()); + Assertions.assertEquals("uqynttwk", response.iterator().next().nextResetTime()); Assertions.assertEquals(QuotaUsageStatus.BLOCKED, response.iterator().next().status()); + Assertions.assertEquals(QuotaScopeType.REGIONAL, response.iterator().next().scopeType()); + Assertions.assertEquals("bsyogjmqjhgcyd", response.iterator().next().scopeId()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UserAssignedIdentityTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UserAssignedIdentityTests.java index 8d80d7a0ff2a..51fddca6e939 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UserAssignedIdentityTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UserAssignedIdentityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -10,7 +10,7 @@ public final class UserAssignedIdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - UserAssignedIdentity model = BinaryData.fromString("{\"principalId\":\"y\",\"clientId\":\"iwbybrkxvdumjg\"}") + UserAssignedIdentity model = BinaryData.fromString("{\"principalId\":\"bhj\",\"clientId\":\"igeho\"}") .toObject(UserAssignedIdentity.class); } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UserOwnedAmlWorkspaceTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UserOwnedAmlWorkspaceTests.java index a50e1b37bf74..67061b4e0e71 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UserOwnedAmlWorkspaceTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UserOwnedAmlWorkspaceTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -11,17 +11,17 @@ public final class UserOwnedAmlWorkspaceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - UserOwnedAmlWorkspace model = BinaryData.fromString("{\"resourceId\":\"s\",\"identityClientId\":\"zgvfcjrwz\"}") + UserOwnedAmlWorkspace model = BinaryData.fromString("{\"resourceId\":\"tnwu\",\"identityClientId\":\"gazxuf\"}") .toObject(UserOwnedAmlWorkspace.class); - Assertions.assertEquals("s", model.resourceId()); - Assertions.assertEquals("zgvfcjrwz", model.identityClientId()); + Assertions.assertEquals("tnwu", model.resourceId()); + Assertions.assertEquals("gazxuf", model.identityClientId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - UserOwnedAmlWorkspace model = new UserOwnedAmlWorkspace().withResourceId("s").withIdentityClientId("zgvfcjrwz"); + UserOwnedAmlWorkspace model = new UserOwnedAmlWorkspace().withResourceId("tnwu").withIdentityClientId("gazxuf"); model = BinaryData.fromObject(model).toObject(UserOwnedAmlWorkspace.class); - Assertions.assertEquals("s", model.resourceId()); - Assertions.assertEquals("zgvfcjrwz", model.identityClientId()); + Assertions.assertEquals("tnwu", model.resourceId()); + Assertions.assertEquals("gazxuf", model.identityClientId()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UserOwnedStorageTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UserOwnedStorageTests.java index 61578255889e..934b170f8093 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UserOwnedStorageTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/UserOwnedStorageTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -11,17 +11,17 @@ public final class UserOwnedStorageTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - UserOwnedStorage model = BinaryData.fromString("{\"resourceId\":\"trg\",\"identityClientId\":\"bpf\"}") + UserOwnedStorage model = BinaryData.fromString("{\"resourceId\":\"zw\",\"identityClientId\":\"g\"}") .toObject(UserOwnedStorage.class); - Assertions.assertEquals("trg", model.resourceId()); - Assertions.assertEquals("bpf", model.identityClientId()); + Assertions.assertEquals("zw", model.resourceId()); + Assertions.assertEquals("g", model.identityClientId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - UserOwnedStorage model = new UserOwnedStorage().withResourceId("trg").withIdentityClientId("bpf"); + UserOwnedStorage model = new UserOwnedStorage().withResourceId("zw").withIdentityClientId("g"); model = BinaryData.fromObject(model).toObject(UserOwnedStorage.class); - Assertions.assertEquals("trg", model.resourceId()); - Assertions.assertEquals("bpf", model.identityClientId()); + Assertions.assertEquals("zw", model.resourceId()); + Assertions.assertEquals("g", model.identityClientId()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/VersionedAgentReferenceTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/VersionedAgentReferenceTests.java new file mode 100644 index 000000000000..f1e9dd31e2a9 --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/VersionedAgentReferenceTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cognitiveservices.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.cognitiveservices.models.VersionedAgentReference; +import org.junit.jupiter.api.Assertions; + +public final class VersionedAgentReferenceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VersionedAgentReference model = BinaryData + .fromString("{\"agentVersion\":\"krxwet\",\"agentId\":\"drcyrucpcun\",\"agentName\":\"zdqumoe\"}") + .toObject(VersionedAgentReference.class); + Assertions.assertEquals("drcyrucpcun", model.agentId()); + Assertions.assertEquals("zdqumoe", model.agentName()); + Assertions.assertEquals("krxwet", model.agentVersion()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VersionedAgentReference model = new VersionedAgentReference().withAgentId("drcyrucpcun") + .withAgentName("zdqumoe") + .withAgentVersion("krxwet"); + model = BinaryData.fromObject(model).toObject(VersionedAgentReference.class); + Assertions.assertEquals("drcyrucpcun", model.agentId()); + Assertions.assertEquals("zdqumoe", model.agentName()); + Assertions.assertEquals("krxwet", model.agentVersion()); + } +} diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/VirtualNetworkRuleTests.java b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/VirtualNetworkRuleTests.java index 53efa2e5e955..124da650ce82 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/VirtualNetworkRuleTests.java +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/test/java/com/azure/resourcemanager/cognitiveservices/generated/VirtualNetworkRuleTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cognitiveservices.generated; @@ -12,21 +12,22 @@ public final class VirtualNetworkRuleTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { VirtualNetworkRule model = BinaryData - .fromString("{\"id\":\"j\",\"state\":\"hbcryffdfdosyge\",\"ignoreMissingVnetServiceEndpoint\":true}") + .fromString( + "{\"id\":\"vlejuvfqa\",\"state\":\"lyxwjkcprbnwbx\",\"ignoreMissingVnetServiceEndpoint\":false}") .toObject(VirtualNetworkRule.class); - Assertions.assertEquals("j", model.id()); - Assertions.assertEquals("hbcryffdfdosyge", model.state()); - Assertions.assertTrue(model.ignoreMissingVnetServiceEndpoint()); + Assertions.assertEquals("vlejuvfqa", model.id()); + Assertions.assertEquals("lyxwjkcprbnwbx", model.state()); + Assertions.assertFalse(model.ignoreMissingVnetServiceEndpoint()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - VirtualNetworkRule model = new VirtualNetworkRule().withId("j") - .withState("hbcryffdfdosyge") - .withIgnoreMissingVnetServiceEndpoint(true); + VirtualNetworkRule model = new VirtualNetworkRule().withId("vlejuvfqa") + .withState("lyxwjkcprbnwbx") + .withIgnoreMissingVnetServiceEndpoint(false); model = BinaryData.fromObject(model).toObject(VirtualNetworkRule.class); - Assertions.assertEquals("j", model.id()); - Assertions.assertEquals("hbcryffdfdosyge", model.state()); - Assertions.assertTrue(model.ignoreMissingVnetServiceEndpoint()); + Assertions.assertEquals("vlejuvfqa", model.id()); + Assertions.assertEquals("lyxwjkcprbnwbx", model.state()); + Assertions.assertFalse(model.ignoreMissingVnetServiceEndpoint()); } } diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/tsp-location.yaml b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/tsp-location.yaml new file mode 100644 index 000000000000..4cf3bf1aba5f --- /dev/null +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/cognitiveservices/CognitiveServices.Management +commit: 2f2a6cd8118938c1ba3f65d4e09a550d4504620f +repo: Azure/azure-rest-api-specs +additionalDirectories: