From ff041a5d3196e7f11430e5ee6c4fa1561d957a7e Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 13 Nov 2023 09:34:47 +0000 Subject: [PATCH] CodeGen from PR 26676 in Azure/azure-rest-api-specs Merge 31f34074beec7a08aeccc0e6f9286106af40abf2 into 78eac0bd58633028293cb1ec1709baa200bed9e2 --- .../Sample_AppCertificateCollection.cs | 10 +- .../Samples/Sample_AppCertificateResource.cs | 8 +- .../Sample_AppServiceCertificateCollection.cs | 207 + ...le_AppServiceCertificateOrderCollection.cs | 220 + ...mple_AppServiceCertificateOrderResource.cs | 408 ++ .../Sample_AppServiceCertificateResource.cs | 118 + .../Sample_AppServiceDomainCollection.cs | 250 + .../Sample_AppServiceDomainResource.cs | 206 +- .../Sample_AppServiceEnvironmentCollection.cs | 204 + .../Sample_AppServiceEnvironmentResource.cs | 491 +- .../Sample_AppServicePlanCollection.cs | 10 +- .../Samples/Sample_AppServicePlanResource.cs | 8 +- ...le_AseV3NetworkingConfigurationResource.cs | 88 + ...Sample_AuthsettingsV2SiteConfigResource.cs | 188 + ...mple_CertificateOrderDetectorCollection.cs | 8 +- ...Sample_CertificateOrderDetectorResource.cs | 2 +- .../Samples/Sample_ContainerAppCollection.cs | 248 + .../Samples/Sample_ContainerAppResource.cs | 222 + ...le_CustomDnsSuffixConfigurationResource.cs | 117 + .../Samples/Sample_DeletedSiteCollection.cs | 6 +- .../Samples/Sample_DeletedSiteResource.cs | 8 +- ...ple_DomainOwnershipIdentifierCollection.cs | 206 + ...ample_DomainOwnershipIdentifierResource.cs | 116 + ...le_HostingEnvironmentDetectorCollection.cs | 8 +- ...mple_HostingEnvironmentDetectorResource.cs | 2 +- ...HostingEnvironmentMultiRolePoolResource.cs | 246 + ...mentPrivateEndpointConnectionCollection.cs | 211 + ...onmentPrivateEndpointConnectionResource.cs | 123 + ..._HostingEnvironmentWorkerPoolCollection.cs | 207 + ...le_HostingEnvironmentWorkerPoolResource.cs | 214 + .../Sample_KubeEnvironmentCollection.cs | 10 +- .../Samples/Sample_KubeEnvironmentResource.cs | 8 +- .../Sample_RequestHistoryCollection.cs | 182 + .../Samples/Sample_RequestHistoryResource.cs | 55 + .../Sample_ResourceGroupResourceExtensions.cs | 2 +- .../Samples/Sample_RevisionCollection.cs | 166 + .../Samples/Sample_RevisionResource.cs | 135 + ...asicPublishingCredentialsPolicyResource.cs | 4 +- ...asicPublishingCredentialsPolicyResource.cs | 4 +- .../Samples/Sample_SiteBackupCollection.cs | 166 + .../Samples/Sample_SiteBackupResource.cs | 185 + .../Sample_SiteConfigAppsettingCollection.cs | 8 +- .../Sample_SiteConfigAppsettingResource.cs | 2 +- .../Sample_SiteDeploymentStatuCollection.cs | 161 + .../Sample_SiteDeploymentStatuResource.cs | 53 + .../Samples/Sample_SiteDetectorCollection.cs | 16 +- .../Samples/Sample_SiteDetectorResource.cs | 4 +- ...Sample_SiteDiagnosticAnalysisCollection.cs | 16 +- .../Sample_SiteDiagnosticAnalysisResource.cs | 8 +- .../Sample_SiteDiagnosticCollection.cs | 16 +- ...Sample_SiteDiagnosticDetectorCollection.cs | 16 +- .../Sample_SiteDiagnosticDetectorResource.cs | 8 +- .../Samples/Sample_SiteDiagnosticResource.cs | 4 +- ...piWorkflowRunActionRepetitionCollection.cs | 178 + ...kApiWorkflowRunActionRepetitionResource.cs | 89 + ...kflowRunActionScopeRepetitionCollection.cs | 178 + ...orkflowRunActionScopeRepetitionResource.cs | 54 + .../Samples/Sample_SiteInstanceCollection.cs | 6 +- .../Samples/Sample_SiteInstanceResource.cs | 2 +- ...SitePrivateEndpointConnectionCollection.cs | 8 +- ...e_SitePrivateEndpointConnectionResource.cs | 6 +- ...ample_SiteSlotDeploymentStatuCollection.cs | 165 + .../Sample_SiteSlotDeploymentStatuResource.cs | 54 + .../Sample_SiteSlotDetectorCollection.cs | 16 +- .../Sample_SiteSlotDetectorResource.cs | 4 +- ...le_SiteSlotDiagnosticAnalysisCollection.cs | 16 +- ...mple_SiteSlotDiagnosticAnalysisResource.cs | 8 +- .../Sample_SiteSlotDiagnosticCollection.cs | 16 +- ...le_SiteSlotDiagnosticDetectorCollection.cs | 16 +- ...mple_SiteSlotDiagnosticDetectorResource.cs | 8 +- .../Sample_SiteSlotDiagnosticResource.cs | 4 +- .../Sample_SiteSlotInstanceCollection.cs | 6 +- .../Sample_SiteSlotInstanceResource.cs | 2 +- ...SlotPrivateEndpointConnectionCollection.cs | 8 +- ...teSlotPrivateEndpointConnectionResource.cs | 6 +- .../Sample_SiteSlotWorkflowCollection.cs | 170 + .../Sample_SiteSlotWorkflowResource.cs | 52 + .../Samples/Sample_SiteWorkflowCollection.cs | 166 + .../Samples/Sample_SiteWorkflowResource.cs | 51 + ...taticSiteBasicAuthPropertiesARMResource.cs | 95 + ...asicAuthPropertiesARMResourceCollection.cs | 212 + .../Sample_StaticSiteBuildCollection.cs | 8 +- ...icSiteBuildDatabaseConnectionCollection.cs | 214 + ...aticSiteBuildDatabaseConnectionResource.cs | 150 + ..._StaticSiteBuildLinkedBackendCollection.cs | 212 + ...le_StaticSiteBuildLinkedBackendResource.cs | 155 + .../Samples/Sample_StaticSiteBuildResource.cs | 48 +- ...eBuildUserProvidedFunctionAppCollection.cs | 10 +- ...iteBuildUserProvidedFunctionAppResource.cs | 6 +- .../Samples/Sample_StaticSiteCollection.cs | 10 +- ...taticSiteCustomDomainOverviewCollection.cs | 10 +- ..._StaticSiteCustomDomainOverviewResource.cs | 8 +- ..._StaticSiteDatabaseConnectionCollection.cs | 209 + ...le_StaticSiteDatabaseConnectionResource.cs | 146 + ...ample_StaticSiteLinkedBackendCollection.cs | 207 + .../Sample_StaticSiteLinkedBackendResource.cs | 151 + ...SitePrivateEndpointConnectionCollection.cs | 10 +- ...icSitePrivateEndpointConnectionResource.cs | 6 +- .../Samples/Sample_StaticSiteResource.cs | 69 +- ...icSiteUserProvidedFunctionAppCollection.cs | 10 +- ...aticSiteUserProvidedFunctionAppResource.cs | 6 +- .../Sample_SubscriptionResourceExtensions.cs | 253 +- .../Sample_TenantResourceExtensions.cs | 14 +- .../Sample_TopLevelDomainCollection.cs | 8 +- .../Samples/Sample_TopLevelDomainResource.cs | 4 +- .../Samples/Sample_WebSiteCollection.cs | 257 + .../Samples/Sample_WebSiteConfigResource.cs | 133 + ...eFtpPublishingCredentialsPolicyResource.cs | 4 +- .../Samples/Sample_WebSiteResource.cs | 680 ++- ...e_WebSiteResourceHealthMetadataResource.cs | 2 +- .../Samples/Sample_WebSiteSlotCollection.cs | 262 + ...e_WebSiteSlotConfigAppSettingCollection.cs | 8 +- ...ple_WebSiteSlotConfigAppSettingResource.cs | 2 +- ...tFtpPublishingCredentialsPolicyResource.cs | 4 +- .../Samples/Sample_WebSiteSlotResource.cs | 256 +- ...bSiteSlotResourceHealthMetadataResource.cs | 2 +- .../Sample_WorkflowRunActionCollection.cs | 174 + .../Sample_WorkflowRunActionResource.cs | 87 + .../Samples/Sample_WorkflowRunCollection.cs | 170 + .../Samples/Sample_WorkflowRunResource.cs | 81 + .../Sample_WorkflowTriggerCollection.cs | 170 + ...Sample_WorkflowTriggerHistoryCollection.cs | 174 + .../Sample_WorkflowTriggerHistoryResource.cs | 84 + .../Samples/Sample_WorkflowTriggerResource.cs | 141 + .../Sample_WorkflowVersionCollection.cs | 170 + .../Samples/Sample_WorkflowVersionResource.cs | 52 + .../src/Generated/AppServiceDomainResource.cs | 60 + .../Generated/AppServiceEnvironmentData.cs | 18 +- .../AppServiceEnvironmentResource.cs | 135 + .../src/Generated/AppServicePlanData.cs | 6 +- .../Generated/ArmAppServiceModelFactory.cs | 910 +++- .../AseV3NetworkingConfigurationData.cs | 14 +- .../AuthsettingsV2SiteConfigResource.cs | 292 ++ .../AuthsettingsV2SiteSlotConfigResource.cs | 293 ++ .../src/Generated/ContainerAppCollection.cs | 416 ++ .../src/Generated/ContainerAppData.cs | 67 + .../src/Generated/ContainerAppResource.cs | 643 +++ .../src/Generated/CsmDeploymentStatusData.cs | 70 + .../CustomDnsSuffixConfigurationData.cs | 60 + .../CustomDnsSuffixConfigurationResource.cs | 300 ++ .../src/Generated/DatabaseConnectionData.cs | 61 + .../Extensions/AppServiceExtensions.cs | 682 +++ .../Extensions/MockableAppServiceArmClient.cs | 264 + ...MockableAppServiceResourceGroupResource.cs | 53 + .../MockableAppServiceSubscriptionResource.cs | 240 + .../src/Generated/KubeEnvironmentData.cs | 10 +- .../ContainerAppOperationSource.cs | 40 + .../SiteDeploymentStatuOperationSource.cs | 40 + .../SiteSlotDeploymentStatuOperationSource.cs | 40 + ...icSiteBuildLinkedBackendOperationSource.cs | 40 + .../StaticSiteLinkedBackendOperationSource.cs | 40 + .../Generated/Models/ActiveRevisionsMode.cs | 54 + ...ppServiceCertificateEmail.Serialization.cs | 83 +- .../Models/AppServiceCertificateEmail.cs | 20 +- .../AppServiceEndpointDetail.Serialization.cs | 4 +- .../Models/AppServiceEndpointDetail.cs | 4 +- ...eEnvironmentAddressResult.Serialization.cs | 14 +- .../AppServiceEnvironmentAddressResult.cs | 10 +- ...AppServiceEnvironmentData.Serialization.cs | 57 +- ...ppServiceEnvironmentPatch.Serialization.cs | 58 +- .../Models/AppServiceEnvironmentPatch.cs | 19 +- ...viceEnvironmentProperties.Serialization.cs | 58 +- .../Models/AppServiceEnvironmentProperties.cs | 19 +- .../src/Generated/Models/AppServiceKind.cs | 51 + .../AppServiceOperation.Serialization.cs | 7 +- .../Generated/Models/AppServiceOperation.cs | 7 +- .../AppServicePlanData.Serialization.cs | 12 +- .../AppServicePlanPatch.Serialization.cs | 12 +- .../Generated/Models/AppServicePlanPatch.cs | 6 +- .../Models/AseRegion.Serialization.cs | 175 + .../src/Generated/Models/AseRegion.cs | 62 + .../AseRegionCollection.Serialization.cs | 45 + .../Generated/Models/AseRegionCollection.cs | 42 + ...tworkingConfigurationData.Serialization.cs | 43 +- .../AzureResourceErrorInfo.Serialization.cs | 55 + .../Models/AzureResourceErrorInfo.cs | 48 + .../src/Generated/Models/BasicAuthName.cs | 48 + .../CertificateOrderAction.Serialization.cs | 73 +- .../Models/CertificateOrderAction.cs | 16 +- .../Models/Configuration.Serialization.cs | 114 + .../src/Generated/Models/Configuration.cs | 51 + .../Models/Container.Serialization.cs | 146 + .../src/Generated/Models/Container.cs | 54 + .../ContainerAppCollection.Serialization.cs | 46 + .../Models/ContainerAppCollection.cs | 43 + .../Models/ContainerAppData.Serialization.cs | 187 + .../Models/ContainerAppProvisioningState.cs | 57 + .../ContainerAppSecret.Serialization.cs | 39 + .../Generated/Models/ContainerAppSecret.cs | 32 + ...ontainerAppsConfiguration.Serialization.cs | 99 + .../Models/ContainerAppsConfiguration.cs | 48 + .../ContainerResources.Serialization.cs | 59 + .../Generated/Models/ContainerResources.cs | 32 + .../Models/ContentHash.Serialization.cs | 39 + .../src/Generated/Models/ContentHash.cs | 32 + .../Models/ContentLink.Serialization.cs | 85 + .../src/Generated/Models/ContentLink.cs | 75 + .../Models/Correlation.Serialization.cs | 33 + .../src/Generated/Models/Correlation.cs | 28 + ...eploymentStatusCollection.Serialization.cs | 46 + .../Models/CsmDeploymentStatusCollection.cs | 43 + .../CsmDeploymentStatusData.Serialization.cs | 211 + ...nsSuffixConfigurationData.Serialization.cs | 143 + ...nsSuffixProvisioningState.Serialization.cs | 32 + .../CustomDnsSuffixProvisioningState.cs | 22 + .../Generated/Models/CustomDomainStatus.cs | 3 + ...tomHostnameAnalysisResult.Serialization.cs | 5 +- .../Models/CustomHostnameAnalysisResult.cs | 5 +- .../CustomHostnameSites.Serialization.cs | 137 + .../Generated/Models/CustomHostnameSites.cs | 50 + ...omHostnameSitesCollection.Serialization.cs | 45 + .../Models/CustomHostnameSitesCollection.cs | 42 + .../Models/CustomScaleRule.Serialization.cs | 96 + .../src/Generated/Models/CustomScaleRule.cs | 47 + .../Generated/Models/Dapr.Serialization.cs | 100 + .../src/Generated/Models/Dapr.cs | 44 + .../Models/DaprComponent.Serialization.cs | 92 + .../src/Generated/Models/DaprComponent.cs | 44 + .../Models/DaprConfig.Serialization.cs | 134 + .../src/Generated/Models/DaprConfig.cs | 52 + .../src/Generated/Models/DaprLogLevel.cs | 57 + .../Models/DaprMetadata.Serialization.cs | 66 + .../src/Generated/Models/DaprMetadata.cs | 36 + ...abaseConnectionCollection.Serialization.cs | 46 + .../Models/DatabaseConnectionCollection.cs | 43 + .../DatabaseConnectionData.Serialization.cs | 149 + ...atabaseConnectionOverview.Serialization.cs | 67 + .../Models/DatabaseConnectionOverview.cs | 48 + ...aseConnectionPatchRequest.Serialization.cs | 44 + .../Models/DatabaseConnectionPatchRequest.cs | 27 + .../Models/DayOfWeek.Serialization.cs | 38 + .../src/Generated/Models/DayOfWeek.cs | 28 + .../Models/DaysOfWeek.Serialization.cs | 38 + .../src/Generated/Models/DaysOfWeek.cs | 28 + .../src/Generated/Models/DefaultAction.cs | 51 + .../Generated/Models/DeploymentBuildStatus.cs | 84 + .../Models/EnterpriseGradeCdnStatus.cs | 57 + .../Models/EnvironmentVar.Serialization.cs | 66 + .../src/Generated/Models/EnvironmentVar.cs | 36 + .../Models/ErrorEntity.Serialization.cs | 164 + .../src/Generated/Models/ErrorEntity.cs | 62 + .../Models/ErrorInfo.Serialization.cs | 32 + .../src/Generated/Models/ErrorInfo.cs | 29 + .../Models/ErrorProperties.Serialization.cs | 55 + .../src/Generated/Models/ErrorProperties.cs | 32 + .../Models/ErrorResponse.Serialization.cs | 48 + .../src/Generated/Models/ErrorResponse.cs | 28 + .../Models/Expression.Serialization.cs | 70 + .../src/Generated/Models/Expression.cs | 74 + .../Models/ExpressionRoot.Serialization.cs | 76 + .../src/Generated/Models/ExpressionRoot.cs | 35 + .../Models/ExpressionTraces.Serialization.cs | 60 + .../src/Generated/Models/ExpressionTraces.cs | 70 + ...ccessControlConfiguration.Serialization.cs | 93 + .../Models/FlowAccessControlConfiguration.cs | 40 + ...ontrolConfigurationPolicy.Serialization.cs | 74 + .../FlowAccessControlConfigurationPolicy.cs | 46 + .../Models/FlowEndpoints.Serialization.cs | 84 + .../src/Generated/Models/FlowEndpoints.cs | 37 + ...lowEndpointsConfiguration.Serialization.cs | 63 + .../Models/FlowEndpointsConfiguration.cs | 32 + .../Models/HttpScaleRule.Serialization.cs | 85 + .../src/Generated/Models/HttpScaleRule.cs | 37 + .../Models/IPAddress.Serialization.cs | 44 + .../src/Generated/Models/IPAddress.cs | 28 + .../Models/IPAddressRange.Serialization.cs | 44 + .../src/Generated/Models/IPAddressRange.cs | 28 + .../Generated/Models/Ingress.Serialization.cs | 125 + .../src/Generated/Models/Ingress.cs | 52 + .../Models/IngressTransportMethod.cs | 54 + .../Models/JsonSchema.Serialization.cs | 39 + .../src/Generated/Models/JsonSchema.cs | 32 + .../src/Generated/Models/KeyType.cs | 54 + .../KubeEnvironmentData.Serialization.cs | 28 +- .../KubeEnvironmentPatch.Serialization.cs | 17 +- .../Generated/Models/KubeEnvironmentPatch.cs | 6 +- ...henticationAccessPolicies.Serialization.cs | 60 + .../OpenAuthenticationAccessPolicies.cs | 32 + ...uthenticationAccessPolicy.Serialization.cs | 74 + .../Models/OpenAuthenticationAccessPolicy.cs | 36 + ...AuthenticationPolicyClaim.Serialization.cs | 55 + .../Models/OpenAuthenticationPolicyClaim.cs | 32 + .../Models/OpenAuthenticationProviderType.cs | 48 + .../src/Generated/Models/ParameterType.cs | 72 + .../Models/QueueScaleRule.Serialization.cs | 85 + .../src/Generated/Models/QueueScaleRule.cs | 40 + .../Generated/Models/RecurrenceFrequency.cs | 69 + .../RecurrenceSchedule.Serialization.cs | 103 + .../Generated/Models/RecurrenceSchedule.cs | 52 + ...urrenceScheduleOccurrence.Serialization.cs | 47 + .../Models/RecurrenceScheduleOccurrence.cs | 32 + ...RegenerateActionParameter.Serialization.cs | 26 + .../Models/RegenerateActionParameter.cs | 21 + .../RegistryCredentials.Serialization.cs | 66 + .../Generated/Models/RegistryCredentials.cs | 36 + ...PrivateEndpointConnection.Serialization.cs | 6 +- .../Models/RemotePrivateEndpointConnection.cs | 6 +- ...ConnectionARMResourceData.Serialization.cs | 6 +- .../Models/RepetitionIndex.Serialization.cs | 52 + .../src/Generated/Models/RepetitionIndex.cs | 34 + .../Generated/Models/Request.Serialization.cs | 82 + .../src/Generated/Models/Request.cs | 67 + .../RequestHistoryData.Serialization.cs | 113 + .../RequestHistoryListResult.Serialization.cs | 50 + .../Models/RequestHistoryListResult.cs | 37 + .../RequestHistoryProperties.Serialization.cs | 94 + .../Models/RequestHistoryProperties.cs | 42 + .../Models/ResourceConfig.Serialization.cs | 59 + .../src/Generated/Models/ResourceConfig.cs | 32 + ...ceNameAvailabilityContent.Serialization.cs | 5 + .../Models/ResourceNameAvailabilityContent.cs | 2 + .../Models/ResourceReference.Serialization.cs | 56 + .../src/Generated/Models/ResourceReference.cs | 36 + .../Models/Response.Serialization.cs | 86 + .../src/Generated/Models/Response.cs | 67 + ...PrivateEndpointConnection.Serialization.cs | 5 +- ...EnvelopeRemotePrivateEndpointConnection.cs | 5 +- .../Models/RetryHistory.Serialization.cs | 112 + .../src/Generated/Models/RetryHistory.cs | 61 + .../RevisionCollection.Serialization.cs | 46 + .../Generated/Models/RevisionCollection.cs | 43 + .../Models/RevisionData.Serialization.cs | 207 + .../Generated/Models/RevisionHealthState.cs | 54 + .../Models/RevisionProvisioningState.cs | 60 + .../RunActionCorrelation.Serialization.cs | 81 + .../Generated/Models/RunActionCorrelation.cs | 32 + .../Models/RunCorrelation.Serialization.cs | 70 + .../src/Generated/Models/RunCorrelation.cs | 36 + .../Generated/Models/Scale.Serialization.cs | 89 + .../src/Generated/Models/Scale.cs | 40 + .../Models/ScaleRule.Serialization.cs | 89 + .../src/Generated/Models/ScaleRule.cs | 40 + .../Models/ScaleRuleAuth.Serialization.cs | 55 + .../src/Generated/Models/ScaleRuleAuth.cs | 32 + .../Generated/Models/Secret.Serialization.cs | 55 + .../src/Generated/Models/Secret.cs | 32 + .../Models/SecretsCollection.Serialization.cs | 38 + .../src/Generated/Models/SecretsCollection.cs | 38 + .../src/Generated/Models/SiteAuthSettings.cs | 4 +- ...> SiteAuthSettingsV2Data.Serialization.cs} | 9 +- .../Models/SiteConfigData.Serialization.cs | 127 +- .../SiteConfigProperties.Serialization.cs | 127 +- .../Generated/Models/SiteConfigProperties.cs | 29 +- ...PropertiesARMResourceData.Serialization.cs | 158 + ...cAuthPropertiesCollection.Serialization.cs | 46 + ...StaticSiteBasicAuthPropertiesCollection.cs | 43 + .../StaticSiteBuildData.Serialization.cs | 32 +- .../Models/StaticSiteData.Serialization.cs | 63 +- ...ConfigurationFileOverview.Serialization.cs | 45 + ...baseConnectionConfigurationFileOverview.cs | 36 + .../StaticSiteLinkedBackend.Serialization.cs | 56 + .../Models/StaticSiteLinkedBackend.cs | 42 + ...kedBackendARMResourceData.Serialization.cs | 127 + ...eLinkedBackendsCollection.Serialization.cs | 46 + .../StaticSiteLinkedBackendsCollection.cs | 43 + .../Models/StaticSitePatch.Serialization.cs | 63 +- .../src/Generated/Models/StaticSitePatch.cs | 22 +- .../Models/Template.Serialization.cs | 100 + .../src/Generated/Models/Template.cs | 48 + .../src/Generated/Models/TlsCipherSuite.cs | 96 + .../Models/TrafficWeight.Serialization.cs | 74 + .../src/Generated/Models/TrafficWeight.cs | 36 + .../TriggeredWebJobData.Serialization.cs | 28 +- .../Generated/Models/UpgradeAvailability.cs | 51 + .../src/Generated/Models/UpgradePreference.cs | 57 + .../Models/WebSiteData.Serialization.cs | 110 +- .../Models/Workflow.Serialization.cs | 318 ++ .../src/Generated/Models/Workflow.cs | 126 + .../Models/WorkflowArtifacts.Serialization.cs | 66 + .../src/Generated/Models/WorkflowArtifacts.cs | 89 + ...orkflowEnvelopeCollection.Serialization.cs | 46 + .../Models/WorkflowEnvelopeCollection.cs | 43 + .../WorkflowEnvelopeData.Serialization.cs | 83 + ...orkflowEnvelopeProperties.Serialization.cs | 71 + .../Models/WorkflowEnvelopeProperties.cs | 70 + .../Models/WorkflowHealth.Serialization.cs | 43 + .../src/Generated/Models/WorkflowHealth.cs | 34 + .../WorkflowHealthState.Serialization.cs | 32 + .../Generated/Models/WorkflowHealthState.cs | 22 + .../WorkflowOutputParameter.Serialization.cs | 114 + .../Models/WorkflowOutputParameter.cs | 63 + .../Models/WorkflowParameter.Serialization.cs | 104 + .../src/Generated/Models/WorkflowParameter.cs | 100 + .../Models/WorkflowProvisioningState.cs | 111 + .../WorkflowRunActionData.Serialization.cs | 178 + ...rkflowRunActionListResult.Serialization.cs | 50 + .../Models/WorkflowRunActionListResult.cs | 37 + ...itionDefinitionCollection.Serialization.cs | 50 + ...RunActionRepetitionDefinitionCollection.cs | 37 + ...nRepetitionDefinitionData.Serialization.cs | 328 ++ .../Models/WorkflowRunData.Serialization.cs | 188 + .../WorkflowRunListResult.Serialization.cs | 50 + .../Generated/Models/WorkflowRunListResult.cs | 37 + .../WorkflowRunTrigger.Serialization.cs | 156 + .../Generated/Models/WorkflowRunTrigger.cs | 204 + .../Models/WorkflowSku.Serialization.cs | 43 + .../src/Generated/Models/WorkflowSku.cs | 34 + .../src/Generated/Models/WorkflowSkuName.cs | 63 + .../src/Generated/Models/WorkflowState.cs | 63 + .../src/Generated/Models/WorkflowStatus.cs | 84 + ...orkflowTriggerCallbackUri.Serialization.cs | 77 + .../Models/WorkflowTriggerCallbackUri.cs | 52 + .../WorkflowTriggerData.Serialization.cs | 160 + ...orkflowTriggerHistoryData.Serialization.cs | 182 + ...wTriggerHistoryListResult.Serialization.cs | 50 + .../WorkflowTriggerHistoryListResult.cs | 37 + ...gerListCallbackUrlQueries.Serialization.cs | 57 + .../WorkflowTriggerListCallbackUrlQueries.cs | 44 + ...WorkflowTriggerListResult.Serialization.cs | 50 + .../Models/WorkflowTriggerListResult.cs | 37 + .../WorkflowTriggerProvisioningState.cs | 99 + ...WorkflowTriggerRecurrence.Serialization.cs | 75 + .../Models/WorkflowTriggerRecurrence.cs | 48 + .../WorkflowVersionData.Serialization.cs | 274 + ...WorkflowVersionListResult.Serialization.cs | 50 + .../Models/WorkflowVersionListResult.cs | 37 + ...rivateEndpointConnectionARMResourceData.cs | 6 +- .../src/Generated/RequestHistoryCollection.cs | 333 ++ .../src/Generated/RequestHistoryData.cs | 43 + .../src/Generated/RequestHistoryResource.cs | 161 + ...pServiceCertificateOrdersRestOperations.cs | 2 +- .../AppServiceEnvironmentsRestOperations.cs | 389 +- .../AppServicePlansRestOperations.cs | 2 +- ...tificateOrdersDiagnosticsRestOperations.cs | 2 +- ...icateRegistrationProviderRestOperations.cs | 2 +- .../CertificatesRestOperations.cs | 2 +- .../ContainerAppsRestOperations.cs | 625 +++ .../ContainerAppsRevisionsRestOperations.cs | 508 ++ .../DeletedWebAppsRestOperations.cs | 2 +- .../DiagnosticsRestOperations.cs | 2 +- ...omainRegistrationProviderRestOperations.cs | 2 +- .../RestOperations/DomainsRestOperations.cs | 81 +- .../GetUsagesInLocationRestOperations.cs | 181 + .../RestOperations/GlobalRestOperations.cs | 2 +- .../KubeEnvironmentsRestOperations.cs | 2 +- .../RestOperations/ProviderRestOperations.cs | 2 +- .../RecommendationsRestOperations.cs | 2 +- .../ResourceHealthMetadataRestOperations.cs | 2 +- .../StaticSitesRestOperations.cs | 4637 +++++++++++++---- .../TopLevelDomainsRestOperations.cs | 2 +- .../RestOperations/WebAppsRestOperations.cs | 1722 +++++- .../WebSiteManagementRestOperations.cs | 280 +- ...petitionsRequestHistoriesRestOperations.cs | 347 ++ ...kflowRunActionRepetitionsRestOperations.cs | 526 ++ ...RunActionScopeRepetitionsRestOperations.cs | 331 ++ .../WorkflowRunActionsRestOperations.cs | 516 ++ .../WorkflowRunsRestOperations.cs | 396 ++ .../WorkflowTriggerHistoriesRestOperations.cs | 418 ++ .../WorkflowTriggersRestOperations.cs | 580 +++ .../WorkflowVersionsRestOperations.cs | 307 ++ .../RestOperations/WorkflowsRestOperations.cs | 205 + .../src/Generated/RevisionCollection.cs | 333 ++ .../src/Generated/RevisionData.cs | 94 + .../src/Generated/RevisionResource.cs | 337 ++ ...ettingsV2.cs => SiteAuthSettingsV2Data.cs} | 18 +- .../src/Generated/SiteConfigData.cs | 29 +- .../SiteDeploymentStatuCollection.cs | 341 ++ .../Generated/SiteDeploymentStatuResource.cs | 161 + ...piWorkflowRunActionRepetitionCollection.cs | 333 ++ ...kApiWorkflowRunActionRepetitionResource.cs | 259 + ...kflowRunActionScopeRepetitionCollection.cs | 333 ++ ...orkflowRunActionScopeRepetitionResource.cs | 160 + .../SiteSlotDeploymentStatuCollection.cs | 341 ++ .../SiteSlotDeploymentStatuResource.cs | 162 + .../Generated/SiteSlotWorkflowCollection.cs | 333 ++ .../src/Generated/SiteSlotWorkflowResource.cs | 158 + .../src/Generated/SiteWorkflowCollection.cs | 333 ++ .../src/Generated/SiteWorkflowResource.cs | 157 + ...taticSiteBasicAuthPropertiesARMResource.cs | 234 + ...asicAuthPropertiesARMResourceCollection.cs | 388 ++ ...cSiteBasicAuthPropertiesARMResourceData.cs | 61 + .../src/Generated/StaticSiteBuildData.cs | 12 +- ...icSiteBuildDatabaseConnectionCollection.cs | 415 ++ ...aticSiteBuildDatabaseConnectionResource.cs | 355 ++ .../StaticSiteBuildLinkedBackendCollection.cs | 415 ++ .../StaticSiteBuildLinkedBackendResource.cs | 380 ++ .../src/Generated/StaticSiteBuildResource.cs | 150 + .../src/Generated/StaticSiteData.cs | 22 +- .../StaticSiteDatabaseConnectionCollection.cs | 415 ++ .../StaticSiteDatabaseConnectionResource.cs | 354 ++ .../StaticSiteLinkedBackendARMResourceData.cs | 55 + .../StaticSiteLinkedBackendCollection.cs | 415 ++ .../StaticSiteLinkedBackendResource.cs | 379 ++ .../src/Generated/StaticSiteResource.cs | 199 + .../src/Generated/TriggeredWebJobData.cs | 10 +- .../src/Generated/WebSiteData.cs | 34 +- .../src/Generated/WebSiteResource.cs | 900 +++- .../src/Generated/WebSiteSlotResource.cs | 365 +- .../src/Generated/WorkflowEnvelopeData.cs | 47 + .../Generated/WorkflowRunActionCollection.cs | 337 ++ .../src/Generated/WorkflowRunActionData.cs | 140 + ...rkflowRunActionRepetitionDefinitionData.cs | 218 + .../Generated/WorkflowRunActionResource.cs | 311 ++ .../src/Generated/WorkflowRunCollection.cs | 342 ++ .../src/Generated/WorkflowRunData.cs | 121 + .../src/Generated/WorkflowRunResource.cs | 271 + .../Generated/WorkflowTriggerCollection.cs | 342 ++ .../src/Generated/WorkflowTriggerData.cs | 72 + .../WorkflowTriggerHistoryCollection.cs | 337 ++ .../Generated/WorkflowTriggerHistoryData.cs | 119 + .../WorkflowTriggerHistoryResource.cs | 227 + .../src/Generated/WorkflowTriggerResource.cs | 400 ++ .../Generated/WorkflowVersionCollection.cs | 340 ++ .../src/Generated/WorkflowVersionData.cs | 118 + .../src/Generated/WorkflowVersionResource.cs | 158 + .../src/autorest.md | 2 +- 506 files changed, 57105 insertions(+), 1875 deletions(-) create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceCertificateCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceCertificateOrderCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceCertificateOrderResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceCertificateResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceDomainCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceEnvironmentCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AseV3NetworkingConfigurationResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AuthsettingsV2SiteConfigResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_ContainerAppCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_ContainerAppResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_CustomDnsSuffixConfigurationResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_DomainOwnershipIdentifierCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_DomainOwnershipIdentifierResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_HostingEnvironmentMultiRolePoolResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_HostingEnvironmentPrivateEndpointConnectionCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_HostingEnvironmentPrivateEndpointConnectionResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_HostingEnvironmentWorkerPoolCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_HostingEnvironmentWorkerPoolResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_RequestHistoryCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_RequestHistoryResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_RevisionCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_RevisionResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteBackupCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteBackupResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDeploymentStatuCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDeploymentStatuResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteHostruntimeWebhookApiWorkflowRunActionRepetitionCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDeploymentStatuCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDeploymentStatuResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotWorkflowCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotWorkflowResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteWorkflowCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteWorkflowResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBasicAuthPropertiesARMResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBasicAuthPropertiesARMResourceCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildDatabaseConnectionCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildDatabaseConnectionResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildLinkedBackendCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildLinkedBackendResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteDatabaseConnectionCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteDatabaseConnectionResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteLinkedBackendCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteLinkedBackendResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteConfigResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteSlotCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowRunActionCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowRunActionResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowRunCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowRunResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowTriggerCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowTriggerHistoryCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowTriggerHistoryResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowTriggerResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowVersionCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowVersionResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/AuthsettingsV2SiteConfigResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/AuthsettingsV2SiteSlotConfigResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/ContainerAppCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/ContainerAppData.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/ContainerAppResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/CsmDeploymentStatusData.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/CustomDnsSuffixConfigurationData.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/CustomDnsSuffixConfigurationResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/DatabaseConnectionData.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/ContainerAppOperationSource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/SiteDeploymentStatuOperationSource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/SiteSlotDeploymentStatuOperationSource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/StaticSiteBuildLinkedBackendOperationSource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/StaticSiteLinkedBackendOperationSource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ActiveRevisionsMode.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceKind.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AseRegion.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AseRegion.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AseRegionCollection.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AseRegionCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AzureResourceErrorInfo.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AzureResourceErrorInfo.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/BasicAuthName.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Configuration.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Configuration.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Container.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Container.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContainerAppCollection.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContainerAppCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContainerAppData.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContainerAppProvisioningState.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContainerAppSecret.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContainerAppSecret.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContainerAppsConfiguration.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContainerAppsConfiguration.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContainerResources.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContainerResources.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContentHash.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContentHash.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContentLink.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContentLink.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Correlation.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Correlation.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CsmDeploymentStatusCollection.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CsmDeploymentStatusCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CsmDeploymentStatusData.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CustomDnsSuffixConfigurationData.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CustomDnsSuffixProvisioningState.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CustomDnsSuffixProvisioningState.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CustomHostnameSites.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CustomHostnameSites.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CustomHostnameSitesCollection.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CustomHostnameSitesCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CustomScaleRule.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CustomScaleRule.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Dapr.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Dapr.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DaprComponent.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DaprComponent.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DaprConfig.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DaprConfig.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DaprLogLevel.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DaprMetadata.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DaprMetadata.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DatabaseConnectionCollection.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DatabaseConnectionCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DatabaseConnectionData.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DatabaseConnectionOverview.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DatabaseConnectionOverview.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DatabaseConnectionPatchRequest.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DatabaseConnectionPatchRequest.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DayOfWeek.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DayOfWeek.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DaysOfWeek.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DaysOfWeek.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DefaultAction.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/DeploymentBuildStatus.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/EnterpriseGradeCdnStatus.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/EnvironmentVar.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/EnvironmentVar.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ErrorEntity.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ErrorEntity.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ErrorInfo.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ErrorInfo.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ErrorProperties.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ErrorProperties.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ErrorResponse.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ErrorResponse.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Expression.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Expression.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ExpressionRoot.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ExpressionRoot.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ExpressionTraces.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ExpressionTraces.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FlowAccessControlConfiguration.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FlowAccessControlConfiguration.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FlowAccessControlConfigurationPolicy.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FlowAccessControlConfigurationPolicy.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FlowEndpoints.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FlowEndpoints.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FlowEndpointsConfiguration.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/FlowEndpointsConfiguration.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/HttpScaleRule.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/HttpScaleRule.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/IPAddress.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/IPAddress.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/IPAddressRange.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/IPAddressRange.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Ingress.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Ingress.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/IngressTransportMethod.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/JsonSchema.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/JsonSchema.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/KeyType.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/OpenAuthenticationAccessPolicies.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/OpenAuthenticationAccessPolicies.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/OpenAuthenticationAccessPolicy.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/OpenAuthenticationAccessPolicy.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/OpenAuthenticationPolicyClaim.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/OpenAuthenticationPolicyClaim.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/OpenAuthenticationProviderType.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ParameterType.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/QueueScaleRule.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/QueueScaleRule.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RecurrenceFrequency.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RecurrenceSchedule.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RecurrenceSchedule.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RecurrenceScheduleOccurrence.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RecurrenceScheduleOccurrence.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RegenerateActionParameter.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RegenerateActionParameter.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RegistryCredentials.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RegistryCredentials.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RepetitionIndex.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RepetitionIndex.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Request.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Request.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RequestHistoryData.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RequestHistoryListResult.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RequestHistoryListResult.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RequestHistoryProperties.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RequestHistoryProperties.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ResourceConfig.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ResourceConfig.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ResourceReference.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ResourceReference.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Response.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Response.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RetryHistory.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RetryHistory.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RevisionCollection.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RevisionCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RevisionData.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RevisionHealthState.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RevisionProvisioningState.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RunActionCorrelation.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RunActionCorrelation.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RunCorrelation.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/RunCorrelation.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Scale.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Scale.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ScaleRule.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ScaleRule.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ScaleRuleAuth.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ScaleRuleAuth.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Secret.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Secret.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/SecretsCollection.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/SecretsCollection.cs rename sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/{SiteAuthSettingsV2.Serialization.cs => SiteAuthSettingsV2Data.Serialization.cs} (93%) create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/StaticSiteBasicAuthPropertiesARMResourceData.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/StaticSiteBasicAuthPropertiesCollection.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/StaticSiteBasicAuthPropertiesCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/StaticSiteDatabaseConnectionConfigurationFileOverview.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/StaticSiteDatabaseConnectionConfigurationFileOverview.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/StaticSiteLinkedBackend.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/StaticSiteLinkedBackend.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/StaticSiteLinkedBackendARMResourceData.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/StaticSiteLinkedBackendsCollection.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/StaticSiteLinkedBackendsCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Template.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Template.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/TlsCipherSuite.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/TrafficWeight.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/TrafficWeight.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/UpgradeAvailability.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/UpgradePreference.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Workflow.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Workflow.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowArtifacts.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowArtifacts.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowEnvelopeCollection.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowEnvelopeCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowEnvelopeData.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowEnvelopeProperties.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowEnvelopeProperties.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowHealth.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowHealth.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowHealthState.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowHealthState.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowOutputParameter.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowOutputParameter.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowParameter.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowParameter.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowProvisioningState.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowRunActionData.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowRunActionListResult.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowRunActionListResult.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowRunActionRepetitionDefinitionCollection.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowRunActionRepetitionDefinitionCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowRunActionRepetitionDefinitionData.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowRunData.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowRunListResult.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowRunListResult.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowRunTrigger.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowRunTrigger.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowSku.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowSku.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowSkuName.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowState.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowStatus.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowTriggerCallbackUri.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowTriggerCallbackUri.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowTriggerData.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowTriggerHistoryData.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowTriggerHistoryListResult.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowTriggerHistoryListResult.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowTriggerListCallbackUrlQueries.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowTriggerListCallbackUrlQueries.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowTriggerListResult.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowTriggerListResult.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowTriggerProvisioningState.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowTriggerRecurrence.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowTriggerRecurrence.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowVersionData.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowVersionListResult.Serialization.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/WorkflowVersionListResult.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/RequestHistoryCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/RequestHistoryData.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/RequestHistoryResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/RestOperations/ContainerAppsRestOperations.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/RestOperations/ContainerAppsRevisionsRestOperations.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/RestOperations/GetUsagesInLocationRestOperations.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/RestOperations/WorkflowRunActionRepetitionsRequestHistoriesRestOperations.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/RestOperations/WorkflowRunActionRepetitionsRestOperations.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/RestOperations/WorkflowRunActionScopeRepetitionsRestOperations.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/RestOperations/WorkflowRunActionsRestOperations.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/RestOperations/WorkflowRunsRestOperations.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/RestOperations/WorkflowTriggerHistoriesRestOperations.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/RestOperations/WorkflowTriggersRestOperations.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/RestOperations/WorkflowVersionsRestOperations.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/RestOperations/WorkflowsRestOperations.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/RevisionCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/RevisionData.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/RevisionResource.cs rename sdk/websites/Azure.ResourceManager.AppService/src/Generated/{Models/SiteAuthSettingsV2.cs => SiteAuthSettingsV2Data.cs} (78%) create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteDeploymentStatuCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteDeploymentStatuResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteHostruntimeWebhookApiWorkflowRunActionRepetitionCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteSlotDeploymentStatuCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteSlotDeploymentStatuResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteSlotWorkflowCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteSlotWorkflowResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteWorkflowCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/SiteWorkflowResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/StaticSiteBasicAuthPropertiesARMResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/StaticSiteBasicAuthPropertiesARMResourceCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/StaticSiteBasicAuthPropertiesARMResourceData.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/StaticSiteBuildDatabaseConnectionCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/StaticSiteBuildDatabaseConnectionResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/StaticSiteBuildLinkedBackendCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/StaticSiteBuildLinkedBackendResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/StaticSiteDatabaseConnectionCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/StaticSiteDatabaseConnectionResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/StaticSiteLinkedBackendARMResourceData.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/StaticSiteLinkedBackendCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/StaticSiteLinkedBackendResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/WorkflowEnvelopeData.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/WorkflowRunActionCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/WorkflowRunActionData.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/WorkflowRunActionRepetitionDefinitionData.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/WorkflowRunActionResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/WorkflowRunCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/WorkflowRunData.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/WorkflowRunResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/WorkflowTriggerCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/WorkflowTriggerData.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/WorkflowTriggerHistoryCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/WorkflowTriggerHistoryData.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/WorkflowTriggerHistoryResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/WorkflowTriggerResource.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/WorkflowVersionCollection.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/WorkflowVersionData.cs create mode 100644 sdk/websites/Azure.ResourceManager.AppService/src/Generated/WorkflowVersionResource.cs diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppCertificateCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppCertificateCollection.cs index 9d4cf1966344..a51240001846 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppCertificateCollection.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppCertificateCollection.cs @@ -23,7 +23,7 @@ public partial class Sample_AppCertificateCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListCertificatesByResourceGroup() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/ListCertificatesByResourceGroup.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListCertificatesByResourceGroup.json // this example is just showing the usage of "Certificates_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task GetAll_ListCertificatesByResourceGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetCertificate() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetCertificate.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetCertificate.json // this example is just showing the usage of "Certificates_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -93,7 +93,7 @@ public async Task Get_GetCertificate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetCertificate() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetCertificate.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetCertificate.json // this example is just showing the usage of "Certificates_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Exists_GetCertificate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetCertificate() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetCertificate.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetCertificate.json // this example is just showing the usage of "Certificates_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -165,7 +165,7 @@ public async Task GetIfExists_GetCertificate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateCertificate() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/CreateOrUpdateCertificate.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/CreateOrUpdateCertificate.json // this example is just showing the usage of "Certificates_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppCertificateResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppCertificateResource.cs index 1a75d55fdb0c..ae1b05c9345d 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppCertificateResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppCertificateResource.cs @@ -24,7 +24,7 @@ public partial class Sample_AppCertificateResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAppCertificates_ListCertificatesForSubscription() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/ListCertificates.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListCertificates.json // this example is just showing the usage of "Certificates_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +56,7 @@ public async Task GetAppCertificates_ListCertificatesForSubscription() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetCertificate() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetCertificate.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetCertificate.json // this example is just showing the usage of "Certificates_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -87,7 +87,7 @@ public async Task Get_GetCertificate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteCertificate() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/DeleteCertificate.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/DeleteCertificate.json // this example is just showing the usage of "Certificates_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -114,7 +114,7 @@ public async Task Delete_DeleteCertificate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_PatchCertificate() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/PatchCertificate.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/PatchCertificate.json // this example is just showing the usage of "Certificates_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceCertificateCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceCertificateCollection.cs new file mode 100644 index 000000000000..460b1f0197cd --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceCertificateCollection.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_AppServiceCertificateCollection + { + // List certificates by App Service Certificate + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListCertificatesByAppServiceCertificate() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/ListCertificatesByAppServiceCertificateOrder.json + // this example is just showing the usage of "AppServiceCertificateOrders_ListCertificates" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceCertificateOrderResource created on azure + // for more information of creating AppServiceCertificateOrderResource, please refer to the document of AppServiceCertificateOrderResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string certificateOrderName = "SampleCertificateOrderName"; + ResourceIdentifier appServiceCertificateOrderResourceId = AppServiceCertificateOrderResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, certificateOrderName); + AppServiceCertificateOrderResource appServiceCertificateOrder = client.GetAppServiceCertificateOrderResource(appServiceCertificateOrderResourceId); + + // get the collection of this AppServiceCertificateResource + AppServiceCertificateCollection collection = appServiceCertificateOrder.GetAppServiceCertificates(); + + // invoke the operation and iterate over the result + await foreach (AppServiceCertificateResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceCertificateData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get App Service Certificate + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetAppServiceCertificate() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/GetAppServiceCertificate.json + // this example is just showing the usage of "AppServiceCertificateOrders_GetCertificate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceCertificateOrderResource created on azure + // for more information of creating AppServiceCertificateOrderResource, please refer to the document of AppServiceCertificateOrderResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string certificateOrderName = "SampleCertificateOrderName"; + ResourceIdentifier appServiceCertificateOrderResourceId = AppServiceCertificateOrderResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, certificateOrderName); + AppServiceCertificateOrderResource appServiceCertificateOrder = client.GetAppServiceCertificateOrderResource(appServiceCertificateOrderResourceId); + + // get the collection of this AppServiceCertificateResource + AppServiceCertificateCollection collection = appServiceCertificateOrder.GetAppServiceCertificates(); + + // invoke the operation + string name = "SampleCertName1"; + AppServiceCertificateResource result = await collection.GetAsync(name); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceCertificateData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get App Service Certificate + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetAppServiceCertificate() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/GetAppServiceCertificate.json + // this example is just showing the usage of "AppServiceCertificateOrders_GetCertificate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceCertificateOrderResource created on azure + // for more information of creating AppServiceCertificateOrderResource, please refer to the document of AppServiceCertificateOrderResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string certificateOrderName = "SampleCertificateOrderName"; + ResourceIdentifier appServiceCertificateOrderResourceId = AppServiceCertificateOrderResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, certificateOrderName); + AppServiceCertificateOrderResource appServiceCertificateOrder = client.GetAppServiceCertificateOrderResource(appServiceCertificateOrderResourceId); + + // get the collection of this AppServiceCertificateResource + AppServiceCertificateCollection collection = appServiceCertificateOrder.GetAppServiceCertificates(); + + // invoke the operation + string name = "SampleCertName1"; + bool result = await collection.ExistsAsync(name); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get App Service Certificate + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetAppServiceCertificate() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/GetAppServiceCertificate.json + // this example is just showing the usage of "AppServiceCertificateOrders_GetCertificate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceCertificateOrderResource created on azure + // for more information of creating AppServiceCertificateOrderResource, please refer to the document of AppServiceCertificateOrderResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string certificateOrderName = "SampleCertificateOrderName"; + ResourceIdentifier appServiceCertificateOrderResourceId = AppServiceCertificateOrderResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, certificateOrderName); + AppServiceCertificateOrderResource appServiceCertificateOrder = client.GetAppServiceCertificateOrderResource(appServiceCertificateOrderResourceId); + + // get the collection of this AppServiceCertificateResource + AppServiceCertificateCollection collection = appServiceCertificateOrder.GetAppServiceCertificates(); + + // invoke the operation + string name = "SampleCertName1"; + NullableResponse response = await collection.GetIfExistsAsync(name); + AppServiceCertificateResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceCertificateData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create Certificate + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateCertificate() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/CreateAppServiceCertificate.json + // this example is just showing the usage of "AppServiceCertificateOrders_CreateOrUpdateCertificate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceCertificateOrderResource created on azure + // for more information of creating AppServiceCertificateOrderResource, please refer to the document of AppServiceCertificateOrderResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string certificateOrderName = "SampleCertificateOrderName"; + ResourceIdentifier appServiceCertificateOrderResourceId = AppServiceCertificateOrderResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, certificateOrderName); + AppServiceCertificateOrderResource appServiceCertificateOrder = client.GetAppServiceCertificateOrderResource(appServiceCertificateOrderResourceId); + + // get the collection of this AppServiceCertificateResource + AppServiceCertificateCollection collection = appServiceCertificateOrder.GetAppServiceCertificates(); + + // invoke the operation + string name = "SampleCertName1"; + AppServiceCertificateData data = new AppServiceCertificateData(new AzureLocation("Global")) + { + KeyVaultId = new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/testrg123/providers/microsoft.keyvault/vaults/SamplevaultName"), + KeyVaultSecretName = "SampleSecretName1", + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, data); + AppServiceCertificateResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceCertificateData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceCertificateOrderCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceCertificateOrderCollection.cs new file mode 100644 index 000000000000..64e7f6adcb67 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceCertificateOrderCollection.cs @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; +using Azure.ResourceManager.AppService.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_AppServiceCertificateOrderCollection + { + // List App Service Certificate orders by resource group + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListAppServiceCertificateOrdersByResourceGroup() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/ListAppServiceCertificateOrdersByResourceGroup.json + // this example is just showing the usage of "AppServiceCertificateOrders_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AppServiceCertificateOrderResource + AppServiceCertificateOrderCollection collection = resourceGroupResource.GetAppServiceCertificateOrders(); + + // invoke the operation and iterate over the result + await foreach (AppServiceCertificateOrderResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceCertificateOrderData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get App Service Certificate Order + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetAppServiceCertificateOrder() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/GetAppServiceCertificateOrder.json + // this example is just showing the usage of "AppServiceCertificateOrders_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AppServiceCertificateOrderResource + AppServiceCertificateOrderCollection collection = resourceGroupResource.GetAppServiceCertificateOrders(); + + // invoke the operation + string certificateOrderName = "SampleCertificateOrderName"; + AppServiceCertificateOrderResource result = await collection.GetAsync(certificateOrderName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceCertificateOrderData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get App Service Certificate Order + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetAppServiceCertificateOrder() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/GetAppServiceCertificateOrder.json + // this example is just showing the usage of "AppServiceCertificateOrders_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AppServiceCertificateOrderResource + AppServiceCertificateOrderCollection collection = resourceGroupResource.GetAppServiceCertificateOrders(); + + // invoke the operation + string certificateOrderName = "SampleCertificateOrderName"; + bool result = await collection.ExistsAsync(certificateOrderName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get App Service Certificate Order + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetAppServiceCertificateOrder() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/GetAppServiceCertificateOrder.json + // this example is just showing the usage of "AppServiceCertificateOrders_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AppServiceCertificateOrderResource + AppServiceCertificateOrderCollection collection = resourceGroupResource.GetAppServiceCertificateOrders(); + + // invoke the operation + string certificateOrderName = "SampleCertificateOrderName"; + NullableResponse response = await collection.GetIfExistsAsync(certificateOrderName); + AppServiceCertificateOrderResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceCertificateOrderData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create Certificate order + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateCertificateOrder() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/CreateAppServiceCertificateOrder.json + // this example is just showing the usage of "AppServiceCertificateOrders_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AppServiceCertificateOrderResource + AppServiceCertificateOrderCollection collection = resourceGroupResource.GetAppServiceCertificateOrders(); + + // invoke the operation + string certificateOrderName = "SampleCertificateOrderName"; + AppServiceCertificateOrderData data = new AppServiceCertificateOrderData(new AzureLocation("Global")) + { + Certificates = +{ +["SampleCertName1"] = new AppServiceCertificateProperties() +{ +KeyVaultId = new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/testrg123/providers/microsoft.keyvault/vaults/SamplevaultName"), +KeyVaultSecretName = "SampleSecretName1", +}, +["SampleCertName2"] = new AppServiceCertificateProperties() +{ +KeyVaultId = new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/testrg123/providers/microsoft.keyvault/vaults/SamplevaultName"), +KeyVaultSecretName = "SampleSecretName2", +}, +}, + DistinguishedName = "CN=SampleCustomDomain.com", + ValidityInYears = 2, + KeySize = 2048, + ProductType = CertificateProductType.StandardDomainValidatedSsl, + IsAutoRenew = true, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, certificateOrderName, data); + AppServiceCertificateOrderResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceCertificateOrderData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceCertificateOrderResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceCertificateOrderResource.cs new file mode 100644 index 000000000000..53216c24cc61 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceCertificateOrderResource.cs @@ -0,0 +1,408 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; +using Azure.ResourceManager.AppService.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_AppServiceCertificateOrderResource + { + // List App Service Certificate orders by subscription + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAppServiceCertificateOrders_ListAppServiceCertificateOrdersBySubscription() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/ListAppServiceCertificateOrdersBySubscription.json + // this example is just showing the usage of "AppServiceCertificateOrders_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (AppServiceCertificateOrderResource item in subscriptionResource.GetAppServiceCertificateOrdersAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceCertificateOrderData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get App Service Certificate Order + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetAppServiceCertificateOrder() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/GetAppServiceCertificateOrder.json + // this example is just showing the usage of "AppServiceCertificateOrders_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceCertificateOrderResource created on azure + // for more information of creating AppServiceCertificateOrderResource, please refer to the document of AppServiceCertificateOrderResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string certificateOrderName = "SampleCertificateOrderName"; + ResourceIdentifier appServiceCertificateOrderResourceId = AppServiceCertificateOrderResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, certificateOrderName); + AppServiceCertificateOrderResource appServiceCertificateOrder = client.GetAppServiceCertificateOrderResource(appServiceCertificateOrderResourceId); + + // invoke the operation + AppServiceCertificateOrderResource result = await appServiceCertificateOrder.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceCertificateOrderData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Delete App Service Certificate Order + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteAppServiceCertificateOrder() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/DeleteAppServiceCertificateOrder.json + // this example is just showing the usage of "AppServiceCertificateOrders_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceCertificateOrderResource created on azure + // for more information of creating AppServiceCertificateOrderResource, please refer to the document of AppServiceCertificateOrderResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string certificateOrderName = "SampleCertificateOrderName"; + ResourceIdentifier appServiceCertificateOrderResourceId = AppServiceCertificateOrderResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, certificateOrderName); + AppServiceCertificateOrderResource appServiceCertificateOrder = client.GetAppServiceCertificateOrderResource(appServiceCertificateOrderResourceId); + + // invoke the operation + await appServiceCertificateOrder.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Update Certificate order + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_UpdateCertificateOrder() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/UpdateAppServiceCertificateOrder.json + // this example is just showing the usage of "AppServiceCertificateOrders_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceCertificateOrderResource created on azure + // for more information of creating AppServiceCertificateOrderResource, please refer to the document of AppServiceCertificateOrderResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string certificateOrderName = "SampleCertificateOrderName"; + ResourceIdentifier appServiceCertificateOrderResourceId = AppServiceCertificateOrderResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, certificateOrderName); + AppServiceCertificateOrderResource appServiceCertificateOrder = client.GetAppServiceCertificateOrderResource(appServiceCertificateOrderResourceId); + + // invoke the operation + AppServiceCertificateOrderPatch patch = new AppServiceCertificateOrderPatch() + { + Certificates = +{ +["SampleCertName1"] = new AppServiceCertificateProperties() +{ +KeyVaultId = new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/testrg123/providers/microsoft.keyvault/vaults/SamplevaultName"), +KeyVaultSecretName = "SampleSecretName1", +}, +["SampleCertName2"] = new AppServiceCertificateProperties() +{ +KeyVaultId = new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/testrg123/providers/microsoft.keyvault/vaults/SamplevaultName"), +KeyVaultSecretName = "SampleSecretName2", +}, +}, + DistinguishedName = "CN=SampleCustomDomain.com", + ValidityInYears = 2, + KeySize = 2048, + ProductType = CertificateProductType.StandardDomainValidatedSsl, + IsAutoRenew = true, + }; + AppServiceCertificateOrderResource result = await appServiceCertificateOrder.UpdateAsync(patch); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceCertificateOrderData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Reissue App Service Certificate Order + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Reissue_ReissueAppServiceCertificateOrder() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/ReissueAppServiceCertificateOrder.json + // this example is just showing the usage of "AppServiceCertificateOrders_Reissue" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceCertificateOrderResource created on azure + // for more information of creating AppServiceCertificateOrderResource, please refer to the document of AppServiceCertificateOrderResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string certificateOrderName = "SampleCertificateOrderName"; + ResourceIdentifier appServiceCertificateOrderResourceId = AppServiceCertificateOrderResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, certificateOrderName); + AppServiceCertificateOrderResource appServiceCertificateOrder = client.GetAppServiceCertificateOrderResource(appServiceCertificateOrderResourceId); + + // invoke the operation + ReissueCertificateOrderContent content = new ReissueCertificateOrderContent() + { + KeySize = 2048, + DelayExistingRevokeInHours = 2, + Csr = "CSR1223238Value", + IsPrivateKeyExternal = false, + }; + await appServiceCertificateOrder.ReissueAsync(content); + + Console.WriteLine($"Succeeded"); + } + + // Renew App Service Certificate Order + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Renew_RenewAppServiceCertificateOrder() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/RenewAppServiceCertificateOrder.json + // this example is just showing the usage of "AppServiceCertificateOrders_Renew" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceCertificateOrderResource created on azure + // for more information of creating AppServiceCertificateOrderResource, please refer to the document of AppServiceCertificateOrderResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string certificateOrderName = "SampleCertificateOrderName"; + ResourceIdentifier appServiceCertificateOrderResourceId = AppServiceCertificateOrderResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, certificateOrderName); + AppServiceCertificateOrderResource appServiceCertificateOrder = client.GetAppServiceCertificateOrderResource(appServiceCertificateOrderResourceId); + + // invoke the operation + RenewCertificateOrderContent content = new RenewCertificateOrderContent() + { + KeySize = 2048, + Csr = "CSR1223238Value", + IsPrivateKeyExternal = false, + }; + await appServiceCertificateOrder.RenewAsync(content); + + Console.WriteLine($"Succeeded"); + } + + // Resend App Service Certificate Order email + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task ResendEmail_ResendAppServiceCertificateOrderEmail() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/ResendAppServiceCertificateOrderEmail.json + // this example is just showing the usage of "AppServiceCertificateOrders_ResendEmail" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceCertificateOrderResource created on azure + // for more information of creating AppServiceCertificateOrderResource, please refer to the document of AppServiceCertificateOrderResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string certificateOrderName = "SampleCertificateOrderName"; + ResourceIdentifier appServiceCertificateOrderResourceId = AppServiceCertificateOrderResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, certificateOrderName); + AppServiceCertificateOrderResource appServiceCertificateOrder = client.GetAppServiceCertificateOrderResource(appServiceCertificateOrderResourceId); + + // invoke the operation + await appServiceCertificateOrder.ResendEmailAsync(); + + Console.WriteLine($"Succeeded"); + } + + // Resend Domain Ownership verification email + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task ResendRequestEmails_ResendDomainOwnershipVerificationEmail() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/ResendDomainOwnershipVerificationEmail.json + // this example is just showing the usage of "AppServiceCertificateOrders_ResendRequestEmails" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceCertificateOrderResource created on azure + // for more information of creating AppServiceCertificateOrderResource, please refer to the document of AppServiceCertificateOrderResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string certificateOrderName = "SampleCertificateOrderName"; + ResourceIdentifier appServiceCertificateOrderResourceId = AppServiceCertificateOrderResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, certificateOrderName); + AppServiceCertificateOrderResource appServiceCertificateOrder = client.GetAppServiceCertificateOrderResource(appServiceCertificateOrderResourceId); + + // invoke the operation + AppServiceDomainNameIdentifier nameIdentifier = new AppServiceDomainNameIdentifier() + { + Name = "Domain name", + }; + await appServiceCertificateOrder.ResendRequestEmailsAsync(nameIdentifier); + + Console.WriteLine($"Succeeded"); + } + + // Retrieve Site Seal + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task RetrieveSiteSeal_RetrieveSiteSeal() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/RetrieveSiteSeal.json + // this example is just showing the usage of "AppServiceCertificateOrders_RetrieveSiteSeal" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceCertificateOrderResource created on azure + // for more information of creating AppServiceCertificateOrderResource, please refer to the document of AppServiceCertificateOrderResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string certificateOrderName = "SampleCertOrder"; + ResourceIdentifier appServiceCertificateOrderResourceId = AppServiceCertificateOrderResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, certificateOrderName); + AppServiceCertificateOrderResource appServiceCertificateOrder = client.GetAppServiceCertificateOrderResource(appServiceCertificateOrderResourceId); + + // invoke the operation + SiteSealContent content = new SiteSealContent() + { + IsLightTheme = true, + Locale = "en-us", + }; + SiteSeal result = await appServiceCertificateOrder.RetrieveSiteSealAsync(content); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Verify Domain Ownership + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task VerifyDomainOwnership_VerifyDomainOwnership() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/VerifyDomainOwnership.json + // this example is just showing the usage of "AppServiceCertificateOrders_VerifyDomainOwnership" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceCertificateOrderResource created on azure + // for more information of creating AppServiceCertificateOrderResource, please refer to the document of AppServiceCertificateOrderResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string certificateOrderName = "SampleCertificateOrderName"; + ResourceIdentifier appServiceCertificateOrderResourceId = AppServiceCertificateOrderResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, certificateOrderName); + AppServiceCertificateOrderResource appServiceCertificateOrder = client.GetAppServiceCertificateOrderResource(appServiceCertificateOrderResourceId); + + // invoke the operation + await appServiceCertificateOrder.VerifyDomainOwnershipAsync(); + + Console.WriteLine($"Succeeded"); + } + + // Retrieve Certificate Order Actions + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task RetrieveCertificateActions_RetrieveCertificateOrderActions() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/RetrieveCertificateOrderActions.json + // this example is just showing the usage of "AppServiceCertificateOrders_RetrieveCertificateActions" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceCertificateOrderResource created on azure + // for more information of creating AppServiceCertificateOrderResource, please refer to the document of AppServiceCertificateOrderResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "SampleCertOrder"; + ResourceIdentifier appServiceCertificateOrderResourceId = AppServiceCertificateOrderResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AppServiceCertificateOrderResource appServiceCertificateOrder = client.GetAppServiceCertificateOrderResource(appServiceCertificateOrderResourceId); + + // invoke the operation and iterate over the result + await foreach (CertificateOrderAction item in appServiceCertificateOrder.RetrieveCertificateActionsAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Retrieve Certificate Email History + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task RetrieveCertificateEmailHistory_RetrieveCertificateEmailHistory() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/RetrieveCertificateEmailHistory.json + // this example is just showing the usage of "AppServiceCertificateOrders_RetrieveCertificateEmailHistory" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceCertificateOrderResource created on azure + // for more information of creating AppServiceCertificateOrderResource, please refer to the document of AppServiceCertificateOrderResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "SampleCertOrder"; + ResourceIdentifier appServiceCertificateOrderResourceId = AppServiceCertificateOrderResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AppServiceCertificateOrderResource appServiceCertificateOrder = client.GetAppServiceCertificateOrderResource(appServiceCertificateOrderResourceId); + + // invoke the operation and iterate over the result + await foreach (AppServiceCertificateEmail item in appServiceCertificateOrder.RetrieveCertificateEmailHistoryAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceCertificateResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceCertificateResource.cs new file mode 100644 index 000000000000..4e52151a39e0 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceCertificateResource.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; +using Azure.ResourceManager.AppService.Models; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_AppServiceCertificateResource + { + // Get App Service Certificate + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetAppServiceCertificate() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/GetAppServiceCertificate.json + // this example is just showing the usage of "AppServiceCertificateOrders_GetCertificate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceCertificateResource created on azure + // for more information of creating AppServiceCertificateResource, please refer to the document of AppServiceCertificateResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string certificateOrderName = "SampleCertificateOrderName"; + string name = "SampleCertName1"; + ResourceIdentifier appServiceCertificateResourceId = AppServiceCertificateResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, certificateOrderName, name); + AppServiceCertificateResource appServiceCertificate = client.GetAppServiceCertificateResource(appServiceCertificateResourceId); + + // invoke the operation + AppServiceCertificateResource result = await appServiceCertificate.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceCertificateData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Delete App Service Certificate + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteAppServiceCertificate() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/DeleteAppServiceCertificate.json + // this example is just showing the usage of "AppServiceCertificateOrders_DeleteCertificate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceCertificateResource created on azure + // for more information of creating AppServiceCertificateResource, please refer to the document of AppServiceCertificateResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string certificateOrderName = "SampleCertificateOrderName"; + string name = "SampleCertName1"; + ResourceIdentifier appServiceCertificateResourceId = AppServiceCertificateResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, certificateOrderName, name); + AppServiceCertificateResource appServiceCertificate = client.GetAppServiceCertificateResource(appServiceCertificateResourceId); + + // invoke the operation + await appServiceCertificate.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Update Certificate + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_UpdateCertificate() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/UpdateAppServiceCertificate.json + // this example is just showing the usage of "AppServiceCertificateOrders_UpdateCertificate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceCertificateResource created on azure + // for more information of creating AppServiceCertificateResource, please refer to the document of AppServiceCertificateResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string certificateOrderName = "SampleCertificateOrderName"; + string name = "SampleCertName1"; + ResourceIdentifier appServiceCertificateResourceId = AppServiceCertificateResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, certificateOrderName, name); + AppServiceCertificateResource appServiceCertificate = client.GetAppServiceCertificateResource(appServiceCertificateResourceId); + + // invoke the operation + AppServiceCertificatePatch patch = new AppServiceCertificatePatch() + { + KeyVaultId = new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/testrg123/providers/microsoft.keyvault/vaults/SamplevaultName"), + KeyVaultSecretName = "SampleSecretName1", + }; + AppServiceCertificateResource result = await appServiceCertificate.UpdateAsync(patch); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceCertificateData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceDomainCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceDomainCollection.cs new file mode 100644 index 000000000000..4f0370a0eab2 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceDomainCollection.cs @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; +using Azure.ResourceManager.AppService.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_AppServiceDomainCollection + { + // List domains by resource group + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListDomainsByResourceGroup() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-01-01/examples/ListDomainsByResourceGroup.json + // this example is just showing the usage of "Domains_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AppServiceDomainResource + AppServiceDomainCollection collection = resourceGroupResource.GetAppServiceDomains(); + + // invoke the operation and iterate over the result + await foreach (AppServiceDomainResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceDomainData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Domain + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetDomain() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-01-01/examples/GetDomain.json + // this example is just showing the usage of "Domains_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AppServiceDomainResource + AppServiceDomainCollection collection = resourceGroupResource.GetAppServiceDomains(); + + // invoke the operation + string domainName = "example.com"; + AppServiceDomainResource result = await collection.GetAsync(domainName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceDomainData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Domain + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetDomain() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-01-01/examples/GetDomain.json + // this example is just showing the usage of "Domains_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AppServiceDomainResource + AppServiceDomainCollection collection = resourceGroupResource.GetAppServiceDomains(); + + // invoke the operation + string domainName = "example.com"; + bool result = await collection.ExistsAsync(domainName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Domain + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetDomain() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-01-01/examples/GetDomain.json + // this example is just showing the usage of "Domains_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AppServiceDomainResource + AppServiceDomainCollection collection = resourceGroupResource.GetAppServiceDomains(); + + // invoke the operation + string domainName = "example.com"; + NullableResponse response = await collection.GetIfExistsAsync(domainName); + AppServiceDomainResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceDomainData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create App Service Domain + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateAppServiceDomain() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-01-01/examples/CreateAppServiceDomain.json + // this example is just showing the usage of "Domains_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AppServiceDomainResource + AppServiceDomainCollection collection = resourceGroupResource.GetAppServiceDomains(); + + // invoke the operation + string domainName = "example.com"; + AppServiceDomainData data = new AppServiceDomainData(new AzureLocation("global")) + { + ContactAdmin = new RegistrationContactInfo("admin@email.com", "John", "Doe", "1-245-534-2242") + { + AddressMailing = new RegistrationAddressInfo("3400 State St", "Chicago", "United States", "67098", "IL"), + Fax = "1-245-534-2242", + JobTitle = "Admin", + NameMiddle = "", + Organization = "Microsoft Inc.", + }, + ContactBilling = new RegistrationContactInfo("billing@email.com", "John", "Doe", "1-245-534-2242") + { + AddressMailing = new RegistrationAddressInfo("3400 State St", "Chicago", "United States", "67098", "IL"), + Fax = "1-245-534-2242", + JobTitle = "Billing", + NameMiddle = "", + Organization = "Microsoft Inc.", + }, + ContactRegistrant = new RegistrationContactInfo("registrant@email.com", "John", "Doe", "1-245-534-2242") + { + AddressMailing = new RegistrationAddressInfo("3400 State St", "Chicago", "United States", "67098", "IL"), + Fax = "1-245-534-2242", + JobTitle = "Registrant", + NameMiddle = "", + Organization = "Microsoft Inc.", + }, + ContactTech = new RegistrationContactInfo("tech@email.com", "John", "Doe", "1-245-534-2242") + { + AddressMailing = new RegistrationAddressInfo("3400 State St", "Chicago", "United States", "67098", "IL"), + Fax = "1-245-534-2242", + JobTitle = "Tech", + NameMiddle = "", + Organization = "Microsoft Inc.", + }, + IsDomainPrivacyEnabled = false, + IsAutoRenew = true, + Consent = new DomainPurchaseConsent() + { + AgreementKeys = +{ +"agreementKey1" +}, + AgreedBy = "192.0.2.1", + AgreedOn = DateTimeOffset.Parse("2021-09-10T19:30:53Z"), + }, + DnsType = AppServiceDnsType.DefaultDomainRegistrarDns, + AuthCode = "exampleAuthCode", + Tags = +{ +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, domainName, data); + AppServiceDomainResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceDomainData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceDomainResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceDomainResource.cs index 9fc1d9d2835f..6cd14fa18ec0 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceDomainResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceDomainResource.cs @@ -7,21 +7,194 @@ using System; using System.Threading.Tasks; +using Azure; using Azure.Core; using Azure.Identity; using Azure.ResourceManager; using Azure.ResourceManager.AppService; +using Azure.ResourceManager.AppService.Models; +using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.AppService.Samples { public partial class Sample_AppServiceDomainResource { + // List domains by subscription + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAppServiceDomains_ListDomainsBySubscription() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-01-01/examples/ListDomainsBySubscription.json + // this example is just showing the usage of "Domains_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (AppServiceDomainResource item in subscriptionResource.GetAppServiceDomainsAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceDomainData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Domain + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetDomain() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-01-01/examples/GetDomain.json + // this example is just showing the usage of "Domains_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceDomainResource created on azure + // for more information of creating AppServiceDomainResource, please refer to the document of AppServiceDomainResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string domainName = "example.com"; + ResourceIdentifier appServiceDomainResourceId = AppServiceDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, domainName); + AppServiceDomainResource appServiceDomain = client.GetAppServiceDomainResource(appServiceDomainResourceId); + + // invoke the operation + AppServiceDomainResource result = await appServiceDomain.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceDomainData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Delete App Service Domain + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteAppServiceDomain() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-01-01/examples/DeleteAppServiceDomain.json + // this example is just showing the usage of "Domains_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceDomainResource created on azure + // for more information of creating AppServiceDomainResource, please refer to the document of AppServiceDomainResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string domainName = "example.com"; + ResourceIdentifier appServiceDomainResourceId = AppServiceDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, domainName); + AppServiceDomainResource appServiceDomain = client.GetAppServiceDomainResource(appServiceDomainResourceId); + + // invoke the operation + bool? forceHardDeleteDomain = true; + await appServiceDomain.DeleteAsync(WaitUntil.Completed, forceHardDeleteDomain: forceHardDeleteDomain); + + Console.WriteLine($"Succeeded"); + } + + // Update App Service Domain + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_UpdateAppServiceDomain() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-01-01/examples/UpdateAppServiceDomain.json + // this example is just showing the usage of "Domains_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceDomainResource created on azure + // for more information of creating AppServiceDomainResource, please refer to the document of AppServiceDomainResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string domainName = "example.com"; + ResourceIdentifier appServiceDomainResourceId = AppServiceDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, domainName); + AppServiceDomainResource appServiceDomain = client.GetAppServiceDomainResource(appServiceDomainResourceId); + + // invoke the operation + AppServiceDomainPatch patch = new AppServiceDomainPatch() + { + ContactAdmin = new RegistrationContactInfo("admin@email.com", "John", "Doe", "1-245-534-2242") + { + AddressMailing = new RegistrationAddressInfo("3400 State St", "Chicago", "United States", "67098", "IL"), + Fax = "1-245-534-2242", + JobTitle = "Admin", + NameMiddle = "", + Organization = "Microsoft Inc.", + }, + ContactBilling = new RegistrationContactInfo("billing@email.com", "John", "Doe", "1-245-534-2242") + { + AddressMailing = new RegistrationAddressInfo("3400 State St", "Chicago", "United States", "67098", "IL"), + Fax = "1-245-534-2242", + JobTitle = "Billing", + NameMiddle = "", + Organization = "Microsoft Inc.", + }, + ContactRegistrant = new RegistrationContactInfo("registrant@email.com", "John", "Doe", "1-245-534-2242") + { + AddressMailing = new RegistrationAddressInfo("3400 State St", "Chicago", "United States", "67098", "IL"), + Fax = "1-245-534-2242", + JobTitle = "Registrant", + NameMiddle = "", + Organization = "Microsoft Inc.", + }, + ContactTech = new RegistrationContactInfo("tech@email.com", "John", "Doe", "1-245-534-2242") + { + AddressMailing = new RegistrationAddressInfo("3400 State St", "Chicago", "United States", "67098", "IL"), + Fax = "1-245-534-2242", + JobTitle = "Tech", + NameMiddle = "", + Organization = "Microsoft Inc.", + }, + IsDomainPrivacyEnabled = false, + IsAutoRenew = true, + Consent = new DomainPurchaseConsent() + { + AgreementKeys = +{ +"agreementKey1" +}, + AgreedBy = "192.0.2.1", + AgreedOn = DateTimeOffset.Parse("2021-09-10T19:30:53Z"), + }, + DnsType = AppServiceDnsType.DefaultDomainRegistrarDns, + AuthCode = "exampleAuthCode", + }; + AppServiceDomainResource result = await appServiceDomain.UpdateAsync(patch); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceDomainData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + // Renew an existing domain [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Renew_RenewAnExistingDomain() { - // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2021-02-01/examples/RenewDomain.json + // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-01-01/examples/RenewDomain.json // this example is just showing the usage of "Domains_Renew" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -42,5 +215,36 @@ public async Task Renew_RenewAnExistingDomain() Console.WriteLine($"Succeeded"); } + + // Transfer out domain + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task TransferOut_TransferOutDomain() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-01-01/examples/TransferOutDomain.json + // this example is just showing the usage of "Domains_TransferOut" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceDomainResource created on azure + // for more information of creating AppServiceDomainResource, please refer to the document of AppServiceDomainResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string domainName = "example.com"; + ResourceIdentifier appServiceDomainResourceId = AppServiceDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, domainName); + AppServiceDomainResource appServiceDomain = client.GetAppServiceDomainResource(appServiceDomainResourceId); + + // invoke the operation + AppServiceDomainResource result = await appServiceDomain.TransferOutAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceDomainData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceEnvironmentCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceEnvironmentCollection.cs new file mode 100644 index 000000000000..b92125c9218b --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceEnvironmentCollection.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; +using Azure.ResourceManager.AppService.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_AppServiceEnvironmentCollection + { + // Get all App Service Environments in a resource group. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_GetAllAppServiceEnvironmentsInAResourceGroup() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_ListByResourceGroup.json + // this example is just showing the usage of "AppServiceEnvironments_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AppServiceEnvironmentResource + AppServiceEnvironmentCollection collection = resourceGroupResource.GetAppServiceEnvironments(); + + // invoke the operation and iterate over the result + await foreach (AppServiceEnvironmentResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceEnvironmentData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get the properties of an App Service Environment. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetThePropertiesOfAnAppServiceEnvironment() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_Get.json + // this example is just showing the usage of "AppServiceEnvironments_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AppServiceEnvironmentResource + AppServiceEnvironmentCollection collection = resourceGroupResource.GetAppServiceEnvironments(); + + // invoke the operation + string name = "test-ase"; + AppServiceEnvironmentResource result = await collection.GetAsync(name); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceEnvironmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get the properties of an App Service Environment. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetThePropertiesOfAnAppServiceEnvironment() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_Get.json + // this example is just showing the usage of "AppServiceEnvironments_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AppServiceEnvironmentResource + AppServiceEnvironmentCollection collection = resourceGroupResource.GetAppServiceEnvironments(); + + // invoke the operation + string name = "test-ase"; + bool result = await collection.ExistsAsync(name); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get the properties of an App Service Environment. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetThePropertiesOfAnAppServiceEnvironment() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_Get.json + // this example is just showing the usage of "AppServiceEnvironments_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AppServiceEnvironmentResource + AppServiceEnvironmentCollection collection = resourceGroupResource.GetAppServiceEnvironments(); + + // invoke the operation + string name = "test-ase"; + NullableResponse response = await collection.GetIfExistsAsync(name); + AppServiceEnvironmentResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceEnvironmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create or update an App Service Environment. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateOrUpdateAnAppServiceEnvironment() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_CreateOrUpdate.json + // this example is just showing the usage of "AppServiceEnvironments_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AppServiceEnvironmentResource + AppServiceEnvironmentCollection collection = resourceGroupResource.GetAppServiceEnvironments(); + + // invoke the operation + string name = "test-ase"; + AppServiceEnvironmentData data = new AppServiceEnvironmentData(new AzureLocation("South Central US")) + { + VirtualNetwork = new AppServiceVirtualNetworkProfile(new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/delegated")), + Kind = "Asev3", + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, data); + AppServiceEnvironmentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceEnvironmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceEnvironmentResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceEnvironmentResource.cs index fab5079f5d56..4e54820003df 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceEnvironmentResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServiceEnvironmentResource.cs @@ -7,22 +7,265 @@ using System; using System.Threading.Tasks; +using Azure; using Azure.Core; using Azure.Identity; using Azure.ResourceManager; using Azure.ResourceManager.AppService; using Azure.ResourceManager.AppService.Models; +using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.AppService.Samples { public partial class Sample_AppServiceEnvironmentResource { - // Get Inbound Network Dependencies Endpoints + // Get all App Service Environments for a subscription. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetInboundNetworkDependenciesEndpoints_GetInboundNetworkDependenciesEndpoints() + public async Task GetAppServiceEnvironments_GetAllAppServiceEnvironmentsForASubscription() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetInboundNetworkDependenciesEndpoints.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_List.json + // this example is just showing the usage of "AppServiceEnvironments_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (AppServiceEnvironmentResource item in subscriptionResource.GetAppServiceEnvironmentsAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceEnvironmentData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get the properties of an App Service Environment. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetThePropertiesOfAnAppServiceEnvironment() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_Get.json + // this example is just showing the usage of "AppServiceEnvironments_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceEnvironmentResource created on azure + // for more information of creating AppServiceEnvironmentResource, please refer to the document of AppServiceEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier appServiceEnvironmentResourceId = AppServiceEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AppServiceEnvironmentResource appServiceEnvironment = client.GetAppServiceEnvironmentResource(appServiceEnvironmentResourceId); + + // invoke the operation + AppServiceEnvironmentResource result = await appServiceEnvironment.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceEnvironmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Delete an App Service Environment. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteAnAppServiceEnvironment() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_Delete.json + // this example is just showing the usage of "AppServiceEnvironments_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceEnvironmentResource created on azure + // for more information of creating AppServiceEnvironmentResource, please refer to the document of AppServiceEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier appServiceEnvironmentResourceId = AppServiceEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AppServiceEnvironmentResource appServiceEnvironment = client.GetAppServiceEnvironmentResource(appServiceEnvironmentResourceId); + + // invoke the operation + await appServiceEnvironment.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Create or update an App Service Environment. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateOrUpdateAnAppServiceEnvironment() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_Update.json + // this example is just showing the usage of "AppServiceEnvironments_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceEnvironmentResource created on azure + // for more information of creating AppServiceEnvironmentResource, please refer to the document of AppServiceEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier appServiceEnvironmentResourceId = AppServiceEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AppServiceEnvironmentResource appServiceEnvironment = client.GetAppServiceEnvironmentResource(appServiceEnvironmentResourceId); + + // invoke the operation + AppServiceEnvironmentPatch patch = new AppServiceEnvironmentPatch() + { + VirtualNetwork = new AppServiceVirtualNetworkProfile(new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-subnet/subnets/delegated")), + FrontEndScaleFactor = 20, + }; + AppServiceEnvironmentResource result = await appServiceEnvironment.UpdateAsync(patch); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceEnvironmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get the used, available, and total worker capacity an App Service Environment. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetCapacities_GetTheUsedAvailableAndTotalWorkerCapacityAnAppServiceEnvironment() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_ListCapacities.json + // this example is just showing the usage of "AppServiceEnvironments_ListCapacities" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceEnvironmentResource created on azure + // for more information of creating AppServiceEnvironmentResource, please refer to the document of AppServiceEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier appServiceEnvironmentResourceId = AppServiceEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AppServiceEnvironmentResource appServiceEnvironment = client.GetAppServiceEnvironmentResource(appServiceEnvironmentResourceId); + + // invoke the operation and iterate over the result + await foreach (StampCapacity item in appServiceEnvironment.GetCapacitiesAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get IP addresses assigned to an App Service Environment. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetVipInfo_GetIPAddressesAssignedToAnAppServiceEnvironment() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_GetVipInfo.json + // this example is just showing the usage of "AppServiceEnvironments_GetVipInfo" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceEnvironmentResource created on azure + // for more information of creating AppServiceEnvironmentResource, please refer to the document of AppServiceEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier appServiceEnvironmentResourceId = AppServiceEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AppServiceEnvironmentResource appServiceEnvironment = client.GetAppServiceEnvironmentResource(appServiceEnvironmentResourceId); + + // invoke the operation + AppServiceEnvironmentAddressResult result = await appServiceEnvironment.GetVipInfoAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get diagnostic information for an App Service Environment. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetDiagnostics_GetDiagnosticInformationForAnAppServiceEnvironment() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_ListDiagnostics.json + // this example is just showing the usage of "AppServiceEnvironments_ListDiagnostics" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceEnvironmentResource created on azure + // for more information of creating AppServiceEnvironmentResource, please refer to the document of AppServiceEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier appServiceEnvironmentResourceId = AppServiceEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AppServiceEnvironmentResource appServiceEnvironment = client.GetAppServiceEnvironmentResource(appServiceEnvironmentResourceId); + + // invoke the operation and iterate over the result + await foreach (HostingEnvironmentDiagnostics item in appServiceEnvironment.GetDiagnosticsAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get a diagnostics item for an App Service Environment. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetDiagnosticsItem_GetADiagnosticsItemForAnAppServiceEnvironment() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_GetDiagnosticsItem.json + // this example is just showing the usage of "AppServiceEnvironments_GetDiagnosticsItem" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceEnvironmentResource created on azure + // for more information of creating AppServiceEnvironmentResource, please refer to the document of AppServiceEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier appServiceEnvironmentResourceId = AppServiceEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AppServiceEnvironmentResource appServiceEnvironment = client.GetAppServiceEnvironmentResource(appServiceEnvironmentResourceId); + + // invoke the operation + string diagnosticsName = "test-diagnostic"; + HostingEnvironmentDiagnostics result = await appServiceEnvironment.GetDiagnosticsItemAsync(diagnosticsName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get the network endpoints of all inbound dependencies of an App Service Environment. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetInboundNetworkDependenciesEndpoints_GetTheNetworkEndpointsOfAllInboundDependenciesOfAnAppServiceEnvironment() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetInboundNetworkDependenciesEndpoints.json // this example is just showing the usage of "AppServiceEnvironments_GetInboundNetworkDependenciesEndpoints" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -47,12 +290,96 @@ public async Task GetInboundNetworkDependenciesEndpoints_GetInboundNetworkDepend Console.WriteLine($"Succeeded"); } - // Get Outbound Network Dependencies Endpoints + // Send a test notification that an upgrade is available for this App Service Environment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task TestUpgradeAvailableNotification_SendATestNotificationThatAnUpgradeIsAvailableForThisAppServiceEnvironment() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_TestUpgradeAvailableNotification.json + // this example is just showing the usage of "AppServiceEnvironments_TestUpgradeAvailableNotification" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceEnvironmentResource created on azure + // for more information of creating AppServiceEnvironmentResource, please refer to the document of AppServiceEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "SampleHostingEnvironment"; + ResourceIdentifier appServiceEnvironmentResourceId = AppServiceEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AppServiceEnvironmentResource appServiceEnvironment = client.GetAppServiceEnvironmentResource(appServiceEnvironmentResourceId); + + // invoke the operation + await appServiceEnvironment.TestUpgradeAvailableNotificationAsync(); + + Console.WriteLine($"Succeeded"); + } + + // Initiate an upgrade on an App Service Environment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Upgrade_InitiateAnUpgradeOnAnAppServiceEnvironment() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_Upgrade.json + // this example is just showing the usage of "AppServiceEnvironments_Upgrade" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceEnvironmentResource created on azure + // for more information of creating AppServiceEnvironmentResource, please refer to the document of AppServiceEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "SampleHostingEnvironment"; + ResourceIdentifier appServiceEnvironmentResourceId = AppServiceEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AppServiceEnvironmentResource appServiceEnvironment = client.GetAppServiceEnvironmentResource(appServiceEnvironmentResourceId); + + // invoke the operation + await appServiceEnvironment.UpgradeAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // List all currently running operations on the App Service Environment. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetOperations_ListAllCurrentlyRunningOperationsOnTheAppServiceEnvironment() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_ListOperations.json + // this example is just showing the usage of "AppServiceEnvironments_ListOperations" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceEnvironmentResource created on azure + // for more information of creating AppServiceEnvironmentResource, please refer to the document of AppServiceEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier appServiceEnvironmentResourceId = AppServiceEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AppServiceEnvironmentResource appServiceEnvironment = client.GetAppServiceEnvironmentResource(appServiceEnvironmentResourceId); + + // invoke the operation and iterate over the result + await foreach (AppServiceOperation item in appServiceEnvironment.GetOperationsAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get the network endpoints of all outbound dependencies of an App Service Environment. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetOutboundNetworkDependenciesEndpoints_GetOutboundNetworkDependenciesEndpoints() + public async Task GetOutboundNetworkDependenciesEndpoints_GetTheNetworkEndpointsOfAllOutboundDependenciesOfAnAppServiceEnvironment() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetOutboundNetworkDependenciesEndpoints.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetOutboundNetworkDependenciesEndpoints.json // this example is just showing the usage of "AppServiceEnvironments_GetOutboundNetworkDependenciesEndpoints" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -76,5 +403,157 @@ public async Task GetOutboundNetworkDependenciesEndpoints_GetOutboundNetworkDepe Console.WriteLine($"Succeeded"); } + + // Gets the private link resources. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetPrivateLinkResources_GetsThePrivateLinkResources() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_GetPrivateLinkResources.json + // this example is just showing the usage of "AppServiceEnvironments_GetPrivateLinkResources" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceEnvironmentResource created on azure + // for more information of creating AppServiceEnvironmentResource, please refer to the document of AppServiceEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier appServiceEnvironmentResourceId = AppServiceEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AppServiceEnvironmentResource appServiceEnvironment = client.GetAppServiceEnvironmentResource(appServiceEnvironmentResourceId); + + // invoke the operation and iterate over the result + await foreach (AppServicePrivateLinkResourceData item in appServiceEnvironment.GetPrivateLinkResourcesAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Reboot all machines in an App Service Environment. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Reboot_RebootAllMachinesInAnAppServiceEnvironment() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_Reboot.json + // this example is just showing the usage of "AppServiceEnvironments_Reboot" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceEnvironmentResource created on azure + // for more information of creating AppServiceEnvironmentResource, please refer to the document of AppServiceEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier appServiceEnvironmentResourceId = AppServiceEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AppServiceEnvironmentResource appServiceEnvironment = client.GetAppServiceEnvironmentResource(appServiceEnvironmentResourceId); + + // invoke the operation + await appServiceEnvironment.RebootAsync(); + + Console.WriteLine($"Succeeded"); + } + + // Get all App Service plans in an App Service Environment. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAppServicePlans_GetAllAppServicePlansInAnAppServiceEnvironment() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_ListAppServicePlans.json + // this example is just showing the usage of "AppServiceEnvironments_ListAppServicePlans" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceEnvironmentResource created on azure + // for more information of creating AppServiceEnvironmentResource, please refer to the document of AppServiceEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier appServiceEnvironmentResourceId = AppServiceEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AppServiceEnvironmentResource appServiceEnvironment = client.GetAppServiceEnvironmentResource(appServiceEnvironmentResourceId); + + // invoke the operation and iterate over the result + await foreach (AppServicePlanResource item in appServiceEnvironment.GetAppServicePlansAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServicePlanData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get all apps in an App Service Environment. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAllWebAppData_GetAllAppsInAnAppServiceEnvironment() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_ListWebApps.json + // this example is just showing the usage of "AppServiceEnvironments_ListWebApps" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceEnvironmentResource created on azure + // for more information of creating AppServiceEnvironmentResource, please refer to the document of AppServiceEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier appServiceEnvironmentResourceId = AppServiceEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AppServiceEnvironmentResource appServiceEnvironment = client.GetAppServiceEnvironmentResource(appServiceEnvironmentResourceId); + + // invoke the operation and iterate over the result + await foreach (WebSiteData item in appServiceEnvironment.GetAllWebAppDataAsync()) + { + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {item.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get global usage metrics of an App Service Environment. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetUsages_GetGlobalUsageMetricsOfAnAppServiceEnvironment() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_ListUsages.json + // this example is just showing the usage of "AppServiceEnvironments_ListUsages" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceEnvironmentResource created on azure + // for more information of creating AppServiceEnvironmentResource, please refer to the document of AppServiceEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier appServiceEnvironmentResourceId = AppServiceEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AppServiceEnvironmentResource appServiceEnvironment = client.GetAppServiceEnvironmentResource(appServiceEnvironmentResourceId); + + // invoke the operation and iterate over the result + await foreach (CsmUsageQuota item in appServiceEnvironment.GetUsagesAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServicePlanCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServicePlanCollection.cs index 9df943fe42d1..6ea1039b198e 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServicePlanCollection.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServicePlanCollection.cs @@ -24,7 +24,7 @@ public partial class Sample_AppServicePlanCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListAppServicePlansByResourceGroup() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/ListAppServicePlansByResourceGroup.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListAppServicePlansByResourceGroup.json // this example is just showing the usage of "AppServicePlans_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task GetAll_ListAppServicePlansByResourceGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppServicePlan() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetAppServicePlan.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetAppServicePlan.json // this example is just showing the usage of "AppServicePlans_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_GetAppServicePlan() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAppServicePlan() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetAppServicePlan.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetAppServicePlan.json // this example is just showing the usage of "AppServicePlans_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -124,7 +124,7 @@ public async Task Exists_GetAppServicePlan() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAppServicePlan() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetAppServicePlan.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetAppServicePlan.json // this example is just showing the usage of "AppServicePlans_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task GetIfExists_GetAppServicePlan() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateAppServicePlan() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/CreateOrUpdateAppServicePlan.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/CreateOrUpdateAppServicePlan.json // this example is just showing the usage of "AppServicePlans_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServicePlanResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServicePlanResource.cs index 3681934edbbc..10d0635fa354 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServicePlanResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AppServicePlanResource.cs @@ -24,7 +24,7 @@ public partial class Sample_AppServicePlanResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAppServicePlans_ListAppServicePlans() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/ListAppServicePlans.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListAppServicePlans.json // this example is just showing the usage of "AppServicePlans_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +56,7 @@ public async Task GetAppServicePlans_ListAppServicePlans() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppServicePlan() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetAppServicePlan.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetAppServicePlan.json // this example is just showing the usage of "AppServicePlans_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -87,7 +87,7 @@ public async Task Get_GetAppServicePlan() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteAppServicePlan() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/DeleteAppServicePlan.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/DeleteAppServicePlan.json // this example is just showing the usage of "AppServicePlans_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -114,7 +114,7 @@ public async Task Delete_DeleteAppServicePlan() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_PatchServicePlan() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/PatchAppServicePlan.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/PatchAppServicePlan.json // this example is just showing the usage of "AppServicePlans_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AseV3NetworkingConfigurationResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AseV3NetworkingConfigurationResource.cs new file mode 100644 index 000000000000..46cb7fdf33ca --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AseV3NetworkingConfigurationResource.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_AseV3NetworkingConfigurationResource + { + // Get networking configuration of an App Service Environment. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetNetworkingConfigurationOfAnAppServiceEnvironment() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_GetAseV3NetworkingConfiguration.json + // this example is just showing the usage of "AppServiceEnvironments_GetAseV3NetworkingConfiguration" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AseV3NetworkingConfigurationResource created on azure + // for more information of creating AseV3NetworkingConfigurationResource, please refer to the document of AseV3NetworkingConfigurationResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier aseV3NetworkingConfigurationResourceId = AseV3NetworkingConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AseV3NetworkingConfigurationResource aseV3NetworkingConfiguration = client.GetAseV3NetworkingConfigurationResource(aseV3NetworkingConfigurationResourceId); + + // invoke the operation + AseV3NetworkingConfigurationResource result = await aseV3NetworkingConfiguration.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AseV3NetworkingConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Update networking configuration of an App Service Environment. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_UpdateNetworkingConfigurationOfAnAppServiceEnvironment() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_UpdateAseNetworkingConfiguration.json + // this example is just showing the usage of "AppServiceEnvironments_UpdateAseNetworkingConfiguration" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AseV3NetworkingConfigurationResource created on azure + // for more information of creating AseV3NetworkingConfigurationResource, please refer to the document of AseV3NetworkingConfigurationResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier aseV3NetworkingConfigurationResourceId = AseV3NetworkingConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AseV3NetworkingConfigurationResource aseV3NetworkingConfiguration = client.GetAseV3NetworkingConfigurationResource(aseV3NetworkingConfigurationResourceId); + + // invoke the operation + AseV3NetworkingConfigurationData data = new AseV3NetworkingConfigurationData() + { + FtpEnabled = true, + RemoteDebugEnabled = true, + }; + ArmOperation lro = await aseV3NetworkingConfiguration.CreateOrUpdateAsync(WaitUntil.Completed, data); + AseV3NetworkingConfigurationResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AseV3NetworkingConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AuthsettingsV2SiteConfigResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AuthsettingsV2SiteConfigResource.cs new file mode 100644 index 000000000000..fb67bcdbf421 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_AuthsettingsV2SiteConfigResource.cs @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; +using Azure.ResourceManager.AppService.Models; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_AuthsettingsV2SiteConfigResource + { + // List Auth Settings without Secrets + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_ListAuthSettingsWithoutSecrets() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetAuthSettingsV2WithoutSecrets.json + // this example is just showing the usage of "WebApps_GetAuthSettingsV2WithoutSecrets" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AuthsettingsV2SiteConfigResource created on azure + // for more information of creating AuthsettingsV2SiteConfigResource, please refer to the document of AuthsettingsV2SiteConfigResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + ResourceIdentifier authsettingsV2SiteConfigResourceId = AuthsettingsV2SiteConfigResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AuthsettingsV2SiteConfigResource authsettingsV2SiteConfig = client.GetAuthsettingsV2SiteConfigResource(authsettingsV2SiteConfigResourceId); + + // invoke the operation + AuthsettingsV2SiteConfigResource result = await authsettingsV2SiteConfig.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SiteAuthSettingsV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Update Auth Settings V2 + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_UpdateAuthSettingsV2() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/UpdateAuthSettingsV2.json + // this example is just showing the usage of "WebApps_UpdateAuthSettingsV2" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AuthsettingsV2SiteConfigResource created on azure + // for more information of creating AuthsettingsV2SiteConfigResource, please refer to the document of AuthsettingsV2SiteConfigResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + ResourceIdentifier authsettingsV2SiteConfigResourceId = AuthsettingsV2SiteConfigResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AuthsettingsV2SiteConfigResource authsettingsV2SiteConfig = client.GetAuthsettingsV2SiteConfigResource(authsettingsV2SiteConfigResourceId); + + // invoke the operation + SiteAuthSettingsV2Data data = new SiteAuthSettingsV2Data() + { + Platform = new AuthPlatform() + { + IsEnabled = true, + RuntimeVersion = "~1", + ConfigFilePath = "/auth/config.json", + }, + GlobalValidation = new GlobalValidation() + { + IsAuthenticationRequired = true, + UnauthenticatedClientAction = UnauthenticatedClientActionV2.Return403, + ExcludedPaths = +{ +"/nosecrets/Path" +}, + }, + IdentityProviders = new AppServiceIdentityProviders() + { + Google = new AppServiceGoogleProvider() + { + IsEnabled = true, + Registration = new ClientRegistration() + { + ClientId = "42d795a9-8abb-4d06-8534-39528af40f8e.apps.googleusercontent.com", + ClientSecretSettingName = "ClientSecret", + }, + LoginScopes = +{ +"admin" +}, + ValidationAllowedAudiences = +{ +"https://example.com" +}, + }, + }, + Login = new WebAppLoginInfo() + { + RoutesLogoutEndpoint = "https://app.com/logout", + TokenStore = new AppServiceTokenStore() + { + IsEnabled = true, + TokenRefreshExtensionHours = 96, + FileSystemDirectory = "/wwwroot/sites/example", + }, + PreserveUrlFragmentsForLogins = true, + AllowedExternalRedirectUrls = +{ +"https://someurl.com" +}, + CookieExpiration = new WebAppCookieExpiration() + { + Convention = CookieExpirationConvention.IdentityProviderDerived, + TimeToExpiration = "2022:09-01T00:00Z", + }, + Nonce = new LoginFlowNonceSettings() + { + ValidateNonce = true, + }, + }, + HttpSettings = new AppServiceHttpSettings() + { + IsHttpsRequired = true, + RoutesApiPrefix = "/authv2/", + ForwardProxy = new AppServiceForwardProxy() + { + Convention = ForwardProxyConvention.Standard, + CustomHostHeaderName = "authHeader", + CustomProtoHeaderName = "customProtoHeader", + }, + }, + }; + ArmOperation lro = await authsettingsV2SiteConfig.CreateOrUpdateAsync(WaitUntil.Completed, data); + AuthsettingsV2SiteConfigResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SiteAuthSettingsV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // List Auth Settings V2 + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAuthSettingsV2_ListAuthSettingsV2() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListAuthSettingsV2.json + // this example is just showing the usage of "WebApps_GetAuthSettingsV2" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AuthsettingsV2SiteConfigResource created on azure + // for more information of creating AuthsettingsV2SiteConfigResource, please refer to the document of AuthsettingsV2SiteConfigResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + ResourceIdentifier authsettingsV2SiteConfigResourceId = AuthsettingsV2SiteConfigResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AuthsettingsV2SiteConfigResource authsettingsV2SiteConfig = client.GetAuthsettingsV2SiteConfigResource(authsettingsV2SiteConfigResourceId); + + // invoke the operation + AuthsettingsV2SiteConfigResource result = await authsettingsV2SiteConfig.GetAuthSettingsV2Async(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SiteAuthSettingsV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_CertificateOrderDetectorCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_CertificateOrderDetectorCollection.cs index fec4ac416e76..1cddeb6a7c63 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_CertificateOrderDetectorCollection.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_CertificateOrderDetectorCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_CertificateOrderDetectorCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListAppServiceCertificateDetectorResponse() { - // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2021-02-01/examples/Diagnostics_ListAppServiceCertificateOrderDetectorResponse.json + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/Diagnostics_ListAppServiceCertificateOrderDetectorResponse.json // this example is just showing the usage of "CertificateOrdersDiagnostics_ListAppServiceCertificateOrderDetectorResponse" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task GetAll_ListAppServiceCertificateDetectorResponse() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppServiceCertificateOrderDetectorResponse() { - // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2021-02-01/examples/Diagnostics_GetAppServiceCertificateOrderDetectorResponse.json + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/Diagnostics_GetAppServiceCertificateOrderDetectorResponse.json // this example is just showing the usage of "CertificateOrdersDiagnostics_GetAppServiceCertificateOrderDetectorResponse" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_GetAppServiceCertificateOrderDetectorResponse() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAppServiceCertificateOrderDetectorResponse() { - // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2021-02-01/examples/Diagnostics_GetAppServiceCertificateOrderDetectorResponse.json + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/Diagnostics_GetAppServiceCertificateOrderDetectorResponse.json // this example is just showing the usage of "CertificateOrdersDiagnostics_GetAppServiceCertificateOrderDetectorResponse" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -125,7 +125,7 @@ public async Task Exists_GetAppServiceCertificateOrderDetectorResponse() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAppServiceCertificateOrderDetectorResponse() { - // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2021-02-01/examples/Diagnostics_GetAppServiceCertificateOrderDetectorResponse.json + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/Diagnostics_GetAppServiceCertificateOrderDetectorResponse.json // this example is just showing the usage of "CertificateOrdersDiagnostics_GetAppServiceCertificateOrderDetectorResponse" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_CertificateOrderDetectorResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_CertificateOrderDetectorResource.cs index a64dcf77407d..4d7a1b10994b 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_CertificateOrderDetectorResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_CertificateOrderDetectorResource.cs @@ -21,7 +21,7 @@ public partial class Sample_CertificateOrderDetectorResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppServiceCertificateOrderDetectorResponse() { - // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2021-02-01/examples/Diagnostics_GetAppServiceCertificateOrderDetectorResponse.json + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/Diagnostics_GetAppServiceCertificateOrderDetectorResponse.json // this example is just showing the usage of "CertificateOrdersDiagnostics_GetAppServiceCertificateOrderDetectorResponse" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_ContainerAppCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_ContainerAppCollection.cs new file mode 100644 index 000000000000..f29b30627d93 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_ContainerAppCollection.cs @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; +using Azure.ResourceManager.AppService.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_ContainerAppCollection + { + // List Container Apps by resource group + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListContainerAppsByResourceGroup() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListContainerAppsByResourceGroup.json + // this example is just showing the usage of "ContainerApps_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ContainerAppResource + ContainerAppCollection collection = resourceGroupResource.GetContainerApps(); + + // invoke the operation and iterate over the result + await foreach (ContainerAppResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerAppData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Container App + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetContainerApp() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetContainerApp.json + // this example is just showing the usage of "ContainerApps_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ContainerAppResource + ContainerAppCollection collection = resourceGroupResource.GetContainerApps(); + + // invoke the operation + string name = "testcontainerApp0"; + ContainerAppResource result = await collection.GetAsync(name); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerAppData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Container App + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetContainerApp() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetContainerApp.json + // this example is just showing the usage of "ContainerApps_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ContainerAppResource + ContainerAppCollection collection = resourceGroupResource.GetContainerApps(); + + // invoke the operation + string name = "testcontainerApp0"; + bool result = await collection.ExistsAsync(name); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Container App + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetContainerApp() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetContainerApp.json + // this example is just showing the usage of "ContainerApps_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ContainerAppResource + ContainerAppCollection collection = resourceGroupResource.GetContainerApps(); + + // invoke the operation + string name = "testcontainerApp0"; + NullableResponse response = await collection.GetIfExistsAsync(name); + ContainerAppResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerAppData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create or Update Container App + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateOrUpdateContainerApp() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/CreateOrUpdateContainerApp.json + // this example is just showing the usage of "ContainerApps_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ContainerAppResource + ContainerAppCollection collection = resourceGroupResource.GetContainerApps(); + + // invoke the operation + string name = "testcontainerApp0"; + ContainerAppData data = new ContainerAppData(new AzureLocation("East US")) + { + KubeEnvironmentId = "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.Web/kubeEnvironments/demokube", + Configuration = new Configuration() + { + Ingress = new Ingress() + { + External = true, + TargetPort = 3000, + }, + }, + Template = new Template() + { + Containers = +{ +new Container() +{ +Image = "repo/testcontainerApp0:v1", +Name = "testcontainerApp0", +} +}, + Scale = new Scale() + { + MinReplicas = 1, + MaxReplicas = 5, + Rules = +{ +new ScaleRule() +{ +Name = "httpscalingrule", +Custom = new CustomScaleRule() +{ +CustomScaleRuleType = "http", +Metadata = +{ +["concurrentRequests"] = "50", +}, +}, +} +}, + }, + Dapr = new Dapr() + { + Enabled = true, + AppPort = 3000, + }, + }, + Kind = "containerApp", + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, data); + ContainerAppResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerAppData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_ContainerAppResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_ContainerAppResource.cs new file mode 100644 index 000000000000..9d9284f79f66 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_ContainerAppResource.cs @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; +using Azure.ResourceManager.AppService.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_ContainerAppResource + { + // List Container Apps by resource group + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetContainerApps_ListContainerAppsByResourceGroup() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListContainerAppsBySubscription.json + // this example is just showing the usage of "ContainerApps_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (ContainerAppResource item in subscriptionResource.GetContainerAppsAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerAppData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Container App + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetContainerApp() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetContainerApp.json + // this example is just showing the usage of "ContainerApps_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppResource created on azure + // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testcontainerApp0"; + ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); + + // invoke the operation + ContainerAppResource result = await containerApp.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerAppData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create or Update Container App + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateOrUpdateContainerApp() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/CreateOrUpdateContainerApp.json + // this example is just showing the usage of "ContainerApps_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppResource created on azure + // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testcontainerApp0"; + ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); + + // invoke the operation + ContainerAppData data = new ContainerAppData(new AzureLocation("East US")) + { + KubeEnvironmentId = "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.Web/kubeEnvironments/demokube", + Configuration = new Configuration() + { + Ingress = new Ingress() + { + External = true, + TargetPort = 3000, + }, + }, + Template = new Template() + { + Containers = +{ +new Container() +{ +Image = "repo/testcontainerApp0:v1", +Name = "testcontainerApp0", +} +}, + Scale = new Scale() + { + MinReplicas = 1, + MaxReplicas = 5, + Rules = +{ +new ScaleRule() +{ +Name = "httpscalingrule", +Custom = new CustomScaleRule() +{ +CustomScaleRuleType = "http", +Metadata = +{ +["concurrentRequests"] = "50", +}, +}, +} +}, + }, + Dapr = new Dapr() + { + Enabled = true, + AppPort = 3000, + }, + }, + Kind = "containerApp", + }; + ArmOperation lro = await containerApp.UpdateAsync(WaitUntil.Completed, data); + ContainerAppResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerAppData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Delete Container App + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteContainerApp() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/DeleteContainerApp.json + // this example is just showing the usage of "ContainerApps_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppResource created on azure + // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testWorkerApp0"; + ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); + + // invoke the operation + await containerApp.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // List Container Apps Secrets + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetSecretsContainerApps_ListContainerAppsSecrets() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListContainerAppSecrets.json + // this example is just showing the usage of "ContainerApps_ListSecrets" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + string name = "testcontainerApp0"; + await foreach (ContainerAppSecret item in subscriptionResource.GetSecretsContainerAppsAsync(name)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_CustomDnsSuffixConfigurationResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_CustomDnsSuffixConfigurationResource.cs new file mode 100644 index 000000000000..b735d0f74d77 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_CustomDnsSuffixConfigurationResource.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_CustomDnsSuffixConfigurationResource + { + // Get ASE custom DNS suffix configuration + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetASECustomDNSSuffixConfiguration() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetAseCustomDnsSuffixConfiguration.json + // this example is just showing the usage of "AppServiceEnvironments_GetAseCustomDnsSuffixConfiguration" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this CustomDnsSuffixConfigurationResource created on azure + // for more information of creating CustomDnsSuffixConfigurationResource, please refer to the document of CustomDnsSuffixConfigurationResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier customDnsSuffixConfigurationResourceId = CustomDnsSuffixConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + CustomDnsSuffixConfigurationResource customDnsSuffixConfiguration = client.GetCustomDnsSuffixConfigurationResource(customDnsSuffixConfigurationResourceId); + + // invoke the operation + CustomDnsSuffixConfigurationResource result = await customDnsSuffixConfiguration.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CustomDnsSuffixConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Update ASE custom DNS suffix configuration + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_UpdateASECustomDNSSuffixConfiguration() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/UpdateAseCustomDnsSuffixConfiguration.json + // this example is just showing the usage of "AppServiceEnvironments_UpdateAseCustomDnsSuffixConfiguration" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this CustomDnsSuffixConfigurationResource created on azure + // for more information of creating CustomDnsSuffixConfigurationResource, please refer to the document of CustomDnsSuffixConfigurationResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier customDnsSuffixConfigurationResourceId = CustomDnsSuffixConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + CustomDnsSuffixConfigurationResource customDnsSuffixConfiguration = client.GetCustomDnsSuffixConfigurationResource(customDnsSuffixConfigurationResourceId); + + // invoke the operation + CustomDnsSuffixConfigurationData data = new CustomDnsSuffixConfigurationData() + { + DnsSuffix = "contoso.com", + CertificateUri = new Uri("https://test-kv.vault.azure.net/secrets/contosocert"), + KeyVaultReferenceIdentity = "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/test-rg/providers/microsoft.managedidentity/userassignedidentities/test-user-mi", + }; + ArmOperation lro = await customDnsSuffixConfiguration.CreateOrUpdateAsync(WaitUntil.Completed, data); + CustomDnsSuffixConfigurationResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CustomDnsSuffixConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Delete ASE custom DNS suffix configuration + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteASECustomDNSSuffixConfiguration() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/DeleteAseCustomDnsSuffixConfiguration.json + // this example is just showing the usage of "AppServiceEnvironments_DeleteAseCustomDnsSuffixConfiguration" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this CustomDnsSuffixConfigurationResource created on azure + // for more information of creating CustomDnsSuffixConfigurationResource, please refer to the document of CustomDnsSuffixConfigurationResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier customDnsSuffixConfigurationResourceId = CustomDnsSuffixConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + CustomDnsSuffixConfigurationResource customDnsSuffixConfiguration = client.GetCustomDnsSuffixConfigurationResource(customDnsSuffixConfigurationResourceId); + + // invoke the operation + ArmOperation lro = await customDnsSuffixConfiguration.DeleteAsync(WaitUntil.Completed); + BinaryData result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_DeletedSiteCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_DeletedSiteCollection.cs index 923636ddb8ad..d7076dba4e98 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_DeletedSiteCollection.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_DeletedSiteCollection.cs @@ -23,7 +23,7 @@ public partial class Sample_DeletedSiteCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetDeletedWebApp() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetDeletedWebApp.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetDeletedWebApp.json // this example is just showing the usage of "Global_GetDeletedWebApp" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +56,7 @@ public async Task Get_GetDeletedWebApp() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetDeletedWebApp() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetDeletedWebApp.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetDeletedWebApp.json // this example is just showing the usage of "Global_GetDeletedWebApp" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -85,7 +85,7 @@ public async Task Exists_GetDeletedWebApp() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetDeletedWebApp() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetDeletedWebApp.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetDeletedWebApp.json // this example is just showing the usage of "Global_GetDeletedWebApp" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_DeletedSiteResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_DeletedSiteResource.cs index 79074a36c439..1996303add7f 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_DeletedSiteResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_DeletedSiteResource.cs @@ -23,7 +23,7 @@ public partial class Sample_DeletedSiteResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetDeletedSitesByLocation_ListDeletedWebAppByLocation() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/ListDeletedWebAppsByLocation.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListDeletedWebAppsByLocation.json // this example is just showing the usage of "DeletedWebApps_ListByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +56,7 @@ public async Task GetDeletedSitesByLocation_ListDeletedWebAppByLocation() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetDeletedWebAppByLocationDeletedWebApp_GetDeletedWebAppByLocation() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetDeletedWebAppByLocation.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetDeletedWebAppByLocation.json // this example is just showing the usage of "DeletedWebApps_GetDeletedWebAppByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -87,7 +87,7 @@ public async Task GetDeletedWebAppByLocationDeletedWebApp_GetDeletedWebAppByLoca [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetDeletedWebApp() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetDeletedWebApp.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetDeletedWebApp.json // this example is just showing the usage of "Global_GetDeletedWebApp" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -117,7 +117,7 @@ public async Task Get_GetDeletedWebApp() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetDeletedWebAppSnapshots_GetDeletedWebAppSnapshots() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetDeletedWebAppSnapshots.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetDeletedWebAppSnapshots.json // this example is just showing the usage of "Global_GetDeletedWebAppSnapshots" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_DomainOwnershipIdentifierCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_DomainOwnershipIdentifierCollection.cs new file mode 100644 index 000000000000..f8ebb70fba8e --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_DomainOwnershipIdentifierCollection.cs @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_DomainOwnershipIdentifierCollection + { + // List Domain Ownership Identifiers + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListDomainOwnershipIdentifiers() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-01-01/examples/ListDomainOwnershipIdentifiers.json + // this example is just showing the usage of "Domains_ListOwnershipIdentifiers" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceDomainResource created on azure + // for more information of creating AppServiceDomainResource, please refer to the document of AppServiceDomainResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string domainName = "example.com"; + ResourceIdentifier appServiceDomainResourceId = AppServiceDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, domainName); + AppServiceDomainResource appServiceDomain = client.GetAppServiceDomainResource(appServiceDomainResourceId); + + // get the collection of this DomainOwnershipIdentifierResource + DomainOwnershipIdentifierCollection collection = appServiceDomain.GetDomainOwnershipIdentifiers(); + + // invoke the operation and iterate over the result + await foreach (DomainOwnershipIdentifierResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DomainOwnershipIdentifierData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Domain Ownership Identifier + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetDomainOwnershipIdentifier() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-01-01/examples/GetDomainOwnershipIdentifier.json + // this example is just showing the usage of "Domains_GetOwnershipIdentifier" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceDomainResource created on azure + // for more information of creating AppServiceDomainResource, please refer to the document of AppServiceDomainResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string domainName = "example.com"; + ResourceIdentifier appServiceDomainResourceId = AppServiceDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, domainName); + AppServiceDomainResource appServiceDomain = client.GetAppServiceDomainResource(appServiceDomainResourceId); + + // get the collection of this DomainOwnershipIdentifierResource + DomainOwnershipIdentifierCollection collection = appServiceDomain.GetDomainOwnershipIdentifiers(); + + // invoke the operation + string name = "SampleOwnershipId"; + DomainOwnershipIdentifierResource result = await collection.GetAsync(name); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DomainOwnershipIdentifierData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Domain Ownership Identifier + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetDomainOwnershipIdentifier() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-01-01/examples/GetDomainOwnershipIdentifier.json + // this example is just showing the usage of "Domains_GetOwnershipIdentifier" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceDomainResource created on azure + // for more information of creating AppServiceDomainResource, please refer to the document of AppServiceDomainResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string domainName = "example.com"; + ResourceIdentifier appServiceDomainResourceId = AppServiceDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, domainName); + AppServiceDomainResource appServiceDomain = client.GetAppServiceDomainResource(appServiceDomainResourceId); + + // get the collection of this DomainOwnershipIdentifierResource + DomainOwnershipIdentifierCollection collection = appServiceDomain.GetDomainOwnershipIdentifiers(); + + // invoke the operation + string name = "SampleOwnershipId"; + bool result = await collection.ExistsAsync(name); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Domain Ownership Identifier + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetDomainOwnershipIdentifier() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-01-01/examples/GetDomainOwnershipIdentifier.json + // this example is just showing the usage of "Domains_GetOwnershipIdentifier" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceDomainResource created on azure + // for more information of creating AppServiceDomainResource, please refer to the document of AppServiceDomainResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string domainName = "example.com"; + ResourceIdentifier appServiceDomainResourceId = AppServiceDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, domainName); + AppServiceDomainResource appServiceDomain = client.GetAppServiceDomainResource(appServiceDomainResourceId); + + // get the collection of this DomainOwnershipIdentifierResource + DomainOwnershipIdentifierCollection collection = appServiceDomain.GetDomainOwnershipIdentifiers(); + + // invoke the operation + string name = "SampleOwnershipId"; + NullableResponse response = await collection.GetIfExistsAsync(name); + DomainOwnershipIdentifierResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DomainOwnershipIdentifierData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create App Service Domain OwnershipIdentifier + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateAppServiceDomainOwnershipIdentifier() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-01-01/examples/CreateAppServiceDomainOwnershipIdentifier.json + // this example is just showing the usage of "Domains_CreateOrUpdateOwnershipIdentifier" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceDomainResource created on azure + // for more information of creating AppServiceDomainResource, please refer to the document of AppServiceDomainResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string domainName = "example.com"; + ResourceIdentifier appServiceDomainResourceId = AppServiceDomainResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, domainName); + AppServiceDomainResource appServiceDomain = client.GetAppServiceDomainResource(appServiceDomainResourceId); + + // get the collection of this DomainOwnershipIdentifierResource + DomainOwnershipIdentifierCollection collection = appServiceDomain.GetDomainOwnershipIdentifiers(); + + // invoke the operation + string name = "SampleOwnershipId"; + DomainOwnershipIdentifierData data = new DomainOwnershipIdentifierData() + { + OwnershipId = "SampleOwnershipId", + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, data); + DomainOwnershipIdentifierResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DomainOwnershipIdentifierData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_DomainOwnershipIdentifierResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_DomainOwnershipIdentifierResource.cs new file mode 100644 index 000000000000..e42b6d4c9dfb --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_DomainOwnershipIdentifierResource.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_DomainOwnershipIdentifierResource + { + // Get Domain Ownership Identifier + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetDomainOwnershipIdentifier() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-01-01/examples/GetDomainOwnershipIdentifier.json + // this example is just showing the usage of "Domains_GetOwnershipIdentifier" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DomainOwnershipIdentifierResource created on azure + // for more information of creating DomainOwnershipIdentifierResource, please refer to the document of DomainOwnershipIdentifierResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string domainName = "example.com"; + string name = "SampleOwnershipId"; + ResourceIdentifier domainOwnershipIdentifierResourceId = DomainOwnershipIdentifierResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, domainName, name); + DomainOwnershipIdentifierResource domainOwnershipIdentifier = client.GetDomainOwnershipIdentifierResource(domainOwnershipIdentifierResourceId); + + // invoke the operation + DomainOwnershipIdentifierResource result = await domainOwnershipIdentifier.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DomainOwnershipIdentifierData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Delete App Service Domain Ownership Identifier + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteAppServiceDomainOwnershipIdentifier() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-01-01/examples/DeleteAppServiceDomainOwnershipIdentifier.json + // this example is just showing the usage of "Domains_DeleteOwnershipIdentifier" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DomainOwnershipIdentifierResource created on azure + // for more information of creating DomainOwnershipIdentifierResource, please refer to the document of DomainOwnershipIdentifierResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string domainName = "example.com"; + string name = "ownershipIdentifier"; + ResourceIdentifier domainOwnershipIdentifierResourceId = DomainOwnershipIdentifierResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, domainName, name); + DomainOwnershipIdentifierResource domainOwnershipIdentifier = client.GetDomainOwnershipIdentifierResource(domainOwnershipIdentifierResourceId); + + // invoke the operation + await domainOwnershipIdentifier.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Update App Service Domain OwnershipIdentifier + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_UpdateAppServiceDomainOwnershipIdentifier() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-01-01/examples/UpdateAppServiceDomainOwnershipIdentifier.json + // this example is just showing the usage of "Domains_UpdateOwnershipIdentifier" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DomainOwnershipIdentifierResource created on azure + // for more information of creating DomainOwnershipIdentifierResource, please refer to the document of DomainOwnershipIdentifierResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string domainName = "example.com"; + string name = "SampleOwnershipId"; + ResourceIdentifier domainOwnershipIdentifierResourceId = DomainOwnershipIdentifierResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, domainName, name); + DomainOwnershipIdentifierResource domainOwnershipIdentifier = client.GetDomainOwnershipIdentifierResource(domainOwnershipIdentifierResourceId); + + // invoke the operation + DomainOwnershipIdentifierData data = new DomainOwnershipIdentifierData() + { + OwnershipId = "SampleOwnershipId", + }; + DomainOwnershipIdentifierResource result = await domainOwnershipIdentifier.UpdateAsync(data); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DomainOwnershipIdentifierData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_HostingEnvironmentDetectorCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_HostingEnvironmentDetectorCollection.cs index 4d67b0767463..a6c24671c4fc 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_HostingEnvironmentDetectorCollection.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_HostingEnvironmentDetectorCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_HostingEnvironmentDetectorCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetAppServiceEnvironmentDetectorResponses() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_ListHostingEnvironmentDetectorResponses.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_ListHostingEnvironmentDetectorResponses.json // this example is just showing the usage of "Diagnostics_ListHostingEnvironmentDetectorResponses" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task GetAll_GetAppServiceEnvironmentDetectorResponses() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppServiceEnvironmentDetectorResponses() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetHostingEnvironmentDetectorResponse.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetHostingEnvironmentDetectorResponse.json // this example is just showing the usage of "Diagnostics_GetHostingEnvironmentDetectorResponse" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_GetAppServiceEnvironmentDetectorResponses() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAppServiceEnvironmentDetectorResponses() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetHostingEnvironmentDetectorResponse.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetHostingEnvironmentDetectorResponse.json // this example is just showing the usage of "Diagnostics_GetHostingEnvironmentDetectorResponse" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -125,7 +125,7 @@ public async Task Exists_GetAppServiceEnvironmentDetectorResponses() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAppServiceEnvironmentDetectorResponses() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetHostingEnvironmentDetectorResponse.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetHostingEnvironmentDetectorResponse.json // this example is just showing the usage of "Diagnostics_GetHostingEnvironmentDetectorResponse" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_HostingEnvironmentDetectorResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_HostingEnvironmentDetectorResource.cs index 63f3bd937c8f..11a825d372ea 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_HostingEnvironmentDetectorResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_HostingEnvironmentDetectorResource.cs @@ -21,7 +21,7 @@ public partial class Sample_HostingEnvironmentDetectorResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppServiceEnvironmentDetectorResponses() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetHostingEnvironmentDetectorResponse.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetHostingEnvironmentDetectorResponse.json // this example is just showing the usage of "Diagnostics_GetHostingEnvironmentDetectorResponse" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_HostingEnvironmentMultiRolePoolResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_HostingEnvironmentMultiRolePoolResource.cs new file mode 100644 index 000000000000..30c683cdcd02 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_HostingEnvironmentMultiRolePoolResource.cs @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; +using Azure.ResourceManager.AppService.Models; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_HostingEnvironmentMultiRolePoolResource + { + // Get properties of a multi-role pool. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetPropertiesOfAMultiRolePool() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_GetMultiRolePool.json + // this example is just showing the usage of "AppServiceEnvironments_GetMultiRolePool" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HostingEnvironmentMultiRolePoolResource created on azure + // for more information of creating HostingEnvironmentMultiRolePoolResource, please refer to the document of HostingEnvironmentMultiRolePoolResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier hostingEnvironmentMultiRolePoolResourceId = HostingEnvironmentMultiRolePoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + HostingEnvironmentMultiRolePoolResource hostingEnvironmentMultiRolePool = client.GetHostingEnvironmentMultiRolePoolResource(hostingEnvironmentMultiRolePoolResourceId); + + // invoke the operation + HostingEnvironmentMultiRolePoolResource result = await hostingEnvironmentMultiRolePool.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceWorkerPoolData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create or update a multi-role pool. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateOrUpdateAMultiRolePool() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_CreateOrUpdateMultiRolePool.json + // this example is just showing the usage of "AppServiceEnvironments_CreateOrUpdateMultiRolePool" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HostingEnvironmentMultiRolePoolResource created on azure + // for more information of creating HostingEnvironmentMultiRolePoolResource, please refer to the document of HostingEnvironmentMultiRolePoolResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier hostingEnvironmentMultiRolePoolResourceId = HostingEnvironmentMultiRolePoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + HostingEnvironmentMultiRolePoolResource hostingEnvironmentMultiRolePool = client.GetHostingEnvironmentMultiRolePoolResource(hostingEnvironmentMultiRolePoolResourceId); + + // invoke the operation + AppServiceWorkerPoolData data = new AppServiceWorkerPoolData() + { + WorkerSize = "Medium", + WorkerCount = 3, + }; + ArmOperation lro = await hostingEnvironmentMultiRolePool.CreateOrUpdateAsync(WaitUntil.Completed, data); + HostingEnvironmentMultiRolePoolResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceWorkerPoolData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create or update a multi-role pool. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateOrUpdateAMultiRolePool() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_CreateOrUpdateMultiRolePool.json + // this example is just showing the usage of "AppServiceEnvironments_UpdateMultiRolePool" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HostingEnvironmentMultiRolePoolResource created on azure + // for more information of creating HostingEnvironmentMultiRolePoolResource, please refer to the document of HostingEnvironmentMultiRolePoolResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier hostingEnvironmentMultiRolePoolResourceId = HostingEnvironmentMultiRolePoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + HostingEnvironmentMultiRolePoolResource hostingEnvironmentMultiRolePool = client.GetHostingEnvironmentMultiRolePoolResource(hostingEnvironmentMultiRolePoolResourceId); + + // invoke the operation + AppServiceWorkerPoolData data = new AppServiceWorkerPoolData() + { + WorkerSize = "Medium", + WorkerCount = 3, + }; + HostingEnvironmentMultiRolePoolResource result = await hostingEnvironmentMultiRolePool.UpdateAsync(data); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceWorkerPoolData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get metric definitions for a specific instance of a multi-role pool of an App Service Environment. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetMultiRolePoolInstanceMetricDefinitions_GetMetricDefinitionsForASpecificInstanceOfAMultiRolePoolOfAnAppServiceEnvironment() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_ListMultiRolePoolInstanceMetricDefinitions.json + // this example is just showing the usage of "AppServiceEnvironments_ListMultiRolePoolInstanceMetricDefinitions" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HostingEnvironmentMultiRolePoolResource created on azure + // for more information of creating HostingEnvironmentMultiRolePoolResource, please refer to the document of HostingEnvironmentMultiRolePoolResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier hostingEnvironmentMultiRolePoolResourceId = HostingEnvironmentMultiRolePoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + HostingEnvironmentMultiRolePoolResource hostingEnvironmentMultiRolePool = client.GetHostingEnvironmentMultiRolePoolResource(hostingEnvironmentMultiRolePoolResourceId); + + // invoke the operation and iterate over the result + string instance = "10.7.1.8"; + await foreach (ResourceMetricDefinition item in hostingEnvironmentMultiRolePool.GetMultiRolePoolInstanceMetricDefinitionsAsync(instance)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get metric definitions for a multi-role pool of an App Service Environment. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetMultiRoleMetricDefinitions_GetMetricDefinitionsForAMultiRolePoolOfAnAppServiceEnvironment() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_ListMultiRoleMetricDefinitions.json + // this example is just showing the usage of "AppServiceEnvironments_ListMultiRoleMetricDefinitions" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HostingEnvironmentMultiRolePoolResource created on azure + // for more information of creating HostingEnvironmentMultiRolePoolResource, please refer to the document of HostingEnvironmentMultiRolePoolResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier hostingEnvironmentMultiRolePoolResourceId = HostingEnvironmentMultiRolePoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + HostingEnvironmentMultiRolePoolResource hostingEnvironmentMultiRolePool = client.GetHostingEnvironmentMultiRolePoolResource(hostingEnvironmentMultiRolePoolResourceId); + + // invoke the operation and iterate over the result + await foreach (ResourceMetricDefinition item in hostingEnvironmentMultiRolePool.GetMultiRoleMetricDefinitionsAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get available SKUs for scaling a multi-role pool. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetMultiRolePoolSkus_GetAvailableSKUsForScalingAMultiRolePool() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_ListMultiRolePoolSkus.json + // this example is just showing the usage of "AppServiceEnvironments_ListMultiRolePoolSkus" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HostingEnvironmentMultiRolePoolResource created on azure + // for more information of creating HostingEnvironmentMultiRolePoolResource, please refer to the document of HostingEnvironmentMultiRolePoolResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier hostingEnvironmentMultiRolePoolResourceId = HostingEnvironmentMultiRolePoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + HostingEnvironmentMultiRolePoolResource hostingEnvironmentMultiRolePool = client.GetHostingEnvironmentMultiRolePoolResource(hostingEnvironmentMultiRolePoolResourceId); + + // invoke the operation and iterate over the result + await foreach (AppServicePoolSkuInfo item in hostingEnvironmentMultiRolePool.GetMultiRolePoolSkusAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get usage metrics for a multi-role pool of an App Service Environment. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetMultiRoleUsages_GetUsageMetricsForAMultiRolePoolOfAnAppServiceEnvironment() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_ListMultiRoleUsages.json + // this example is just showing the usage of "AppServiceEnvironments_ListMultiRoleUsages" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HostingEnvironmentMultiRolePoolResource created on azure + // for more information of creating HostingEnvironmentMultiRolePoolResource, please refer to the document of HostingEnvironmentMultiRolePoolResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier hostingEnvironmentMultiRolePoolResourceId = HostingEnvironmentMultiRolePoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + HostingEnvironmentMultiRolePoolResource hostingEnvironmentMultiRolePool = client.GetHostingEnvironmentMultiRolePoolResource(hostingEnvironmentMultiRolePoolResourceId); + + // invoke the operation and iterate over the result + await foreach (AppServiceUsage item in hostingEnvironmentMultiRolePool.GetMultiRoleUsagesAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_HostingEnvironmentPrivateEndpointConnectionCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_HostingEnvironmentPrivateEndpointConnectionCollection.cs new file mode 100644 index 000000000000..14f047f345e1 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_HostingEnvironmentPrivateEndpointConnectionCollection.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; +using Azure.ResourceManager.AppService.Models; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_HostingEnvironmentPrivateEndpointConnectionCollection + { + // Gets the list of private endpoints associated with a hosting environment. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_GetsTheListOfPrivateEndpointsAssociatedWithAHostingEnvironment() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_GetPrivateEndpointConnectionList.json + // this example is just showing the usage of "AppServiceEnvironments_GetPrivateEndpointConnectionList" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceEnvironmentResource created on azure + // for more information of creating AppServiceEnvironmentResource, please refer to the document of AppServiceEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier appServiceEnvironmentResourceId = AppServiceEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AppServiceEnvironmentResource appServiceEnvironment = client.GetAppServiceEnvironmentResource(appServiceEnvironmentResourceId); + + // get the collection of this HostingEnvironmentPrivateEndpointConnectionResource + HostingEnvironmentPrivateEndpointConnectionCollection collection = appServiceEnvironment.GetHostingEnvironmentPrivateEndpointConnections(); + + // invoke the operation and iterate over the result + await foreach (HostingEnvironmentPrivateEndpointConnectionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RemotePrivateEndpointConnectionARMResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Gets a private endpoint connection. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetsAPrivateEndpointConnection() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_GetPrivateEndpointConnection.json + // this example is just showing the usage of "AppServiceEnvironments_GetPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceEnvironmentResource created on azure + // for more information of creating AppServiceEnvironmentResource, please refer to the document of AppServiceEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier appServiceEnvironmentResourceId = AppServiceEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AppServiceEnvironmentResource appServiceEnvironment = client.GetAppServiceEnvironmentResource(appServiceEnvironmentResourceId); + + // get the collection of this HostingEnvironmentPrivateEndpointConnectionResource + HostingEnvironmentPrivateEndpointConnectionCollection collection = appServiceEnvironment.GetHostingEnvironmentPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "fa38656c-034e-43d8-adce-fe06ce039c98"; + HostingEnvironmentPrivateEndpointConnectionResource result = await collection.GetAsync(privateEndpointConnectionName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RemotePrivateEndpointConnectionARMResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Gets a private endpoint connection. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetsAPrivateEndpointConnection() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_GetPrivateEndpointConnection.json + // this example is just showing the usage of "AppServiceEnvironments_GetPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceEnvironmentResource created on azure + // for more information of creating AppServiceEnvironmentResource, please refer to the document of AppServiceEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier appServiceEnvironmentResourceId = AppServiceEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AppServiceEnvironmentResource appServiceEnvironment = client.GetAppServiceEnvironmentResource(appServiceEnvironmentResourceId); + + // get the collection of this HostingEnvironmentPrivateEndpointConnectionResource + HostingEnvironmentPrivateEndpointConnectionCollection collection = appServiceEnvironment.GetHostingEnvironmentPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "fa38656c-034e-43d8-adce-fe06ce039c98"; + bool result = await collection.ExistsAsync(privateEndpointConnectionName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Gets a private endpoint connection. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetsAPrivateEndpointConnection() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_GetPrivateEndpointConnection.json + // this example is just showing the usage of "AppServiceEnvironments_GetPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceEnvironmentResource created on azure + // for more information of creating AppServiceEnvironmentResource, please refer to the document of AppServiceEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier appServiceEnvironmentResourceId = AppServiceEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AppServiceEnvironmentResource appServiceEnvironment = client.GetAppServiceEnvironmentResource(appServiceEnvironmentResourceId); + + // get the collection of this HostingEnvironmentPrivateEndpointConnectionResource + HostingEnvironmentPrivateEndpointConnectionCollection collection = appServiceEnvironment.GetHostingEnvironmentPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "fa38656c-034e-43d8-adce-fe06ce039c98"; + NullableResponse response = await collection.GetIfExistsAsync(privateEndpointConnectionName); + HostingEnvironmentPrivateEndpointConnectionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RemotePrivateEndpointConnectionARMResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Approves or rejects a private endpoint connection. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_ApprovesOrRejectsAPrivateEndpointConnection() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_ApproveOrRejectPrivateEndpointConnection.json + // this example is just showing the usage of "AppServiceEnvironments_ApproveOrRejectPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceEnvironmentResource created on azure + // for more information of creating AppServiceEnvironmentResource, please refer to the document of AppServiceEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier appServiceEnvironmentResourceId = AppServiceEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AppServiceEnvironmentResource appServiceEnvironment = client.GetAppServiceEnvironmentResource(appServiceEnvironmentResourceId); + + // get the collection of this HostingEnvironmentPrivateEndpointConnectionResource + HostingEnvironmentPrivateEndpointConnectionCollection collection = appServiceEnvironment.GetHostingEnvironmentPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "fa38656c-034e-43d8-adce-fe06ce039c98"; + PrivateLinkConnectionApprovalRequestInfo info = new PrivateLinkConnectionApprovalRequestInfo() + { + PrivateLinkServiceConnectionState = new PrivateLinkConnectionState() + { + Status = "Approved", + Description = "Approved by johndoe@company.com", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, privateEndpointConnectionName, info); + HostingEnvironmentPrivateEndpointConnectionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RemotePrivateEndpointConnectionARMResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_HostingEnvironmentPrivateEndpointConnectionResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_HostingEnvironmentPrivateEndpointConnectionResource.cs new file mode 100644 index 000000000000..9be76426e7ca --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_HostingEnvironmentPrivateEndpointConnectionResource.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; +using Azure.ResourceManager.AppService.Models; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_HostingEnvironmentPrivateEndpointConnectionResource + { + // Gets a private endpoint connection. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetsAPrivateEndpointConnection() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_GetPrivateEndpointConnection.json + // this example is just showing the usage of "AppServiceEnvironments_GetPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HostingEnvironmentPrivateEndpointConnectionResource created on azure + // for more information of creating HostingEnvironmentPrivateEndpointConnectionResource, please refer to the document of HostingEnvironmentPrivateEndpointConnectionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + string privateEndpointConnectionName = "fa38656c-034e-43d8-adce-fe06ce039c98"; + ResourceIdentifier hostingEnvironmentPrivateEndpointConnectionResourceId = HostingEnvironmentPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, privateEndpointConnectionName); + HostingEnvironmentPrivateEndpointConnectionResource hostingEnvironmentPrivateEndpointConnection = client.GetHostingEnvironmentPrivateEndpointConnectionResource(hostingEnvironmentPrivateEndpointConnectionResourceId); + + // invoke the operation + HostingEnvironmentPrivateEndpointConnectionResource result = await hostingEnvironmentPrivateEndpointConnection.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RemotePrivateEndpointConnectionARMResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Approves or rejects a private endpoint connection. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_ApprovesOrRejectsAPrivateEndpointConnection() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_ApproveOrRejectPrivateEndpointConnection.json + // this example is just showing the usage of "AppServiceEnvironments_ApproveOrRejectPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HostingEnvironmentPrivateEndpointConnectionResource created on azure + // for more information of creating HostingEnvironmentPrivateEndpointConnectionResource, please refer to the document of HostingEnvironmentPrivateEndpointConnectionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + string privateEndpointConnectionName = "fa38656c-034e-43d8-adce-fe06ce039c98"; + ResourceIdentifier hostingEnvironmentPrivateEndpointConnectionResourceId = HostingEnvironmentPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, privateEndpointConnectionName); + HostingEnvironmentPrivateEndpointConnectionResource hostingEnvironmentPrivateEndpointConnection = client.GetHostingEnvironmentPrivateEndpointConnectionResource(hostingEnvironmentPrivateEndpointConnectionResourceId); + + // invoke the operation + PrivateLinkConnectionApprovalRequestInfo info = new PrivateLinkConnectionApprovalRequestInfo() + { + PrivateLinkServiceConnectionState = new PrivateLinkConnectionState() + { + Status = "Approved", + Description = "Approved by johndoe@company.com", + }, + }; + ArmOperation lro = await hostingEnvironmentPrivateEndpointConnection.UpdateAsync(WaitUntil.Completed, info); + HostingEnvironmentPrivateEndpointConnectionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RemotePrivateEndpointConnectionARMResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Deletes a private endpoint connection. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeletesAPrivateEndpointConnection() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_DeletePrivateEndpointConnection.json + // this example is just showing the usage of "AppServiceEnvironments_DeletePrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HostingEnvironmentPrivateEndpointConnectionResource created on azure + // for more information of creating HostingEnvironmentPrivateEndpointConnectionResource, please refer to the document of HostingEnvironmentPrivateEndpointConnectionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + string privateEndpointConnectionName = "fa38656c-034e-43d8-adce-fe06ce039c98"; + ResourceIdentifier hostingEnvironmentPrivateEndpointConnectionResourceId = HostingEnvironmentPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, privateEndpointConnectionName); + HostingEnvironmentPrivateEndpointConnectionResource hostingEnvironmentPrivateEndpointConnection = client.GetHostingEnvironmentPrivateEndpointConnectionResource(hostingEnvironmentPrivateEndpointConnectionResourceId); + + // invoke the operation + ArmOperation lro = await hostingEnvironmentPrivateEndpointConnection.DeleteAsync(WaitUntil.Completed); + BinaryData result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_HostingEnvironmentWorkerPoolCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_HostingEnvironmentWorkerPoolCollection.cs new file mode 100644 index 000000000000..321115408a02 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_HostingEnvironmentWorkerPoolCollection.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_HostingEnvironmentWorkerPoolCollection + { + // Get all worker pools of an App Service Environment. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_GetAllWorkerPoolsOfAnAppServiceEnvironment() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_ListWorkerPools.json + // this example is just showing the usage of "AppServiceEnvironments_ListWorkerPools" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceEnvironmentResource created on azure + // for more information of creating AppServiceEnvironmentResource, please refer to the document of AppServiceEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier appServiceEnvironmentResourceId = AppServiceEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AppServiceEnvironmentResource appServiceEnvironment = client.GetAppServiceEnvironmentResource(appServiceEnvironmentResourceId); + + // get the collection of this HostingEnvironmentWorkerPoolResource + HostingEnvironmentWorkerPoolCollection collection = appServiceEnvironment.GetHostingEnvironmentWorkerPools(); + + // invoke the operation and iterate over the result + await foreach (HostingEnvironmentWorkerPoolResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceWorkerPoolData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get properties of a worker pool. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetPropertiesOfAWorkerPool() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_GetWorkerPool.json + // this example is just showing the usage of "AppServiceEnvironments_GetWorkerPool" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceEnvironmentResource created on azure + // for more information of creating AppServiceEnvironmentResource, please refer to the document of AppServiceEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier appServiceEnvironmentResourceId = AppServiceEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AppServiceEnvironmentResource appServiceEnvironment = client.GetAppServiceEnvironmentResource(appServiceEnvironmentResourceId); + + // get the collection of this HostingEnvironmentWorkerPoolResource + HostingEnvironmentWorkerPoolCollection collection = appServiceEnvironment.GetHostingEnvironmentWorkerPools(); + + // invoke the operation + string workerPoolName = "workerPool1"; + HostingEnvironmentWorkerPoolResource result = await collection.GetAsync(workerPoolName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceWorkerPoolData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get properties of a worker pool. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetPropertiesOfAWorkerPool() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_GetWorkerPool.json + // this example is just showing the usage of "AppServiceEnvironments_GetWorkerPool" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceEnvironmentResource created on azure + // for more information of creating AppServiceEnvironmentResource, please refer to the document of AppServiceEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier appServiceEnvironmentResourceId = AppServiceEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AppServiceEnvironmentResource appServiceEnvironment = client.GetAppServiceEnvironmentResource(appServiceEnvironmentResourceId); + + // get the collection of this HostingEnvironmentWorkerPoolResource + HostingEnvironmentWorkerPoolCollection collection = appServiceEnvironment.GetHostingEnvironmentWorkerPools(); + + // invoke the operation + string workerPoolName = "workerPool1"; + bool result = await collection.ExistsAsync(workerPoolName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get properties of a worker pool. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetPropertiesOfAWorkerPool() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_GetWorkerPool.json + // this example is just showing the usage of "AppServiceEnvironments_GetWorkerPool" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceEnvironmentResource created on azure + // for more information of creating AppServiceEnvironmentResource, please refer to the document of AppServiceEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier appServiceEnvironmentResourceId = AppServiceEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AppServiceEnvironmentResource appServiceEnvironment = client.GetAppServiceEnvironmentResource(appServiceEnvironmentResourceId); + + // get the collection of this HostingEnvironmentWorkerPoolResource + HostingEnvironmentWorkerPoolCollection collection = appServiceEnvironment.GetHostingEnvironmentWorkerPools(); + + // invoke the operation + string workerPoolName = "workerPool1"; + NullableResponse response = await collection.GetIfExistsAsync(workerPoolName); + HostingEnvironmentWorkerPoolResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceWorkerPoolData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Get properties of a worker pool. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_GetPropertiesOfAWorkerPool() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_CreateOrUpdateWorkerPool.json + // this example is just showing the usage of "AppServiceEnvironments_CreateOrUpdateWorkerPool" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AppServiceEnvironmentResource created on azure + // for more information of creating AppServiceEnvironmentResource, please refer to the document of AppServiceEnvironmentResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + ResourceIdentifier appServiceEnvironmentResourceId = AppServiceEnvironmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + AppServiceEnvironmentResource appServiceEnvironment = client.GetAppServiceEnvironmentResource(appServiceEnvironmentResourceId); + + // get the collection of this HostingEnvironmentWorkerPoolResource + HostingEnvironmentWorkerPoolCollection collection = appServiceEnvironment.GetHostingEnvironmentWorkerPools(); + + // invoke the operation + string workerPoolName = "0"; + AppServiceWorkerPoolData data = new AppServiceWorkerPoolData() + { + WorkerSize = "Small", + WorkerCount = 3, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, workerPoolName, data); + HostingEnvironmentWorkerPoolResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceWorkerPoolData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_HostingEnvironmentWorkerPoolResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_HostingEnvironmentWorkerPoolResource.cs new file mode 100644 index 000000000000..d1e419d9e038 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_HostingEnvironmentWorkerPoolResource.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; +using Azure.ResourceManager.AppService.Models; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_HostingEnvironmentWorkerPoolResource + { + // Get properties of a worker pool. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetPropertiesOfAWorkerPool() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_GetWorkerPool.json + // this example is just showing the usage of "AppServiceEnvironments_GetWorkerPool" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HostingEnvironmentWorkerPoolResource created on azure + // for more information of creating HostingEnvironmentWorkerPoolResource, please refer to the document of HostingEnvironmentWorkerPoolResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + string workerPoolName = "workerPool1"; + ResourceIdentifier hostingEnvironmentWorkerPoolResourceId = HostingEnvironmentWorkerPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workerPoolName); + HostingEnvironmentWorkerPoolResource hostingEnvironmentWorkerPool = client.GetHostingEnvironmentWorkerPoolResource(hostingEnvironmentWorkerPoolResourceId); + + // invoke the operation + HostingEnvironmentWorkerPoolResource result = await hostingEnvironmentWorkerPool.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceWorkerPoolData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get properties of a worker pool. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_GetPropertiesOfAWorkerPool() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_CreateOrUpdateWorkerPool.json + // this example is just showing the usage of "AppServiceEnvironments_UpdateWorkerPool" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HostingEnvironmentWorkerPoolResource created on azure + // for more information of creating HostingEnvironmentWorkerPoolResource, please refer to the document of HostingEnvironmentWorkerPoolResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + string workerPoolName = "0"; + ResourceIdentifier hostingEnvironmentWorkerPoolResourceId = HostingEnvironmentWorkerPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workerPoolName); + HostingEnvironmentWorkerPoolResource hostingEnvironmentWorkerPool = client.GetHostingEnvironmentWorkerPoolResource(hostingEnvironmentWorkerPoolResourceId); + + // invoke the operation + AppServiceWorkerPoolData data = new AppServiceWorkerPoolData() + { + WorkerSize = "Small", + WorkerCount = 3, + }; + HostingEnvironmentWorkerPoolResource result = await hostingEnvironmentWorkerPool.UpdateAsync(data); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AppServiceWorkerPoolData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get metric definitions for a specific instance of a worker pool of an App Service Environment. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetWorkerPoolInstanceMetricDefinitions_GetMetricDefinitionsForASpecificInstanceOfAWorkerPoolOfAnAppServiceEnvironment() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_ListWorkerPoolInstanceMetricDefinitions.json + // this example is just showing the usage of "AppServiceEnvironments_ListWorkerPoolInstanceMetricDefinitions" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HostingEnvironmentWorkerPoolResource created on azure + // for more information of creating HostingEnvironmentWorkerPoolResource, please refer to the document of HostingEnvironmentWorkerPoolResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + string workerPoolName = "0"; + ResourceIdentifier hostingEnvironmentWorkerPoolResourceId = HostingEnvironmentWorkerPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workerPoolName); + HostingEnvironmentWorkerPoolResource hostingEnvironmentWorkerPool = client.GetHostingEnvironmentWorkerPoolResource(hostingEnvironmentWorkerPoolResourceId); + + // invoke the operation and iterate over the result + string instance = "10.8.0.7"; + await foreach (ResourceMetricDefinition item in hostingEnvironmentWorkerPool.GetWorkerPoolInstanceMetricDefinitionsAsync(instance)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get metric definitions for a worker pool of an App Service Environment. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetWebWorkerMetricDefinitions_GetMetricDefinitionsForAWorkerPoolOfAnAppServiceEnvironment() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_ListWebWorkerMetricDefinitions.json + // this example is just showing the usage of "AppServiceEnvironments_ListWebWorkerMetricDefinitions" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HostingEnvironmentWorkerPoolResource created on azure + // for more information of creating HostingEnvironmentWorkerPoolResource, please refer to the document of HostingEnvironmentWorkerPoolResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + string workerPoolName = "0"; + ResourceIdentifier hostingEnvironmentWorkerPoolResourceId = HostingEnvironmentWorkerPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workerPoolName); + HostingEnvironmentWorkerPoolResource hostingEnvironmentWorkerPool = client.GetHostingEnvironmentWorkerPoolResource(hostingEnvironmentWorkerPoolResourceId); + + // invoke the operation and iterate over the result + await foreach (ResourceMetricDefinition item in hostingEnvironmentWorkerPool.GetWebWorkerMetricDefinitionsAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get available SKUs for scaling a worker pool. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetWorkerPoolSkus_GetAvailableSKUsForScalingAWorkerPool() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_ListWorkerPoolSkus.json + // this example is just showing the usage of "AppServiceEnvironments_ListWorkerPoolSkus" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HostingEnvironmentWorkerPoolResource created on azure + // for more information of creating HostingEnvironmentWorkerPoolResource, please refer to the document of HostingEnvironmentWorkerPoolResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + string workerPoolName = "workerPool1"; + ResourceIdentifier hostingEnvironmentWorkerPoolResourceId = HostingEnvironmentWorkerPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workerPoolName); + HostingEnvironmentWorkerPoolResource hostingEnvironmentWorkerPool = client.GetHostingEnvironmentWorkerPoolResource(hostingEnvironmentWorkerPoolResourceId); + + // invoke the operation and iterate over the result + await foreach (AppServicePoolSkuInfo item in hostingEnvironmentWorkerPool.GetWorkerPoolSkusAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get usage metrics for a worker pool of an App Service Environment. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetWebWorkerUsages_GetUsageMetricsForAWorkerPoolOfAnAppServiceEnvironment() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AppServiceEnvironments_ListWebWorkerUsages.json + // this example is just showing the usage of "AppServiceEnvironments_ListWebWorkerUsages" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HostingEnvironmentWorkerPoolResource created on azure + // for more information of creating HostingEnvironmentWorkerPoolResource, please refer to the document of HostingEnvironmentWorkerPoolResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-rg"; + string name = "test-ase"; + string workerPoolName = "0"; + ResourceIdentifier hostingEnvironmentWorkerPoolResourceId = HostingEnvironmentWorkerPoolResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workerPoolName); + HostingEnvironmentWorkerPoolResource hostingEnvironmentWorkerPool = client.GetHostingEnvironmentWorkerPoolResource(hostingEnvironmentWorkerPoolResourceId); + + // invoke the operation and iterate over the result + await foreach (AppServiceUsage item in hostingEnvironmentWorkerPool.GetWebWorkerUsagesAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_KubeEnvironmentCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_KubeEnvironmentCollection.cs index 8e0621041e15..7a7a3c28ddf9 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_KubeEnvironmentCollection.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_KubeEnvironmentCollection.cs @@ -23,7 +23,7 @@ public partial class Sample_KubeEnvironmentCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListKubeEnvironmentsByResourceGroup() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/KubeEnvironments_ListByResourceGroup.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/KubeEnvironments_ListByResourceGroup.json // this example is just showing the usage of "KubeEnvironments_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task GetAll_ListKubeEnvironmentsByResourceGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetKubeEnvironmentsByName() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/KubeEnvironments_Get.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/KubeEnvironments_Get.json // this example is just showing the usage of "KubeEnvironments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -93,7 +93,7 @@ public async Task Get_GetKubeEnvironmentsByName() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetKubeEnvironmentsByName() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/KubeEnvironments_Get.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/KubeEnvironments_Get.json // this example is just showing the usage of "KubeEnvironments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Exists_GetKubeEnvironmentsByName() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetKubeEnvironmentsByName() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/KubeEnvironments_Get.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/KubeEnvironments_Get.json // this example is just showing the usage of "KubeEnvironments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -165,7 +165,7 @@ public async Task GetIfExists_GetKubeEnvironmentsByName() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateKubeEnvironments() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/KubeEnvironments_CreateOrUpdate.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/KubeEnvironments_CreateOrUpdate.json // this example is just showing the usage of "KubeEnvironments_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_KubeEnvironmentResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_KubeEnvironmentResource.cs index e7a6fc26495b..8b3a4596d00f 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_KubeEnvironmentResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_KubeEnvironmentResource.cs @@ -24,7 +24,7 @@ public partial class Sample_KubeEnvironmentResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetKubeEnvironments_ListKubeEnvironmentsBySubscription() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/KubeEnvironments_ListBySubscription.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/KubeEnvironments_ListBySubscription.json // this example is just showing the usage of "KubeEnvironments_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +56,7 @@ public async Task GetKubeEnvironments_ListKubeEnvironmentsBySubscription() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetKubeEnvironmentsByName() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/KubeEnvironments_Get.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/KubeEnvironments_Get.json // this example is just showing the usage of "KubeEnvironments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -87,7 +87,7 @@ public async Task Get_GetKubeEnvironmentsByName() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteKubeEnvironmentByName() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/KubeEnvironments_Delete.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/KubeEnvironments_Delete.json // this example is just showing the usage of "KubeEnvironments_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -114,7 +114,7 @@ public async Task Delete_DeleteKubeEnvironmentByName() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateKubeEnvironments() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/KubeEnvironments_Update.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/KubeEnvironments_Update.json // this example is just showing the usage of "KubeEnvironments_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_RequestHistoryCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_RequestHistoryCollection.cs new file mode 100644 index 000000000000..1d005ba867fb --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_RequestHistoryCollection.cs @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_RequestHistoryCollection + { + // List repetition request history + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListRepetitionRequestHistory() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowRunActionRepetitionsRequestHistories_List.json + // this example is just showing the usage of "WorkflowRunActionRepetitionsRequestHistories_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource created on azure + // for more information of creating SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource, please refer to the document of SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-resource-group"; + string name = "test-name"; + string workflowName = "test-workflow"; + string runName = "08586776228332053161046300351"; + string actionName = "HTTP_Webhook"; + string repetitionName = "000001"; + ResourceIdentifier siteHostruntimeWebhookApiWorkflowRunActionRepetitionResourceId = SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, runName, actionName, repetitionName); + SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource siteHostruntimeWebhookApiWorkflowRunActionRepetition = client.GetSiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource(siteHostruntimeWebhookApiWorkflowRunActionRepetitionResourceId); + + // get the collection of this RequestHistoryResource + RequestHistoryCollection collection = siteHostruntimeWebhookApiWorkflowRunActionRepetition.GetRequestHistories(); + + // invoke the operation and iterate over the result + await foreach (RequestHistoryResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RequestHistoryData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get a repetition request history + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetARepetitionRequestHistory() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowRunActionRepetitionsRequestHistories_Get.json + // this example is just showing the usage of "WorkflowRunActionRepetitionsRequestHistories_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource created on azure + // for more information of creating SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource, please refer to the document of SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-resource-group"; + string name = "test-name"; + string workflowName = "test-workflow"; + string runName = "08586776228332053161046300351"; + string actionName = "HTTP_Webhook"; + string repetitionName = "000001"; + ResourceIdentifier siteHostruntimeWebhookApiWorkflowRunActionRepetitionResourceId = SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, runName, actionName, repetitionName); + SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource siteHostruntimeWebhookApiWorkflowRunActionRepetition = client.GetSiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource(siteHostruntimeWebhookApiWorkflowRunActionRepetitionResourceId); + + // get the collection of this RequestHistoryResource + RequestHistoryCollection collection = siteHostruntimeWebhookApiWorkflowRunActionRepetition.GetRequestHistories(); + + // invoke the operation + string requestHistoryName = "08586611142732800686"; + RequestHistoryResource result = await collection.GetAsync(requestHistoryName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RequestHistoryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get a repetition request history + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetARepetitionRequestHistory() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowRunActionRepetitionsRequestHistories_Get.json + // this example is just showing the usage of "WorkflowRunActionRepetitionsRequestHistories_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource created on azure + // for more information of creating SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource, please refer to the document of SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-resource-group"; + string name = "test-name"; + string workflowName = "test-workflow"; + string runName = "08586776228332053161046300351"; + string actionName = "HTTP_Webhook"; + string repetitionName = "000001"; + ResourceIdentifier siteHostruntimeWebhookApiWorkflowRunActionRepetitionResourceId = SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, runName, actionName, repetitionName); + SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource siteHostruntimeWebhookApiWorkflowRunActionRepetition = client.GetSiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource(siteHostruntimeWebhookApiWorkflowRunActionRepetitionResourceId); + + // get the collection of this RequestHistoryResource + RequestHistoryCollection collection = siteHostruntimeWebhookApiWorkflowRunActionRepetition.GetRequestHistories(); + + // invoke the operation + string requestHistoryName = "08586611142732800686"; + bool result = await collection.ExistsAsync(requestHistoryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get a repetition request history + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetARepetitionRequestHistory() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowRunActionRepetitionsRequestHistories_Get.json + // this example is just showing the usage of "WorkflowRunActionRepetitionsRequestHistories_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource created on azure + // for more information of creating SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource, please refer to the document of SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-resource-group"; + string name = "test-name"; + string workflowName = "test-workflow"; + string runName = "08586776228332053161046300351"; + string actionName = "HTTP_Webhook"; + string repetitionName = "000001"; + ResourceIdentifier siteHostruntimeWebhookApiWorkflowRunActionRepetitionResourceId = SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, runName, actionName, repetitionName); + SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource siteHostruntimeWebhookApiWorkflowRunActionRepetition = client.GetSiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource(siteHostruntimeWebhookApiWorkflowRunActionRepetitionResourceId); + + // get the collection of this RequestHistoryResource + RequestHistoryCollection collection = siteHostruntimeWebhookApiWorkflowRunActionRepetition.GetRequestHistories(); + + // invoke the operation + string requestHistoryName = "08586611142732800686"; + NullableResponse response = await collection.GetIfExistsAsync(requestHistoryName); + RequestHistoryResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RequestHistoryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_RequestHistoryResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_RequestHistoryResource.cs new file mode 100644 index 000000000000..fd95f3568dad --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_RequestHistoryResource.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_RequestHistoryResource + { + // Get a repetition request history + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetARepetitionRequestHistory() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowRunActionRepetitionsRequestHistories_Get.json + // this example is just showing the usage of "WorkflowRunActionRepetitionsRequestHistories_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RequestHistoryResource created on azure + // for more information of creating RequestHistoryResource, please refer to the document of RequestHistoryResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-resource-group"; + string name = "test-name"; + string workflowName = "test-workflow"; + string runName = "08586776228332053161046300351"; + string actionName = "HTTP_Webhook"; + string repetitionName = "000001"; + string requestHistoryName = "08586611142732800686"; + ResourceIdentifier requestHistoryResourceId = RequestHistoryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, runName, actionName, repetitionName, requestHistoryName); + RequestHistoryResource requestHistory = client.GetRequestHistoryResource(requestHistoryResourceId); + + // invoke the operation + RequestHistoryResource result = await requestHistory.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RequestHistoryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs index 36d744e8b718..1e528eeb3820 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs @@ -22,7 +22,7 @@ public partial class Sample_ResourceGroupResourceExtensions [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAllResourceHealthMetadataData_ListResourceHealthMetadataForAResourceGroup() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/ListResourceHealthMetadataByResourceGroup.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListResourceHealthMetadataByResourceGroup.json // this example is just showing the usage of "ResourceHealthMetadata_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_RevisionCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_RevisionCollection.cs new file mode 100644 index 000000000000..b32e730212f6 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_RevisionCollection.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_RevisionCollection + { + // List Container App's revisions + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListContainerAppSRevisions() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListRevisions.json + // this example is just showing the usage of "ContainerAppsRevisions_ListRevisions" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppResource created on azure + // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string containerAppName = "testcontainerApp0"; + ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); + ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); + + // get the collection of this RevisionResource + RevisionCollection collection = containerApp.GetRevisions(); + + // invoke the operation and iterate over the result + await foreach (RevisionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RevisionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Container App's revision + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetContainerAppSRevision() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetRevision.json + // this example is just showing the usage of "ContainerAppsRevisions_GetRevision" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppResource created on azure + // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string containerAppName = "testcontainerApp0"; + ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); + ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); + + // get the collection of this RevisionResource + RevisionCollection collection = containerApp.GetRevisions(); + + // invoke the operation + string name = "testcontainerApp0-pjxhsye"; + RevisionResource result = await collection.GetAsync(name); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RevisionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Container App's revision + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetContainerAppSRevision() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetRevision.json + // this example is just showing the usage of "ContainerAppsRevisions_GetRevision" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppResource created on azure + // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string containerAppName = "testcontainerApp0"; + ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); + ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); + + // get the collection of this RevisionResource + RevisionCollection collection = containerApp.GetRevisions(); + + // invoke the operation + string name = "testcontainerApp0-pjxhsye"; + bool result = await collection.ExistsAsync(name); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Container App's revision + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetContainerAppSRevision() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetRevision.json + // this example is just showing the usage of "ContainerAppsRevisions_GetRevision" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerAppResource created on azure + // for more information of creating ContainerAppResource, please refer to the document of ContainerAppResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string containerAppName = "testcontainerApp0"; + ResourceIdentifier containerAppResourceId = ContainerAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName); + ContainerAppResource containerApp = client.GetContainerAppResource(containerAppResourceId); + + // get the collection of this RevisionResource + RevisionCollection collection = containerApp.GetRevisions(); + + // invoke the operation + string name = "testcontainerApp0-pjxhsye"; + NullableResponse response = await collection.GetIfExistsAsync(name); + RevisionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RevisionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_RevisionResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_RevisionResource.cs new file mode 100644 index 000000000000..dfdf29f96f22 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_RevisionResource.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_RevisionResource + { + // Get Container App's revision + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetContainerAppSRevision() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetRevision.json + // this example is just showing the usage of "ContainerAppsRevisions_GetRevision" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RevisionResource created on azure + // for more information of creating RevisionResource, please refer to the document of RevisionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string containerAppName = "testcontainerApp0"; + string name = "testcontainerApp0-pjxhsye"; + ResourceIdentifier revisionResourceId = RevisionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName, name); + RevisionResource revision = client.GetRevisionResource(revisionResourceId); + + // invoke the operation + RevisionResource result = await revision.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RevisionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Activate Container App's revision + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task ActivateRevision_ActivateContainerAppSRevision() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ActivateRevision.json + // this example is just showing the usage of "ContainerAppsRevisions_ActivateRevision" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RevisionResource created on azure + // for more information of creating RevisionResource, please refer to the document of RevisionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string containerAppName = "testcontainerApp0"; + string name = "testcontainerApp0-pjxhsye"; + ResourceIdentifier revisionResourceId = RevisionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName, name); + RevisionResource revision = client.GetRevisionResource(revisionResourceId); + + // invoke the operation + await revision.ActivateRevisionAsync(); + + Console.WriteLine($"Succeeded"); + } + + // Deactivate Container App's revision + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task DeactivateRevision_DeactivateContainerAppSRevision() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/DeactivateRevision.json + // this example is just showing the usage of "ContainerAppsRevisions_DeactivateRevision" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RevisionResource created on azure + // for more information of creating RevisionResource, please refer to the document of RevisionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string containerAppName = "testcontainerApp0"; + string name = "testcontainerApp0-pjxhsye"; + ResourceIdentifier revisionResourceId = RevisionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName, name); + RevisionResource revision = client.GetRevisionResource(revisionResourceId); + + // invoke the operation + await revision.DeactivateRevisionAsync(); + + Console.WriteLine($"Succeeded"); + } + + // Restart Container App's revision + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task RestartRevision_RestartContainerAppSRevision() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/RestartRevision.json + // this example is just showing the usage of "ContainerAppsRevisions_RestartRevision" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RevisionResource created on azure + // for more information of creating RevisionResource, please refer to the document of RevisionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string containerAppName = "testStaticSite0"; + string name = "testcontainerApp0-pjxhsye"; + ResourceIdentifier revisionResourceId = RevisionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, containerAppName, name); + RevisionResource revision = client.GetRevisionResource(revisionResourceId); + + // invoke the operation + await revision.RestartRevisionAsync(); + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_ScmSiteBasicPublishingCredentialsPolicyResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_ScmSiteBasicPublishingCredentialsPolicyResource.cs index 4f7cbbf61626..117d0a023e4e 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_ScmSiteBasicPublishingCredentialsPolicyResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_ScmSiteBasicPublishingCredentialsPolicyResource.cs @@ -22,7 +22,7 @@ public partial class Sample_ScmSiteBasicPublishingCredentialsPolicyResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetSCMAllowed() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetPublishingCredentialsPolicy.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetPublishingCredentialsPolicy.json // this example is just showing the usage of "WebApps_GetScmAllowed" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_GetSCMAllowed() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_UpdateSCMAllowed() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/UpdatePublishingCredentialsPolicy.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/UpdatePublishingCredentialsPolicy.json // this example is just showing the usage of "WebApps_UpdateScmAllowed" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_ScmSiteSlotBasicPublishingCredentialsPolicyResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_ScmSiteSlotBasicPublishingCredentialsPolicyResource.cs index c14ea03a7bdb..9aa466b7217b 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_ScmSiteSlotBasicPublishingCredentialsPolicyResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_ScmSiteSlotBasicPublishingCredentialsPolicyResource.cs @@ -22,7 +22,7 @@ public partial class Sample_ScmSiteSlotBasicPublishingCredentialsPolicyResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetSCMAllowed() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetPublishingCredentialsPolicySlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetPublishingCredentialsPolicySlot.json // this example is just showing the usage of "WebApps_GetScmAllowedSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -54,7 +54,7 @@ public async Task Get_GetSCMAllowed() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_UpdateSCMAllowed() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/UpdatePublishingCredentialsPolicySlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/UpdatePublishingCredentialsPolicySlot.json // this example is just showing the usage of "WebApps_UpdateScmAllowedSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteBackupCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteBackupCollection.cs new file mode 100644 index 000000000000..e1b8040f83b8 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteBackupCollection.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_SiteBackupCollection + { + // List web app backups + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListWebAppBackups() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListWebAppBackups.json + // this example is just showing the usage of "WebApps_ListBackups" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // get the collection of this SiteBackupResource + SiteBackupCollection collection = webSite.GetSiteBackups(); + + // invoke the operation and iterate over the result + await foreach (SiteBackupResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebAppBackupData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get web app backup + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetWebAppBackup() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWebAppBackup.json + // this example is just showing the usage of "WebApps_GetBackupStatus" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // get the collection of this SiteBackupResource + SiteBackupCollection collection = webSite.GetSiteBackups(); + + // invoke the operation + string backupId = "12345"; + SiteBackupResource result = await collection.GetAsync(backupId); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebAppBackupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get web app backup + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetWebAppBackup() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWebAppBackup.json + // this example is just showing the usage of "WebApps_GetBackupStatus" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // get the collection of this SiteBackupResource + SiteBackupCollection collection = webSite.GetSiteBackups(); + + // invoke the operation + string backupId = "12345"; + bool result = await collection.ExistsAsync(backupId); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get web app backup + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetWebAppBackup() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWebAppBackup.json + // this example is just showing the usage of "WebApps_GetBackupStatus" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // get the collection of this SiteBackupResource + SiteBackupCollection collection = webSite.GetSiteBackups(); + + // invoke the operation + string backupId = "12345"; + NullableResponse response = await collection.GetIfExistsAsync(backupId); + SiteBackupResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebAppBackupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteBackupResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteBackupResource.cs new file mode 100644 index 000000000000..278de260dfb0 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteBackupResource.cs @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; +using Azure.ResourceManager.AppService.Models; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_SiteBackupResource + { + // Get web app backup + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetWebAppBackup() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWebAppBackup.json + // this example is just showing the usage of "WebApps_GetBackupStatus" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SiteBackupResource created on azure + // for more information of creating SiteBackupResource, please refer to the document of SiteBackupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + string backupId = "12345"; + ResourceIdentifier siteBackupResourceId = SiteBackupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, backupId); + SiteBackupResource siteBackup = client.GetSiteBackupResource(siteBackupResourceId); + + // invoke the operation + SiteBackupResource result = await siteBackup.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebAppBackupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Delete web app backup + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteWebAppBackup() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/DeleteWebAppBackup.json + // this example is just showing the usage of "WebApps_DeleteBackup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SiteBackupResource created on azure + // for more information of creating SiteBackupResource, please refer to the document of SiteBackupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + string backupId = "12345"; + ResourceIdentifier siteBackupResourceId = SiteBackupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, backupId); + SiteBackupResource siteBackup = client.GetSiteBackupResource(siteBackupResourceId); + + // invoke the operation + await siteBackup.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Get web app backup with secrets + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetBackupStatusSecrets_GetWebAppBackupWithSecrets() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWebAppBackupWithSecrets.json + // this example is just showing the usage of "WebApps_ListBackupStatusSecrets" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SiteBackupResource created on azure + // for more information of creating SiteBackupResource, please refer to the document of SiteBackupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + string backupId = "12345"; + ResourceIdentifier siteBackupResourceId = SiteBackupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, backupId); + SiteBackupResource siteBackup = client.GetSiteBackupResource(siteBackupResourceId); + + // invoke the operation + WebAppBackupInfo info = new WebAppBackupInfo() + { + BackupName = "abcdwe", + IsEnabled = true, + StorageAccountUri = new Uri("DefaultEndpointsProtocol=https;AccountName=storagesample;AccountKey="), + BackupSchedule = new WebAppBackupSchedule(7, BackupFrequencyUnit.Day, true, 30) + { + StartOn = DateTimeOffset.Parse("2022-09-02T17:33:11.641Z"), + }, + Databases = +{ +new AppServiceDatabaseBackupSetting(AppServiceDatabaseType.SqlAzure) +{ +Name = "backenddb", +ConnectionStringName = "backend", +ConnectionString = "DSN=data-source-name[;SERVER=value] [;PWD=value] [;UID=value] [;=]", +},new AppServiceDatabaseBackupSetting(AppServiceDatabaseType.SqlAzure) +{ +Name = "statsdb", +ConnectionStringName = "stats", +ConnectionString = "DSN=data-source-name[;SERVER=value] [;PWD=value] [;UID=value] [;=]", +} +}, + }; + SiteBackupResource result = await siteBackup.GetBackupStatusSecretsAsync(info); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebAppBackupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Restore web app from backup + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Restore_RestoreWebAppFromBackup() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/RestoreWebAppBackup.json + // this example is just showing the usage of "WebApps_Restore" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SiteBackupResource created on azure + // for more information of creating SiteBackupResource, please refer to the document of SiteBackupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + string backupId = "123244"; + ResourceIdentifier siteBackupResourceId = SiteBackupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, backupId); + SiteBackupResource siteBackup = client.GetSiteBackupResource(siteBackupResourceId); + + // invoke the operation + RestoreRequestInfo info = new RestoreRequestInfo() + { + StorageAccountUri = new Uri("DefaultEndpointsProtocol=https;AccountName=storagesample;AccountKey="), + CanOverwrite = true, + SiteName = "sitef6141", + Databases = +{ +new AppServiceDatabaseBackupSetting(AppServiceDatabaseType.SqlAzure) +{ +Name = "backenddb", +ConnectionStringName = "backend", +ConnectionString = "DSN=data-source-name[;SERVER=value] [;PWD=value] [;UID=value] [;=]", +},new AppServiceDatabaseBackupSetting(AppServiceDatabaseType.SqlAzure) +{ +Name = "statsdb", +ConnectionStringName = "stats", +ConnectionString = "DSN=data-source-name[;SERVER=value] [;PWD=value] [;UID=value] [;=]", +} +}, + }; + await siteBackup.RestoreAsync(WaitUntil.Completed, info); + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteConfigAppsettingCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteConfigAppsettingCollection.cs index cdda20d97747..7ce3d4e9fd6f 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteConfigAppsettingCollection.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteConfigAppsettingCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_SiteConfigAppsettingCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetAzureKeyVaultReferencesForAppSettings() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetKeyVaultReferencesForAppSettings.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetKeyVaultReferencesForAppSettings.json // this example is just showing the usage of "WebApps_GetAppSettingsKeyVaultReferences" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task GetAll_GetAzureKeyVaultReferencesForAppSettings() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAzureKeyVaultAppSettingReference() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetKeyVaultReferencesForAppSetting.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetKeyVaultReferencesForAppSetting.json // this example is just showing the usage of "WebApps_GetAppSettingKeyVaultReference" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_GetAzureKeyVaultAppSettingReference() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAzureKeyVaultAppSettingReference() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetKeyVaultReferencesForAppSetting.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetKeyVaultReferencesForAppSetting.json // this example is just showing the usage of "WebApps_GetAppSettingKeyVaultReference" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -125,7 +125,7 @@ public async Task Exists_GetAzureKeyVaultAppSettingReference() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAzureKeyVaultAppSettingReference() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetKeyVaultReferencesForAppSetting.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetKeyVaultReferencesForAppSetting.json // this example is just showing the usage of "WebApps_GetAppSettingKeyVaultReference" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteConfigAppsettingResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteConfigAppsettingResource.cs index e182637eb42d..d306972b6b84 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteConfigAppsettingResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteConfigAppsettingResource.cs @@ -21,7 +21,7 @@ public partial class Sample_SiteConfigAppsettingResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAzureKeyVaultAppSettingReference() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetKeyVaultReferencesForAppSetting.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetKeyVaultReferencesForAppSetting.json // this example is just showing the usage of "WebApps_GetAppSettingKeyVaultReference" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDeploymentStatuCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDeploymentStatuCollection.cs new file mode 100644 index 000000000000..6c036335e67d --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDeploymentStatuCollection.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_SiteDeploymentStatuCollection + { + // List Deployment Status + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListDeploymentStatus() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListSiteDeploymentStatus.json + // this example is just showing the usage of "WebApps_ListProductionSiteDeploymentStatuses" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testSite"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // get the collection of this SiteDeploymentStatuResource + SiteDeploymentStatuCollection collection = webSite.GetSiteDeploymentStatus(); + + // invoke the operation and iterate over the result + await foreach (SiteDeploymentStatuResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CsmDeploymentStatusData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Deployment Status + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetDeploymentStatus() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSiteDeploymentStatus.json + // this example is just showing the usage of "WebApps_GetProductionSiteDeploymentStatus" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testSite"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // get the collection of this SiteDeploymentStatuResource + SiteDeploymentStatuCollection collection = webSite.GetSiteDeploymentStatus(); + + // invoke the operation + string deploymentStatusId = "eacfd68b-3bbd-4ad9-99c5-98614d89c8e5"; + ArmOperation lro = await collection.GetAsync(WaitUntil.Completed, deploymentStatusId); + SiteDeploymentStatuResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CsmDeploymentStatusData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Deployment Status + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetDeploymentStatus() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSiteDeploymentStatus.json + // this example is just showing the usage of "WebApps_GetProductionSiteDeploymentStatus" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testSite"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // get the collection of this SiteDeploymentStatuResource + SiteDeploymentStatuCollection collection = webSite.GetSiteDeploymentStatus(); + + // invoke the operation + string deploymentStatusId = "eacfd68b-3bbd-4ad9-99c5-98614d89c8e5"; + ArmOperation lro = await collection.ExistsAsync(WaitUntil.Completed, deploymentStatusId); + bool result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Deployment Status + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetDeploymentStatus() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSiteDeploymentStatus.json + // this example is just showing the usage of "WebApps_GetProductionSiteDeploymentStatus" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testSite"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // get the collection of this SiteDeploymentStatuResource + SiteDeploymentStatuCollection collection = webSite.GetSiteDeploymentStatus(); + + // invoke the operation + string deploymentStatusId = "eacfd68b-3bbd-4ad9-99c5-98614d89c8e5"; + ArmOperation lro = await collection.GetIfExistsAsync(WaitUntil.Completed, deploymentStatusId); + SiteDeploymentStatuResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CsmDeploymentStatusData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDeploymentStatuResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDeploymentStatuResource.cs new file mode 100644 index 000000000000..a724b4524e44 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDeploymentStatuResource.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_SiteDeploymentStatuResource + { + // Get Deployment Status + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetDeploymentStatus() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSiteDeploymentStatus.json + // this example is just showing the usage of "WebApps_GetProductionSiteDeploymentStatus" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SiteDeploymentStatuResource created on azure + // for more information of creating SiteDeploymentStatuResource, please refer to the document of SiteDeploymentStatuResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testSite"; + string deploymentStatusId = "eacfd68b-3bbd-4ad9-99c5-98614d89c8e5"; + ResourceIdentifier siteDeploymentStatuResourceId = SiteDeploymentStatuResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, deploymentStatusId); + SiteDeploymentStatuResource siteDeploymentStatu = client.GetSiteDeploymentStatuResource(siteDeploymentStatuResourceId); + + // invoke the operation + ArmOperation lro = await siteDeploymentStatu.GetAsync(WaitUntil.Completed); + SiteDeploymentStatuResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CsmDeploymentStatusData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDetectorCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDetectorCollection.cs index 62a3d83b0c23..5d50aa4c8a1a 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDetectorCollection.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDetectorCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_SiteDetectorCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetAppDetectorResponses() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_ListSiteDetectorResponses.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_ListSiteDetectorResponses.json // this example is just showing the usage of "Diagnostics_ListSiteDetectorResponses" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task GetAll_GetAppDetectorResponses() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetAppSlotDetectorResponses() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_ListSiteDetectorResponsesSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_ListSiteDetectorResponsesSlot.json // this example is just showing the usage of "Diagnostics_ListSiteDetectorResponses" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +96,7 @@ public async Task GetAll_GetAppSlotDetectorResponses() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppDetectorResponse() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetectorResponse.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetectorResponse.json // this example is just showing the usage of "Diagnostics_GetSiteDetectorResponse" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -131,7 +131,7 @@ public async Task Get_GetAppDetectorResponse() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAppDetectorResponse() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetectorResponse.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetectorResponse.json // this example is just showing the usage of "Diagnostics_GetSiteDetectorResponse" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -162,7 +162,7 @@ public async Task Exists_GetAppDetectorResponse() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAppDetectorResponse() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetectorResponse.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetectorResponse.json // this example is just showing the usage of "Diagnostics_GetSiteDetectorResponse" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -205,7 +205,7 @@ public async Task GetIfExists_GetAppDetectorResponse() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppSlotDetectorResponse() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetectorResponseSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetectorResponseSlot.json // this example is just showing the usage of "Diagnostics_GetSiteDetectorResponse" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -240,7 +240,7 @@ public async Task Get_GetAppSlotDetectorResponse() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAppSlotDetectorResponse() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetectorResponseSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetectorResponseSlot.json // this example is just showing the usage of "Diagnostics_GetSiteDetectorResponse" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -271,7 +271,7 @@ public async Task Exists_GetAppSlotDetectorResponse() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAppSlotDetectorResponse() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetectorResponseSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetectorResponseSlot.json // this example is just showing the usage of "Diagnostics_GetSiteDetectorResponse" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDetectorResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDetectorResource.cs index 48804fabfcf3..c05a5ee4e9cd 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDetectorResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDetectorResource.cs @@ -21,7 +21,7 @@ public partial class Sample_SiteDetectorResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppDetectorResponse() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetectorResponse.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetectorResponse.json // this example is just showing the usage of "Diagnostics_GetSiteDetectorResponse" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_GetAppDetectorResponse() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppSlotDetectorResponse() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetectorResponseSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetectorResponseSlot.json // this example is just showing the usage of "Diagnostics_GetSiteDetectorResponse" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDiagnosticAnalysisCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDiagnosticAnalysisCollection.cs index 08efc623c3fa..68564f7178bc 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDiagnosticAnalysisCollection.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDiagnosticAnalysisCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_SiteDiagnosticAnalysisCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListAppAnalyses() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_ListSiteAnalyses.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_ListSiteAnalyses.json // this example is just showing the usage of "Diagnostics_ListSiteAnalyses" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task GetAll_ListAppAnalyses() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListAppSlotAnalyses() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_ListSiteAnalysesSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_ListSiteAnalysesSlot.json // this example is just showing the usage of "Diagnostics_ListSiteAnalyses" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -98,7 +98,7 @@ public async Task GetAll_ListAppSlotAnalyses() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppAnalysis() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteAnalysis.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteAnalysis.json // this example is just showing the usage of "Diagnostics_GetSiteAnalysis" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -134,7 +134,7 @@ public async Task Get_GetAppAnalysis() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAppAnalysis() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteAnalysis.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteAnalysis.json // this example is just showing the usage of "Diagnostics_GetSiteAnalysis" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task Exists_GetAppAnalysis() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAppAnalysis() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteAnalysis.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteAnalysis.json // this example is just showing the usage of "Diagnostics_GetSiteAnalysis" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -210,7 +210,7 @@ public async Task GetIfExists_GetAppAnalysis() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppSlotAnalysis() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteAnalysisSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteAnalysisSlot.json // this example is just showing the usage of "Diagnostics_GetSiteAnalysis" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -246,7 +246,7 @@ public async Task Get_GetAppSlotAnalysis() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAppSlotAnalysis() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteAnalysisSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteAnalysisSlot.json // this example is just showing the usage of "Diagnostics_GetSiteAnalysis" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -278,7 +278,7 @@ public async Task Exists_GetAppSlotAnalysis() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAppSlotAnalysis() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteAnalysisSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteAnalysisSlot.json // this example is just showing the usage of "Diagnostics_GetSiteAnalysis" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDiagnosticAnalysisResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDiagnosticAnalysisResource.cs index f2ce05d62b46..1cb4e6ed5703 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDiagnosticAnalysisResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDiagnosticAnalysisResource.cs @@ -22,7 +22,7 @@ public partial class Sample_SiteDiagnosticAnalysisResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppAnalysis() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteAnalysis.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteAnalysis.json // this example is just showing the usage of "Diagnostics_GetSiteAnalysis" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_GetAppAnalysis() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppSlotAnalysis() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteAnalysisSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteAnalysisSlot.json // this example is just showing the usage of "Diagnostics_GetSiteAnalysis" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,7 +88,7 @@ public async Task Get_GetAppSlotAnalysis() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Execute_ExecuteSiteAnalysis() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_ExecuteSiteAnalysis.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_ExecuteSiteAnalysis.json // this example is just showing the usage of "Diagnostics_ExecuteSiteAnalysis" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -117,7 +117,7 @@ public async Task Execute_ExecuteSiteAnalysis() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Execute_ExecuteSiteSlotAnalysis() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_ExecuteSiteAnalysisSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_ExecuteSiteAnalysisSlot.json // this example is just showing the usage of "Diagnostics_ExecuteSiteAnalysis" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDiagnosticCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDiagnosticCollection.cs index 8db4fbc5ba34..67ec77b21a35 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDiagnosticCollection.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDiagnosticCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_SiteDiagnosticCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListAppDiagnosticCategories() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_ListSiteDiagnosticCategories.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_ListSiteDiagnosticCategories.json // this example is just showing the usage of "Diagnostics_ListSiteDiagnosticCategories" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task GetAll_ListAppDiagnosticCategories() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListAppSlotDiagnosticCategories() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_ListSiteDiagnosticCategoriesSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_ListSiteDiagnosticCategoriesSlot.json // this example is just showing the usage of "Diagnostics_ListSiteDiagnosticCategories" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +96,7 @@ public async Task GetAll_ListAppSlotDiagnosticCategories() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppDiagnosticCategory() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDiagnosticCategory.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDiagnosticCategory.json // this example is just showing the usage of "Diagnostics_GetSiteDiagnosticCategory" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -131,7 +131,7 @@ public async Task Get_GetAppDiagnosticCategory() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAppDiagnosticCategory() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDiagnosticCategory.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDiagnosticCategory.json // this example is just showing the usage of "Diagnostics_GetSiteDiagnosticCategory" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -162,7 +162,7 @@ public async Task Exists_GetAppDiagnosticCategory() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAppDiagnosticCategory() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDiagnosticCategory.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDiagnosticCategory.json // this example is just showing the usage of "Diagnostics_GetSiteDiagnosticCategory" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -205,7 +205,7 @@ public async Task GetIfExists_GetAppDiagnosticCategory() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppSlotDiagnosticCategory() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDiagnosticCategorySlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDiagnosticCategorySlot.json // this example is just showing the usage of "Diagnostics_GetSiteDiagnosticCategory" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -240,7 +240,7 @@ public async Task Get_GetAppSlotDiagnosticCategory() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAppSlotDiagnosticCategory() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDiagnosticCategorySlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDiagnosticCategorySlot.json // this example is just showing the usage of "Diagnostics_GetSiteDiagnosticCategory" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -271,7 +271,7 @@ public async Task Exists_GetAppSlotDiagnosticCategory() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAppSlotDiagnosticCategory() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDiagnosticCategorySlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDiagnosticCategorySlot.json // this example is just showing the usage of "Diagnostics_GetSiteDiagnosticCategory" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDiagnosticDetectorCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDiagnosticDetectorCollection.cs index b52fb1ac4e3a..d2472aeeee86 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDiagnosticDetectorCollection.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDiagnosticDetectorCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_SiteDiagnosticDetectorCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListAppDetectors() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_ListSiteDetectors.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_ListSiteDetectors.json // this example is just showing the usage of "Diagnostics_ListSiteDetectors" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task GetAll_ListAppDetectors() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListAppSlotDetectors() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_ListSiteDetectorsSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_ListSiteDetectorsSlot.json // this example is just showing the usage of "Diagnostics_ListSiteDetectors" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -98,7 +98,7 @@ public async Task GetAll_ListAppSlotDetectors() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppDetector() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetector.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetector.json // this example is just showing the usage of "Diagnostics_GetSiteDetector" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -134,7 +134,7 @@ public async Task Get_GetAppDetector() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAppDetector() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetector.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetector.json // this example is just showing the usage of "Diagnostics_GetSiteDetector" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task Exists_GetAppDetector() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAppDetector() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetector.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetector.json // this example is just showing the usage of "Diagnostics_GetSiteDetector" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -210,7 +210,7 @@ public async Task GetIfExists_GetAppDetector() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppSlotDetector() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetectorSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetectorSlot.json // this example is just showing the usage of "Diagnostics_GetSiteDetector" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -246,7 +246,7 @@ public async Task Get_GetAppSlotDetector() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAppSlotDetector() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetectorSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetectorSlot.json // this example is just showing the usage of "Diagnostics_GetSiteDetector" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -278,7 +278,7 @@ public async Task Exists_GetAppSlotDetector() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAppSlotDetector() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetectorSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetectorSlot.json // this example is just showing the usage of "Diagnostics_GetSiteDetector" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDiagnosticDetectorResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDiagnosticDetectorResource.cs index dfedc5ea8449..c21a39db8606 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDiagnosticDetectorResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDiagnosticDetectorResource.cs @@ -22,7 +22,7 @@ public partial class Sample_SiteDiagnosticDetectorResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppDetector() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetector.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetector.json // this example is just showing the usage of "Diagnostics_GetSiteDetector" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_GetAppDetector() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppSlotDetector() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetectorSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetectorSlot.json // this example is just showing the usage of "Diagnostics_GetSiteDetector" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,7 +88,7 @@ public async Task Get_GetAppSlotDetector() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Execute_ExecuteSiteDetector() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_ExecuteSiteDetector.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_ExecuteSiteDetector.json // this example is just showing the usage of "Diagnostics_ExecuteSiteDetector" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -117,7 +117,7 @@ public async Task Execute_ExecuteSiteDetector() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Execute_ExecuteSiteSlotDetector() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_ExecuteSiteDetectorSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_ExecuteSiteDetectorSlot.json // this example is just showing the usage of "Diagnostics_ExecuteSiteDetector" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDiagnosticResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDiagnosticResource.cs index db4cf51ed7d1..f963e8746767 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDiagnosticResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteDiagnosticResource.cs @@ -21,7 +21,7 @@ public partial class Sample_SiteDiagnosticResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppDiagnosticCategory() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDiagnosticCategory.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDiagnosticCategory.json // this example is just showing the usage of "Diagnostics_GetSiteDiagnosticCategory" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_GetAppDiagnosticCategory() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppSlotDiagnosticCategory() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDiagnosticCategorySlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDiagnosticCategorySlot.json // this example is just showing the usage of "Diagnostics_GetSiteDiagnosticCategory" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteHostruntimeWebhookApiWorkflowRunActionRepetitionCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteHostruntimeWebhookApiWorkflowRunActionRepetitionCollection.cs new file mode 100644 index 000000000000..7dcc071dd9b5 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteHostruntimeWebhookApiWorkflowRunActionRepetitionCollection.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_SiteHostruntimeWebhookApiWorkflowRunActionRepetitionCollection + { + // List repetitions + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListRepetitions() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowRunActionRepetitions_List.json + // this example is just showing the usage of "WorkflowRunActionRepetitions_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkflowRunActionResource created on azure + // for more information of creating WorkflowRunActionResource, please refer to the document of WorkflowRunActionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testResourceGroup"; + string name = "test-name"; + string workflowName = "testFlow"; + string runName = "08586776228332053161046300351"; + string actionName = "testAction"; + ResourceIdentifier workflowRunActionResourceId = WorkflowRunActionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, runName, actionName); + WorkflowRunActionResource workflowRunAction = client.GetWorkflowRunActionResource(workflowRunActionResourceId); + + // get the collection of this SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource + SiteHostruntimeWebhookApiWorkflowRunActionRepetitionCollection collection = workflowRunAction.GetSiteHostruntimeWebhookApiWorkflowRunActionRepetitions(); + + // invoke the operation and iterate over the result + await foreach (SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowRunActionRepetitionDefinitionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get a repetition + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetARepetition() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowRunActionRepetitions_Get.json + // this example is just showing the usage of "WorkflowRunActionRepetitions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkflowRunActionResource created on azure + // for more information of creating WorkflowRunActionResource, please refer to the document of WorkflowRunActionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testResourceGroup"; + string name = "test-name"; + string workflowName = "testFlow"; + string runName = "08586776228332053161046300351"; + string actionName = "testAction"; + ResourceIdentifier workflowRunActionResourceId = WorkflowRunActionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, runName, actionName); + WorkflowRunActionResource workflowRunAction = client.GetWorkflowRunActionResource(workflowRunActionResourceId); + + // get the collection of this SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource + SiteHostruntimeWebhookApiWorkflowRunActionRepetitionCollection collection = workflowRunAction.GetSiteHostruntimeWebhookApiWorkflowRunActionRepetitions(); + + // invoke the operation + string repetitionName = "000001"; + SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource result = await collection.GetAsync(repetitionName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowRunActionRepetitionDefinitionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get a repetition + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetARepetition() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowRunActionRepetitions_Get.json + // this example is just showing the usage of "WorkflowRunActionRepetitions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkflowRunActionResource created on azure + // for more information of creating WorkflowRunActionResource, please refer to the document of WorkflowRunActionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testResourceGroup"; + string name = "test-name"; + string workflowName = "testFlow"; + string runName = "08586776228332053161046300351"; + string actionName = "testAction"; + ResourceIdentifier workflowRunActionResourceId = WorkflowRunActionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, runName, actionName); + WorkflowRunActionResource workflowRunAction = client.GetWorkflowRunActionResource(workflowRunActionResourceId); + + // get the collection of this SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource + SiteHostruntimeWebhookApiWorkflowRunActionRepetitionCollection collection = workflowRunAction.GetSiteHostruntimeWebhookApiWorkflowRunActionRepetitions(); + + // invoke the operation + string repetitionName = "000001"; + bool result = await collection.ExistsAsync(repetitionName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get a repetition + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetARepetition() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowRunActionRepetitions_Get.json + // this example is just showing the usage of "WorkflowRunActionRepetitions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkflowRunActionResource created on azure + // for more information of creating WorkflowRunActionResource, please refer to the document of WorkflowRunActionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testResourceGroup"; + string name = "test-name"; + string workflowName = "testFlow"; + string runName = "08586776228332053161046300351"; + string actionName = "testAction"; + ResourceIdentifier workflowRunActionResourceId = WorkflowRunActionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, runName, actionName); + WorkflowRunActionResource workflowRunAction = client.GetWorkflowRunActionResource(workflowRunActionResourceId); + + // get the collection of this SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource + SiteHostruntimeWebhookApiWorkflowRunActionRepetitionCollection collection = workflowRunAction.GetSiteHostruntimeWebhookApiWorkflowRunActionRepetitions(); + + // invoke the operation + string repetitionName = "000001"; + NullableResponse response = await collection.GetIfExistsAsync(repetitionName); + SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowRunActionRepetitionDefinitionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource.cs new file mode 100644 index 000000000000..a50590d8e343 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; +using Azure.ResourceManager.AppService.Models; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource + { + // Get a repetition + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetARepetition() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowRunActionRepetitions_Get.json + // this example is just showing the usage of "WorkflowRunActionRepetitions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource created on azure + // for more information of creating SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource, please refer to the document of SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testResourceGroup"; + string name = "test-name"; + string workflowName = "testFlow"; + string runName = "08586776228332053161046300351"; + string actionName = "testAction"; + string repetitionName = "000001"; + ResourceIdentifier siteHostruntimeWebhookApiWorkflowRunActionRepetitionResourceId = SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, runName, actionName, repetitionName); + SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource siteHostruntimeWebhookApiWorkflowRunActionRepetition = client.GetSiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource(siteHostruntimeWebhookApiWorkflowRunActionRepetitionResourceId); + + // invoke the operation + SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource result = await siteHostruntimeWebhookApiWorkflowRunActionRepetition.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowRunActionRepetitionDefinitionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // List expression traces for a repetition + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetExpressionTraces_ListExpressionTracesForARepetition() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowRunActionRepetitions_ListExpressionTraces.json + // this example is just showing the usage of "WorkflowRunActionRepetitions_ListExpressionTraces" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource created on azure + // for more information of creating SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource, please refer to the document of SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testResourceGroup"; + string name = "test-name"; + string workflowName = "testFlow"; + string runName = "08586776228332053161046300351"; + string actionName = "testAction"; + string repetitionName = "000001"; + ResourceIdentifier siteHostruntimeWebhookApiWorkflowRunActionRepetitionResourceId = SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, runName, actionName, repetitionName); + SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource siteHostruntimeWebhookApiWorkflowRunActionRepetition = client.GetSiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource(siteHostruntimeWebhookApiWorkflowRunActionRepetitionResourceId); + + // invoke the operation and iterate over the result + await foreach (ExpressionRoot item in siteHostruntimeWebhookApiWorkflowRunActionRepetition.GetExpressionTracesAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionCollection.cs new file mode 100644 index 000000000000..e4a16aa1c03b --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionCollection.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionCollection + { + // List the scoped repetitions + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListTheScopedRepetitions() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowRunActionScopeRepetitions_List.json + // this example is just showing the usage of "WorkflowRunActionScopeRepetitions_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkflowRunActionResource created on azure + // for more information of creating WorkflowRunActionResource, please refer to the document of WorkflowRunActionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testResourceGroup"; + string name = "test-name"; + string workflowName = "testFlow"; + string runName = "08586776228332053161046300351"; + string actionName = "for_each"; + ResourceIdentifier workflowRunActionResourceId = WorkflowRunActionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, runName, actionName); + WorkflowRunActionResource workflowRunAction = client.GetWorkflowRunActionResource(workflowRunActionResourceId); + + // get the collection of this SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource + SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionCollection collection = workflowRunAction.GetSiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitions(); + + // invoke the operation and iterate over the result + await foreach (SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowRunActionRepetitionDefinitionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get a scoped repetition + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetAScopedRepetition() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowRunActionScopeRepetitions_Get.json + // this example is just showing the usage of "WorkflowRunActionScopeRepetitions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkflowRunActionResource created on azure + // for more information of creating WorkflowRunActionResource, please refer to the document of WorkflowRunActionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testResourceGroup"; + string name = "test-name"; + string workflowName = "testFlow"; + string runName = "08586776228332053161046300351"; + string actionName = "for_each"; + ResourceIdentifier workflowRunActionResourceId = WorkflowRunActionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, runName, actionName); + WorkflowRunActionResource workflowRunAction = client.GetWorkflowRunActionResource(workflowRunActionResourceId); + + // get the collection of this SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource + SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionCollection collection = workflowRunAction.GetSiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitions(); + + // invoke the operation + string repetitionName = "000000"; + SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource result = await collection.GetAsync(repetitionName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowRunActionRepetitionDefinitionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get a scoped repetition + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetAScopedRepetition() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowRunActionScopeRepetitions_Get.json + // this example is just showing the usage of "WorkflowRunActionScopeRepetitions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkflowRunActionResource created on azure + // for more information of creating WorkflowRunActionResource, please refer to the document of WorkflowRunActionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testResourceGroup"; + string name = "test-name"; + string workflowName = "testFlow"; + string runName = "08586776228332053161046300351"; + string actionName = "for_each"; + ResourceIdentifier workflowRunActionResourceId = WorkflowRunActionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, runName, actionName); + WorkflowRunActionResource workflowRunAction = client.GetWorkflowRunActionResource(workflowRunActionResourceId); + + // get the collection of this SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource + SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionCollection collection = workflowRunAction.GetSiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitions(); + + // invoke the operation + string repetitionName = "000000"; + bool result = await collection.ExistsAsync(repetitionName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get a scoped repetition + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetAScopedRepetition() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowRunActionScopeRepetitions_Get.json + // this example is just showing the usage of "WorkflowRunActionScopeRepetitions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkflowRunActionResource created on azure + // for more information of creating WorkflowRunActionResource, please refer to the document of WorkflowRunActionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testResourceGroup"; + string name = "test-name"; + string workflowName = "testFlow"; + string runName = "08586776228332053161046300351"; + string actionName = "for_each"; + ResourceIdentifier workflowRunActionResourceId = WorkflowRunActionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, runName, actionName); + WorkflowRunActionResource workflowRunAction = client.GetWorkflowRunActionResource(workflowRunActionResourceId); + + // get the collection of this SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource + SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionCollection collection = workflowRunAction.GetSiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitions(); + + // invoke the operation + string repetitionName = "000000"; + NullableResponse response = await collection.GetIfExistsAsync(repetitionName); + SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowRunActionRepetitionDefinitionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource.cs new file mode 100644 index 000000000000..ef48236f7411 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource + { + // Get a scoped repetition + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetAScopedRepetition() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowRunActionScopeRepetitions_Get.json + // this example is just showing the usage of "WorkflowRunActionScopeRepetitions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource created on azure + // for more information of creating SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource, please refer to the document of SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testResourceGroup"; + string name = "test-name"; + string workflowName = "testFlow"; + string runName = "08586776228332053161046300351"; + string actionName = "for_each"; + string repetitionName = "000000"; + ResourceIdentifier siteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResourceId = SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, runName, actionName, repetitionName); + SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource siteHostruntimeWebhookApiWorkflowRunActionScopeRepetition = client.GetSiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource(siteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResourceId); + + // invoke the operation + SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource result = await siteHostruntimeWebhookApiWorkflowRunActionScopeRepetition.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowRunActionRepetitionDefinitionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteInstanceCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteInstanceCollection.cs index b89496fe0d70..7dcf1285f523 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteInstanceCollection.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteInstanceCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_SiteInstanceCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetSiteInstanceInfo() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetSiteInstanceInfo.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSiteInstanceInfo.json // this example is just showing the usage of "WebApps_GetInstanceInfo" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task Get_GetSiteInstanceInfo() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetSiteInstanceInfo() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetSiteInstanceInfo.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSiteInstanceInfo.json // this example is just showing the usage of "WebApps_GetInstanceInfo" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,7 +88,7 @@ public async Task Exists_GetSiteInstanceInfo() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetSiteInstanceInfo() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetSiteInstanceInfo.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSiteInstanceInfo.json // this example is just showing the usage of "WebApps_GetInstanceInfo" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteInstanceResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteInstanceResource.cs index fd27938d315d..0b3fc823210d 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteInstanceResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteInstanceResource.cs @@ -21,7 +21,7 @@ public partial class Sample_SiteInstanceResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetSiteInstanceInfo() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetSiteInstanceInfo.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSiteInstanceInfo.json // this example is just showing the usage of "WebApps_GetInstanceInfo" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SitePrivateEndpointConnectionCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SitePrivateEndpointConnectionCollection.cs index b6935d0d5568..8cc811f9698b 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SitePrivateEndpointConnectionCollection.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SitePrivateEndpointConnectionCollection.cs @@ -23,7 +23,7 @@ public partial class Sample_SitePrivateEndpointConnectionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAPrivateEndpointConnectionForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetSitePrivateEndpointConnection.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSitePrivateEndpointConnection.json // this example is just showing the usage of "WebApps_GetPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,7 @@ public async Task Get_GetAPrivateEndpointConnectionForASite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAPrivateEndpointConnectionForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetSitePrivateEndpointConnection.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSitePrivateEndpointConnection.json // this example is just showing the usage of "WebApps_GetPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,7 +89,7 @@ public async Task Exists_GetAPrivateEndpointConnectionForASite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAPrivateEndpointConnectionForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetSitePrivateEndpointConnection.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSitePrivateEndpointConnection.json // this example is just showing the usage of "WebApps_GetPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -132,7 +132,7 @@ public async Task GetIfExists_GetAPrivateEndpointConnectionForASite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_ApprovesOrRejectsAPrivateEndpointConnectionForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/ApproveRejectSitePrivateEndpointConnection.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ApproveRejectSitePrivateEndpointConnection.json // this example is just showing the usage of "WebApps_ApproveOrRejectPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SitePrivateEndpointConnectionResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SitePrivateEndpointConnectionResource.cs index 8b2a8087191e..ac640fdf1352 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SitePrivateEndpointConnectionResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SitePrivateEndpointConnectionResource.cs @@ -23,7 +23,7 @@ public partial class Sample_SitePrivateEndpointConnectionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAPrivateEndpointConnectionForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetSitePrivateEndpointConnection.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSitePrivateEndpointConnection.json // this example is just showing the usage of "WebApps_GetPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_GetAPrivateEndpointConnectionForASite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_ApprovesOrRejectsAPrivateEndpointConnectionForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/ApproveRejectSitePrivateEndpointConnection.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ApproveRejectSitePrivateEndpointConnection.json // this example is just showing the usage of "WebApps_ApproveOrRejectPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -97,7 +97,7 @@ public async Task Update_ApprovesOrRejectsAPrivateEndpointConnectionForASite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteAPrivateEndpointConnectionForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/DeleteSitePrivateEndpointConnection.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/DeleteSitePrivateEndpointConnection.json // this example is just showing the usage of "WebApps_DeletePrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDeploymentStatuCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDeploymentStatuCollection.cs new file mode 100644 index 000000000000..fa529e17f12b --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDeploymentStatuCollection.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_SiteSlotDeploymentStatuCollection + { + // List Deployment Status Slot + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListDeploymentStatusSlot() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListSiteDeploymentStatusSlot.json + // this example is just showing the usage of "WebApps_ListSlotSiteDeploymentStatusesSlot" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteSlotResource created on azure + // for more information of creating WebSiteSlotResource, please refer to the document of WebSiteSlotResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testSite"; + string slot = "stage"; + ResourceIdentifier webSiteSlotResourceId = WebSiteSlotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, slot); + WebSiteSlotResource webSiteSlot = client.GetWebSiteSlotResource(webSiteSlotResourceId); + + // get the collection of this SiteSlotDeploymentStatuResource + SiteSlotDeploymentStatuCollection collection = webSiteSlot.GetSiteSlotDeploymentStatus(); + + // invoke the operation and iterate over the result + await foreach (SiteSlotDeploymentStatuResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CsmDeploymentStatusData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Deployment Status Slot + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetDeploymentStatusSlot() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSiteDeploymentStatusSlot.json + // this example is just showing the usage of "WebApps_GetSlotSiteDeploymentStatusSlot" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteSlotResource created on azure + // for more information of creating WebSiteSlotResource, please refer to the document of WebSiteSlotResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testSite"; + string slot = "stage"; + ResourceIdentifier webSiteSlotResourceId = WebSiteSlotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, slot); + WebSiteSlotResource webSiteSlot = client.GetWebSiteSlotResource(webSiteSlotResourceId); + + // get the collection of this SiteSlotDeploymentStatuResource + SiteSlotDeploymentStatuCollection collection = webSiteSlot.GetSiteSlotDeploymentStatus(); + + // invoke the operation + string deploymentStatusId = "eacfd68b-3bbd-4ad9-99c5-98614d89c8e5"; + ArmOperation lro = await collection.GetAsync(WaitUntil.Completed, deploymentStatusId); + SiteSlotDeploymentStatuResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CsmDeploymentStatusData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Deployment Status Slot + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetDeploymentStatusSlot() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSiteDeploymentStatusSlot.json + // this example is just showing the usage of "WebApps_GetSlotSiteDeploymentStatusSlot" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteSlotResource created on azure + // for more information of creating WebSiteSlotResource, please refer to the document of WebSiteSlotResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testSite"; + string slot = "stage"; + ResourceIdentifier webSiteSlotResourceId = WebSiteSlotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, slot); + WebSiteSlotResource webSiteSlot = client.GetWebSiteSlotResource(webSiteSlotResourceId); + + // get the collection of this SiteSlotDeploymentStatuResource + SiteSlotDeploymentStatuCollection collection = webSiteSlot.GetSiteSlotDeploymentStatus(); + + // invoke the operation + string deploymentStatusId = "eacfd68b-3bbd-4ad9-99c5-98614d89c8e5"; + ArmOperation lro = await collection.ExistsAsync(WaitUntil.Completed, deploymentStatusId); + bool result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Deployment Status Slot + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetDeploymentStatusSlot() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSiteDeploymentStatusSlot.json + // this example is just showing the usage of "WebApps_GetSlotSiteDeploymentStatusSlot" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteSlotResource created on azure + // for more information of creating WebSiteSlotResource, please refer to the document of WebSiteSlotResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testSite"; + string slot = "stage"; + ResourceIdentifier webSiteSlotResourceId = WebSiteSlotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, slot); + WebSiteSlotResource webSiteSlot = client.GetWebSiteSlotResource(webSiteSlotResourceId); + + // get the collection of this SiteSlotDeploymentStatuResource + SiteSlotDeploymentStatuCollection collection = webSiteSlot.GetSiteSlotDeploymentStatus(); + + // invoke the operation + string deploymentStatusId = "eacfd68b-3bbd-4ad9-99c5-98614d89c8e5"; + ArmOperation lro = await collection.GetIfExistsAsync(WaitUntil.Completed, deploymentStatusId); + SiteSlotDeploymentStatuResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CsmDeploymentStatusData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDeploymentStatuResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDeploymentStatuResource.cs new file mode 100644 index 000000000000..a5789dfad9df --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDeploymentStatuResource.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_SiteSlotDeploymentStatuResource + { + // Get Deployment Status Slot + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetDeploymentStatusSlot() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSiteDeploymentStatusSlot.json + // this example is just showing the usage of "WebApps_GetSlotSiteDeploymentStatusSlot" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SiteSlotDeploymentStatuResource created on azure + // for more information of creating SiteSlotDeploymentStatuResource, please refer to the document of SiteSlotDeploymentStatuResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testSite"; + string slot = "stage"; + string deploymentStatusId = "eacfd68b-3bbd-4ad9-99c5-98614d89c8e5"; + ResourceIdentifier siteSlotDeploymentStatuResourceId = SiteSlotDeploymentStatuResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, slot, deploymentStatusId); + SiteSlotDeploymentStatuResource siteSlotDeploymentStatu = client.GetSiteSlotDeploymentStatuResource(siteSlotDeploymentStatuResourceId); + + // invoke the operation + ArmOperation lro = await siteSlotDeploymentStatu.GetAsync(WaitUntil.Completed); + SiteSlotDeploymentStatuResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + CsmDeploymentStatusData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDetectorCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDetectorCollection.cs index bdb57d52ee0a..64158693a6b5 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDetectorCollection.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDetectorCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_SiteSlotDetectorCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetAppDetectorResponses() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_ListSiteDetectorResponses.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_ListSiteDetectorResponses.json // this example is just showing the usage of "Diagnostics_ListSiteDetectorResponsesSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task GetAll_GetAppDetectorResponses() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetAppSlotDetectorResponses() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_ListSiteDetectorResponsesSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_ListSiteDetectorResponsesSlot.json // this example is just showing the usage of "Diagnostics_ListSiteDetectorResponsesSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -98,7 +98,7 @@ public async Task GetAll_GetAppSlotDetectorResponses() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppDetectorResponse() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetectorResponse.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetectorResponse.json // this example is just showing the usage of "Diagnostics_GetSiteDetectorResponseSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -134,7 +134,7 @@ public async Task Get_GetAppDetectorResponse() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAppDetectorResponse() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetectorResponse.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetectorResponse.json // this example is just showing the usage of "Diagnostics_GetSiteDetectorResponseSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task Exists_GetAppDetectorResponse() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAppDetectorResponse() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetectorResponse.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetectorResponse.json // this example is just showing the usage of "Diagnostics_GetSiteDetectorResponseSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -210,7 +210,7 @@ public async Task GetIfExists_GetAppDetectorResponse() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppSlotDetectorResponse() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetectorResponseSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetectorResponseSlot.json // this example is just showing the usage of "Diagnostics_GetSiteDetectorResponseSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -246,7 +246,7 @@ public async Task Get_GetAppSlotDetectorResponse() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAppSlotDetectorResponse() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetectorResponseSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetectorResponseSlot.json // this example is just showing the usage of "Diagnostics_GetSiteDetectorResponseSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -278,7 +278,7 @@ public async Task Exists_GetAppSlotDetectorResponse() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAppSlotDetectorResponse() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetectorResponseSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetectorResponseSlot.json // this example is just showing the usage of "Diagnostics_GetSiteDetectorResponseSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDetectorResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDetectorResource.cs index aa9d73a480af..053f5de385d1 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDetectorResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDetectorResource.cs @@ -21,7 +21,7 @@ public partial class Sample_SiteSlotDetectorResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppDetectorResponse() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetectorResponse.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetectorResponse.json // this example is just showing the usage of "Diagnostics_GetSiteDetectorResponseSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -54,7 +54,7 @@ public async Task Get_GetAppDetectorResponse() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppSlotDetectorResponse() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetectorResponseSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetectorResponseSlot.json // this example is just showing the usage of "Diagnostics_GetSiteDetectorResponseSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDiagnosticAnalysisCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDiagnosticAnalysisCollection.cs index 225560e4dc3b..62391e819845 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDiagnosticAnalysisCollection.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDiagnosticAnalysisCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_SiteSlotDiagnosticAnalysisCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListAppAnalyses() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_ListSiteAnalyses.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_ListSiteAnalyses.json // this example is just showing the usage of "Diagnostics_ListSiteAnalysesSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,7 +61,7 @@ public async Task GetAll_ListAppAnalyses() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListAppSlotAnalyses() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_ListSiteAnalysesSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_ListSiteAnalysesSlot.json // this example is just showing the usage of "Diagnostics_ListSiteAnalysesSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -100,7 +100,7 @@ public async Task GetAll_ListAppSlotAnalyses() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppAnalysis() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteAnalysis.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteAnalysis.json // this example is just showing the usage of "Diagnostics_GetSiteAnalysisSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -137,7 +137,7 @@ public async Task Get_GetAppAnalysis() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAppAnalysis() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteAnalysis.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteAnalysis.json // this example is just showing the usage of "Diagnostics_GetSiteAnalysisSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -170,7 +170,7 @@ public async Task Exists_GetAppAnalysis() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAppAnalysis() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteAnalysis.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteAnalysis.json // this example is just showing the usage of "Diagnostics_GetSiteAnalysisSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -215,7 +215,7 @@ public async Task GetIfExists_GetAppAnalysis() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppSlotAnalysis() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteAnalysisSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteAnalysisSlot.json // this example is just showing the usage of "Diagnostics_GetSiteAnalysisSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -252,7 +252,7 @@ public async Task Get_GetAppSlotAnalysis() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAppSlotAnalysis() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteAnalysisSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteAnalysisSlot.json // this example is just showing the usage of "Diagnostics_GetSiteAnalysisSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -285,7 +285,7 @@ public async Task Exists_GetAppSlotAnalysis() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAppSlotAnalysis() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteAnalysisSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteAnalysisSlot.json // this example is just showing the usage of "Diagnostics_GetSiteAnalysisSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDiagnosticAnalysisResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDiagnosticAnalysisResource.cs index c2ae9abacf7d..0236232672ad 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDiagnosticAnalysisResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDiagnosticAnalysisResource.cs @@ -22,7 +22,7 @@ public partial class Sample_SiteSlotDiagnosticAnalysisResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppAnalysis() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteAnalysis.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteAnalysis.json // this example is just showing the usage of "Diagnostics_GetSiteAnalysisSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +56,7 @@ public async Task Get_GetAppAnalysis() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppSlotAnalysis() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteAnalysisSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteAnalysisSlot.json // this example is just showing the usage of "Diagnostics_GetSiteAnalysisSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -90,7 +90,7 @@ public async Task Get_GetAppSlotAnalysis() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ExecuteSiteAnalysisSlot_ExecuteSiteAnalysis() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_ExecuteSiteAnalysis.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_ExecuteSiteAnalysis.json // this example is just showing the usage of "Diagnostics_ExecuteSiteAnalysisSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -120,7 +120,7 @@ public async Task ExecuteSiteAnalysisSlot_ExecuteSiteAnalysis() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ExecuteSiteAnalysisSlot_ExecuteSiteSlotAnalysis() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_ExecuteSiteAnalysisSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_ExecuteSiteAnalysisSlot.json // this example is just showing the usage of "Diagnostics_ExecuteSiteAnalysisSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDiagnosticCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDiagnosticCollection.cs index 1a8118e09141..833a0d7c1969 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDiagnosticCollection.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDiagnosticCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_SiteSlotDiagnosticCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListAppDiagnosticCategories() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_ListSiteDiagnosticCategories.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_ListSiteDiagnosticCategories.json // this example is just showing the usage of "Diagnostics_ListSiteDiagnosticCategoriesSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task GetAll_ListAppDiagnosticCategories() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListAppSlotDiagnosticCategories() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_ListSiteDiagnosticCategoriesSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_ListSiteDiagnosticCategoriesSlot.json // this example is just showing the usage of "Diagnostics_ListSiteDiagnosticCategoriesSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -98,7 +98,7 @@ public async Task GetAll_ListAppSlotDiagnosticCategories() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppDiagnosticCategory() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDiagnosticCategory.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDiagnosticCategory.json // this example is just showing the usage of "Diagnostics_GetSiteDiagnosticCategorySlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -134,7 +134,7 @@ public async Task Get_GetAppDiagnosticCategory() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAppDiagnosticCategory() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDiagnosticCategory.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDiagnosticCategory.json // this example is just showing the usage of "Diagnostics_GetSiteDiagnosticCategorySlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task Exists_GetAppDiagnosticCategory() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAppDiagnosticCategory() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDiagnosticCategory.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDiagnosticCategory.json // this example is just showing the usage of "Diagnostics_GetSiteDiagnosticCategorySlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -210,7 +210,7 @@ public async Task GetIfExists_GetAppDiagnosticCategory() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppSlotDiagnosticCategory() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDiagnosticCategorySlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDiagnosticCategorySlot.json // this example is just showing the usage of "Diagnostics_GetSiteDiagnosticCategorySlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -246,7 +246,7 @@ public async Task Get_GetAppSlotDiagnosticCategory() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAppSlotDiagnosticCategory() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDiagnosticCategorySlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDiagnosticCategorySlot.json // this example is just showing the usage of "Diagnostics_GetSiteDiagnosticCategorySlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -278,7 +278,7 @@ public async Task Exists_GetAppSlotDiagnosticCategory() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAppSlotDiagnosticCategory() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDiagnosticCategorySlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDiagnosticCategorySlot.json // this example is just showing the usage of "Diagnostics_GetSiteDiagnosticCategorySlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDiagnosticDetectorCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDiagnosticDetectorCollection.cs index 19e030d45653..3da5bdfcbcb8 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDiagnosticDetectorCollection.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDiagnosticDetectorCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_SiteSlotDiagnosticDetectorCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListAppDetectors() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_ListSiteDetectors.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_ListSiteDetectors.json // this example is just showing the usage of "Diagnostics_ListSiteDetectorsSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,7 +61,7 @@ public async Task GetAll_ListAppDetectors() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListAppSlotDetectors() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_ListSiteDetectorsSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_ListSiteDetectorsSlot.json // this example is just showing the usage of "Diagnostics_ListSiteDetectorsSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -100,7 +100,7 @@ public async Task GetAll_ListAppSlotDetectors() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppDetector() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetector.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetector.json // this example is just showing the usage of "Diagnostics_GetSiteDetectorSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -137,7 +137,7 @@ public async Task Get_GetAppDetector() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAppDetector() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetector.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetector.json // this example is just showing the usage of "Diagnostics_GetSiteDetectorSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -170,7 +170,7 @@ public async Task Exists_GetAppDetector() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAppDetector() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetector.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetector.json // this example is just showing the usage of "Diagnostics_GetSiteDetectorSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -215,7 +215,7 @@ public async Task GetIfExists_GetAppDetector() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppSlotDetector() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetectorSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetectorSlot.json // this example is just showing the usage of "Diagnostics_GetSiteDetectorSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -252,7 +252,7 @@ public async Task Get_GetAppSlotDetector() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAppSlotDetector() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetectorSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetectorSlot.json // this example is just showing the usage of "Diagnostics_GetSiteDetectorSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -285,7 +285,7 @@ public async Task Exists_GetAppSlotDetector() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAppSlotDetector() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetectorSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetectorSlot.json // this example is just showing the usage of "Diagnostics_GetSiteDetectorSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDiagnosticDetectorResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDiagnosticDetectorResource.cs index 4b76b445f606..9d10d53a1f1f 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDiagnosticDetectorResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDiagnosticDetectorResource.cs @@ -22,7 +22,7 @@ public partial class Sample_SiteSlotDiagnosticDetectorResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppDetector() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetector.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetector.json // this example is just showing the usage of "Diagnostics_GetSiteDetectorSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +56,7 @@ public async Task Get_GetAppDetector() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppSlotDetector() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDetectorSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDetectorSlot.json // this example is just showing the usage of "Diagnostics_GetSiteDetectorSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -90,7 +90,7 @@ public async Task Get_GetAppSlotDetector() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ExecuteSiteDetectorSlot_ExecuteSiteDetector() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_ExecuteSiteDetector.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_ExecuteSiteDetector.json // this example is just showing the usage of "Diagnostics_ExecuteSiteDetectorSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -120,7 +120,7 @@ public async Task ExecuteSiteDetectorSlot_ExecuteSiteDetector() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ExecuteSiteDetectorSlot_ExecuteSiteSlotDetector() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_ExecuteSiteDetectorSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_ExecuteSiteDetectorSlot.json // this example is just showing the usage of "Diagnostics_ExecuteSiteDetectorSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDiagnosticResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDiagnosticResource.cs index cadd09fca11a..5a9673339c68 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDiagnosticResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotDiagnosticResource.cs @@ -21,7 +21,7 @@ public partial class Sample_SiteSlotDiagnosticResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppDiagnosticCategory() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDiagnosticCategory.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDiagnosticCategory.json // this example is just showing the usage of "Diagnostics_GetSiteDiagnosticCategorySlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -54,7 +54,7 @@ public async Task Get_GetAppDiagnosticCategory() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAppSlotDiagnosticCategory() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/Diagnostics_GetSiteDiagnosticCategorySlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Diagnostics_GetSiteDiagnosticCategorySlot.json // this example is just showing the usage of "Diagnostics_GetSiteDiagnosticCategorySlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotInstanceCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotInstanceCollection.cs index f8c3906bcc32..cb097b5a6bae 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotInstanceCollection.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotInstanceCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_SiteSlotInstanceCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetSiteInstanceInfo() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetSiteInstanceInfo.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSiteInstanceInfo.json // this example is just showing the usage of "WebApps_GetInstanceInfoSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,7 @@ public async Task Get_GetSiteInstanceInfo() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetSiteInstanceInfo() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetSiteInstanceInfo.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSiteInstanceInfo.json // this example is just showing the usage of "WebApps_GetInstanceInfoSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -90,7 +90,7 @@ public async Task Exists_GetSiteInstanceInfo() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetSiteInstanceInfo() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetSiteInstanceInfo.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSiteInstanceInfo.json // this example is just showing the usage of "WebApps_GetInstanceInfoSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotInstanceResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotInstanceResource.cs index d77c031a84ba..a1a711827ea2 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotInstanceResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotInstanceResource.cs @@ -21,7 +21,7 @@ public partial class Sample_SiteSlotInstanceResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetSiteInstanceInfo() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetSiteInstanceInfo.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSiteInstanceInfo.json // this example is just showing the usage of "WebApps_GetInstanceInfoSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotPrivateEndpointConnectionCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotPrivateEndpointConnectionCollection.cs index 8eeab7695a2e..4e68c5f564bf 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotPrivateEndpointConnectionCollection.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotPrivateEndpointConnectionCollection.cs @@ -23,7 +23,7 @@ public partial class Sample_SiteSlotPrivateEndpointConnectionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAPrivateEndpointConnectionForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetSitePrivateEndpointConnectionSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSitePrivateEndpointConnectionSlot.json // this example is just showing the usage of "WebApps_GetPrivateEndpointConnectionSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task Get_GetAPrivateEndpointConnectionForASite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAPrivateEndpointConnectionForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetSitePrivateEndpointConnectionSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSitePrivateEndpointConnectionSlot.json // this example is just showing the usage of "WebApps_GetPrivateEndpointConnectionSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -91,7 +91,7 @@ public async Task Exists_GetAPrivateEndpointConnectionForASite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAPrivateEndpointConnectionForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetSitePrivateEndpointConnectionSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSitePrivateEndpointConnectionSlot.json // this example is just showing the usage of "WebApps_GetPrivateEndpointConnectionSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -135,7 +135,7 @@ public async Task GetIfExists_GetAPrivateEndpointConnectionForASite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_ApprovesOrRejectsAPrivateEndpointConnectionForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/ApproveRejectSitePrivateEndpointConnectionSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ApproveRejectSitePrivateEndpointConnectionSlot.json // this example is just showing the usage of "WebApps_ApproveOrRejectPrivateEndpointConnectionSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotPrivateEndpointConnectionResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotPrivateEndpointConnectionResource.cs index 6bd14f4569f3..40e40c99dd3c 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotPrivateEndpointConnectionResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotPrivateEndpointConnectionResource.cs @@ -23,7 +23,7 @@ public partial class Sample_SiteSlotPrivateEndpointConnectionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAPrivateEndpointConnectionForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetSitePrivateEndpointConnectionSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSitePrivateEndpointConnectionSlot.json // this example is just showing the usage of "WebApps_GetPrivateEndpointConnectionSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +56,7 @@ public async Task Get_GetAPrivateEndpointConnectionForASite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_ApprovesOrRejectsAPrivateEndpointConnectionForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/ApproveRejectSitePrivateEndpointConnectionSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ApproveRejectSitePrivateEndpointConnectionSlot.json // this example is just showing the usage of "WebApps_ApproveOrRejectPrivateEndpointConnectionSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -99,7 +99,7 @@ public async Task Update_ApprovesOrRejectsAPrivateEndpointConnectionForASite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteAPrivateEndpointConnectionForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/DeleteSitePrivateEndpointConnectionSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/DeleteSitePrivateEndpointConnectionSlot.json // this example is just showing the usage of "WebApps_DeletePrivateEndpointConnectionSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotWorkflowCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotWorkflowCollection.cs new file mode 100644 index 000000000000..636d0e91bd30 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotWorkflowCollection.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_SiteSlotWorkflowCollection + { + // List the workflows Slot + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListTheWorkflowsSlot() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListWorkflows.json + // this example is just showing the usage of "WebApps_ListInstanceWorkflowsSlot" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteSlotResource created on azure + // for more information of creating WebSiteSlotResource, please refer to the document of WebSiteSlotResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "testsite2"; + string slot = "staging"; + ResourceIdentifier webSiteSlotResourceId = WebSiteSlotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, slot); + WebSiteSlotResource webSiteSlot = client.GetWebSiteSlotResource(webSiteSlotResourceId); + + // get the collection of this SiteSlotWorkflowResource + SiteSlotWorkflowCollection collection = webSiteSlot.GetSiteSlotWorkflows(); + + // invoke the operation and iterate over the result + await foreach (SiteSlotWorkflowResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowEnvelopeData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // GET a workflow Slot + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GETAWorkflowSlot() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWorkflow.json + // this example is just showing the usage of "WebApps_GetInstanceWorkflowSlot" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteSlotResource created on azure + // for more information of creating WebSiteSlotResource, please refer to the document of WebSiteSlotResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "testsite2"; + string slot = "staging"; + ResourceIdentifier webSiteSlotResourceId = WebSiteSlotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, slot); + WebSiteSlotResource webSiteSlot = client.GetWebSiteSlotResource(webSiteSlotResourceId); + + // get the collection of this SiteSlotWorkflowResource + SiteSlotWorkflowCollection collection = webSiteSlot.GetSiteSlotWorkflows(); + + // invoke the operation + string workflowName = "stateful1"; + SiteSlotWorkflowResource result = await collection.GetAsync(workflowName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowEnvelopeData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // GET a workflow Slot + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GETAWorkflowSlot() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWorkflow.json + // this example is just showing the usage of "WebApps_GetInstanceWorkflowSlot" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteSlotResource created on azure + // for more information of creating WebSiteSlotResource, please refer to the document of WebSiteSlotResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "testsite2"; + string slot = "staging"; + ResourceIdentifier webSiteSlotResourceId = WebSiteSlotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, slot); + WebSiteSlotResource webSiteSlot = client.GetWebSiteSlotResource(webSiteSlotResourceId); + + // get the collection of this SiteSlotWorkflowResource + SiteSlotWorkflowCollection collection = webSiteSlot.GetSiteSlotWorkflows(); + + // invoke the operation + string workflowName = "stateful1"; + bool result = await collection.ExistsAsync(workflowName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // GET a workflow Slot + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GETAWorkflowSlot() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWorkflow.json + // this example is just showing the usage of "WebApps_GetInstanceWorkflowSlot" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteSlotResource created on azure + // for more information of creating WebSiteSlotResource, please refer to the document of WebSiteSlotResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "testsite2"; + string slot = "staging"; + ResourceIdentifier webSiteSlotResourceId = WebSiteSlotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, slot); + WebSiteSlotResource webSiteSlot = client.GetWebSiteSlotResource(webSiteSlotResourceId); + + // get the collection of this SiteSlotWorkflowResource + SiteSlotWorkflowCollection collection = webSiteSlot.GetSiteSlotWorkflows(); + + // invoke the operation + string workflowName = "stateful1"; + NullableResponse response = await collection.GetIfExistsAsync(workflowName); + SiteSlotWorkflowResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowEnvelopeData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotWorkflowResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotWorkflowResource.cs new file mode 100644 index 000000000000..20c26328e1b5 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteSlotWorkflowResource.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_SiteSlotWorkflowResource + { + // GET a workflow Slot + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GETAWorkflowSlot() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWorkflow.json + // this example is just showing the usage of "WebApps_GetInstanceWorkflowSlot" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SiteSlotWorkflowResource created on azure + // for more information of creating SiteSlotWorkflowResource, please refer to the document of SiteSlotWorkflowResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "testsite2"; + string slot = "staging"; + string workflowName = "stateful1"; + ResourceIdentifier siteSlotWorkflowResourceId = SiteSlotWorkflowResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, slot, workflowName); + SiteSlotWorkflowResource siteSlotWorkflow = client.GetSiteSlotWorkflowResource(siteSlotWorkflowResourceId); + + // invoke the operation + SiteSlotWorkflowResource result = await siteSlotWorkflow.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowEnvelopeData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteWorkflowCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteWorkflowCollection.cs new file mode 100644 index 000000000000..748a2bf546b6 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteWorkflowCollection.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_SiteWorkflowCollection + { + // List the workflows + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListTheWorkflows() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListWorkflows.json + // this example is just showing the usage of "WebApps_ListWorkflows" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "testsite2"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // get the collection of this SiteWorkflowResource + SiteWorkflowCollection collection = webSite.GetSiteWorkflows(); + + // invoke the operation and iterate over the result + await foreach (SiteWorkflowResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowEnvelopeData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // GET a workflow + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GETAWorkflow() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWorkflow.json + // this example is just showing the usage of "WebApps_GetWorkflow" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "testsite2"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // get the collection of this SiteWorkflowResource + SiteWorkflowCollection collection = webSite.GetSiteWorkflows(); + + // invoke the operation + string workflowName = "stateful1"; + SiteWorkflowResource result = await collection.GetAsync(workflowName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowEnvelopeData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // GET a workflow + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GETAWorkflow() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWorkflow.json + // this example is just showing the usage of "WebApps_GetWorkflow" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "testsite2"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // get the collection of this SiteWorkflowResource + SiteWorkflowCollection collection = webSite.GetSiteWorkflows(); + + // invoke the operation + string workflowName = "stateful1"; + bool result = await collection.ExistsAsync(workflowName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // GET a workflow + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GETAWorkflow() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWorkflow.json + // this example is just showing the usage of "WebApps_GetWorkflow" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "testsite2"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // get the collection of this SiteWorkflowResource + SiteWorkflowCollection collection = webSite.GetSiteWorkflows(); + + // invoke the operation + string workflowName = "stateful1"; + NullableResponse response = await collection.GetIfExistsAsync(workflowName); + SiteWorkflowResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowEnvelopeData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteWorkflowResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteWorkflowResource.cs new file mode 100644 index 000000000000..c83e5b0e11b0 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SiteWorkflowResource.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_SiteWorkflowResource + { + // GET a workflow + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GETAWorkflow() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWorkflow.json + // this example is just showing the usage of "WebApps_GetWorkflow" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SiteWorkflowResource created on azure + // for more information of creating SiteWorkflowResource, please refer to the document of SiteWorkflowResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "testsite2"; + string workflowName = "stateful1"; + ResourceIdentifier siteWorkflowResourceId = SiteWorkflowResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName); + SiteWorkflowResource siteWorkflow = client.GetSiteWorkflowResource(siteWorkflowResourceId); + + // invoke the operation + SiteWorkflowResource result = await siteWorkflow.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowEnvelopeData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBasicAuthPropertiesARMResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBasicAuthPropertiesARMResource.cs new file mode 100644 index 000000000000..cf0c3c25ae4a --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBasicAuthPropertiesARMResource.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; +using Azure.ResourceManager.AppService.Models; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_StaticSiteBasicAuthPropertiesARMResource + { + // Gets the basic auth properties for a static site. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetsTheBasicAuthPropertiesForAStaticSite() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSiteBasicAuth.json + // this example is just showing the usage of "StaticSites_GetBasicAuth" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteBasicAuthPropertiesARMResource created on azure + // for more information of creating StaticSiteBasicAuthPropertiesARMResource, please refer to the document of StaticSiteBasicAuthPropertiesARMResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + BasicAuthName basicAuthName = BasicAuthName.Default; + ResourceIdentifier staticSiteBasicAuthPropertiesARMResourceId = StaticSiteBasicAuthPropertiesARMResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, basicAuthName); + StaticSiteBasicAuthPropertiesARMResource staticSiteBasicAuthPropertiesARMResource = client.GetStaticSiteBasicAuthPropertiesARMResource(staticSiteBasicAuthPropertiesARMResourceId); + + // invoke the operation + StaticSiteBasicAuthPropertiesARMResource result = await staticSiteBasicAuthPropertiesARMResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + StaticSiteBasicAuthPropertiesARMResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Creates or updates basic auth properties for a static site. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreatesOrUpdatesBasicAuthPropertiesForAStaticSite() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/CreateOrUpdateStaticSiteBasicAuth.json + // this example is just showing the usage of "StaticSites_CreateOrUpdateBasicAuth" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteBasicAuthPropertiesARMResource created on azure + // for more information of creating StaticSiteBasicAuthPropertiesARMResource, please refer to the document of StaticSiteBasicAuthPropertiesARMResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + BasicAuthName basicAuthName = BasicAuthName.Default; + ResourceIdentifier staticSiteBasicAuthPropertiesARMResourceId = StaticSiteBasicAuthPropertiesARMResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, basicAuthName); + StaticSiteBasicAuthPropertiesARMResource staticSiteBasicAuthPropertiesARMResource = client.GetStaticSiteBasicAuthPropertiesARMResource(staticSiteBasicAuthPropertiesARMResourceId); + + // invoke the operation + StaticSiteBasicAuthPropertiesARMResourceData data = new StaticSiteBasicAuthPropertiesARMResourceData() + { + Password = "**********************", + SecretUri = null, + ApplicableEnvironmentsMode = "AllEnvironments", + Environments = +{ +}, + }; + ArmOperation lro = await staticSiteBasicAuthPropertiesARMResource.UpdateAsync(WaitUntil.Completed, data); + StaticSiteBasicAuthPropertiesARMResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + StaticSiteBasicAuthPropertiesARMResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBasicAuthPropertiesARMResourceCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBasicAuthPropertiesARMResourceCollection.cs new file mode 100644 index 000000000000..496f8ef5e1af --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBasicAuthPropertiesARMResourceCollection.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; +using Azure.ResourceManager.AppService.Models; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_StaticSiteBasicAuthPropertiesARMResourceCollection + { + // Lists the basic auth properties for a static site. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListsTheBasicAuthPropertiesForAStaticSite() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListStaticSiteBasicAuth.json + // this example is just showing the usage of "StaticSites_ListBasicAuth" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteResource created on azure + // for more information of creating StaticSiteResource, please refer to the document of StaticSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + ResourceIdentifier staticSiteResourceId = StaticSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + StaticSiteResource staticSite = client.GetStaticSiteResource(staticSiteResourceId); + + // get the collection of this StaticSiteBasicAuthPropertiesARMResource + StaticSiteBasicAuthPropertiesARMResourceCollection collection = staticSite.GetStaticSiteBasicAuthPropertiesARMResources(); + + // invoke the operation and iterate over the result + await foreach (StaticSiteBasicAuthPropertiesARMResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + StaticSiteBasicAuthPropertiesARMResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Gets the basic auth properties for a static site. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetsTheBasicAuthPropertiesForAStaticSite() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSiteBasicAuth.json + // this example is just showing the usage of "StaticSites_GetBasicAuth" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteResource created on azure + // for more information of creating StaticSiteResource, please refer to the document of StaticSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + ResourceIdentifier staticSiteResourceId = StaticSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + StaticSiteResource staticSite = client.GetStaticSiteResource(staticSiteResourceId); + + // get the collection of this StaticSiteBasicAuthPropertiesARMResource + StaticSiteBasicAuthPropertiesARMResourceCollection collection = staticSite.GetStaticSiteBasicAuthPropertiesARMResources(); + + // invoke the operation + BasicAuthName basicAuthName = BasicAuthName.Default; + StaticSiteBasicAuthPropertiesARMResource result = await collection.GetAsync(basicAuthName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + StaticSiteBasicAuthPropertiesARMResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Gets the basic auth properties for a static site. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetsTheBasicAuthPropertiesForAStaticSite() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSiteBasicAuth.json + // this example is just showing the usage of "StaticSites_GetBasicAuth" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteResource created on azure + // for more information of creating StaticSiteResource, please refer to the document of StaticSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + ResourceIdentifier staticSiteResourceId = StaticSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + StaticSiteResource staticSite = client.GetStaticSiteResource(staticSiteResourceId); + + // get the collection of this StaticSiteBasicAuthPropertiesARMResource + StaticSiteBasicAuthPropertiesARMResourceCollection collection = staticSite.GetStaticSiteBasicAuthPropertiesARMResources(); + + // invoke the operation + BasicAuthName basicAuthName = BasicAuthName.Default; + bool result = await collection.ExistsAsync(basicAuthName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Gets the basic auth properties for a static site. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetsTheBasicAuthPropertiesForAStaticSite() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSiteBasicAuth.json + // this example is just showing the usage of "StaticSites_GetBasicAuth" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteResource created on azure + // for more information of creating StaticSiteResource, please refer to the document of StaticSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + ResourceIdentifier staticSiteResourceId = StaticSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + StaticSiteResource staticSite = client.GetStaticSiteResource(staticSiteResourceId); + + // get the collection of this StaticSiteBasicAuthPropertiesARMResource + StaticSiteBasicAuthPropertiesARMResourceCollection collection = staticSite.GetStaticSiteBasicAuthPropertiesARMResources(); + + // invoke the operation + BasicAuthName basicAuthName = BasicAuthName.Default; + NullableResponse response = await collection.GetIfExistsAsync(basicAuthName); + StaticSiteBasicAuthPropertiesARMResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + StaticSiteBasicAuthPropertiesARMResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Creates or updates basic auth properties for a static site. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreatesOrUpdatesBasicAuthPropertiesForAStaticSite() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/CreateOrUpdateStaticSiteBasicAuth.json + // this example is just showing the usage of "StaticSites_CreateOrUpdateBasicAuth" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteResource created on azure + // for more information of creating StaticSiteResource, please refer to the document of StaticSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + ResourceIdentifier staticSiteResourceId = StaticSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + StaticSiteResource staticSite = client.GetStaticSiteResource(staticSiteResourceId); + + // get the collection of this StaticSiteBasicAuthPropertiesARMResource + StaticSiteBasicAuthPropertiesARMResourceCollection collection = staticSite.GetStaticSiteBasicAuthPropertiesARMResources(); + + // invoke the operation + BasicAuthName basicAuthName = BasicAuthName.Default; + StaticSiteBasicAuthPropertiesARMResourceData data = new StaticSiteBasicAuthPropertiesARMResourceData() + { + Password = "**********************", + SecretUri = null, + ApplicableEnvironmentsMode = "AllEnvironments", + Environments = +{ +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, basicAuthName, data); + StaticSiteBasicAuthPropertiesARMResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + StaticSiteBasicAuthPropertiesARMResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildCollection.cs index dda864e9a26c..480cf241ec2f 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildCollection.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_StaticSiteBuildCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetAllBuildsForAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetStaticSiteBuilds.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSiteBuilds.json // this example is just showing the usage of "StaticSites_GetStaticSiteBuilds" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task GetAll_GetAllBuildsForAStaticSite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAStaticSiteBuild() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetStaticSiteBuild.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSiteBuild.json // this example is just showing the usage of "StaticSites_GetStaticSiteBuild" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_GetAStaticSiteBuild() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAStaticSiteBuild() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetStaticSiteBuild.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSiteBuild.json // this example is just showing the usage of "StaticSites_GetStaticSiteBuild" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -125,7 +125,7 @@ public async Task Exists_GetAStaticSiteBuild() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAStaticSiteBuild() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetStaticSiteBuild.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSiteBuild.json // this example is just showing the usage of "StaticSites_GetStaticSiteBuild" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildDatabaseConnectionCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildDatabaseConnectionCollection.cs new file mode 100644 index 000000000000..c761588ee4da --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildDatabaseConnectionCollection.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_StaticSiteBuildDatabaseConnectionCollection + { + // List overviews of database connections for the static site build. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListOverviewsOfDatabaseConnectionsForTheStaticSiteBuild() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSiteBuildDatabaseConnections.json + // this example is just showing the usage of "StaticSites_GetBuildDatabaseConnections" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteBuildResource created on azure + // for more information of creating StaticSiteBuildResource, please refer to the document of StaticSiteBuildResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + string environmentName = "default"; + ResourceIdentifier staticSiteBuildResourceId = StaticSiteBuildResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, environmentName); + StaticSiteBuildResource staticSiteBuild = client.GetStaticSiteBuildResource(staticSiteBuildResourceId); + + // get the collection of this StaticSiteBuildDatabaseConnectionResource + StaticSiteBuildDatabaseConnectionCollection collection = staticSiteBuild.GetStaticSiteBuildDatabaseConnections(); + + // invoke the operation and iterate over the result + await foreach (StaticSiteBuildDatabaseConnectionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DatabaseConnectionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get overview of database connections for the static site build. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetOverviewOfDatabaseConnectionsForTheStaticSiteBuild() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSiteBuildDatabaseConnection.json + // this example is just showing the usage of "StaticSites_GetBuildDatabaseConnection" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteBuildResource created on azure + // for more information of creating StaticSiteBuildResource, please refer to the document of StaticSiteBuildResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + string environmentName = "default"; + ResourceIdentifier staticSiteBuildResourceId = StaticSiteBuildResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, environmentName); + StaticSiteBuildResource staticSiteBuild = client.GetStaticSiteBuildResource(staticSiteBuildResourceId); + + // get the collection of this StaticSiteBuildDatabaseConnectionResource + StaticSiteBuildDatabaseConnectionCollection collection = staticSiteBuild.GetStaticSiteBuildDatabaseConnections(); + + // invoke the operation + string databaseConnectionName = "default"; + StaticSiteBuildDatabaseConnectionResource result = await collection.GetAsync(databaseConnectionName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DatabaseConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get overview of database connections for the static site build. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetOverviewOfDatabaseConnectionsForTheStaticSiteBuild() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSiteBuildDatabaseConnection.json + // this example is just showing the usage of "StaticSites_GetBuildDatabaseConnection" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteBuildResource created on azure + // for more information of creating StaticSiteBuildResource, please refer to the document of StaticSiteBuildResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + string environmentName = "default"; + ResourceIdentifier staticSiteBuildResourceId = StaticSiteBuildResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, environmentName); + StaticSiteBuildResource staticSiteBuild = client.GetStaticSiteBuildResource(staticSiteBuildResourceId); + + // get the collection of this StaticSiteBuildDatabaseConnectionResource + StaticSiteBuildDatabaseConnectionCollection collection = staticSiteBuild.GetStaticSiteBuildDatabaseConnections(); + + // invoke the operation + string databaseConnectionName = "default"; + bool result = await collection.ExistsAsync(databaseConnectionName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get overview of database connections for the static site build. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetOverviewOfDatabaseConnectionsForTheStaticSiteBuild() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSiteBuildDatabaseConnection.json + // this example is just showing the usage of "StaticSites_GetBuildDatabaseConnection" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteBuildResource created on azure + // for more information of creating StaticSiteBuildResource, please refer to the document of StaticSiteBuildResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + string environmentName = "default"; + ResourceIdentifier staticSiteBuildResourceId = StaticSiteBuildResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, environmentName); + StaticSiteBuildResource staticSiteBuild = client.GetStaticSiteBuildResource(staticSiteBuildResourceId); + + // get the collection of this StaticSiteBuildDatabaseConnectionResource + StaticSiteBuildDatabaseConnectionCollection collection = staticSiteBuild.GetStaticSiteBuildDatabaseConnections(); + + // invoke the operation + string databaseConnectionName = "default"; + NullableResponse response = await collection.GetIfExistsAsync(databaseConnectionName); + StaticSiteBuildDatabaseConnectionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DatabaseConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create or update a database connection for a static site build + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateOrUpdateADatabaseConnectionForAStaticSiteBuild() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/CreateOrUpdateStaticSiteBuildDatabaseConnection.json + // this example is just showing the usage of "StaticSites_CreateOrUpdateBuildDatabaseConnection" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteBuildResource created on azure + // for more information of creating StaticSiteBuildResource, please refer to the document of StaticSiteBuildResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + string environmentName = "default"; + ResourceIdentifier staticSiteBuildResourceId = StaticSiteBuildResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, environmentName); + StaticSiteBuildResource staticSiteBuild = client.GetStaticSiteBuildResource(staticSiteBuildResourceId); + + // get the collection of this StaticSiteBuildDatabaseConnectionResource + StaticSiteBuildDatabaseConnectionCollection collection = staticSiteBuild.GetStaticSiteBuildDatabaseConnections(); + + // invoke the operation + string databaseConnectionName = "default"; + DatabaseConnectionData data = new DatabaseConnectionData() + { + ResourceId = "/subscription/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/databaseRG/providers/Microsoft.DocumentDB/databaseAccounts/exampleDatabaseName", + ConnectionIdentity = "SystemAssigned", + ConnectionString = "AccountEndpoint=https://exampleDatabaseName.documents.azure.com:443/;Database=mydb;", + Region = "West US 2", + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, databaseConnectionName, data); + StaticSiteBuildDatabaseConnectionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DatabaseConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildDatabaseConnectionResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildDatabaseConnectionResource.cs new file mode 100644 index 000000000000..3a53da042975 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildDatabaseConnectionResource.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; +using Azure.ResourceManager.AppService.Models; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_StaticSiteBuildDatabaseConnectionResource + { + // Get overview of database connections for the static site build. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetOverviewOfDatabaseConnectionsForTheStaticSiteBuild() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSiteBuildDatabaseConnection.json + // this example is just showing the usage of "StaticSites_GetBuildDatabaseConnection" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteBuildDatabaseConnectionResource created on azure + // for more information of creating StaticSiteBuildDatabaseConnectionResource, please refer to the document of StaticSiteBuildDatabaseConnectionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + string environmentName = "default"; + string databaseConnectionName = "default"; + ResourceIdentifier staticSiteBuildDatabaseConnectionResourceId = StaticSiteBuildDatabaseConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, environmentName, databaseConnectionName); + StaticSiteBuildDatabaseConnectionResource staticSiteBuildDatabaseConnection = client.GetStaticSiteBuildDatabaseConnectionResource(staticSiteBuildDatabaseConnectionResourceId); + + // invoke the operation + StaticSiteBuildDatabaseConnectionResource result = await staticSiteBuildDatabaseConnection.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DatabaseConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Delete a database connection from a static site build. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteADatabaseConnectionFromAStaticSiteBuild() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/DeleteStaticSiteBuildDatabaseConnection.json + // this example is just showing the usage of "StaticSites_DeleteBuildDatabaseConnection" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteBuildDatabaseConnectionResource created on azure + // for more information of creating StaticSiteBuildDatabaseConnectionResource, please refer to the document of StaticSiteBuildDatabaseConnectionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + string environmentName = "default"; + string databaseConnectionName = "default"; + ResourceIdentifier staticSiteBuildDatabaseConnectionResourceId = StaticSiteBuildDatabaseConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, environmentName, databaseConnectionName); + StaticSiteBuildDatabaseConnectionResource staticSiteBuildDatabaseConnection = client.GetStaticSiteBuildDatabaseConnectionResource(staticSiteBuildDatabaseConnectionResourceId); + + // invoke the operation + await staticSiteBuildDatabaseConnection.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Patch a database connection for a static site build + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_PatchADatabaseConnectionForAStaticSiteBuild() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/PatchStaticSiteBuildDatabaseConnection.json + // this example is just showing the usage of "StaticSites_UpdateBuildDatabaseConnection" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteBuildDatabaseConnectionResource created on azure + // for more information of creating StaticSiteBuildDatabaseConnectionResource, please refer to the document of StaticSiteBuildDatabaseConnectionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + string environmentName = "default"; + string databaseConnectionName = "default"; + ResourceIdentifier staticSiteBuildDatabaseConnectionResourceId = StaticSiteBuildDatabaseConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, environmentName, databaseConnectionName); + StaticSiteBuildDatabaseConnectionResource staticSiteBuildDatabaseConnection = client.GetStaticSiteBuildDatabaseConnectionResource(staticSiteBuildDatabaseConnectionResourceId); + + // invoke the operation + DatabaseConnectionPatchRequest databaseConnectionRequestEnvelope = new DatabaseConnectionPatchRequest(); + StaticSiteBuildDatabaseConnectionResource result = await staticSiteBuildDatabaseConnection.UpdateAsync(databaseConnectionRequestEnvelope); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DatabaseConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get details of database connections for the static site build. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetBuildDatabaseConnectionWithDetails_GetDetailsOfDatabaseConnectionsForTheStaticSiteBuild() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSiteBuildDatabaseConnectionWithDetails.json + // this example is just showing the usage of "StaticSites_GetBuildDatabaseConnectionWithDetails" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteBuildDatabaseConnectionResource created on azure + // for more information of creating StaticSiteBuildDatabaseConnectionResource, please refer to the document of StaticSiteBuildDatabaseConnectionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + string environmentName = "default"; + string databaseConnectionName = "default"; + ResourceIdentifier staticSiteBuildDatabaseConnectionResourceId = StaticSiteBuildDatabaseConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, environmentName, databaseConnectionName); + StaticSiteBuildDatabaseConnectionResource staticSiteBuildDatabaseConnection = client.GetStaticSiteBuildDatabaseConnectionResource(staticSiteBuildDatabaseConnectionResourceId); + + // invoke the operation + StaticSiteBuildDatabaseConnectionResource result = await staticSiteBuildDatabaseConnection.GetBuildDatabaseConnectionWithDetailsAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DatabaseConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildLinkedBackendCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildLinkedBackendCollection.cs new file mode 100644 index 000000000000..62bb2656b5b7 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildLinkedBackendCollection.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_StaticSiteBuildLinkedBackendCollection + { + // Get details of the linked backends registered with a static site build. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_GetDetailsOfTheLinkedBackendsRegisteredWithAStaticSiteBuild() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetLinkedBackendsForStaticSiteBuild.json + // this example is just showing the usage of "StaticSites_GetLinkedBackendsForBuild" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteBuildResource created on azure + // for more information of creating StaticSiteBuildResource, please refer to the document of StaticSiteBuildResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + string environmentName = "default"; + ResourceIdentifier staticSiteBuildResourceId = StaticSiteBuildResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, environmentName); + StaticSiteBuildResource staticSiteBuild = client.GetStaticSiteBuildResource(staticSiteBuildResourceId); + + // get the collection of this StaticSiteBuildLinkedBackendResource + StaticSiteBuildLinkedBackendCollection collection = staticSiteBuild.GetStaticSiteBuildLinkedBackends(); + + // invoke the operation and iterate over the result + await foreach (StaticSiteBuildLinkedBackendResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + StaticSiteLinkedBackendARMResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get details of the linked backend registered with a static site build by name. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetDetailsOfTheLinkedBackendRegisteredWithAStaticSiteBuildByName() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetLinkedBackendForStaticSiteBuild.json + // this example is just showing the usage of "StaticSites_GetLinkedBackendForBuild" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteBuildResource created on azure + // for more information of creating StaticSiteBuildResource, please refer to the document of StaticSiteBuildResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + string environmentName = "default"; + ResourceIdentifier staticSiteBuildResourceId = StaticSiteBuildResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, environmentName); + StaticSiteBuildResource staticSiteBuild = client.GetStaticSiteBuildResource(staticSiteBuildResourceId); + + // get the collection of this StaticSiteBuildLinkedBackendResource + StaticSiteBuildLinkedBackendCollection collection = staticSiteBuild.GetStaticSiteBuildLinkedBackends(); + + // invoke the operation + string linkedBackendName = "testBackend"; + StaticSiteBuildLinkedBackendResource result = await collection.GetAsync(linkedBackendName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + StaticSiteLinkedBackendARMResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get details of the linked backend registered with a static site build by name. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetDetailsOfTheLinkedBackendRegisteredWithAStaticSiteBuildByName() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetLinkedBackendForStaticSiteBuild.json + // this example is just showing the usage of "StaticSites_GetLinkedBackendForBuild" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteBuildResource created on azure + // for more information of creating StaticSiteBuildResource, please refer to the document of StaticSiteBuildResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + string environmentName = "default"; + ResourceIdentifier staticSiteBuildResourceId = StaticSiteBuildResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, environmentName); + StaticSiteBuildResource staticSiteBuild = client.GetStaticSiteBuildResource(staticSiteBuildResourceId); + + // get the collection of this StaticSiteBuildLinkedBackendResource + StaticSiteBuildLinkedBackendCollection collection = staticSiteBuild.GetStaticSiteBuildLinkedBackends(); + + // invoke the operation + string linkedBackendName = "testBackend"; + bool result = await collection.ExistsAsync(linkedBackendName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get details of the linked backend registered with a static site build by name. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetDetailsOfTheLinkedBackendRegisteredWithAStaticSiteBuildByName() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetLinkedBackendForStaticSiteBuild.json + // this example is just showing the usage of "StaticSites_GetLinkedBackendForBuild" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteBuildResource created on azure + // for more information of creating StaticSiteBuildResource, please refer to the document of StaticSiteBuildResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + string environmentName = "default"; + ResourceIdentifier staticSiteBuildResourceId = StaticSiteBuildResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, environmentName); + StaticSiteBuildResource staticSiteBuild = client.GetStaticSiteBuildResource(staticSiteBuildResourceId); + + // get the collection of this StaticSiteBuildLinkedBackendResource + StaticSiteBuildLinkedBackendCollection collection = staticSiteBuild.GetStaticSiteBuildLinkedBackends(); + + // invoke the operation + string linkedBackendName = "testBackend"; + NullableResponse response = await collection.GetIfExistsAsync(linkedBackendName); + StaticSiteBuildLinkedBackendResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + StaticSiteLinkedBackendARMResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Link a backend to a static site build + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_LinkABackendToAStaticSiteBuild() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/LinkBackendToStaticSiteBuild.json + // this example is just showing the usage of "StaticSites_LinkBackendToBuild" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteBuildResource created on azure + // for more information of creating StaticSiteBuildResource, please refer to the document of StaticSiteBuildResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + string environmentName = "default"; + ResourceIdentifier staticSiteBuildResourceId = StaticSiteBuildResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, environmentName); + StaticSiteBuildResource staticSiteBuild = client.GetStaticSiteBuildResource(staticSiteBuildResourceId); + + // get the collection of this StaticSiteBuildLinkedBackendResource + StaticSiteBuildLinkedBackendCollection collection = staticSiteBuild.GetStaticSiteBuildLinkedBackends(); + + // invoke the operation + string linkedBackendName = "testBackend"; + StaticSiteLinkedBackendARMResourceData data = new StaticSiteLinkedBackendARMResourceData() + { + BackendResourceId = "/subscription/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/backendRg/providers/Microsoft.Web/sites/testBackend", + Region = "West US 2", + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, linkedBackendName, data); + StaticSiteBuildLinkedBackendResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + StaticSiteLinkedBackendARMResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildLinkedBackendResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildLinkedBackendResource.cs new file mode 100644 index 000000000000..44fa3f6a9bd1 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildLinkedBackendResource.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_StaticSiteBuildLinkedBackendResource + { + // Validate if backend can be linked to static site build. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task ValidateBackendForBuild_ValidateIfBackendCanBeLinkedToStaticSiteBuild() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ValidateLinkedBackendForStaticSiteBuild.json + // this example is just showing the usage of "StaticSites_ValidateBackendForBuild" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteBuildLinkedBackendResource created on azure + // for more information of creating StaticSiteBuildLinkedBackendResource, please refer to the document of StaticSiteBuildLinkedBackendResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + string environmentName = "default"; + string linkedBackendName = "testBackend"; + ResourceIdentifier staticSiteBuildLinkedBackendResourceId = StaticSiteBuildLinkedBackendResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, environmentName, linkedBackendName); + StaticSiteBuildLinkedBackendResource staticSiteBuildLinkedBackend = client.GetStaticSiteBuildLinkedBackendResource(staticSiteBuildLinkedBackendResourceId); + + // invoke the operation + StaticSiteLinkedBackendARMResourceData data = new StaticSiteLinkedBackendARMResourceData() + { + BackendResourceId = "/subscription/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/backendRg/providers/Microsoft.Web/sites/testBackend", + Region = "West US 2", + }; + await staticSiteBuildLinkedBackend.ValidateBackendForBuildAsync(WaitUntil.Completed, data); + + Console.WriteLine($"Succeeded"); + } + + // Get details of the linked backend registered with a static site build by name. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetDetailsOfTheLinkedBackendRegisteredWithAStaticSiteBuildByName() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetLinkedBackendForStaticSiteBuild.json + // this example is just showing the usage of "StaticSites_GetLinkedBackendForBuild" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteBuildLinkedBackendResource created on azure + // for more information of creating StaticSiteBuildLinkedBackendResource, please refer to the document of StaticSiteBuildLinkedBackendResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + string environmentName = "default"; + string linkedBackendName = "testBackend"; + ResourceIdentifier staticSiteBuildLinkedBackendResourceId = StaticSiteBuildLinkedBackendResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, environmentName, linkedBackendName); + StaticSiteBuildLinkedBackendResource staticSiteBuildLinkedBackend = client.GetStaticSiteBuildLinkedBackendResource(staticSiteBuildLinkedBackendResourceId); + + // invoke the operation + StaticSiteBuildLinkedBackendResource result = await staticSiteBuildLinkedBackend.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + StaticSiteLinkedBackendARMResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Link a backend to a static site build + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_LinkABackendToAStaticSiteBuild() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/LinkBackendToStaticSiteBuild.json + // this example is just showing the usage of "StaticSites_LinkBackendToBuild" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteBuildLinkedBackendResource created on azure + // for more information of creating StaticSiteBuildLinkedBackendResource, please refer to the document of StaticSiteBuildLinkedBackendResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + string environmentName = "default"; + string linkedBackendName = "testBackend"; + ResourceIdentifier staticSiteBuildLinkedBackendResourceId = StaticSiteBuildLinkedBackendResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, environmentName, linkedBackendName); + StaticSiteBuildLinkedBackendResource staticSiteBuildLinkedBackend = client.GetStaticSiteBuildLinkedBackendResource(staticSiteBuildLinkedBackendResourceId); + + // invoke the operation + StaticSiteLinkedBackendARMResourceData data = new StaticSiteLinkedBackendARMResourceData() + { + BackendResourceId = "/subscription/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/backendRg/providers/Microsoft.Web/sites/testBackend", + Region = "West US 2", + }; + ArmOperation lro = await staticSiteBuildLinkedBackend.UpdateAsync(WaitUntil.Completed, data); + StaticSiteBuildLinkedBackendResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + StaticSiteLinkedBackendARMResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Unlink a backend from a static site build. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_UnlinkABackendFromAStaticSiteBuild() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/UnlinkBackendFromStaticSiteBuild.json + // this example is just showing the usage of "StaticSites_UnlinkBackendFromBuild" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteBuildLinkedBackendResource created on azure + // for more information of creating StaticSiteBuildLinkedBackendResource, please refer to the document of StaticSiteBuildLinkedBackendResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + string environmentName = "12"; + string linkedBackendName = "testBackend"; + ResourceIdentifier staticSiteBuildLinkedBackendResourceId = StaticSiteBuildLinkedBackendResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, environmentName, linkedBackendName); + StaticSiteBuildLinkedBackendResource staticSiteBuildLinkedBackend = client.GetStaticSiteBuildLinkedBackendResource(staticSiteBuildLinkedBackendResourceId); + + // invoke the operation + await staticSiteBuildLinkedBackend.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildResource.cs index 58156eed4f3a..f4dd917f2745 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildResource.cs @@ -23,7 +23,7 @@ public partial class Sample_StaticSiteBuildResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAStaticSiteBuild() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetStaticSiteBuild.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSiteBuild.json // this example is just showing the usage of "StaticSites_GetStaticSiteBuild" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_GetAStaticSiteBuild() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteAStaticSiteBuild() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/DeleteStaticSiteBuild.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/DeleteStaticSiteBuild.json // this example is just showing the usage of "StaticSites_DeleteStaticSiteBuild" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -83,7 +83,7 @@ public async Task Delete_DeleteAStaticSiteBuild() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdateAppSettings_CreatesOrUpdatesTheFunctionAppSettingsOfAStaticSiteBuild() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/CreateOrUpdateStaticSiteBuildAppSettings.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/CreateOrUpdateStaticSiteBuildAppSettings.json // this example is just showing the usage of "StaticSites_CreateOrUpdateStaticSiteBuildAppSettings" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -119,7 +119,7 @@ public async Task CreateOrUpdateAppSettings_CreatesOrUpdatesTheFunctionAppSettin [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdateFunctionAppSettings_CreatesOrUpdatesTheFunctionAppSettingsOfAStaticSiteBuild() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/CreateOrUpdateStaticSiteBuildFunctionAppSettings.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/CreateOrUpdateStaticSiteBuildFunctionAppSettings.json // this example is just showing the usage of "StaticSites_CreateOrUpdateStaticSiteBuildFunctionAppSettings" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -155,7 +155,7 @@ public async Task CreateOrUpdateFunctionAppSettings_CreatesOrUpdatesTheFunctionA [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetFunctions_GetsTheFunctionsOfAParticularStaticSiteBuild() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/ListStaticSiteBuildFunctions.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListStaticSiteBuildFunctions.json // this example is just showing the usage of "StaticSites_ListStaticSiteBuildFunctions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -186,7 +186,7 @@ public async Task GetFunctions_GetsTheFunctionsOfAParticularStaticSiteBuild() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetStaticSiteBuildAppSettings_GetAppSettingsOfAStaticSiteBuild() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/ListStaticSiteBuildAppSettings.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListStaticSiteBuildAppSettings.json // this example is just showing the usage of "StaticSites_ListStaticSiteBuildAppSettings" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -214,7 +214,7 @@ public async Task GetStaticSiteBuildAppSettings_GetAppSettingsOfAStaticSiteBuild [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetFunctionAppSettings_GetFunctionAppSettingsOfAStaticSiteBuild() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/ListStaticSiteBuildFunctionAppSettings.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListStaticSiteBuildFunctionAppSettings.json // this example is just showing the usage of "StaticSites_ListStaticSiteBuildFunctionAppSettings" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -237,12 +237,44 @@ public async Task GetFunctionAppSettings_GetFunctionAppSettingsOfAStaticSiteBuil Console.WriteLine($"Succeeded: {result}"); } + // List full details of database connections for the static site build. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetBuildDatabaseConnectionsWithDetails_ListFullDetailsOfDatabaseConnectionsForTheStaticSiteBuild() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSiteBuildDatabaseConnectionsWithDetails.json + // this example is just showing the usage of "StaticSites_GetBuildDatabaseConnectionsWithDetails" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteBuildResource created on azure + // for more information of creating StaticSiteBuildResource, please refer to the document of StaticSiteBuildResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + string environmentName = "default"; + ResourceIdentifier staticSiteBuildResourceId = StaticSiteBuildResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, environmentName); + StaticSiteBuildResource staticSiteBuild = client.GetStaticSiteBuildResource(staticSiteBuildResourceId); + + // invoke the operation and iterate over the result + await foreach (DatabaseConnectionData item in staticSiteBuild.GetBuildDatabaseConnectionsWithDetailsAsync()) + { + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {item.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + // Deploy a site from a zipped package to a particular static site build [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateZipDeployment_DeployASiteFromAZippedPackageToAParticularStaticSiteBuild() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/StaticSiteBuildZipDeploy.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/StaticSiteBuildZipDeploy.json // this example is just showing the usage of "StaticSites_CreateZipDeploymentForStaticSiteBuild" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildUserProvidedFunctionAppCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildUserProvidedFunctionAppCollection.cs index 4a9698f5714c..bfede01f7db7 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildUserProvidedFunctionAppCollection.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildUserProvidedFunctionAppCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_StaticSiteBuildUserProvidedFunctionAppCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetDetailsOfTheUserProvidedFunctionAppsRegisteredWithAStaticSiteBuild() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetUserProvidedFunctionAppsForStaticSiteBuild.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetUserProvidedFunctionAppsForStaticSiteBuild.json // this example is just showing the usage of "StaticSites_GetUserProvidedFunctionAppsForStaticSiteBuild" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task GetAll_GetDetailsOfTheUserProvidedFunctionAppsRegisteredWithAS [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetDetailsOfTheUserProvidedFunctionAppRegisteredWithAStaticSiteBuild() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetUserProvidedFunctionAppForStaticSiteBuild.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetUserProvidedFunctionAppForStaticSiteBuild.json // this example is just showing the usage of "StaticSites_GetUserProvidedFunctionAppForStaticSiteBuild" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +96,7 @@ public async Task Get_GetDetailsOfTheUserProvidedFunctionAppRegisteredWithAStati [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetDetailsOfTheUserProvidedFunctionAppRegisteredWithAStaticSiteBuild() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetUserProvidedFunctionAppForStaticSiteBuild.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetUserProvidedFunctionAppForStaticSiteBuild.json // this example is just showing the usage of "StaticSites_GetUserProvidedFunctionAppForStaticSiteBuild" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -128,7 +128,7 @@ public async Task Exists_GetDetailsOfTheUserProvidedFunctionAppRegisteredWithASt [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetDetailsOfTheUserProvidedFunctionAppRegisteredWithAStaticSiteBuild() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetUserProvidedFunctionAppForStaticSiteBuild.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetUserProvidedFunctionAppForStaticSiteBuild.json // this example is just showing the usage of "StaticSites_GetUserProvidedFunctionAppForStaticSiteBuild" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -172,7 +172,7 @@ public async Task GetIfExists_GetDetailsOfTheUserProvidedFunctionAppRegisteredWi [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_RegisterAUserProvidedFunctionAppWithAStaticSiteBuild() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/RegisterUserProvidedFunctionAppWithStaticSiteBuild.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/RegisterUserProvidedFunctionAppWithStaticSiteBuild.json // this example is just showing the usage of "StaticSites_RegisterUserProvidedFunctionAppWithStaticSiteBuild" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildUserProvidedFunctionAppResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildUserProvidedFunctionAppResource.cs index b5e44228448a..c716884af2a2 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildUserProvidedFunctionAppResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteBuildUserProvidedFunctionAppResource.cs @@ -22,7 +22,7 @@ public partial class Sample_StaticSiteBuildUserProvidedFunctionAppResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetDetailsOfTheUserProvidedFunctionAppRegisteredWithAStaticSiteBuild() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetUserProvidedFunctionAppForStaticSiteBuild.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetUserProvidedFunctionAppForStaticSiteBuild.json // this example is just showing the usage of "StaticSites_GetUserProvidedFunctionAppForStaticSiteBuild" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_GetDetailsOfTheUserProvidedFunctionAppRegisteredWithAStati [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_RegisterAUserProvidedFunctionAppWithAStaticSiteBuild() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/RegisterUserProvidedFunctionAppWithStaticSiteBuild.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/RegisterUserProvidedFunctionAppWithStaticSiteBuild.json // this example is just showing the usage of "StaticSites_RegisterUserProvidedFunctionAppWithStaticSiteBuild" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -95,7 +95,7 @@ public async Task Update_RegisterAUserProvidedFunctionAppWithAStaticSiteBuild() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DetachTheUserProvidedFunctionAppFromTheStaticSiteBuild() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/DetachUserProvidedFunctionAppFromStaticSiteBuild.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/DetachUserProvidedFunctionAppFromStaticSiteBuild.json // this example is just showing the usage of "StaticSites_DetachUserProvidedFunctionAppFromStaticSiteBuild" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteCollection.cs index 241174364c35..9782f9062141 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteCollection.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteCollection.cs @@ -24,7 +24,7 @@ public partial class Sample_StaticSiteCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetStaticSitesForAResourceGroup() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetStaticSites.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSites.json // this example is just showing the usage of "StaticSites_GetStaticSitesByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task GetAll_GetStaticSitesForAResourceGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetDetailsForAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetStaticSite.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSite.json // this example is just showing the usage of "StaticSites_GetStaticSite" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_GetDetailsForAStaticSite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetDetailsForAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetStaticSite.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSite.json // this example is just showing the usage of "StaticSites_GetStaticSite" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -124,7 +124,7 @@ public async Task Exists_GetDetailsForAStaticSite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetDetailsForAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetStaticSite.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSite.json // this example is just showing the usage of "StaticSites_GetStaticSite" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task GetIfExists_GetDetailsForAStaticSite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/CreateOrUpdateStaticSite.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/CreateOrUpdateStaticSite.json // this example is just showing the usage of "StaticSites_CreateOrUpdateStaticSite" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteCustomDomainOverviewCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteCustomDomainOverviewCollection.cs index 8765c8c1afd9..17289ed869db 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteCustomDomainOverviewCollection.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteCustomDomainOverviewCollection.cs @@ -23,7 +23,7 @@ public partial class Sample_StaticSiteCustomDomainOverviewCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListCustomDomainsForAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetStaticSiteCustomDomains.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSiteCustomDomains.json // this example is just showing the usage of "StaticSites_ListStaticSiteCustomDomains" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task GetAll_ListCustomDomainsForAStaticSite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetCustomDomainForAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetStaticSiteCustomDomain.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSiteCustomDomain.json // this example is just showing the usage of "StaticSites_GetStaticSiteCustomDomain" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -95,7 +95,7 @@ public async Task Get_GetCustomDomainForAStaticSite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetCustomDomainForAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetStaticSiteCustomDomain.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSiteCustomDomain.json // this example is just showing the usage of "StaticSites_GetStaticSiteCustomDomain" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -126,7 +126,7 @@ public async Task Exists_GetCustomDomainForAStaticSite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetCustomDomainForAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetStaticSiteCustomDomain.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSiteCustomDomain.json // this example is just showing the usage of "StaticSites_GetStaticSiteCustomDomain" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -169,7 +169,7 @@ public async Task GetIfExists_GetCustomDomainForAStaticSite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateACustomDomainForAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/CreateOrUpdateStaticSiteCustomDomain.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/CreateOrUpdateStaticSiteCustomDomain.json // this example is just showing the usage of "StaticSites_CreateOrUpdateStaticSiteCustomDomain" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteCustomDomainOverviewResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteCustomDomainOverviewResource.cs index f4dc344f9994..1f05c3ab59c2 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteCustomDomainOverviewResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteCustomDomainOverviewResource.cs @@ -23,7 +23,7 @@ public partial class Sample_StaticSiteCustomDomainOverviewResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetCustomDomainForAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetStaticSiteCustomDomain.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSiteCustomDomain.json // this example is just showing the usage of "StaticSites_GetStaticSiteCustomDomain" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_GetCustomDomainForAStaticSite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateACustomDomainForAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/CreateOrUpdateStaticSiteCustomDomain.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/CreateOrUpdateStaticSiteCustomDomain.json // this example is just showing the usage of "StaticSites_CreateOrUpdateStaticSiteCustomDomain" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,7 +89,7 @@ public async Task Update_CreateOrUpdateACustomDomainForAStaticSite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteACustomDomainForAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/DeleteStaticSiteCustomDomain.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/DeleteStaticSiteCustomDomain.json // this example is just showing the usage of "StaticSites_DeleteStaticSiteCustomDomain" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -117,7 +117,7 @@ public async Task Delete_DeleteACustomDomainForAStaticSite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ValidateCustomDomainCanBeAddedToStaticSite_ValidateACustomDomainForAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/ValidateStaticSiteCustomDomain.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ValidateStaticSiteCustomDomain.json // this example is just showing the usage of "StaticSites_ValidateCustomDomainCanBeAddedToStaticSite" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteDatabaseConnectionCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteDatabaseConnectionCollection.cs new file mode 100644 index 000000000000..19afac8a99b2 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteDatabaseConnectionCollection.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_StaticSiteDatabaseConnectionCollection + { + // List overviews of database connections for the static site. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListOverviewsOfDatabaseConnectionsForTheStaticSite() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSiteDatabaseConnections.json + // this example is just showing the usage of "StaticSites_GetDatabaseConnections" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteResource created on azure + // for more information of creating StaticSiteResource, please refer to the document of StaticSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + ResourceIdentifier staticSiteResourceId = StaticSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + StaticSiteResource staticSite = client.GetStaticSiteResource(staticSiteResourceId); + + // get the collection of this StaticSiteDatabaseConnectionResource + StaticSiteDatabaseConnectionCollection collection = staticSite.GetStaticSiteDatabaseConnections(); + + // invoke the operation and iterate over the result + await foreach (StaticSiteDatabaseConnectionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DatabaseConnectionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get overview of database connections for the static site. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetOverviewOfDatabaseConnectionsForTheStaticSite() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSiteDatabaseConnection.json + // this example is just showing the usage of "StaticSites_GetDatabaseConnection" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteResource created on azure + // for more information of creating StaticSiteResource, please refer to the document of StaticSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + ResourceIdentifier staticSiteResourceId = StaticSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + StaticSiteResource staticSite = client.GetStaticSiteResource(staticSiteResourceId); + + // get the collection of this StaticSiteDatabaseConnectionResource + StaticSiteDatabaseConnectionCollection collection = staticSite.GetStaticSiteDatabaseConnections(); + + // invoke the operation + string databaseConnectionName = "default"; + StaticSiteDatabaseConnectionResource result = await collection.GetAsync(databaseConnectionName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DatabaseConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get overview of database connections for the static site. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetOverviewOfDatabaseConnectionsForTheStaticSite() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSiteDatabaseConnection.json + // this example is just showing the usage of "StaticSites_GetDatabaseConnection" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteResource created on azure + // for more information of creating StaticSiteResource, please refer to the document of StaticSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + ResourceIdentifier staticSiteResourceId = StaticSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + StaticSiteResource staticSite = client.GetStaticSiteResource(staticSiteResourceId); + + // get the collection of this StaticSiteDatabaseConnectionResource + StaticSiteDatabaseConnectionCollection collection = staticSite.GetStaticSiteDatabaseConnections(); + + // invoke the operation + string databaseConnectionName = "default"; + bool result = await collection.ExistsAsync(databaseConnectionName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get overview of database connections for the static site. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetOverviewOfDatabaseConnectionsForTheStaticSite() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSiteDatabaseConnection.json + // this example is just showing the usage of "StaticSites_GetDatabaseConnection" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteResource created on azure + // for more information of creating StaticSiteResource, please refer to the document of StaticSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + ResourceIdentifier staticSiteResourceId = StaticSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + StaticSiteResource staticSite = client.GetStaticSiteResource(staticSiteResourceId); + + // get the collection of this StaticSiteDatabaseConnectionResource + StaticSiteDatabaseConnectionCollection collection = staticSite.GetStaticSiteDatabaseConnections(); + + // invoke the operation + string databaseConnectionName = "default"; + NullableResponse response = await collection.GetIfExistsAsync(databaseConnectionName); + StaticSiteDatabaseConnectionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DatabaseConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create or update a database connection for a static site + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateOrUpdateADatabaseConnectionForAStaticSite() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/CreateOrUpdateStaticSiteDatabaseConnection.json + // this example is just showing the usage of "StaticSites_CreateOrUpdateDatabaseConnection" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteResource created on azure + // for more information of creating StaticSiteResource, please refer to the document of StaticSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + ResourceIdentifier staticSiteResourceId = StaticSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + StaticSiteResource staticSite = client.GetStaticSiteResource(staticSiteResourceId); + + // get the collection of this StaticSiteDatabaseConnectionResource + StaticSiteDatabaseConnectionCollection collection = staticSite.GetStaticSiteDatabaseConnections(); + + // invoke the operation + string databaseConnectionName = "default"; + DatabaseConnectionData data = new DatabaseConnectionData() + { + ResourceId = "/subscription/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/databaseRG/providers/Microsoft.DocumentDB/databaseAccounts/exampleDatabaseName", + ConnectionIdentity = "SystemAssigned", + ConnectionString = "AccountEndpoint=https://exampleDatabaseName.documents.azure.com:443/;Database=mydb;", + Region = "West US 2", + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, databaseConnectionName, data); + StaticSiteDatabaseConnectionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DatabaseConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteDatabaseConnectionResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteDatabaseConnectionResource.cs new file mode 100644 index 000000000000..a73fd479541f --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteDatabaseConnectionResource.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; +using Azure.ResourceManager.AppService.Models; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_StaticSiteDatabaseConnectionResource + { + // Get overview of database connections for the static site. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetOverviewOfDatabaseConnectionsForTheStaticSite() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSiteDatabaseConnection.json + // this example is just showing the usage of "StaticSites_GetDatabaseConnection" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteDatabaseConnectionResource created on azure + // for more information of creating StaticSiteDatabaseConnectionResource, please refer to the document of StaticSiteDatabaseConnectionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + string databaseConnectionName = "default"; + ResourceIdentifier staticSiteDatabaseConnectionResourceId = StaticSiteDatabaseConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, databaseConnectionName); + StaticSiteDatabaseConnectionResource staticSiteDatabaseConnection = client.GetStaticSiteDatabaseConnectionResource(staticSiteDatabaseConnectionResourceId); + + // invoke the operation + StaticSiteDatabaseConnectionResource result = await staticSiteDatabaseConnection.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DatabaseConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Delete a database connection from a static site. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteADatabaseConnectionFromAStaticSite() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/DeleteStaticSiteDatabaseConnection.json + // this example is just showing the usage of "StaticSites_DeleteDatabaseConnection" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteDatabaseConnectionResource created on azure + // for more information of creating StaticSiteDatabaseConnectionResource, please refer to the document of StaticSiteDatabaseConnectionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + string databaseConnectionName = "default"; + ResourceIdentifier staticSiteDatabaseConnectionResourceId = StaticSiteDatabaseConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, databaseConnectionName); + StaticSiteDatabaseConnectionResource staticSiteDatabaseConnection = client.GetStaticSiteDatabaseConnectionResource(staticSiteDatabaseConnectionResourceId); + + // invoke the operation + await staticSiteDatabaseConnection.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Patch a database connection for a static site + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_PatchADatabaseConnectionForAStaticSite() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/PatchStaticSiteDatabaseConnection.json + // this example is just showing the usage of "StaticSites_UpdateDatabaseConnection" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteDatabaseConnectionResource created on azure + // for more information of creating StaticSiteDatabaseConnectionResource, please refer to the document of StaticSiteDatabaseConnectionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + string databaseConnectionName = "default"; + ResourceIdentifier staticSiteDatabaseConnectionResourceId = StaticSiteDatabaseConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, databaseConnectionName); + StaticSiteDatabaseConnectionResource staticSiteDatabaseConnection = client.GetStaticSiteDatabaseConnectionResource(staticSiteDatabaseConnectionResourceId); + + // invoke the operation + DatabaseConnectionPatchRequest databaseConnectionRequestEnvelope = new DatabaseConnectionPatchRequest(); + StaticSiteDatabaseConnectionResource result = await staticSiteDatabaseConnection.UpdateAsync(databaseConnectionRequestEnvelope); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DatabaseConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get details of database connections for the static site. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetDatabaseConnectionWithDetails_GetDetailsOfDatabaseConnectionsForTheStaticSite() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSiteDatabaseConnectionWithDetails.json + // this example is just showing the usage of "StaticSites_GetDatabaseConnectionWithDetails" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteDatabaseConnectionResource created on azure + // for more information of creating StaticSiteDatabaseConnectionResource, please refer to the document of StaticSiteDatabaseConnectionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + string databaseConnectionName = "default"; + ResourceIdentifier staticSiteDatabaseConnectionResourceId = StaticSiteDatabaseConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, databaseConnectionName); + StaticSiteDatabaseConnectionResource staticSiteDatabaseConnection = client.GetStaticSiteDatabaseConnectionResource(staticSiteDatabaseConnectionResourceId); + + // invoke the operation + StaticSiteDatabaseConnectionResource result = await staticSiteDatabaseConnection.GetDatabaseConnectionWithDetailsAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DatabaseConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteLinkedBackendCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteLinkedBackendCollection.cs new file mode 100644 index 000000000000..d050ca66bef8 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteLinkedBackendCollection.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_StaticSiteLinkedBackendCollection + { + // Get details of the linked backends registered with a static site. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_GetDetailsOfTheLinkedBackendsRegisteredWithAStaticSite() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetLinkedBackendsForStaticSite.json + // this example is just showing the usage of "StaticSites_GetLinkedBackends" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteResource created on azure + // for more information of creating StaticSiteResource, please refer to the document of StaticSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + ResourceIdentifier staticSiteResourceId = StaticSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + StaticSiteResource staticSite = client.GetStaticSiteResource(staticSiteResourceId); + + // get the collection of this StaticSiteLinkedBackendResource + StaticSiteLinkedBackendCollection collection = staticSite.GetStaticSiteLinkedBackends(); + + // invoke the operation and iterate over the result + await foreach (StaticSiteLinkedBackendResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + StaticSiteLinkedBackendARMResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get details of the linked backend registered with a static site by name. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetDetailsOfTheLinkedBackendRegisteredWithAStaticSiteByName() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetLinkedBackendForStaticSite.json + // this example is just showing the usage of "StaticSites_GetLinkedBackend" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteResource created on azure + // for more information of creating StaticSiteResource, please refer to the document of StaticSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + ResourceIdentifier staticSiteResourceId = StaticSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + StaticSiteResource staticSite = client.GetStaticSiteResource(staticSiteResourceId); + + // get the collection of this StaticSiteLinkedBackendResource + StaticSiteLinkedBackendCollection collection = staticSite.GetStaticSiteLinkedBackends(); + + // invoke the operation + string linkedBackendName = "testBackend"; + StaticSiteLinkedBackendResource result = await collection.GetAsync(linkedBackendName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + StaticSiteLinkedBackendARMResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get details of the linked backend registered with a static site by name. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetDetailsOfTheLinkedBackendRegisteredWithAStaticSiteByName() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetLinkedBackendForStaticSite.json + // this example is just showing the usage of "StaticSites_GetLinkedBackend" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteResource created on azure + // for more information of creating StaticSiteResource, please refer to the document of StaticSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + ResourceIdentifier staticSiteResourceId = StaticSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + StaticSiteResource staticSite = client.GetStaticSiteResource(staticSiteResourceId); + + // get the collection of this StaticSiteLinkedBackendResource + StaticSiteLinkedBackendCollection collection = staticSite.GetStaticSiteLinkedBackends(); + + // invoke the operation + string linkedBackendName = "testBackend"; + bool result = await collection.ExistsAsync(linkedBackendName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get details of the linked backend registered with a static site by name. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetDetailsOfTheLinkedBackendRegisteredWithAStaticSiteByName() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetLinkedBackendForStaticSite.json + // this example is just showing the usage of "StaticSites_GetLinkedBackend" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteResource created on azure + // for more information of creating StaticSiteResource, please refer to the document of StaticSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + ResourceIdentifier staticSiteResourceId = StaticSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + StaticSiteResource staticSite = client.GetStaticSiteResource(staticSiteResourceId); + + // get the collection of this StaticSiteLinkedBackendResource + StaticSiteLinkedBackendCollection collection = staticSite.GetStaticSiteLinkedBackends(); + + // invoke the operation + string linkedBackendName = "testBackend"; + NullableResponse response = await collection.GetIfExistsAsync(linkedBackendName); + StaticSiteLinkedBackendResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + StaticSiteLinkedBackendARMResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Link a backend to a static site + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_LinkABackendToAStaticSite() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/LinkBackendToStaticSite.json + // this example is just showing the usage of "StaticSites_LinkBackend" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteResource created on azure + // for more information of creating StaticSiteResource, please refer to the document of StaticSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + ResourceIdentifier staticSiteResourceId = StaticSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + StaticSiteResource staticSite = client.GetStaticSiteResource(staticSiteResourceId); + + // get the collection of this StaticSiteLinkedBackendResource + StaticSiteLinkedBackendCollection collection = staticSite.GetStaticSiteLinkedBackends(); + + // invoke the operation + string linkedBackendName = "testBackend"; + StaticSiteLinkedBackendARMResourceData data = new StaticSiteLinkedBackendARMResourceData() + { + BackendResourceId = "/subscription/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/backendRg/providers/Microsoft.Web/sites/testBackend", + Region = "West US 2", + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, linkedBackendName, data); + StaticSiteLinkedBackendResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + StaticSiteLinkedBackendARMResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteLinkedBackendResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteLinkedBackendResource.cs new file mode 100644 index 000000000000..aa2e056372b8 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteLinkedBackendResource.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_StaticSiteLinkedBackendResource + { + // Validate if backend can be linked to static site. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task ValidateBackend_ValidateIfBackendCanBeLinkedToStaticSite() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ValidateLinkedBackendForStaticSite.json + // this example is just showing the usage of "StaticSites_ValidateBackend" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteLinkedBackendResource created on azure + // for more information of creating StaticSiteLinkedBackendResource, please refer to the document of StaticSiteLinkedBackendResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + string linkedBackendName = "testBackend"; + ResourceIdentifier staticSiteLinkedBackendResourceId = StaticSiteLinkedBackendResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, linkedBackendName); + StaticSiteLinkedBackendResource staticSiteLinkedBackend = client.GetStaticSiteLinkedBackendResource(staticSiteLinkedBackendResourceId); + + // invoke the operation + StaticSiteLinkedBackendARMResourceData data = new StaticSiteLinkedBackendARMResourceData() + { + BackendResourceId = "/subscription/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/backendRg/providers/Microsoft.Web/sites/testBackend", + Region = "West US 2", + }; + await staticSiteLinkedBackend.ValidateBackendAsync(WaitUntil.Completed, data); + + Console.WriteLine($"Succeeded"); + } + + // Get details of the linked backend registered with a static site by name. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetDetailsOfTheLinkedBackendRegisteredWithAStaticSiteByName() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetLinkedBackendForStaticSite.json + // this example is just showing the usage of "StaticSites_GetLinkedBackend" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteLinkedBackendResource created on azure + // for more information of creating StaticSiteLinkedBackendResource, please refer to the document of StaticSiteLinkedBackendResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + string linkedBackendName = "testBackend"; + ResourceIdentifier staticSiteLinkedBackendResourceId = StaticSiteLinkedBackendResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, linkedBackendName); + StaticSiteLinkedBackendResource staticSiteLinkedBackend = client.GetStaticSiteLinkedBackendResource(staticSiteLinkedBackendResourceId); + + // invoke the operation + StaticSiteLinkedBackendResource result = await staticSiteLinkedBackend.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + StaticSiteLinkedBackendARMResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Link a backend to a static site + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_LinkABackendToAStaticSite() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/LinkBackendToStaticSite.json + // this example is just showing the usage of "StaticSites_LinkBackend" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteLinkedBackendResource created on azure + // for more information of creating StaticSiteLinkedBackendResource, please refer to the document of StaticSiteLinkedBackendResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + string linkedBackendName = "testBackend"; + ResourceIdentifier staticSiteLinkedBackendResourceId = StaticSiteLinkedBackendResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, linkedBackendName); + StaticSiteLinkedBackendResource staticSiteLinkedBackend = client.GetStaticSiteLinkedBackendResource(staticSiteLinkedBackendResourceId); + + // invoke the operation + StaticSiteLinkedBackendARMResourceData data = new StaticSiteLinkedBackendARMResourceData() + { + BackendResourceId = "/subscription/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/backendRg/providers/Microsoft.Web/sites/testBackend", + Region = "West US 2", + }; + ArmOperation lro = await staticSiteLinkedBackend.UpdateAsync(WaitUntil.Completed, data); + StaticSiteLinkedBackendResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + StaticSiteLinkedBackendARMResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Unlink a backend from a static site. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_UnlinkABackendFromAStaticSite() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/UnlinkBackendFromStaticSite.json + // this example is just showing the usage of "StaticSites_UnlinkBackend" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteLinkedBackendResource created on azure + // for more information of creating StaticSiteLinkedBackendResource, please refer to the document of StaticSiteLinkedBackendResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + string linkedBackendName = "testBackend"; + ResourceIdentifier staticSiteLinkedBackendResourceId = StaticSiteLinkedBackendResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, linkedBackendName); + StaticSiteLinkedBackendResource staticSiteLinkedBackend = client.GetStaticSiteLinkedBackendResource(staticSiteLinkedBackendResourceId); + + // invoke the operation + await staticSiteLinkedBackend.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSitePrivateEndpointConnectionCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSitePrivateEndpointConnectionCollection.cs index d9e932f94c3c..79eec86d1bac 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSitePrivateEndpointConnectionCollection.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSitePrivateEndpointConnectionCollection.cs @@ -23,7 +23,7 @@ public partial class Sample_StaticSitePrivateEndpointConnectionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetAListOfPrivateEndpointConnectionsAssociatedWithASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetSitePrivateEndpointConnectionList.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSitePrivateEndpointConnectionList.json // this example is just showing the usage of "StaticSites_GetPrivateEndpointConnectionList" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task GetAll_GetAListOfPrivateEndpointConnectionsAssociatedWithASite [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAPrivateEndpointConnectionForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetSitePrivateEndpointConnection.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSitePrivateEndpointConnection.json // this example is just showing the usage of "StaticSites_GetPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -95,7 +95,7 @@ public async Task Get_GetAPrivateEndpointConnectionForASite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAPrivateEndpointConnectionForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetSitePrivateEndpointConnection.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSitePrivateEndpointConnection.json // this example is just showing the usage of "StaticSites_GetPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -126,7 +126,7 @@ public async Task Exists_GetAPrivateEndpointConnectionForASite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAPrivateEndpointConnectionForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetSitePrivateEndpointConnection.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSitePrivateEndpointConnection.json // this example is just showing the usage of "StaticSites_GetPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -169,7 +169,7 @@ public async Task GetIfExists_GetAPrivateEndpointConnectionForASite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_ApprovesOrRejectsAPrivateEndpointConnectionForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/ApproveRejectSitePrivateEndpointConnection.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ApproveRejectSitePrivateEndpointConnection.json // this example is just showing the usage of "StaticSites_ApproveOrRejectPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSitePrivateEndpointConnectionResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSitePrivateEndpointConnectionResource.cs index 4a961a66fda5..ad65b1f0ec3b 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSitePrivateEndpointConnectionResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSitePrivateEndpointConnectionResource.cs @@ -23,7 +23,7 @@ public partial class Sample_StaticSitePrivateEndpointConnectionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAPrivateEndpointConnectionForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetSitePrivateEndpointConnection.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSitePrivateEndpointConnection.json // this example is just showing the usage of "StaticSites_GetPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_GetAPrivateEndpointConnectionForASite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_ApprovesOrRejectsAPrivateEndpointConnectionForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/ApproveRejectSitePrivateEndpointConnection.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ApproveRejectSitePrivateEndpointConnection.json // this example is just showing the usage of "StaticSites_ApproveOrRejectPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -97,7 +97,7 @@ public async Task Update_ApprovesOrRejectsAPrivateEndpointConnectionForASite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteAPrivateEndpointConnectionForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/DeleteSitePrivateEndpointConnection.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/DeleteSitePrivateEndpointConnection.json // this example is just showing the usage of "StaticSites_DeletePrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteResource.cs index e568fa3f057e..d01f534bd7d6 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteResource.cs @@ -24,7 +24,7 @@ public partial class Sample_StaticSiteResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetStaticSites_GetAllStaticSitesInASubscription() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetAllStaticSites.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetAllStaticSites.json // this example is just showing the usage of "StaticSites_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +56,7 @@ public async Task GetStaticSites_GetAllStaticSitesInASubscription() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetDetailsForAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetStaticSite.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSite.json // this example is just showing the usage of "StaticSites_GetStaticSite" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -87,7 +87,7 @@ public async Task Get_GetDetailsForAStaticSite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/DeleteStaticSite.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/DeleteStaticSite.json // this example is just showing the usage of "StaticSites_DeleteStaticSite" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -114,7 +114,7 @@ public async Task Delete_DeleteAStaticSite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_PatchAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/PatchStaticSite.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/PatchStaticSite.json // this example is just showing the usage of "StaticSites_UpdateStaticSite" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -146,7 +146,7 @@ public async Task Update_PatchAStaticSite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetUsers_ListUsersForAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/ListStaticSiteUsers.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListStaticSiteUsers.json // this example is just showing the usage of "StaticSites_ListStaticSiteUsers" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -177,7 +177,7 @@ public async Task GetUsers_ListUsersForAStaticSite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task DeleteUser_DeleteAUserForAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/DeleteStaticSiteUser.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/DeleteStaticSiteUser.json // this example is just showing the usage of "StaticSites_DeleteStaticSiteUser" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -206,7 +206,7 @@ public async Task DeleteUser_DeleteAUserForAStaticSite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task UpdateUser_CreateOrUpdateAUserForAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/UpdateStaticSiteUser.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/UpdateStaticSiteUser.json // this example is just showing the usage of "StaticSites_UpdateStaticSiteUser" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -239,7 +239,7 @@ public async Task UpdateUser_CreateOrUpdateAUserForAStaticSite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdateAppSettings_CreatesOrUpdatesTheAppSettingsOfAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/CreateOrUpdateStaticSiteAppSettings.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/CreateOrUpdateStaticSiteAppSettings.json // this example is just showing the usage of "StaticSites_CreateOrUpdateStaticSiteAppSettings" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -274,7 +274,7 @@ public async Task CreateOrUpdateAppSettings_CreatesOrUpdatesTheAppSettingsOfASta [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdateFunctionAppSettings_CreatesOrUpdatesTheFunctionAppSettingsOfAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/CreateOrUpdateStaticSiteFunctionAppSettings.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/CreateOrUpdateStaticSiteFunctionAppSettings.json // this example is just showing the usage of "StaticSites_CreateOrUpdateStaticSiteFunctionAppSettings" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -309,7 +309,7 @@ public async Task CreateOrUpdateFunctionAppSettings_CreatesOrUpdatesTheFunctionA [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateUserRolesInvitationLink_CreateAnInvitationLinkForAUserForAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/CreateUserRolesInvitationLink.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/CreateUserRolesInvitationLink.json // this example is just showing the usage of "StaticSites_CreateUserRolesInvitationLink" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -344,7 +344,7 @@ public async Task CreateUserRolesInvitationLink_CreateAnInvitationLinkForAUserFo [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Detach_DetachAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/DetachStaticSite.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/DetachStaticSite.json // this example is just showing the usage of "StaticSites_DetachStaticSite" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -371,7 +371,7 @@ public async Task Detach_DetachAStaticSite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetStaticSiteFunctions_GetsTheFunctionsOfAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/ListStaticSiteFunctions.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListStaticSiteFunctions.json // this example is just showing the usage of "StaticSites_ListStaticSiteFunctions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -401,7 +401,7 @@ public async Task GetStaticSiteFunctions_GetsTheFunctionsOfAStaticSite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAppSettings_GetAppSettingsOfAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/ListStaticSiteAppSettings.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListStaticSiteAppSettings.json // this example is just showing the usage of "StaticSites_ListStaticSiteAppSettings" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -428,7 +428,7 @@ public async Task GetAppSettings_GetAppSettingsOfAStaticSite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetConfiguredRoles_ListsTheConfiguredRolesForAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/ListStaticSiteConfiguredRoles.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListStaticSiteConfiguredRoles.json // this example is just showing the usage of "StaticSites_ListStaticSiteConfiguredRoles" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -455,7 +455,7 @@ public async Task GetConfiguredRoles_ListsTheConfiguredRolesForAStaticSite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetFunctionAppSettings_GetFunctionAppSettingsOfAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/ListStaticSiteFunctionAppSettings.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListStaticSiteFunctionAppSettings.json // this example is just showing the usage of "StaticSites_ListStaticSiteFunctionAppSettings" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -482,7 +482,7 @@ public async Task GetFunctionAppSettings_GetFunctionAppSettingsOfAStaticSite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetStaticSiteSecrets_ListSecretsForAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/ListStaticSiteSecrets.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListStaticSiteSecrets.json // this example is just showing the usage of "StaticSites_ListStaticSiteSecrets" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -509,7 +509,7 @@ public async Task GetStaticSiteSecrets_ListSecretsForAStaticSite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetPrivateLinkResources_GetPrivateLinkResourcesOfASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetSitePrivateLinkResources.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSitePrivateLinkResources.json // this example is just showing the usage of "StaticSites_GetPrivateLinkResources" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -539,7 +539,7 @@ public async Task GetPrivateLinkResources_GetPrivateLinkResourcesOfASite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ResetApiKey_ResetTheApiKeyForAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/ResetStaticSiteApiKey.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ResetStaticSiteApiKey.json // this example is just showing the usage of "StaticSites_ResetStaticSiteApiKey" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -566,12 +566,43 @@ public async Task ResetApiKey_ResetTheApiKeyForAStaticSite() Console.WriteLine($"Succeeded"); } + // List full details of database connections for the static site. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetDatabaseConnectionsWithDetails_ListFullDetailsOfDatabaseConnectionsForTheStaticSite() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetStaticSiteDatabaseConnectionsWithDetails.json + // this example is just showing the usage of "StaticSites_GetDatabaseConnectionsWithDetails" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this StaticSiteResource created on azure + // for more information of creating StaticSiteResource, please refer to the document of StaticSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "rg"; + string name = "testStaticSite0"; + ResourceIdentifier staticSiteResourceId = StaticSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + StaticSiteResource staticSite = client.GetStaticSiteResource(staticSiteResourceId); + + // invoke the operation and iterate over the result + await foreach (DatabaseConnectionData item in staticSite.GetDatabaseConnectionsWithDetailsAsync()) + { + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {item.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + // Deploy a site from a zipped package [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateZipDeploymentForStaticSite_DeployASiteFromAZippedPackage() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/StaticSiteZipDeploy.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/StaticSiteZipDeploy.json // this example is just showing the usage of "StaticSites_CreateZipDeploymentForStaticSite" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteUserProvidedFunctionAppCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteUserProvidedFunctionAppCollection.cs index 91f5f6d39865..bea4d398a979 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteUserProvidedFunctionAppCollection.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteUserProvidedFunctionAppCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_StaticSiteUserProvidedFunctionAppCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetDetailsOfTheUserProvidedFunctionAppsRegisteredWithAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetUserProvidedFunctionAppsForStaticSite.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetUserProvidedFunctionAppsForStaticSite.json // this example is just showing the usage of "StaticSites_GetUserProvidedFunctionAppsForStaticSite" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task GetAll_GetDetailsOfTheUserProvidedFunctionAppsRegisteredWithAS [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetDetailsOfTheUserProvidedFunctionAppRegisteredWithAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetUserProvidedFunctionAppForStaticSite.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetUserProvidedFunctionAppForStaticSite.json // this example is just showing the usage of "StaticSites_GetUserProvidedFunctionAppForStaticSite" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Get_GetDetailsOfTheUserProvidedFunctionAppRegisteredWithAStati [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetDetailsOfTheUserProvidedFunctionAppRegisteredWithAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetUserProvidedFunctionAppForStaticSite.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetUserProvidedFunctionAppForStaticSite.json // this example is just showing the usage of "StaticSites_GetUserProvidedFunctionAppForStaticSite" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -125,7 +125,7 @@ public async Task Exists_GetDetailsOfTheUserProvidedFunctionAppRegisteredWithASt [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetDetailsOfTheUserProvidedFunctionAppRegisteredWithAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetUserProvidedFunctionAppForStaticSite.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetUserProvidedFunctionAppForStaticSite.json // this example is just showing the usage of "StaticSites_GetUserProvidedFunctionAppForStaticSite" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -168,7 +168,7 @@ public async Task GetIfExists_GetDetailsOfTheUserProvidedFunctionAppRegisteredWi [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_RegisterAUserProvidedFunctionAppWithAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/RegisterUserProvidedFunctionAppWithStaticSite.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/RegisterUserProvidedFunctionAppWithStaticSite.json // this example is just showing the usage of "StaticSites_RegisterUserProvidedFunctionAppWithStaticSite" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteUserProvidedFunctionAppResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteUserProvidedFunctionAppResource.cs index 9b0ac453d8d5..28548b59c6b6 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteUserProvidedFunctionAppResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_StaticSiteUserProvidedFunctionAppResource.cs @@ -22,7 +22,7 @@ public partial class Sample_StaticSiteUserProvidedFunctionAppResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetDetailsOfTheUserProvidedFunctionAppRegisteredWithAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetUserProvidedFunctionAppForStaticSite.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetUserProvidedFunctionAppForStaticSite.json // this example is just showing the usage of "StaticSites_GetUserProvidedFunctionAppForStaticSite" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -54,7 +54,7 @@ public async Task Get_GetDetailsOfTheUserProvidedFunctionAppRegisteredWithAStati [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_RegisterAUserProvidedFunctionAppWithAStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/RegisterUserProvidedFunctionAppWithStaticSite.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/RegisterUserProvidedFunctionAppWithStaticSite.json // this example is just showing the usage of "StaticSites_RegisterUserProvidedFunctionAppWithStaticSite" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -93,7 +93,7 @@ public async Task Update_RegisterAUserProvidedFunctionAppWithAStaticSite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DetachTheUserProvidedFunctionAppFromTheStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/DetachUserProvidedFunctionAppFromStaticSite.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/DetachUserProvidedFunctionAppFromStaticSite.json // this example is just showing the usage of "StaticSites_DetachUserProvidedFunctionAppFromStaticSite" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 580c237f0d56..dc38d4da6135 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -18,12 +18,145 @@ namespace Azure.ResourceManager.AppService.Samples { public partial class Sample_SubscriptionResourceExtensions { + // Validate App Service Certificate purchase information by subscription + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task ValidateAppServiceCertificateOrderPurchaseInformation_ValidateAppServiceCertificatePurchaseInformationBySubscription() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/ValidateAppServiceCertificatePurchaseInformationBySubscription.json + // this example is just showing the usage of "AppServiceCertificateOrders_ValidatePurchaseInformation" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AppServiceCertificateOrderData data = new AppServiceCertificateOrderData(new AzureLocation("Global")) + { + Certificates = +{ +["SampleCertName1"] = new AppServiceCertificateProperties() +{ +KeyVaultId = new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/testrg123/providers/microsoft.keyvault/vaults/SamplevaultName"), +KeyVaultSecretName = "SampleSecretName1", +}, +["SampleCertName2"] = new AppServiceCertificateProperties() +{ +KeyVaultId = new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/testrg123/providers/microsoft.keyvault/vaults/SamplevaultName"), +KeyVaultSecretName = "SampleSecretName2", +}, +}, + DistinguishedName = "CN=SampleCustomDomain.com", + ValidityInYears = 2, + KeySize = 2048, + ProductType = CertificateProductType.StandardDomainValidatedSsl, + IsAutoRenew = true, + }; + await subscriptionResource.ValidateAppServiceCertificateOrderPurchaseInformationAsync(data); + + Console.WriteLine($"Succeeded"); + } + + // Check domain availability + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CheckAppServiceDomainRegistrationAvailability_CheckDomainAvailability() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-01-01/examples/CheckDomainAvailability.json + // this example is just showing the usage of "Domains_CheckAvailability" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AppServiceDomainNameIdentifier identifier = new AppServiceDomainNameIdentifier() + { + Name = "abcd.com", + }; + DomainAvailabilityCheckResult result = await subscriptionResource.CheckAppServiceDomainRegistrationAvailabilityAsync(identifier); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Domain Control Center Sso Request + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetControlCenterSsoRequestDomain_GetDomainControlCenterSsoRequest() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-01-01/examples/GetDomainControlCenterSsoRequest.json + // this example is just showing the usage of "Domains_GetControlCenterSsoRequest" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + DomainControlCenterSsoRequestInfo result = await subscriptionResource.GetControlCenterSsoRequestDomainAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + // List domain recommendations + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAppServiceDomainRecommendations_ListDomainRecommendations() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-01-01/examples/ListDomainRecommendations.json + // this example is just showing the usage of "Domains_ListRecommendations" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + DomainRecommendationSearchContent content = new DomainRecommendationSearchContent() + { + Keywords = "example1", + MaxDomainRecommendations = 10, + }; + await foreach (AppServiceDomainNameIdentifier item in subscriptionResource.GetAppServiceDomainRecommendationsAsync(content)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + // List ResourceHealthMetadata for a subscription [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAllResourceHealthMetadata_ListResourceHealthMetadataForASubscription() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/ListResourceHealthMetadataBySubscription.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListResourceHealthMetadataBySubscription.json // this example is just showing the usage of "ResourceHealthMetadata_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -47,12 +180,97 @@ public async Task GetAllResourceHealthMetadata_ListResourceHealthMetadataForASub Console.WriteLine($"Succeeded"); } + // Get custom hostnames under subscription + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetCustomHostNameSites_GetCustomHostnamesUnderSubscription() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListCustomHostNameSites.json + // this example is just showing the usage of "ListCustomHostNameSites" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (CustomHostnameSites item in subscriptionResource.GetCustomHostNameSitesAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get specific custom hostname under subscription + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetCustomHostNameSites_GetSpecificCustomHostnameUnderSubscription() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListCustomSpecificHostNameSites.json + // this example is just showing the usage of "ListCustomHostNameSites" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + string hostname = "www.example.com"; + await foreach (CustomHostnameSites item in subscriptionResource.GetCustomHostNameSitesAsync(hostname: hostname)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + + // List aseregions + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAseRegions_ListAseregions() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListAseRegions.json + // this example is just showing the usage of "ListAseRegions" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (AseRegion item in subscriptionResource.GetAseRegionsAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + // VerifyHostingEnvironmentVnet [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task VerifyHostingEnvironmentVnet_VerifyHostingEnvironmentVnet() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/VerifyHostingEnvironmentVnet.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/VerifyHostingEnvironmentVnet.json // this example is just showing the usage of "VerifyHostingEnvironmentVnet" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,12 +296,41 @@ public async Task VerifyHostingEnvironmentVnet_VerifyHostingEnvironmentVnet() Console.WriteLine($"Succeeded: {result}"); } + // Get usages in location for subscription + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetGetUsagesInLocations_GetUsagesInLocationForSubscription() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetUsagesInLocation.json + // this example is just showing the usage of "GetUsagesInLocation_list" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + AzureLocation location = new AzureLocation("West US"); + await foreach (CsmUsageQuota item in subscriptionResource.GetGetUsagesInLocationsAsync(location)) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + // Generates a preview workflow file for the static site [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PreviewStaticSiteWorkflow_GeneratesAPreviewWorkflowFileForTheStaticSite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GenerateStaticSiteWorkflowPreview.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GenerateStaticSiteWorkflowPreview.json // this example is just showing the usage of "StaticSites_PreviewWorkflow" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_TenantResourceExtensions.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_TenantResourceExtensions.cs index 4822f373e24e..ff9ba7459358 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_TenantResourceExtensions.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_TenantResourceExtensions.cs @@ -22,7 +22,7 @@ public partial class Sample_TenantResourceExtensions [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetOperationsCertificateRegistrationProviders_ListOperations() { - // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2021-02-01/examples/ListOperations.json + // Generated from example definition: specification/web/resource-manager/Microsoft.CertificateRegistration/stable/2023-01-01/examples/ListOperations.json // this example is just showing the usage of "CertificateRegistrationProvider_ListOperations" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,7 +48,7 @@ public async Task GetOperationsCertificateRegistrationProviders_ListOperations() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetOperationsDomainRegistrationProviders_ListOperations() { - // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2021-02-01/examples/ListOperations.json + // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-01-01/examples/ListOperations.json // this example is just showing the usage of "DomainRegistrationProvider_ListOperations" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -74,7 +74,7 @@ public async Task GetOperationsDomainRegistrationProviders_ListOperations() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetFunctionAppStacksProviders_GetFunctionAppStacks() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetFunctionAppStacks.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetFunctionAppStacks.json // this example is just showing the usage of "Provider_GetFunctionAppStacks" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -100,7 +100,7 @@ public async Task GetFunctionAppStacksProviders_GetFunctionAppStacks() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetFunctionAppStacksForLocationProviders_GetLocationsFunctionAppStacks() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetFunctionAppStacksForLocation.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetFunctionAppStacksForLocation.json // this example is just showing the usage of "Provider_GetFunctionAppStacksForLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -127,7 +127,7 @@ public async Task GetFunctionAppStacksForLocationProviders_GetLocationsFunctionA [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetWebAppStacksByLocation_GetLocationsWebAppStacks() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetWebAppStacksForLocation.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWebAppStacksForLocation.json // this example is just showing the usage of "Provider_GetWebAppStacksForLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -154,7 +154,7 @@ public async Task GetWebAppStacksByLocation_GetLocationsWebAppStacks() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetOperationsProviders_ListOperations() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/ListOperations.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListOperations.json // this example is just showing the usage of "Provider_ListOperations" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -180,7 +180,7 @@ public async Task GetOperationsProviders_ListOperations() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetWebAppStacksProviders_GetWebAppStacks() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetWebAppStacks.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWebAppStacks.json // this example is just showing the usage of "Provider_GetWebAppStacks" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_TopLevelDomainCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_TopLevelDomainCollection.cs index 8fec7cab1b67..fa044d980677 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_TopLevelDomainCollection.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_TopLevelDomainCollection.cs @@ -23,7 +23,7 @@ public partial class Sample_TopLevelDomainCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListTopLevelDomains() { - // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2021-02-01/examples/ListTopLevelDomains.json + // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-01-01/examples/ListTopLevelDomains.json // this example is just showing the usage of "TopLevelDomains_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,7 @@ public async Task GetAll_ListTopLevelDomains() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetTopLevelDomain() { - // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2021-02-01/examples/GetTopLevelDomain.json + // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-01-01/examples/GetTopLevelDomain.json // this example is just showing the usage of "TopLevelDomains_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -91,7 +91,7 @@ public async Task Get_GetTopLevelDomain() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetTopLevelDomain() { - // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2021-02-01/examples/GetTopLevelDomain.json + // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-01-01/examples/GetTopLevelDomain.json // this example is just showing the usage of "TopLevelDomains_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -120,7 +120,7 @@ public async Task Exists_GetTopLevelDomain() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetTopLevelDomain() { - // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2021-02-01/examples/GetTopLevelDomain.json + // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-01-01/examples/GetTopLevelDomain.json // this example is just showing the usage of "TopLevelDomains_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_TopLevelDomainResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_TopLevelDomainResource.cs index 20367fecd103..587383a2e527 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_TopLevelDomainResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_TopLevelDomainResource.cs @@ -22,7 +22,7 @@ public partial class Sample_TopLevelDomainResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetTopLevelDomain() { - // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2021-02-01/examples/GetTopLevelDomain.json + // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-01-01/examples/GetTopLevelDomain.json // this example is just showing the usage of "TopLevelDomains_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_GetTopLevelDomain() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAgreements_ListTopLevelDomainAgreements() { - // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2021-02-01/examples/ListTopLevelDomainAgreements.json + // Generated from example definition: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2023-01-01/examples/ListTopLevelDomainAgreements.json // this example is just showing the usage of "TopLevelDomains_ListAgreements" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteCollection.cs new file mode 100644 index 000000000000..fe654cbde1dd --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteCollection.cs @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; +using Azure.ResourceManager.AppService.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_WebSiteCollection + { + // List Web Apps by Resource group + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListWebAppsByResourceGroup() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListWebAppsByResourceGroup.json + // this example is just showing the usage of "WebApps_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WebSiteResource + WebSiteCollection collection = resourceGroupResource.GetWebSites(); + + // invoke the operation and iterate over the result + await foreach (WebSiteResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebSiteData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Web App + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetWebApp() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWebApp.json + // this example is just showing the usage of "WebApps_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WebSiteResource + WebSiteCollection collection = resourceGroupResource.GetWebSites(); + + // invoke the operation + string name = "sitef6141"; + WebSiteResource result = await collection.GetAsync(name); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebSiteData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Web App + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetWebApp() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWebApp.json + // this example is just showing the usage of "WebApps_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WebSiteResource + WebSiteCollection collection = resourceGroupResource.GetWebSites(); + + // invoke the operation + string name = "sitef6141"; + bool result = await collection.ExistsAsync(name); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Web App + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetWebApp() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWebApp.json + // this example is just showing the usage of "WebApps_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WebSiteResource + WebSiteCollection collection = resourceGroupResource.GetWebSites(); + + // invoke the operation + string name = "sitef6141"; + NullableResponse response = await collection.GetIfExistsAsync(name); + WebSiteResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebSiteData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Clone web app + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CloneWebApp() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/CloneWebApp.json + // this example is just showing the usage of "WebApps_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WebSiteResource + WebSiteCollection collection = resourceGroupResource.GetWebSites(); + + // invoke the operation + string name = "sitef6141"; + WebSiteData data = new WebSiteData(new AzureLocation("East US")) + { + CloningInfo = new CloningInfo(new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg456/providers/Microsoft.Web/sites/srcsiteg478")) + { + CanOverwrite = false, + CloneCustomHostNames = true, + CloneSourceControl = true, + SourceWebAppLocation = new AzureLocation("West Europe"), + HostingEnvironment = "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg456/providers/Microsoft.Web/hostingenvironments/aseforsites", + AppSettingsOverrides = +{ +["Setting1"] = "NewValue1", +["Setting3"] = "NewValue5", +}, + ConfigureLoadBalancing = false, + }, + Kind = "app", + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, data); + WebSiteResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebSiteData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create or Update web app + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateOrUpdateWebApp() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/CreateOrUpdateWebApp.json + // this example is just showing the usage of "WebApps_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WebSiteResource + WebSiteCollection collection = resourceGroupResource.GetWebSites(); + + // invoke the operation + string name = "sitef6141"; + WebSiteData data = new WebSiteData(new AzureLocation("East US")) + { + AppServicePlanId = new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/serverfarms/DefaultAsp"), + Kind = "app", + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, data); + WebSiteResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebSiteData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteConfigResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteConfigResource.cs new file mode 100644 index 000000000000..7062676fa2c8 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteConfigResource.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; +using Azure.ResourceManager.AppService.Models; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_WebSiteConfigResource + { + // Get Site Config + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetSiteConfig() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSiteConfig.json + // this example is just showing the usage of "WebApps_GetConfiguration" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteConfigResource created on azure + // for more information of creating WebSiteConfigResource, please refer to the document of WebSiteConfigResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + ResourceIdentifier webSiteConfigResourceId = WebSiteConfigResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteConfigResource webSiteConfig = client.GetWebSiteConfigResource(webSiteConfigResourceId); + + // invoke the operation + WebSiteConfigResource result = await webSiteConfig.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SiteConfigData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Update Site Config + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_UpdateSiteConfig() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/UpdateSiteConfig.json + // this example is just showing the usage of "WebApps_CreateOrUpdateConfiguration" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteConfigResource created on azure + // for more information of creating WebSiteConfigResource, please refer to the document of WebSiteConfigResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + ResourceIdentifier webSiteConfigResourceId = WebSiteConfigResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteConfigResource webSiteConfig = client.GetWebSiteConfigResource(webSiteConfigResourceId); + + // invoke the operation + SiteConfigData data = new SiteConfigData() + { + NumberOfWorkers = 1, + DefaultDocuments = +{ +"Default.htm","Default.html","Default.asp","index.htm","index.html","iisstart.htm","default.aspx","index.php","hostingstart.html" +}, + NetFrameworkVersion = "v4.0", + PhpVersion = "5.6", + PythonVersion = "", + NodeVersion = "", + PowerShellVersion = "", + LinuxFxVersion = "", + IsRequestTracingEnabled = false, + IsRemoteDebuggingEnabled = false, + IsHttpLoggingEnabled = false, + UseManagedIdentityCreds = false, + LogsDirectorySizeLimit = 35, + IsDetailedErrorLoggingEnabled = false, + Use32BitWorkerProcess = true, + IsWebSocketsEnabled = false, + IsAlwaysOn = false, + AppCommandLine = "", + ManagedPipelineMode = ManagedPipelineMode.Integrated, + VirtualApplications = +{ +new VirtualApplication() +{ +VirtualPath = "/", +PhysicalPath = "site\\wwwroot", +IsPreloadEnabled = false, +} +}, + LoadBalancing = SiteLoadBalancing.LeastRequests, + IsAutoHealEnabled = false, + VnetName = "", + IsVnetRouteAllEnabled = false, + VnetPrivatePortsCount = 0, + IsHttp20Enabled = false, + MinTlsVersion = AppServiceSupportedTlsVersion.Tls1_2, + ScmMinTlsVersion = AppServiceSupportedTlsVersion.Tls1_2, + FtpsState = AppServiceFtpsState.AllAllowed, + FunctionAppScaleLimit = 0, + IsFunctionsRuntimeScaleMonitoringEnabled = false, + MinimumElasticInstanceCount = 0, + AzureStorageAccounts = +{ +}, + }; + ArmOperation lro = await webSiteConfig.CreateOrUpdateAsync(WaitUntil.Completed, data); + WebSiteConfigResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SiteConfigData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteFtpPublishingCredentialsPolicyResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteFtpPublishingCredentialsPolicyResource.cs index 469cff493da6..d664c339942b 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteFtpPublishingCredentialsPolicyResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteFtpPublishingCredentialsPolicyResource.cs @@ -22,7 +22,7 @@ public partial class Sample_WebSiteFtpPublishingCredentialsPolicyResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetFTPAllowed() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetPublishingCredentialsPolicy.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetPublishingCredentialsPolicy.json // this example is just showing the usage of "WebApps_GetFtpAllowed" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_GetFTPAllowed() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_UpdateFTPAllowed() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/UpdatePublishingCredentialsPolicy.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/UpdatePublishingCredentialsPolicy.json // this example is just showing the usage of "WebApps_UpdateFtpAllowed" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteResource.cs index 7b669648936e..3a569db06b80 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteResource.cs @@ -14,17 +14,452 @@ using Azure.ResourceManager; using Azure.ResourceManager.AppService; using Azure.ResourceManager.AppService.Models; +using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.AppService.Samples { public partial class Sample_WebSiteResource { + // List Web apps for subscription + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetWebSites_ListWebAppsForSubscription() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListWebApps.json + // this example is just showing the usage of "WebApps_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (WebSiteResource item in subscriptionResource.GetWebSitesAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebSiteData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Web App + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetWebApp() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWebApp.json + // this example is just showing the usage of "WebApps_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // invoke the operation + WebSiteResource result = await webSite.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebSiteData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Delete Web app + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteWebApp() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/DeleteWebApp.json + // this example is just showing the usage of "WebApps_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // invoke the operation + await webSite.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Update web app + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_UpdateWebApp() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/UpdateWebApp.json + // this example is just showing the usage of "WebApps_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // invoke the operation + SitePatchInfo info = new SitePatchInfo() + { + ServerFarmId = new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/serverfarms/DefaultAsp"), + }; + WebSiteResource result = await webSite.UpdateAsync(info); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebSiteData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Analyze custom hostname for webapp. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task AnalyzeCustomHostname_AnalyzeCustomHostnameForWebapp() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AnalyzeCustomHostName.json + // this example is just showing the usage of "WebApps_AnalyzeCustomHostname" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // invoke the operation + CustomHostnameAnalysisResult result = await webSite.AnalyzeCustomHostnameAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Apply web app slot config + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task ApplySlotConfigToProduction_ApplyWebAppSlotConfig() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ApplySlotConfig.json + // this example is just showing the usage of "WebApps_ApplySlotConfigToProduction" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // invoke the operation + CsmSlotEntity slotSwapEntity = new CsmSlotEntity("staging", true); + await webSite.ApplySlotConfigToProductionAsync(slotSwapEntity); + + Console.WriteLine($"Succeeded"); + } + + // Backup web app + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Backup_BackupWebApp() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/BackupWebApp.json + // this example is just showing the usage of "WebApps_Backup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // invoke the operation + WebAppBackupInfo info = new WebAppBackupInfo() + { + BackupName = "abcdwe", + IsEnabled = true, + StorageAccountUri = new Uri("DefaultEndpointsProtocol=https;AccountName=storagesample;AccountKey="), + BackupSchedule = new WebAppBackupSchedule(7, BackupFrequencyUnit.Day, true, 30) + { + StartOn = DateTimeOffset.Parse("2022-09-02T17:33:11.641Z"), + }, + Databases = +{ +new AppServiceDatabaseBackupSetting(AppServiceDatabaseType.SqlAzure) +{ +Name = "backenddb", +ConnectionStringName = "backend", +ConnectionString = "DSN=data-source-name[;SERVER=value] [;PWD=value] [;UID=value] [;=]", +},new AppServiceDatabaseBackupSetting(AppServiceDatabaseType.SqlAzure) +{ +Name = "statsdb", +ConnectionStringName = "stats", +ConnectionString = "DSN=data-source-name[;SERVER=value] [;PWD=value] [;UID=value] [;=]", +} +}, + }; + WebAppBackupData result = await webSite.BackupAsync(info); + + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {result.Id}"); + } + + // List web app configurations + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAllConfigurationData_ListWebAppConfigurations() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListWebAppConfigurations.json + // this example is just showing the usage of "WebApps_ListConfigurations" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // invoke the operation and iterate over the result + await foreach (SiteConfigData item in webSite.GetAllConfigurationDataAsync()) + { + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {item.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Update App Settings + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task UpdateApplicationSettings_UpdateAppSettings() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/UpdateAppSettings.json + // this example is just showing the usage of "WebApps_UpdateApplicationSettings" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // invoke the operation + AppServiceConfigurationDictionary appSettings = new AppServiceConfigurationDictionary() + { + Properties = +{ +["Setting1"] = "Value1", +["Setting2"] = "Value2", +}, + }; + AppServiceConfigurationDictionary result = await webSite.UpdateApplicationSettingsAsync(appSettings); + + Console.WriteLine($"Succeeded: {result}"); + } + + // List App Settings + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetApplicationSettings_ListAppSettings() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListAppSettings.json + // this example is just showing the usage of "WebApps_ListApplicationSettings" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // invoke the operation + AppServiceConfigurationDictionary result = await webSite.GetApplicationSettingsAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Update Auth Settings + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task UpdateAuthSettings_UpdateAuthSettings() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/UpdateAuthSettings.json + // this example is just showing the usage of "WebApps_UpdateAuthSettings" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // invoke the operation + SiteAuthSettings siteAuthSettings = new SiteAuthSettings() + { + IsEnabled = true, + RuntimeVersion = "~1", + UnauthenticatedClientAction = UnauthenticatedClientAction.RedirectToLoginPage, + IsTokenStoreEnabled = true, + AllowedExternalRedirectUrls = +{ +"sitef6141.customdomain.net","sitef6141.customdomain.info" +}, + DefaultProvider = BuiltInAuthenticationProvider.Google, + TokenRefreshExtensionHours = 120, + ClientId = "42d795a9-8abb-4d06-8534-39528af40f8e.apps.googleusercontent.com", + }; + SiteAuthSettings result = await webSite.UpdateAuthSettingsAsync(siteAuthSettings); + + Console.WriteLine($"Succeeded: {result}"); + } + + // List Auth Settings + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAuthSettings_ListAuthSettings() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListAuthSettings.json + // this example is just showing the usage of "WebApps_GetAuthSettings" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // invoke the operation + SiteAuthSettings result = await webSite.GetAuthSettingsAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Update Azure Storage Accounts + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task UpdateAzureStorageAccounts_UpdateAzureStorageAccounts() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/UpdateAzureStorageAccounts.json + // this example is just showing the usage of "WebApps_UpdateAzureStorageAccounts" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // invoke the operation + AzureStoragePropertyDictionary azureStorageAccounts = new AzureStoragePropertyDictionary() + { + Properties = +{ +["account1"] = new AppServiceStorageAccessInfo() +{ +StorageType = AppServiceStorageType.AzureFiles, +AccountName = "testsa", +ShareName = "web", +AccessKey = "26515^%@#*", +MountPath = "/mounts/a/files", +}, +}, + }; + AzureStoragePropertyDictionary result = await webSite.UpdateAzureStorageAccountsAsync(azureStorageAccounts); + + Console.WriteLine($"Succeeded: {result}"); + } + // List backups [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAllSiteBackupData_ListBackups() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/ListSlotBackups.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListSlotBackups.json // this example is just showing the usage of "WebApps_ListSiteBackups" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +490,7 @@ public async Task GetAllSiteBackupData_ListBackups() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetNetworkTraceOperation_GetTheCurrentStatusOfANetworkTraceOperationForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetWebSiteNetworkTraceOperation.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWebSiteNetworkTraceOperation.json // this example is just showing the usage of "WebApps_GetNetworkTraceOperation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +521,7 @@ public async Task GetNetworkTraceOperation_GetTheCurrentStatusOfANetworkTraceOpe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task StartWebSiteNetworkTraceOperation_StartANewNetworkTraceOperationForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/StartWebSiteNetworkTraceOperation.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/StartWebSiteNetworkTraceOperation.json // this example is just showing the usage of "WebApps_StartWebSiteNetworkTraceOperation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -115,7 +550,7 @@ public async Task StartWebSiteNetworkTraceOperation_StartANewNetworkTraceOperati [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task StopWebSiteNetworkTrace_StopACurrentlyRunningNetworkTraceOperationForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/StopWebSiteNetworkTrace.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/StopWebSiteNetworkTrace.json // this example is just showing the usage of "WebApps_StopWebSiteNetworkTrace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -142,7 +577,7 @@ public async Task StopWebSiteNetworkTrace_StopACurrentlyRunningNetworkTraceOpera [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetNetworkTraces_GetNetworkTracesForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetWebSiteNetworkTraces.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWebSiteNetworkTraces.json // this example is just showing the usage of "WebApps_GetNetworkTraces" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -173,7 +608,7 @@ public async Task GetNetworkTraces_GetNetworkTracesForASite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetNetworkTraceOperationV2_GetTheCurrentStatusOfANetworkTraceOperationForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetWebSiteNetworkTraceOperation.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWebSiteNetworkTraceOperation.json // this example is just showing the usage of "WebApps_GetNetworkTraceOperationV2" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -204,7 +639,7 @@ public async Task GetNetworkTraceOperationV2_GetTheCurrentStatusOfANetworkTraceO [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetNetworkTracesV2_GetNetworkTracesForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetWebSiteNetworkTraces.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWebSiteNetworkTraces.json // this example is just showing the usage of "WebApps_GetNetworkTracesV2" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -235,7 +670,7 @@ public async Task GetNetworkTracesV2_GetNetworkTracesForASite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetPrivateLinkResources_GetPrivateLinkResourcesOfASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetSitePrivateLinkResources.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSitePrivateLinkResources.json // this example is just showing the usage of "WebApps_GetPrivateLinkResources" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -265,7 +700,7 @@ public async Task GetPrivateLinkResources_GetPrivateLinkResourcesOfASite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task StartNetworkTrace_StartANewNetworkTraceOperationForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/StartWebSiteNetworkTraceOperation.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/StartWebSiteNetworkTraceOperation.json // this example is just showing the usage of "WebApps_StartNetworkTrace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -294,7 +729,7 @@ public async Task StartNetworkTrace_StartANewNetworkTraceOperationForASite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task StopNetworkTrace_StopACurrentlyRunningNetworkTraceOperationForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/StopWebSiteNetworkTrace.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/StopWebSiteNetworkTrace.json // this example is just showing the usage of "WebApps_StopNetworkTrace" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -315,5 +750,230 @@ public async Task StopNetworkTrace_StopACurrentlyRunningNetworkTraceOperationFor Console.WriteLine($"Succeeded"); } + + // Delete workflow artifacts + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task DeployWorkflowArtifacts_DeleteWorkflowArtifacts() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/DeleteDeployWorkflowArtifacts.json + // this example is just showing the usage of "WebApps_DeployWorkflowArtifacts" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "testsite2"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // invoke the operation + WorkflowArtifacts workflowArtifacts = new WorkflowArtifacts() + { + FilesToDelete = +{ +"test/workflow.json","test/" +}, + }; + await webSite.DeployWorkflowArtifactsAsync(workflowArtifacts: workflowArtifacts); + + Console.WriteLine($"Succeeded"); + } + + // Deploys workflow artifacts + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task DeployWorkflowArtifacts_DeploysWorkflowArtifacts() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/PostDeployWorkflowArtifacts.json + // this example is just showing the usage of "WebApps_DeployWorkflowArtifacts" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "testsite2"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // invoke the operation + WorkflowArtifacts workflowArtifacts = new WorkflowArtifacts() + { + AppSettings = BinaryData.FromObjectAsJson(new Dictionary() + { + ["eventHub_connectionString"] = "Endpoint=sb://example.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=EXAMPLE1a2b3c4d5e6fEXAMPLE=" + }), + Files = +{ +["connections.json"] = BinaryData.FromObjectAsJson(new Dictionary() +{ +["managedApiConnections"] = new Dictionary() +{ +}, +["serviceProviderConnections"] = new Dictionary() +{ +["eventHub"] = new Dictionary() +{ +["displayName"] = "example1", +["parameterValues"] = new Dictionary() +{ +["connectionString"] = "@appsetting('eventHub_connectionString')"}, +["serviceProvider"] = new Dictionary() +{ +["id"] = "/serviceProviders/eventHub"}}}}), +["test1/workflow.json"] = BinaryData.FromObjectAsJson(new Dictionary() +{ +["definition"] = new Dictionary() +{ +["$schema"] = "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", +["actions"] = new Dictionary() +{ +}, +["contentVersion"] = "1.0.0.0", +["outputs"] = new Dictionary() +{ +}, +["triggers"] = new Dictionary() +{ +["When_events_are_available_in_Event_hub"] = new Dictionary() +{ +["type"] = "ServiceProvider", +["inputs"] = new Dictionary() +{ +["parameters"] = new Dictionary() +{ +["eventHubName"] = "test123"}, +["serviceProviderConfiguration"] = new Dictionary() +{ +["operationId"] = "receiveEvents", +["connectionName"] = "eventHub", +["serviceProviderId"] = "/serviceProviders/eventHub"}}, +["splitOn"] = "@triggerOutputs()?['body']"}}}, +["kind"] = "Stateful"}), +}, + }; + await webSite.DeployWorkflowArtifactsAsync(workflowArtifacts: workflowArtifacts); + + Console.WriteLine($"Succeeded"); + } + + // List the Instance Workflows Configuration Connections + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetWorkflowsConnections_ListTheInstanceWorkflowsConfigurationConnections() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListWorkflowsConfigurationConnections.json + // this example is just showing the usage of "WebApps_ListWorkflowsConnections" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "testsite2"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // invoke the operation + WorkflowEnvelopeData result = await webSite.GetWorkflowsConnectionsAsync(); + + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {result.Id}"); + } + + // Regenerate the callback URL access key for request triggers + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task RegenerateAccessKeyWorkflow_RegenerateTheCallbackURLAccessKeyForRequestTriggers() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Workflows_RegenerateAccessKey.json + // this example is just showing the usage of "Workflows_RegenerateAccessKey" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testResourceGroup"; + string name = "test-name"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // invoke the operation + string workflowName = "testWorkflowName"; + RegenerateActionParameter keyType = new RegenerateActionParameter() + { + KeyType = KeyType.Primary, + }; + await webSite.RegenerateAccessKeyWorkflowAsync(workflowName, keyType); + + Console.WriteLine($"Succeeded"); + } + + // Validate a workflow + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task ValidateWorkflow_ValidateAWorkflow() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/Workflows_Validate.json + // this example is just showing the usage of "Workflows_Validate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-resource-group"; + string name = "test-name"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // invoke the operation + string workflowName = "test-workflow"; + Workflow validate = new Workflow(new AzureLocation("placeholder")) + { + Definition = BinaryData.FromObjectAsJson(new Dictionary() + { + ["$schema"] = "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", + ["actions"] = new Dictionary() + { + }, + ["contentVersion"] = "1.0.0.0", + ["outputs"] = new Dictionary() + { + }, + ["parameters"] = new Dictionary() + { + }, + ["triggers"] = new Dictionary() + { + } + }), + Kind = AppServiceKind.Stateful, + }; + await webSite.ValidateWorkflowAsync(workflowName, validate); + + Console.WriteLine($"Succeeded"); + } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteResourceHealthMetadataResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteResourceHealthMetadataResource.cs index f7153104c288..425381791df5 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteResourceHealthMetadataResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteResourceHealthMetadataResource.cs @@ -21,7 +21,7 @@ public partial class Sample_WebSiteResourceHealthMetadataResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetResourceHealthMetadata() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetResourceHealthMetadataBySite.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetResourceHealthMetadataBySite.json // this example is just showing the usage of "ResourceHealthMetadata_GetBySite" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteSlotCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteSlotCollection.cs new file mode 100644 index 000000000000..cd13286852d9 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteSlotCollection.cs @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; +using Azure.ResourceManager.AppService.Models; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_WebSiteSlotCollection + { + // List Web App Slots + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListWebAppSlots() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListWebAppSlots.json + // this example is just showing the usage of "WebApps_ListSlots" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // get the collection of this WebSiteSlotResource + WebSiteSlotCollection collection = webSite.GetWebSiteSlots(); + + // invoke the operation and iterate over the result + await foreach (WebSiteSlotResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebSiteData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Web App Slot + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetWebAppSlot() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWebAppSlot.json + // this example is just showing the usage of "WebApps_GetSlot" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // get the collection of this WebSiteSlotResource + WebSiteSlotCollection collection = webSite.GetWebSiteSlots(); + + // invoke the operation + string slot = "staging"; + WebSiteSlotResource result = await collection.GetAsync(slot); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebSiteData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Web App Slot + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetWebAppSlot() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWebAppSlot.json + // this example is just showing the usage of "WebApps_GetSlot" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // get the collection of this WebSiteSlotResource + WebSiteSlotCollection collection = webSite.GetWebSiteSlots(); + + // invoke the operation + string slot = "staging"; + bool result = await collection.ExistsAsync(slot); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Web App Slot + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetWebAppSlot() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWebAppSlot.json + // this example is just showing the usage of "WebApps_GetSlot" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // get the collection of this WebSiteSlotResource + WebSiteSlotCollection collection = webSite.GetWebSiteSlots(); + + // invoke the operation + string slot = "staging"; + NullableResponse response = await collection.GetIfExistsAsync(slot); + WebSiteSlotResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebSiteData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Clone web app slot + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CloneWebAppSlot() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/CloneWebAppSlot.json + // this example is just showing the usage of "WebApps_CreateOrUpdateSlot" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // get the collection of this WebSiteSlotResource + WebSiteSlotCollection collection = webSite.GetWebSiteSlots(); + + // invoke the operation + string slot = "staging"; + WebSiteData data = new WebSiteData(new AzureLocation("East US")) + { + CloningInfo = new CloningInfo(new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg456/providers/Microsoft.Web/sites/srcsiteg478/slot/qa")) + { + CanOverwrite = false, + CloneCustomHostNames = true, + CloneSourceControl = true, + SourceWebAppLocation = new AzureLocation("West Europe"), + HostingEnvironment = "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg456/providers/Microsoft.Web/hostingenvironments/aseforsites", + AppSettingsOverrides = +{ +["Setting1"] = "NewValue1", +["Setting3"] = "NewValue5", +}, + ConfigureLoadBalancing = false, + }, + Kind = "app", + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, slot, data); + WebSiteSlotResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebSiteData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create or Update Web App Slot + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateOrUpdateWebAppSlot() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/CreateOrUpdateWebAppSlot.json + // this example is just showing the usage of "WebApps_CreateOrUpdateSlot" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // get the collection of this WebSiteSlotResource + WebSiteSlotCollection collection = webSite.GetWebSiteSlots(); + + // invoke the operation + string slot = "staging"; + WebSiteData data = new WebSiteData(new AzureLocation("East US")) + { + AppServicePlanId = new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/serverfarms/DefaultAsp"), + Kind = "app", + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, slot, data); + WebSiteSlotResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebSiteData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteSlotConfigAppSettingCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteSlotConfigAppSettingCollection.cs index e79e68a8e333..a6a440e99a7e 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteSlotConfigAppSettingCollection.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteSlotConfigAppSettingCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_WebSiteSlotConfigAppSettingCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetAzureKeyVaultReferencesForAppSettingsForSlot() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetKeyVaultReferencesForAppSettingsSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetKeyVaultReferencesForAppSettingsSlot.json // this example is just showing the usage of "WebApps_GetAppSettingsKeyVaultReferencesSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task GetAll_GetAzureKeyVaultReferencesForAppSettingsForSlot() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAzureKeyVaultSlotAppSettingReference() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetKeyVaultReferencesForAppSettingSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetKeyVaultReferencesForAppSettingSlot.json // this example is just showing the usage of "WebApps_GetAppSettingKeyVaultReferenceSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +96,7 @@ public async Task Get_GetAzureKeyVaultSlotAppSettingReference() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAzureKeyVaultSlotAppSettingReference() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetKeyVaultReferencesForAppSettingSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetKeyVaultReferencesForAppSettingSlot.json // this example is just showing the usage of "WebApps_GetAppSettingKeyVaultReferenceSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -128,7 +128,7 @@ public async Task Exists_GetAzureKeyVaultSlotAppSettingReference() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAzureKeyVaultSlotAppSettingReference() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetKeyVaultReferencesForAppSettingSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetKeyVaultReferencesForAppSettingSlot.json // this example is just showing the usage of "WebApps_GetAppSettingKeyVaultReferenceSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteSlotConfigAppSettingResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteSlotConfigAppSettingResource.cs index c1ebca8ba72d..6529c387429c 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteSlotConfigAppSettingResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteSlotConfigAppSettingResource.cs @@ -21,7 +21,7 @@ public partial class Sample_WebSiteSlotConfigAppSettingResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAzureKeyVaultSlotAppSettingReference() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetKeyVaultReferencesForAppSettingSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetKeyVaultReferencesForAppSettingSlot.json // this example is just showing the usage of "WebApps_GetAppSettingKeyVaultReferenceSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteSlotFtpPublishingCredentialsPolicyResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteSlotFtpPublishingCredentialsPolicyResource.cs index 3cbf8678764b..f1c9bdecc206 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteSlotFtpPublishingCredentialsPolicyResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteSlotFtpPublishingCredentialsPolicyResource.cs @@ -22,7 +22,7 @@ public partial class Sample_WebSiteSlotFtpPublishingCredentialsPolicyResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetFTPAllowed() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetPublishingCredentialsPolicySlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetPublishingCredentialsPolicySlot.json // this example is just showing the usage of "WebApps_GetFtpAllowedSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -54,7 +54,7 @@ public async Task Get_GetFTPAllowed() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_UpdateFTPAllowed() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/UpdatePublishingCredentialsPolicySlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/UpdatePublishingCredentialsPolicySlot.json // this example is just showing the usage of "WebApps_UpdateFtpAllowedSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteSlotResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteSlotResource.cs index e4da874cdb68..2694342b57b6 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteSlotResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteSlotResource.cs @@ -19,12 +19,136 @@ namespace Azure.ResourceManager.AppService.Samples { public partial class Sample_WebSiteSlotResource { + // Get Web App Slot + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetWebAppSlot() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWebAppSlot.json + // this example is just showing the usage of "WebApps_GetSlot" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteSlotResource created on azure + // for more information of creating WebSiteSlotResource, please refer to the document of WebSiteSlotResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + string slot = "staging"; + ResourceIdentifier webSiteSlotResourceId = WebSiteSlotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, slot); + WebSiteSlotResource webSiteSlot = client.GetWebSiteSlotResource(webSiteSlotResourceId); + + // invoke the operation + WebSiteSlotResource result = await webSiteSlot.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebSiteData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Delete Web App Slot + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteWebAppSlot() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/DeleteWebAppSlot.json + // this example is just showing the usage of "WebApps_DeleteSlot" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteSlotResource created on azure + // for more information of creating WebSiteSlotResource, please refer to the document of WebSiteSlotResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + string slot = "staging"; + ResourceIdentifier webSiteSlotResourceId = WebSiteSlotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, slot); + WebSiteSlotResource webSiteSlot = client.GetWebSiteSlotResource(webSiteSlotResourceId); + + // invoke the operation + await webSiteSlot.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Update Web App Slot + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_UpdateWebAppSlot() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/UpdateWebAppSlot.json + // this example is just showing the usage of "WebApps_UpdateSlot" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteSlotResource created on azure + // for more information of creating WebSiteSlotResource, please refer to the document of WebSiteSlotResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + string slot = "staging"; + ResourceIdentifier webSiteSlotResourceId = WebSiteSlotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, slot); + WebSiteSlotResource webSiteSlot = client.GetWebSiteSlotResource(webSiteSlotResourceId); + + // invoke the operation + SitePatchInfo info = new SitePatchInfo() + { + ServerFarmId = new ResourceIdentifier("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/serverfarms/DefaultAsp"), + }; + WebSiteSlotResource result = await webSiteSlot.UpdateAsync(info); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WebSiteData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Analyze custom hostname for slot + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task AnalyzeCustomHostnameSlot_AnalyzeCustomHostnameForSlot() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/AnalyzeCustomHostNameSlot.json + // this example is just showing the usage of "WebApps_AnalyzeCustomHostnameSlot" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteSlotResource created on azure + // for more information of creating WebSiteSlotResource, please refer to the document of WebSiteSlotResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "sitef6141"; + string slot = "staging"; + ResourceIdentifier webSiteSlotResourceId = WebSiteSlotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, slot); + WebSiteSlotResource webSiteSlot = client.GetWebSiteSlotResource(webSiteSlotResourceId); + + // invoke the operation + CustomHostnameAnalysisResult result = await webSiteSlot.AnalyzeCustomHostnameSlotAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + // List backups [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAllSiteBackupSlotData_ListBackups() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/ListSlotBackups.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListSlotBackups.json // this example is just showing the usage of "WebApps_ListSiteBackupsSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +180,7 @@ public async Task GetAllSiteBackupSlotData_ListBackups() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetNetworkTraceOperationSlot_GetTheCurrentStatusOfANetworkTraceOperationForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetWebSiteNetworkTraceOperation.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWebSiteNetworkTraceOperation.json // this example is just showing the usage of "WebApps_GetNetworkTraceOperationSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,7 +212,7 @@ public async Task GetNetworkTraceOperationSlot_GetTheCurrentStatusOfANetworkTrac [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task StartWebSiteNetworkTraceOperationSlot_StartANewNetworkTraceOperationForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/StartWebSiteNetworkTraceOperation.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/StartWebSiteNetworkTraceOperation.json // this example is just showing the usage of "WebApps_StartWebSiteNetworkTraceOperationSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -118,7 +242,7 @@ public async Task StartWebSiteNetworkTraceOperationSlot_StartANewNetworkTraceOpe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task StopWebSiteNetworkTraceSlot_StopACurrentlyRunningNetworkTraceOperationForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/StopWebSiteNetworkTrace.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/StopWebSiteNetworkTrace.json // this example is just showing the usage of "WebApps_StopWebSiteNetworkTraceSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -146,7 +270,7 @@ public async Task StopWebSiteNetworkTraceSlot_StopACurrentlyRunningNetworkTraceO [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetNetworkTracesSlot_GetNetworkTracesForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetWebSiteNetworkTraces.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWebSiteNetworkTraces.json // this example is just showing the usage of "WebApps_GetNetworkTracesSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -178,7 +302,7 @@ public async Task GetNetworkTracesSlot_GetNetworkTracesForASite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetNetworkTraceOperationSlotV2_GetTheCurrentStatusOfANetworkTraceOperationForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetWebSiteNetworkTraceOperation.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWebSiteNetworkTraceOperation.json // this example is just showing the usage of "WebApps_GetNetworkTraceOperationSlotV2" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -210,7 +334,7 @@ public async Task GetNetworkTraceOperationSlotV2_GetTheCurrentStatusOfANetworkTr [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetNetworkTracesSlotV2_GetNetworkTracesForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetWebSiteNetworkTraces.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetWebSiteNetworkTraces.json // this example is just showing the usage of "WebApps_GetNetworkTracesSlotV2" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -242,7 +366,7 @@ public async Task GetNetworkTracesSlotV2_GetNetworkTracesForASite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetPrivateLinkResourcesSlot_GetPrivateLinkResourcesOfASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetSitePrivateLinkResourcesSlot.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetSitePrivateLinkResourcesSlot.json // this example is just showing the usage of "WebApps_GetPrivateLinkResourcesSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -273,7 +397,7 @@ public async Task GetPrivateLinkResourcesSlot_GetPrivateLinkResourcesOfASite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task StartNetworkTraceSlot_StartANewNetworkTraceOperationForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/StartWebSiteNetworkTraceOperation.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/StartWebSiteNetworkTraceOperation.json // this example is just showing the usage of "WebApps_StartNetworkTraceSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -303,7 +427,7 @@ public async Task StartNetworkTraceSlot_StartANewNetworkTraceOperationForASite() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task StopNetworkTraceSlot_StopACurrentlyRunningNetworkTraceOperationForASite() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/StopWebSiteNetworkTrace.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/StopWebSiteNetworkTrace.json // this example is just showing the usage of "WebApps_StopNetworkTraceSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -325,5 +449,117 @@ public async Task StopNetworkTraceSlot_StopACurrentlyRunningNetworkTraceOperatio Console.WriteLine($"Succeeded"); } + + // Deploys workflow artifacts slot + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task DeployWorkflowArtifactsSlot_DeploysWorkflowArtifactsSlot() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/PostDeployWorkflowArtifactsSlot.json + // this example is just showing the usage of "WebApps_DeployWorkflowArtifactsSlot" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteSlotResource created on azure + // for more information of creating WebSiteSlotResource, please refer to the document of WebSiteSlotResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "testsite2"; + string slot = "testsSlot"; + ResourceIdentifier webSiteSlotResourceId = WebSiteSlotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, slot); + WebSiteSlotResource webSiteSlot = client.GetWebSiteSlotResource(webSiteSlotResourceId); + + // invoke the operation + WorkflowArtifacts workflowArtifacts = new WorkflowArtifacts() + { + AppSettings = BinaryData.FromObjectAsJson(new Dictionary() + { + ["eventHub_connectionString"] = "Endpoint=sb://example.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=EXAMPLE1a2b3c4d5e6fEXAMPLE=" + }), + Files = +{ +["connections.json"] = BinaryData.FromObjectAsJson(new Dictionary() +{ +["managedApiConnections"] = new Dictionary() +{ +}, +["serviceProviderConnections"] = new Dictionary() +{ +["eventHub"] = new Dictionary() +{ +["displayName"] = "example1", +["parameterValues"] = new Dictionary() +{ +["connectionString"] = "@appsetting('eventHub_connectionString')"}, +["serviceProvider"] = new Dictionary() +{ +["id"] = "/serviceProviders/eventHub"}}}}), +["test1/workflow.json"] = BinaryData.FromObjectAsJson(new Dictionary() +{ +["definition"] = new Dictionary() +{ +["$schema"] = "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", +["actions"] = new Dictionary() +{ +}, +["contentVersion"] = "1.0.0.0", +["outputs"] = new Dictionary() +{ +}, +["triggers"] = new Dictionary() +{ +["When_events_are_available_in_Event_hub"] = new Dictionary() +{ +["type"] = "ServiceProvider", +["inputs"] = new Dictionary() +{ +["parameters"] = new Dictionary() +{ +["eventHubName"] = "test123"}, +["serviceProviderConfiguration"] = new Dictionary() +{ +["operationId"] = "receiveEvents", +["connectionName"] = "eventHub", +["serviceProviderId"] = "/serviceProviders/eventHub"}}, +["splitOn"] = "@triggerOutputs()?['body']"}}}, +["kind"] = "Stateful"}), +}, + }; + await webSiteSlot.DeployWorkflowArtifactsSlotAsync(workflowArtifacts: workflowArtifacts); + + Console.WriteLine($"Succeeded"); + } + + // List the Instance Workflows Configuration Connections Slot + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetWorkflowsConnectionsSlot_ListTheInstanceWorkflowsConfigurationConnectionsSlot() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/ListWorkflowsConfigurationConnections.json + // this example is just showing the usage of "WebApps_ListWorkflowsConnectionsSlot" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteSlotResource created on azure + // for more information of creating WebSiteSlotResource, please refer to the document of WebSiteSlotResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string name = "testsite2"; + string slot = "staging"; + ResourceIdentifier webSiteSlotResourceId = WebSiteSlotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, slot); + WebSiteSlotResource webSiteSlot = client.GetWebSiteSlotResource(webSiteSlotResourceId); + + // invoke the operation + WorkflowEnvelopeData result = await webSiteSlot.GetWorkflowsConnectionsSlotAsync(); + + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {result.Id}"); + } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteSlotResourceHealthMetadataResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteSlotResourceHealthMetadataResource.cs index affc6c88048d..a366425793cc 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteSlotResourceHealthMetadataResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WebSiteSlotResourceHealthMetadataResource.cs @@ -21,7 +21,7 @@ public partial class Sample_WebSiteSlotResourceHealthMetadataResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetResourceHealthMetadata() { - // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2021-02-01/examples/GetResourceHealthMetadataBySite.json + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/GetResourceHealthMetadataBySite.json // this example is just showing the usage of "ResourceHealthMetadata_GetBySiteSlot" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowRunActionCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowRunActionCollection.cs new file mode 100644 index 000000000000..6642fff845b6 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowRunActionCollection.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_WorkflowRunActionCollection + { + // List a workflow run actions + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListAWorkflowRunActions() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowRunActions_List.json + // this example is just showing the usage of "WorkflowRunActions_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkflowRunResource created on azure + // for more information of creating WorkflowRunResource, please refer to the document of WorkflowRunResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-resource-group"; + string name = "test-name"; + string workflowName = "test-workflow"; + string runName = "08586676746934337772206998657CU22"; + ResourceIdentifier workflowRunResourceId = WorkflowRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, runName); + WorkflowRunResource workflowRun = client.GetWorkflowRunResource(workflowRunResourceId); + + // get the collection of this WorkflowRunActionResource + WorkflowRunActionCollection collection = workflowRun.GetWorkflowRunActions(); + + // invoke the operation and iterate over the result + await foreach (WorkflowRunActionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowRunActionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get a workflow run action + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetAWorkflowRunAction() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowRunActions_Get.json + // this example is just showing the usage of "WorkflowRunActions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkflowRunResource created on azure + // for more information of creating WorkflowRunResource, please refer to the document of WorkflowRunResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-resource-group"; + string name = "test-name"; + string workflowName = "test-workflow"; + string runName = "08586676746934337772206998657CU22"; + ResourceIdentifier workflowRunResourceId = WorkflowRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, runName); + WorkflowRunResource workflowRun = client.GetWorkflowRunResource(workflowRunResourceId); + + // get the collection of this WorkflowRunActionResource + WorkflowRunActionCollection collection = workflowRun.GetWorkflowRunActions(); + + // invoke the operation + string actionName = "HTTP"; + WorkflowRunActionResource result = await collection.GetAsync(actionName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowRunActionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get a workflow run action + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetAWorkflowRunAction() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowRunActions_Get.json + // this example is just showing the usage of "WorkflowRunActions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkflowRunResource created on azure + // for more information of creating WorkflowRunResource, please refer to the document of WorkflowRunResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-resource-group"; + string name = "test-name"; + string workflowName = "test-workflow"; + string runName = "08586676746934337772206998657CU22"; + ResourceIdentifier workflowRunResourceId = WorkflowRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, runName); + WorkflowRunResource workflowRun = client.GetWorkflowRunResource(workflowRunResourceId); + + // get the collection of this WorkflowRunActionResource + WorkflowRunActionCollection collection = workflowRun.GetWorkflowRunActions(); + + // invoke the operation + string actionName = "HTTP"; + bool result = await collection.ExistsAsync(actionName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get a workflow run action + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetAWorkflowRunAction() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowRunActions_Get.json + // this example is just showing the usage of "WorkflowRunActions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkflowRunResource created on azure + // for more information of creating WorkflowRunResource, please refer to the document of WorkflowRunResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-resource-group"; + string name = "test-name"; + string workflowName = "test-workflow"; + string runName = "08586676746934337772206998657CU22"; + ResourceIdentifier workflowRunResourceId = WorkflowRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, runName); + WorkflowRunResource workflowRun = client.GetWorkflowRunResource(workflowRunResourceId); + + // get the collection of this WorkflowRunActionResource + WorkflowRunActionCollection collection = workflowRun.GetWorkflowRunActions(); + + // invoke the operation + string actionName = "HTTP"; + NullableResponse response = await collection.GetIfExistsAsync(actionName); + WorkflowRunActionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowRunActionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowRunActionResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowRunActionResource.cs new file mode 100644 index 000000000000..e801c7fcf703 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowRunActionResource.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; +using Azure.ResourceManager.AppService.Models; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_WorkflowRunActionResource + { + // Get a workflow run action + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetAWorkflowRunAction() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowRunActions_Get.json + // this example is just showing the usage of "WorkflowRunActions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkflowRunActionResource created on azure + // for more information of creating WorkflowRunActionResource, please refer to the document of WorkflowRunActionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-resource-group"; + string name = "test-name"; + string workflowName = "test-workflow"; + string runName = "08586676746934337772206998657CU22"; + string actionName = "HTTP"; + ResourceIdentifier workflowRunActionResourceId = WorkflowRunActionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, runName, actionName); + WorkflowRunActionResource workflowRunAction = client.GetWorkflowRunActionResource(workflowRunActionResourceId); + + // invoke the operation + WorkflowRunActionResource result = await workflowRunAction.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowRunActionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // List expression traces + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetExpressionTraces_ListExpressionTraces() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowRunActions_ListExpressionTraces.json + // this example is just showing the usage of "WorkflowRunActions_ListExpressionTraces" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkflowRunActionResource created on azure + // for more information of creating WorkflowRunActionResource, please refer to the document of WorkflowRunActionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testResourceGroup"; + string name = "test-name"; + string workflowName = "testFlow"; + string runName = "08586776228332053161046300351"; + string actionName = "testAction"; + ResourceIdentifier workflowRunActionResourceId = WorkflowRunActionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, runName, actionName); + WorkflowRunActionResource workflowRunAction = client.GetWorkflowRunActionResource(workflowRunActionResourceId); + + // invoke the operation and iterate over the result + await foreach (ExpressionRoot item in workflowRunAction.GetExpressionTracesAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowRunCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowRunCollection.cs new file mode 100644 index 000000000000..b34ed745ac7b --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowRunCollection.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_WorkflowRunCollection + { + // List workflow runs + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListWorkflowRuns() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowRuns_List.json + // this example is just showing the usage of "WorkflowRuns_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-resource-group"; + string name = "test-name"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // get the collection of this WorkflowRunResource + string workflowName = "test-workflow"; + WorkflowRunCollection collection = webSite.GetWorkflowRuns(workflowName); + + // invoke the operation and iterate over the result + await foreach (WorkflowRunResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowRunData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get a run for a workflow + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetARunForAWorkflow() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowRuns_Get.json + // this example is just showing the usage of "WorkflowRuns_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-resource-group"; + string name = "test-name"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // get the collection of this WorkflowRunResource + string workflowName = "test-workflow"; + WorkflowRunCollection collection = webSite.GetWorkflowRuns(workflowName); + + // invoke the operation + string runName = "08586676746934337772206998657CU22"; + WorkflowRunResource result = await collection.GetAsync(runName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get a run for a workflow + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetARunForAWorkflow() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowRuns_Get.json + // this example is just showing the usage of "WorkflowRuns_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-resource-group"; + string name = "test-name"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // get the collection of this WorkflowRunResource + string workflowName = "test-workflow"; + WorkflowRunCollection collection = webSite.GetWorkflowRuns(workflowName); + + // invoke the operation + string runName = "08586676746934337772206998657CU22"; + bool result = await collection.ExistsAsync(runName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get a run for a workflow + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetARunForAWorkflow() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowRuns_Get.json + // this example is just showing the usage of "WorkflowRuns_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-resource-group"; + string name = "test-name"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // get the collection of this WorkflowRunResource + string workflowName = "test-workflow"; + WorkflowRunCollection collection = webSite.GetWorkflowRuns(workflowName); + + // invoke the operation + string runName = "08586676746934337772206998657CU22"; + NullableResponse response = await collection.GetIfExistsAsync(runName); + WorkflowRunResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowRunResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowRunResource.cs new file mode 100644 index 000000000000..39bc462f7a09 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowRunResource.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_WorkflowRunResource + { + // Get a run for a workflow + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetARunForAWorkflow() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowRuns_Get.json + // this example is just showing the usage of "WorkflowRuns_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkflowRunResource created on azure + // for more information of creating WorkflowRunResource, please refer to the document of WorkflowRunResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-resource-group"; + string name = "test-name"; + string workflowName = "test-workflow"; + string runName = "08586676746934337772206998657CU22"; + ResourceIdentifier workflowRunResourceId = WorkflowRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, runName); + WorkflowRunResource workflowRun = client.GetWorkflowRunResource(workflowRunResourceId); + + // invoke the operation + WorkflowRunResource result = await workflowRun.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Cancel a workflow run + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Cancel_CancelAWorkflowRun() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowRuns_Cancel.json + // this example is just showing the usage of "WorkflowRuns_Cancel" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkflowRunResource created on azure + // for more information of creating WorkflowRunResource, please refer to the document of WorkflowRunResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-resource-group"; + string name = "test-name"; + string workflowName = "test-workflow"; + string runName = "08586676746934337772206998657CU22"; + ResourceIdentifier workflowRunResourceId = WorkflowRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, runName); + WorkflowRunResource workflowRun = client.GetWorkflowRunResource(workflowRunResourceId); + + // invoke the operation + await workflowRun.CancelAsync(); + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowTriggerCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowTriggerCollection.cs new file mode 100644 index 000000000000..f37052040367 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowTriggerCollection.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_WorkflowTriggerCollection + { + // List workflow triggers + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListWorkflowTriggers() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowTriggers_List.json + // this example is just showing the usage of "WorkflowTriggers_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-resource-group"; + string name = "test-name"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // get the collection of this WorkflowTriggerResource + string workflowName = "test-workflow"; + WorkflowTriggerCollection collection = webSite.GetWorkflowTriggers(workflowName); + + // invoke the operation and iterate over the result + await foreach (WorkflowTriggerResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowTriggerData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get a workflow trigger + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetAWorkflowTrigger() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowTriggers_Get.json + // this example is just showing the usage of "WorkflowTriggers_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-resource-group"; + string name = "test-name"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // get the collection of this WorkflowTriggerResource + string workflowName = "test-workflow"; + WorkflowTriggerCollection collection = webSite.GetWorkflowTriggers(workflowName); + + // invoke the operation + string triggerName = "manual"; + WorkflowTriggerResource result = await collection.GetAsync(triggerName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowTriggerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get a workflow trigger + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetAWorkflowTrigger() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowTriggers_Get.json + // this example is just showing the usage of "WorkflowTriggers_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-resource-group"; + string name = "test-name"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // get the collection of this WorkflowTriggerResource + string workflowName = "test-workflow"; + WorkflowTriggerCollection collection = webSite.GetWorkflowTriggers(workflowName); + + // invoke the operation + string triggerName = "manual"; + bool result = await collection.ExistsAsync(triggerName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get a workflow trigger + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetAWorkflowTrigger() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowTriggers_Get.json + // this example is just showing the usage of "WorkflowTriggers_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-resource-group"; + string name = "test-name"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // get the collection of this WorkflowTriggerResource + string workflowName = "test-workflow"; + WorkflowTriggerCollection collection = webSite.GetWorkflowTriggers(workflowName); + + // invoke the operation + string triggerName = "manual"; + NullableResponse response = await collection.GetIfExistsAsync(triggerName); + WorkflowTriggerResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowTriggerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowTriggerHistoryCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowTriggerHistoryCollection.cs new file mode 100644 index 000000000000..d5cfc612d8ab --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowTriggerHistoryCollection.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_WorkflowTriggerHistoryCollection + { + // List a workflow trigger history + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListAWorkflowTriggerHistory() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowTriggerHistories_List.json + // this example is just showing the usage of "WorkflowTriggerHistories_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkflowTriggerResource created on azure + // for more information of creating WorkflowTriggerResource, please refer to the document of WorkflowTriggerResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testResourceGroup"; + string name = "test-name"; + string workflowName = "testWorkflowName"; + string triggerName = "testTriggerName"; + ResourceIdentifier workflowTriggerResourceId = WorkflowTriggerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, triggerName); + WorkflowTriggerResource workflowTrigger = client.GetWorkflowTriggerResource(workflowTriggerResourceId); + + // get the collection of this WorkflowTriggerHistoryResource + WorkflowTriggerHistoryCollection collection = workflowTrigger.GetWorkflowTriggerHistories(); + + // invoke the operation and iterate over the result + await foreach (WorkflowTriggerHistoryResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowTriggerHistoryData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get a workflow trigger history + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetAWorkflowTriggerHistory() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowTriggerHistories_Get.json + // this example is just showing the usage of "WorkflowTriggerHistories_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkflowTriggerResource created on azure + // for more information of creating WorkflowTriggerResource, please refer to the document of WorkflowTriggerResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testResourceGroup"; + string name = "test-name"; + string workflowName = "testWorkflowName"; + string triggerName = "testTriggerName"; + ResourceIdentifier workflowTriggerResourceId = WorkflowTriggerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, triggerName); + WorkflowTriggerResource workflowTrigger = client.GetWorkflowTriggerResource(workflowTriggerResourceId); + + // get the collection of this WorkflowTriggerHistoryResource + WorkflowTriggerHistoryCollection collection = workflowTrigger.GetWorkflowTriggerHistories(); + + // invoke the operation + string historyName = "08586676746934337772206998657CU22"; + WorkflowTriggerHistoryResource result = await collection.GetAsync(historyName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowTriggerHistoryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get a workflow trigger history + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetAWorkflowTriggerHistory() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowTriggerHistories_Get.json + // this example is just showing the usage of "WorkflowTriggerHistories_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkflowTriggerResource created on azure + // for more information of creating WorkflowTriggerResource, please refer to the document of WorkflowTriggerResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testResourceGroup"; + string name = "test-name"; + string workflowName = "testWorkflowName"; + string triggerName = "testTriggerName"; + ResourceIdentifier workflowTriggerResourceId = WorkflowTriggerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, triggerName); + WorkflowTriggerResource workflowTrigger = client.GetWorkflowTriggerResource(workflowTriggerResourceId); + + // get the collection of this WorkflowTriggerHistoryResource + WorkflowTriggerHistoryCollection collection = workflowTrigger.GetWorkflowTriggerHistories(); + + // invoke the operation + string historyName = "08586676746934337772206998657CU22"; + bool result = await collection.ExistsAsync(historyName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get a workflow trigger history + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetAWorkflowTriggerHistory() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowTriggerHistories_Get.json + // this example is just showing the usage of "WorkflowTriggerHistories_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkflowTriggerResource created on azure + // for more information of creating WorkflowTriggerResource, please refer to the document of WorkflowTriggerResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testResourceGroup"; + string name = "test-name"; + string workflowName = "testWorkflowName"; + string triggerName = "testTriggerName"; + ResourceIdentifier workflowTriggerResourceId = WorkflowTriggerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, triggerName); + WorkflowTriggerResource workflowTrigger = client.GetWorkflowTriggerResource(workflowTriggerResourceId); + + // get the collection of this WorkflowTriggerHistoryResource + WorkflowTriggerHistoryCollection collection = workflowTrigger.GetWorkflowTriggerHistories(); + + // invoke the operation + string historyName = "08586676746934337772206998657CU22"; + NullableResponse response = await collection.GetIfExistsAsync(historyName); + WorkflowTriggerHistoryResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowTriggerHistoryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowTriggerHistoryResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowTriggerHistoryResource.cs new file mode 100644 index 000000000000..35c16d7f75df --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowTriggerHistoryResource.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_WorkflowTriggerHistoryResource + { + // Get a workflow trigger history + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetAWorkflowTriggerHistory() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowTriggerHistories_Get.json + // this example is just showing the usage of "WorkflowTriggerHistories_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkflowTriggerHistoryResource created on azure + // for more information of creating WorkflowTriggerHistoryResource, please refer to the document of WorkflowTriggerHistoryResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testResourceGroup"; + string name = "test-name"; + string workflowName = "testWorkflowName"; + string triggerName = "testTriggerName"; + string historyName = "08586676746934337772206998657CU22"; + ResourceIdentifier workflowTriggerHistoryResourceId = WorkflowTriggerHistoryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, triggerName, historyName); + WorkflowTriggerHistoryResource workflowTriggerHistory = client.GetWorkflowTriggerHistoryResource(workflowTriggerHistoryResourceId); + + // invoke the operation + WorkflowTriggerHistoryResource result = await workflowTriggerHistory.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowTriggerHistoryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Resubmit a workflow run based on the trigger history + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Resubmit_ResubmitAWorkflowRunBasedOnTheTriggerHistory() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowTriggerHistories_Resubmit.json + // this example is just showing the usage of "WorkflowTriggerHistories_Resubmit" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkflowTriggerHistoryResource created on azure + // for more information of creating WorkflowTriggerHistoryResource, please refer to the document of WorkflowTriggerHistoryResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testResourceGroup"; + string name = "test-name"; + string workflowName = "testWorkflowName"; + string triggerName = "testTriggerName"; + string historyName = "testHistoryName"; + ResourceIdentifier workflowTriggerHistoryResourceId = WorkflowTriggerHistoryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, triggerName, historyName); + WorkflowTriggerHistoryResource workflowTriggerHistory = client.GetWorkflowTriggerHistoryResource(workflowTriggerHistoryResourceId); + + // invoke the operation + await workflowTriggerHistory.ResubmitAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowTriggerResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowTriggerResource.cs new file mode 100644 index 000000000000..7095d91a60fa --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowTriggerResource.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; +using Azure.ResourceManager.AppService.Models; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_WorkflowTriggerResource + { + // Get a workflow trigger + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetAWorkflowTrigger() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowTriggers_Get.json + // this example is just showing the usage of "WorkflowTriggers_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkflowTriggerResource created on azure + // for more information of creating WorkflowTriggerResource, please refer to the document of WorkflowTriggerResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-resource-group"; + string name = "test-name"; + string workflowName = "test-workflow"; + string triggerName = "manual"; + ResourceIdentifier workflowTriggerResourceId = WorkflowTriggerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, triggerName); + WorkflowTriggerResource workflowTrigger = client.GetWorkflowTriggerResource(workflowTriggerResourceId); + + // invoke the operation + WorkflowTriggerResource result = await workflowTrigger.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowTriggerData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get the callback URL for a trigger + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetCallbackUrl_GetTheCallbackURLForATrigger() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowTriggers_ListCallbackUrl.json + // this example is just showing the usage of "WorkflowTriggers_ListCallbackUrl" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkflowTriggerResource created on azure + // for more information of creating WorkflowTriggerResource, please refer to the document of WorkflowTriggerResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-resource-group"; + string name = "test-name"; + string workflowName = "test-workflow"; + string triggerName = "manual"; + ResourceIdentifier workflowTriggerResourceId = WorkflowTriggerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, triggerName); + WorkflowTriggerResource workflowTrigger = client.GetWorkflowTriggerResource(workflowTriggerResourceId); + + // invoke the operation + WorkflowTriggerCallbackUri result = await workflowTrigger.GetCallbackUrlAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Run a workflow trigger + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Run_RunAWorkflowTrigger() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowTriggers_Run.json + // this example is just showing the usage of "WorkflowTriggers_Run" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkflowTriggerResource created on azure + // for more information of creating WorkflowTriggerResource, please refer to the document of WorkflowTriggerResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-resource-group"; + string name = "test-name"; + string workflowName = "test-workflow"; + string triggerName = "recurrence"; + ResourceIdentifier workflowTriggerResourceId = WorkflowTriggerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, triggerName); + WorkflowTriggerResource workflowTrigger = client.GetWorkflowTriggerResource(workflowTriggerResourceId); + + // invoke the operation + await workflowTrigger.RunAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Get trigger schema + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetSchemaJson_GetTriggerSchema() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowTriggers_GetSchemaJson.json + // this example is just showing the usage of "WorkflowTriggers_GetSchemaJson" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkflowTriggerResource created on azure + // for more information of creating WorkflowTriggerResource, please refer to the document of WorkflowTriggerResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testResourceGroup"; + string name = "test-name"; + string workflowName = "testWorkflow"; + string triggerName = "testTrigger"; + ResourceIdentifier workflowTriggerResourceId = WorkflowTriggerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, triggerName); + WorkflowTriggerResource workflowTrigger = client.GetWorkflowTriggerResource(workflowTriggerResourceId); + + // invoke the operation + JsonSchema result = await workflowTrigger.GetSchemaJsonAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowVersionCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowVersionCollection.cs new file mode 100644 index 000000000000..5a536e2c9856 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowVersionCollection.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_WorkflowVersionCollection + { + // List a workflows versions + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListAWorkflowsVersions() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowVersions_List.json + // this example is just showing the usage of "WorkflowVersions_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-resource-group"; + string name = "test-name"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // get the collection of this WorkflowVersionResource + string workflowName = "test-workflow"; + WorkflowVersionCollection collection = webSite.GetWorkflowVersions(workflowName); + + // invoke the operation and iterate over the result + await foreach (WorkflowVersionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowVersionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get a workflow version + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetAWorkflowVersion() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowVersions_Get.json + // this example is just showing the usage of "WorkflowVersions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-resource-group"; + string name = "test-name"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // get the collection of this WorkflowVersionResource + string workflowName = "test-workflow"; + WorkflowVersionCollection collection = webSite.GetWorkflowVersions(workflowName); + + // invoke the operation + string versionId = "08586676824806722526"; + WorkflowVersionResource result = await collection.GetAsync(versionId); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowVersionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get a workflow version + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetAWorkflowVersion() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowVersions_Get.json + // this example is just showing the usage of "WorkflowVersions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-resource-group"; + string name = "test-name"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // get the collection of this WorkflowVersionResource + string workflowName = "test-workflow"; + WorkflowVersionCollection collection = webSite.GetWorkflowVersions(workflowName); + + // invoke the operation + string versionId = "08586676824806722526"; + bool result = await collection.ExistsAsync(versionId); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get a workflow version + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetAWorkflowVersion() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowVersions_Get.json + // this example is just showing the usage of "WorkflowVersions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebSiteResource created on azure + // for more information of creating WebSiteResource, please refer to the document of WebSiteResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-resource-group"; + string name = "test-name"; + ResourceIdentifier webSiteResourceId = WebSiteResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + WebSiteResource webSite = client.GetWebSiteResource(webSiteResourceId); + + // get the collection of this WorkflowVersionResource + string workflowName = "test-workflow"; + WorkflowVersionCollection collection = webSite.GetWorkflowVersions(workflowName); + + // invoke the operation + string versionId = "08586676824806722526"; + NullableResponse response = await collection.GetIfExistsAsync(versionId); + WorkflowVersionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowVersionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowVersionResource.cs b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowVersionResource.cs new file mode 100644 index 000000000000..b167b0672b3e --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/samples/Generated/Samples/Sample_WorkflowVersionResource.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Samples +{ + public partial class Sample_WorkflowVersionResource + { + // Get a workflow version + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetAWorkflowVersion() + { + // Generated from example definition: specification/web/resource-manager/Microsoft.Web/stable/2023-01-01/examples/WorkflowVersions_Get.json + // this example is just showing the usage of "WorkflowVersions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkflowVersionResource created on azure + // for more information of creating WorkflowVersionResource, please refer to the document of WorkflowVersionResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "test-resource-group"; + string name = "test-name"; + string workflowName = "test-workflow"; + string versionId = "08586676824806722526"; + ResourceIdentifier workflowVersionResourceId = WorkflowVersionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name, workflowName, versionId); + WorkflowVersionResource workflowVersion = client.GetWorkflowVersionResource(workflowVersionResourceId); + + // invoke the operation + WorkflowVersionResource result = await workflowVersion.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + WorkflowVersionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceDomainResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceDomainResource.cs index b91111998bdd..7817d9818f7f 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceDomainResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceDomainResource.cs @@ -405,5 +405,65 @@ public virtual Response Renew(CancellationToken cancellationToken = default) throw; } } + + /// + /// Transfer out domain to another registrar + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/transferOut + /// + /// + /// Operation Id + /// Domains_TransferOut + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> TransferOutAsync(CancellationToken cancellationToken = default) + { + using var scope = _appServiceDomainDomainsClientDiagnostics.CreateScope("AppServiceDomainResource.TransferOut"); + scope.Start(); + try + { + var response = await _appServiceDomainDomainsRestClient.TransferOutAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new AppServiceDomainResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Transfer out domain to another registrar + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/transferOut + /// + /// + /// Operation Id + /// Domains_TransferOut + /// + /// + /// + /// The cancellation token to use. + public virtual Response TransferOut(CancellationToken cancellationToken = default) + { + using var scope = _appServiceDomainDomainsClientDiagnostics.CreateScope("AppServiceDomainResource.TransferOut"); + scope.Start(); + try + { + var response = _appServiceDomainDomainsRestClient.TransferOut(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new AppServiceDomainResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceEnvironmentData.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceEnvironmentData.cs index 472aadf1b3a9..7a526bd1a68f 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceEnvironmentData.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceEnvironmentData.cs @@ -50,10 +50,14 @@ public AppServiceEnvironmentData(AzureLocation location) : base(location) /// Custom settings for changing the behavior of the App Service Environment. /// User added ip ranges to whitelist on ASE db. /// Flag that displays whether an ASE has linux workers or not. + /// Upgrade Preference. /// Dedicated Host Count. /// Whether or not this App Service Environment is zone-redundant. + /// Full view of the custom domain suffix configuration for ASEv3. + /// Full view of networking configuration for an ASE. + /// Whether an upgrade is available for this App Service Environment. /// Kind of resource. - internal AppServiceEnvironmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ProvisioningState? provisioningState, HostingEnvironmentStatus? status, AppServiceVirtualNetworkProfile virtualNetwork, LoadBalancingMode? internalLoadBalancingMode, string multiSize, int? multiRoleCount, int? ipSslAddressCount, string dnsSuffix, int? maximumNumberOfMachines, int? frontEndScaleFactor, bool? isSuspended, IList clusterSettings, IList userWhitelistedIPRanges, bool? hasLinuxWorkers, int? dedicatedHostCount, bool? isZoneRedundant, string kind) : base(id, name, resourceType, systemData, tags, location) + internal AppServiceEnvironmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ProvisioningState? provisioningState, HostingEnvironmentStatus? status, AppServiceVirtualNetworkProfile virtualNetwork, LoadBalancingMode? internalLoadBalancingMode, string multiSize, int? multiRoleCount, int? ipSslAddressCount, string dnsSuffix, int? maximumNumberOfMachines, int? frontEndScaleFactor, bool? isSuspended, IList clusterSettings, IList userWhitelistedIPRanges, bool? hasLinuxWorkers, UpgradePreference? upgradePreference, int? dedicatedHostCount, bool? isZoneRedundant, CustomDnsSuffixConfigurationData customDnsSuffixConfiguration, AseV3NetworkingConfigurationData networkingConfiguration, UpgradeAvailability? upgradeAvailability, string kind) : base(id, name, resourceType, systemData, tags, location) { ProvisioningState = provisioningState; Status = status; @@ -69,8 +73,12 @@ internal AppServiceEnvironmentData(ResourceIdentifier id, string name, ResourceT ClusterSettings = clusterSettings; UserWhitelistedIPRanges = userWhitelistedIPRanges; HasLinuxWorkers = hasLinuxWorkers; + UpgradePreference = upgradePreference; DedicatedHostCount = dedicatedHostCount; IsZoneRedundant = isZoneRedundant; + CustomDnsSuffixConfiguration = customDnsSuffixConfiguration; + NetworkingConfiguration = networkingConfiguration; + UpgradeAvailability = upgradeAvailability; Kind = kind; } @@ -105,10 +113,18 @@ internal AppServiceEnvironmentData(ResourceIdentifier id, string name, ResourceT public IList UserWhitelistedIPRanges { get; } /// Flag that displays whether an ASE has linux workers or not. public bool? HasLinuxWorkers { get; } + /// Upgrade Preference. + public UpgradePreference? UpgradePreference { get; set; } /// Dedicated Host Count. public int? DedicatedHostCount { get; set; } /// Whether or not this App Service Environment is zone-redundant. public bool? IsZoneRedundant { get; set; } + /// Full view of the custom domain suffix configuration for ASEv3. + public CustomDnsSuffixConfigurationData CustomDnsSuffixConfiguration { get; set; } + /// Full view of networking configuration for an ASE. + public AseV3NetworkingConfigurationData NetworkingConfiguration { get; set; } + /// Whether an upgrade is available for this App Service Environment. + public UpgradeAvailability? UpgradeAvailability { get; } /// Kind of resource. public string Kind { get; set; } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceEnvironmentResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceEnvironmentResource.cs index fafc5bb27471..21c329874967 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceEnvironmentResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServiceEnvironmentResource.cs @@ -160,6 +160,13 @@ public virtual Response GetHostingEnvironmen return GetHostingEnvironmentDetectors().Get(detectorName, startTime, endTime, timeGrain, cancellationToken); } + /// Gets an object representing a CustomDnsSuffixConfigurationResource along with the instance operations that can be performed on it in the AppServiceEnvironment. + /// Returns a object. + public virtual CustomDnsSuffixConfigurationResource GetCustomDnsSuffixConfiguration() + { + return new CustomDnsSuffixConfigurationResource(Client, Id.AppendChildResource("configurations", "customdnssuffix")); + } + /// Gets an object representing a AseV3NetworkingConfigurationResource along with the instance operations that can be performed on it in the AppServiceEnvironment. /// Returns a object. public virtual AseV3NetworkingConfigurationResource GetAseV3NetworkingConfiguration() @@ -799,6 +806,134 @@ public virtual Pageable GetInboundNetworkDependencie return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, InboundEnvironmentEndpoint.DeserializeInboundEnvironmentEndpoint, _appServiceEnvironmentClientDiagnostics, Pipeline, "AppServiceEnvironmentResource.GetInboundNetworkDependenciesEndpoints", "value", "nextLink", cancellationToken); } + /// + /// Send a test notification that an upgrade is available for this App Service Environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/testUpgradeAvailableNotification + /// + /// + /// Operation Id + /// AppServiceEnvironments_TestUpgradeAvailableNotification + /// + /// + /// + /// The cancellation token to use. + public virtual async Task TestUpgradeAvailableNotificationAsync(CancellationToken cancellationToken = default) + { + using var scope = _appServiceEnvironmentClientDiagnostics.CreateScope("AppServiceEnvironmentResource.TestUpgradeAvailableNotification"); + scope.Start(); + try + { + var response = await _appServiceEnvironmentRestClient.TestUpgradeAvailableNotificationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Send a test notification that an upgrade is available for this App Service Environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/testUpgradeAvailableNotification + /// + /// + /// Operation Id + /// AppServiceEnvironments_TestUpgradeAvailableNotification + /// + /// + /// + /// The cancellation token to use. + public virtual Response TestUpgradeAvailableNotification(CancellationToken cancellationToken = default) + { + using var scope = _appServiceEnvironmentClientDiagnostics.CreateScope("AppServiceEnvironmentResource.TestUpgradeAvailableNotification"); + scope.Start(); + try + { + var response = _appServiceEnvironmentRestClient.TestUpgradeAvailableNotification(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Initiate an upgrade of an App Service Environment if one is available. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/upgrade + /// + /// + /// Operation Id + /// AppServiceEnvironments_Upgrade + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task UpgradeAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _appServiceEnvironmentClientDiagnostics.CreateScope("AppServiceEnvironmentResource.Upgrade"); + scope.Start(); + try + { + var response = await _appServiceEnvironmentRestClient.UpgradeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new AppServiceArmOperation(_appServiceEnvironmentClientDiagnostics, Pipeline, _appServiceEnvironmentRestClient.CreateUpgradeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Initiate an upgrade of an App Service Environment if one is available. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/upgrade + /// + /// + /// Operation Id + /// AppServiceEnvironments_Upgrade + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Upgrade(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _appServiceEnvironmentClientDiagnostics.CreateScope("AppServiceEnvironmentResource.Upgrade"); + scope.Start(); + try + { + var response = _appServiceEnvironmentRestClient.Upgrade(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new AppServiceArmOperation(_appServiceEnvironmentClientDiagnostics, Pipeline, _appServiceEnvironmentRestClient.CreateUpgradeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Description for List all currently running operations on the App Service Environment. /// diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServicePlanData.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServicePlanData.cs index c4e3c2d39558..57477eac865b 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServicePlanData.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AppServicePlanData.cs @@ -40,6 +40,7 @@ public AppServicePlanData(AzureLocation location) : base(location) /// App Service plan subscription. /// Specification for the App Service Environment to use for the App Service plan. /// Maximum number of instances that can be assigned to this App Service plan. + /// The number of instances that are assigned to this App Service plan. /// Geographical location for the App Service plan. /// /// If <code>true</code>, apps assigned to this App Service plan can be scaled independently. @@ -64,7 +65,7 @@ public AppServicePlanData(AzureLocation location) : base(location) /// If <code>false</code>, this App Service Plan will not perform availability zone balancing. /// /// Kind of resource. - internal AppServicePlanData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, AppServiceSkuDescription sku, ExtendedLocation extendedLocation, string workerTierName, AppServicePlanStatus? status, string subscription, HostingEnvironmentProfile hostingEnvironmentProfile, int? maximumNumberOfWorkers, string geoRegion, bool? isPerSiteScaling, bool? isElasticScaleEnabled, int? maximumElasticWorkerCount, int? numberOfSites, bool? isSpot, DateTimeOffset? spotExpireOn, DateTimeOffset? freeOfferExpireOn, string resourceGroup, bool? isReserved, bool? isXenon, bool? isHyperV, int? targetWorkerCount, int? targetWorkerSizeId, ProvisioningState? provisioningState, KubeEnvironmentProfile kubeEnvironmentProfile, bool? isZoneRedundant, string kind) : base(id, name, resourceType, systemData, tags, location) + internal AppServicePlanData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, AppServiceSkuDescription sku, ExtendedLocation extendedLocation, string workerTierName, AppServicePlanStatus? status, string subscription, HostingEnvironmentProfile hostingEnvironmentProfile, int? maximumNumberOfWorkers, int? numberOfWorkers, string geoRegion, bool? isPerSiteScaling, bool? isElasticScaleEnabled, int? maximumElasticWorkerCount, int? numberOfSites, bool? isSpot, DateTimeOffset? spotExpireOn, DateTimeOffset? freeOfferExpireOn, string resourceGroup, bool? isReserved, bool? isXenon, bool? isHyperV, int? targetWorkerCount, int? targetWorkerSizeId, ProvisioningState? provisioningState, KubeEnvironmentProfile kubeEnvironmentProfile, bool? isZoneRedundant, string kind) : base(id, name, resourceType, systemData, tags, location) { Sku = sku; ExtendedLocation = extendedLocation; @@ -73,6 +74,7 @@ internal AppServicePlanData(ResourceIdentifier id, string name, ResourceType res Subscription = subscription; HostingEnvironmentProfile = hostingEnvironmentProfile; MaximumNumberOfWorkers = maximumNumberOfWorkers; + NumberOfWorkers = numberOfWorkers; GeoRegion = geoRegion; IsPerSiteScaling = isPerSiteScaling; IsElasticScaleEnabled = isElasticScaleEnabled; @@ -107,6 +109,8 @@ internal AppServicePlanData(ResourceIdentifier id, string name, ResourceType res public HostingEnvironmentProfile HostingEnvironmentProfile { get; set; } /// Maximum number of instances that can be assigned to this App Service plan. public int? MaximumNumberOfWorkers { get; } + /// The number of instances that are assigned to this App Service plan. + public int? NumberOfWorkers { get; } /// Geographical location for the App Service plan. public string GeoRegion { get; } /// diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ArmAppServiceModelFactory.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ArmAppServiceModelFactory.cs index 87c034749a91..3748aa781876 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ArmAppServiceModelFactory.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ArmAppServiceModelFactory.cs @@ -9,7 +9,6 @@ using System.Collections.Generic; using System.Linq; using System.Net; -using Azure; using Azure.Core; using Azure.ResourceManager.AppService; using Azure.ResourceManager.Models; @@ -210,31 +209,21 @@ public static SiteSeal SiteSeal(string html = null) } /// Initializes a new instance of CertificateOrderAction. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. /// Action type. /// Time at which the certificate action was performed. - /// Kind of resource. /// A new instance for mocking. - public static CertificateOrderAction CertificateOrderAction(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, CertificateOrderActionType? actionType = null, DateTimeOffset? createdOn = null, string kind = null) + public static CertificateOrderAction CertificateOrderAction(CertificateOrderActionType? actionType = null, DateTimeOffset? createdOn = null) { - return new CertificateOrderAction(id, name, resourceType, systemData, actionType, createdOn, kind); + return new CertificateOrderAction(actionType, createdOn); } /// Initializes a new instance of AppServiceCertificateEmail. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. /// Email id. /// Time stamp. - /// Kind of resource. /// A new instance for mocking. - public static AppServiceCertificateEmail AppServiceCertificateEmail(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string emailId = null, DateTimeOffset? timeStamp = null, string kind = null) + public static AppServiceCertificateEmail AppServiceCertificateEmail(string emailId = null, DateTimeOffset? timeStamp = null) { - return new AppServiceCertificateEmail(id, name, resourceType, systemData, emailId, timeStamp, kind); + return new AppServiceCertificateEmail(emailId, timeStamp); } /// Initializes a new instance of AppServiceDetectorData. @@ -577,17 +566,21 @@ public static TldLegalAgreement TldLegalAgreement(string agreementKey = null, st /// Custom settings for changing the behavior of the App Service Environment. /// User added ip ranges to whitelist on ASE db. /// Flag that displays whether an ASE has linux workers or not. + /// Upgrade Preference. /// Dedicated Host Count. /// Whether or not this App Service Environment is zone-redundant. + /// Full view of the custom domain suffix configuration for ASEv3. + /// Full view of networking configuration for an ASE. + /// Whether an upgrade is available for this App Service Environment. /// Kind of resource. /// A new instance for mocking. - public static AppServiceEnvironmentData AppServiceEnvironmentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ProvisioningState? provisioningState = null, HostingEnvironmentStatus? status = null, AppServiceVirtualNetworkProfile virtualNetwork = null, LoadBalancingMode? internalLoadBalancingMode = null, string multiSize = null, int? multiRoleCount = null, int? ipSslAddressCount = null, string dnsSuffix = null, int? maximumNumberOfMachines = null, int? frontEndScaleFactor = null, bool? isSuspended = null, IEnumerable clusterSettings = null, IEnumerable userWhitelistedIPRanges = null, bool? hasLinuxWorkers = null, int? dedicatedHostCount = null, bool? isZoneRedundant = null, string kind = null) + public static AppServiceEnvironmentData AppServiceEnvironmentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ProvisioningState? provisioningState = null, HostingEnvironmentStatus? status = null, AppServiceVirtualNetworkProfile virtualNetwork = null, LoadBalancingMode? internalLoadBalancingMode = null, string multiSize = null, int? multiRoleCount = null, int? ipSslAddressCount = null, string dnsSuffix = null, int? maximumNumberOfMachines = null, int? frontEndScaleFactor = null, bool? isSuspended = null, IEnumerable clusterSettings = null, IEnumerable userWhitelistedIPRanges = null, bool? hasLinuxWorkers = null, UpgradePreference? upgradePreference = null, int? dedicatedHostCount = null, bool? isZoneRedundant = null, CustomDnsSuffixConfigurationData customDnsSuffixConfiguration = null, AseV3NetworkingConfigurationData networkingConfiguration = null, UpgradeAvailability? upgradeAvailability = null, string kind = null) { tags ??= new Dictionary(); clusterSettings ??= new List(); userWhitelistedIPRanges ??= new List(); - return new AppServiceEnvironmentData(id, name, resourceType, systemData, tags, location, provisioningState, status, virtualNetwork, internalLoadBalancingMode, multiSize, multiRoleCount, ipSslAddressCount, dnsSuffix, maximumNumberOfMachines, frontEndScaleFactor, isSuspended, clusterSettings?.ToList(), userWhitelistedIPRanges?.ToList(), hasLinuxWorkers, dedicatedHostCount, isZoneRedundant, kind); + return new AppServiceEnvironmentData(id, name, resourceType, systemData, tags, location, provisioningState, status, virtualNetwork, internalLoadBalancingMode, multiSize, multiRoleCount, ipSslAddressCount, dnsSuffix, maximumNumberOfMachines, frontEndScaleFactor, isSuspended, clusterSettings?.ToList(), userWhitelistedIPRanges?.ToList(), hasLinuxWorkers, upgradePreference, dedicatedHostCount, isZoneRedundant, customDnsSuffixConfiguration, networkingConfiguration, upgradeAvailability, kind); } /// Initializes a new instance of AppServiceEnvironmentProperties. @@ -608,15 +601,19 @@ public static AppServiceEnvironmentData AppServiceEnvironmentData(ResourceIdenti /// Custom settings for changing the behavior of the App Service Environment. /// User added ip ranges to whitelist on ASE db. /// Flag that displays whether an ASE has linux workers or not. + /// Upgrade Preference. /// Dedicated Host Count. /// Whether or not this App Service Environment is zone-redundant. + /// Full view of the custom domain suffix configuration for ASEv3. + /// Full view of networking configuration for an ASE. + /// Whether an upgrade is available for this App Service Environment. /// A new instance for mocking. - public static AppServiceEnvironmentProperties AppServiceEnvironmentProperties(ProvisioningState? provisioningState = null, HostingEnvironmentStatus? status = null, AppServiceVirtualNetworkProfile virtualNetwork = null, LoadBalancingMode? internalLoadBalancingMode = null, string multiSize = null, int? multiRoleCount = null, int? ipSslAddressCount = null, string dnsSuffix = null, int? maximumNumberOfMachines = null, int? frontEndScaleFactor = null, bool? isSuspended = null, IEnumerable clusterSettings = null, IEnumerable userWhitelistedIPRanges = null, bool? hasLinuxWorkers = null, int? dedicatedHostCount = null, bool? isZoneRedundant = null) + public static AppServiceEnvironmentProperties AppServiceEnvironmentProperties(ProvisioningState? provisioningState = null, HostingEnvironmentStatus? status = null, AppServiceVirtualNetworkProfile virtualNetwork = null, LoadBalancingMode? internalLoadBalancingMode = null, string multiSize = null, int? multiRoleCount = null, int? ipSslAddressCount = null, string dnsSuffix = null, int? maximumNumberOfMachines = null, int? frontEndScaleFactor = null, bool? isSuspended = null, IEnumerable clusterSettings = null, IEnumerable userWhitelistedIPRanges = null, bool? hasLinuxWorkers = null, UpgradePreference? upgradePreference = null, int? dedicatedHostCount = null, bool? isZoneRedundant = null, CustomDnsSuffixConfigurationData customDnsSuffixConfiguration = null, AseV3NetworkingConfigurationData networkingConfiguration = null, UpgradeAvailability? upgradeAvailability = null) { clusterSettings ??= new List(); userWhitelistedIPRanges ??= new List(); - return new AppServiceEnvironmentProperties(provisioningState, status, virtualNetwork, internalLoadBalancingMode, multiSize, multiRoleCount, ipSslAddressCount, dnsSuffix, maximumNumberOfMachines, frontEndScaleFactor, isSuspended, clusterSettings?.ToList(), userWhitelistedIPRanges?.ToList(), hasLinuxWorkers, dedicatedHostCount, isZoneRedundant); + return new AppServiceEnvironmentProperties(provisioningState, status, virtualNetwork, internalLoadBalancingMode, multiSize, multiRoleCount, ipSslAddressCount, dnsSuffix, maximumNumberOfMachines, frontEndScaleFactor, isSuspended, clusterSettings?.ToList(), userWhitelistedIPRanges?.ToList(), hasLinuxWorkers, upgradePreference, dedicatedHostCount, isZoneRedundant, customDnsSuffixConfiguration, networkingConfiguration, upgradeAvailability); } /// Initializes a new instance of AppServiceVirtualNetworkProfile. @@ -630,6 +627,48 @@ public static AppServiceVirtualNetworkProfile AppServiceVirtualNetworkProfile(Re return new AppServiceVirtualNetworkProfile(id, name, resourceType, subnet); } + /// Initializes a new instance of CustomDnsSuffixConfigurationData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// + /// The default custom domain suffix to use for all sites deployed on the ASE. + /// The URL referencing the Azure Key Vault certificate secret that should be used as the default SSL/TLS certificate for sites with the custom domain suffix. + /// The user-assigned identity to use for resolving the key vault certificate reference. If not specified, the system-assigned ASE identity will be used if available. + /// Kind of resource. + /// A new instance for mocking. + public static CustomDnsSuffixConfigurationData CustomDnsSuffixConfigurationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, CustomDnsSuffixProvisioningState? provisioningState = null, string provisioningDetails = null, string dnsSuffix = null, Uri certificateUri = null, string keyVaultReferenceIdentity = null, string kind = null) + { + return new CustomDnsSuffixConfigurationData(id, name, resourceType, systemData, provisioningState, provisioningDetails, dnsSuffix, certificateUri, keyVaultReferenceIdentity, kind); + } + + /// Initializes a new instance of AseV3NetworkingConfigurationData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// + /// + /// + /// Property to enable and disable new private endpoint connection creation on ASE. + /// Property to enable and disable FTP on ASEV3. + /// Property to enable and disable Remote Debug on ASEV3. + /// Customer provided Inbound IP Address. Only able to be set on Ase create. + /// Kind of resource. + /// A new instance for mocking. + public static AseV3NetworkingConfigurationData AseV3NetworkingConfigurationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable windowsOutboundIPAddresses = null, IEnumerable linuxOutboundIPAddresses = null, IEnumerable externalInboundIPAddresses = null, IEnumerable internalInboundIPAddresses = null, bool? allowNewPrivateEndpointConnections = null, bool? ftpEnabled = null, bool? remoteDebugEnabled = null, string inboundIPAddressOverride = null, string kind = null) + { + windowsOutboundIPAddresses ??= new List(); + linuxOutboundIPAddresses ??= new List(); + externalInboundIPAddresses ??= new List(); + internalInboundIPAddresses ??= new List(); + + return new AseV3NetworkingConfigurationData(id, name, resourceType, systemData, windowsOutboundIPAddresses?.ToList(), linuxOutboundIPAddresses?.ToList(), externalInboundIPAddresses?.ToList(), internalInboundIPAddresses?.ToList(), allowNewPrivateEndpointConnections, ftpEnabled, remoteDebugEnabled, inboundIPAddressOverride, kind); + } + /// Initializes a new instance of AppServiceEnvironmentPatch. /// The id. /// The name. @@ -652,16 +691,20 @@ public static AppServiceVirtualNetworkProfile AppServiceVirtualNetworkProfile(Re /// Custom settings for changing the behavior of the App Service Environment. /// User added ip ranges to whitelist on ASE db. /// Flag that displays whether an ASE has linux workers or not. + /// Upgrade Preference. /// Dedicated Host Count. /// Whether or not this App Service Environment is zone-redundant. + /// Full view of the custom domain suffix configuration for ASEv3. + /// Full view of networking configuration for an ASE. + /// Whether an upgrade is available for this App Service Environment. /// Kind of resource. /// A new instance for mocking. - public static AppServiceEnvironmentPatch AppServiceEnvironmentPatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ProvisioningState? provisioningState = null, HostingEnvironmentStatus? status = null, AppServiceVirtualNetworkProfile virtualNetwork = null, LoadBalancingMode? internalLoadBalancingMode = null, string multiSize = null, int? multiRoleCount = null, int? ipSslAddressCount = null, string dnsSuffix = null, int? maximumNumberOfMachines = null, int? frontEndScaleFactor = null, bool? isSuspended = null, IEnumerable clusterSettings = null, IEnumerable userWhitelistedIPRanges = null, bool? hasLinuxWorkers = null, int? dedicatedHostCount = null, bool? isZoneRedundant = null, string kind = null) + public static AppServiceEnvironmentPatch AppServiceEnvironmentPatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ProvisioningState? provisioningState = null, HostingEnvironmentStatus? status = null, AppServiceVirtualNetworkProfile virtualNetwork = null, LoadBalancingMode? internalLoadBalancingMode = null, string multiSize = null, int? multiRoleCount = null, int? ipSslAddressCount = null, string dnsSuffix = null, int? maximumNumberOfMachines = null, int? frontEndScaleFactor = null, bool? isSuspended = null, IEnumerable clusterSettings = null, IEnumerable userWhitelistedIPRanges = null, bool? hasLinuxWorkers = null, UpgradePreference? upgradePreference = null, int? dedicatedHostCount = null, bool? isZoneRedundant = null, CustomDnsSuffixConfigurationData customDnsSuffixConfiguration = null, AseV3NetworkingConfigurationData networkingConfiguration = null, UpgradeAvailability? upgradeAvailability = null, string kind = null) { clusterSettings ??= new List(); userWhitelistedIPRanges ??= new List(); - return new AppServiceEnvironmentPatch(id, name, resourceType, systemData, provisioningState, status, virtualNetwork, internalLoadBalancingMode, multiSize, multiRoleCount, ipSslAddressCount, dnsSuffix, maximumNumberOfMachines, frontEndScaleFactor, isSuspended, clusterSettings?.ToList(), userWhitelistedIPRanges?.ToList(), hasLinuxWorkers, dedicatedHostCount, isZoneRedundant, kind); + return new AppServiceEnvironmentPatch(id, name, resourceType, systemData, provisioningState, status, virtualNetwork, internalLoadBalancingMode, multiSize, multiRoleCount, ipSslAddressCount, dnsSuffix, maximumNumberOfMachines, frontEndScaleFactor, isSuspended, clusterSettings?.ToList(), userWhitelistedIPRanges?.ToList(), hasLinuxWorkers, upgradePreference, dedicatedHostCount, isZoneRedundant, customDnsSuffixConfiguration, networkingConfiguration, upgradeAvailability, kind); } /// Initializes a new instance of StampCapacity. @@ -701,36 +744,14 @@ public static StampCapacity StampCapacity(string name = null, long? availableCap /// Additional virtual IPs. /// Kind of resource. /// A new instance for mocking. - public static AppServiceEnvironmentAddressResult AppServiceEnvironmentAddressResult(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IPAddress serviceIPAddress = null, IPAddress internalIPAddress = null, IEnumerable outboundIPAddresses = null, IEnumerable virtualIPMappings = null, string kind = null) + public static AppServiceEnvironmentAddressResult AppServiceEnvironmentAddressResult(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, System.Net.IPAddress serviceIPAddress = null, System.Net.IPAddress internalIPAddress = null, IEnumerable outboundIPAddresses = null, IEnumerable virtualIPMappings = null, string kind = null) { - outboundIPAddresses ??= new List(); + outboundIPAddresses ??= new List(); virtualIPMappings ??= new List(); return new AppServiceEnvironmentAddressResult(id, name, resourceType, systemData, serviceIPAddress, internalIPAddress, outboundIPAddresses?.ToList(), virtualIPMappings?.ToList(), kind); } - /// Initializes a new instance of AseV3NetworkingConfigurationData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// - /// - /// - /// - /// Property to enable and disable new private endpoint connection creation on ASE. - /// Kind of resource. - /// A new instance for mocking. - public static AseV3NetworkingConfigurationData AseV3NetworkingConfigurationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable windowsOutboundIPAddresses = null, IEnumerable linuxOutboundIPAddresses = null, IEnumerable externalInboundIPAddresses = null, IEnumerable internalInboundIPAddresses = null, bool? allowNewPrivateEndpointConnections = null, string kind = null) - { - windowsOutboundIPAddresses ??= new List(); - linuxOutboundIPAddresses ??= new List(); - externalInboundIPAddresses ??= new List(); - internalInboundIPAddresses ??= new List(); - - return new AseV3NetworkingConfigurationData(id, name, resourceType, systemData, windowsOutboundIPAddresses?.ToList(), linuxOutboundIPAddresses?.ToList(), externalInboundIPAddresses?.ToList(), internalInboundIPAddresses?.ToList(), allowNewPrivateEndpointConnections, kind); - } - /// Initializes a new instance of HostingEnvironmentDiagnostics. /// Name/identifier of the diagnostics. /// Diagnostics output. @@ -842,9 +863,9 @@ public static AppServiceUsage AppServiceUsage(ResourceIdentifier id = null, stri /// Time when operation will expire. /// Applicable only for stamp operation ids. /// A new instance for mocking. - public static AppServiceOperation AppServiceOperation(string id = null, string name = null, AppServiceOperationStatus? status = null, IEnumerable errors = null, DateTimeOffset? createdOn = null, DateTimeOffset? modifiedOn = null, DateTimeOffset? expireOn = null, Guid? geoMasterOperationId = null) + public static AppServiceOperation AppServiceOperation(string id = null, string name = null, AppServiceOperationStatus? status = null, IEnumerable errors = null, DateTimeOffset? createdOn = null, DateTimeOffset? modifiedOn = null, DateTimeOffset? expireOn = null, Guid? geoMasterOperationId = null) { - errors ??= new List(); + errors ??= new List(); return new AppServiceOperation(id, name, status, errors?.ToList(), createdOn, modifiedOn, expireOn, geoMasterOperationId); } @@ -877,7 +898,7 @@ public static AppServiceEndpointDependency AppServiceEndpointDependency(string d /// The time in milliseconds it takes for a TCP connection to be created from the App Service Environment to this IpAddress at this Port. /// Whether it is possible to create a TCP connection from the App Service Environment to this IpAddress at this Port. /// A new instance for mocking. - public static AppServiceEndpointDetail AppServiceEndpointDetail(IPAddress ipAddress = null, int? port = null, double? latency = null, bool? isAccessible = null) + public static AppServiceEndpointDetail AppServiceEndpointDetail(System.Net.IPAddress ipAddress = null, int? port = null, double? latency = null, bool? isAccessible = null) { return new AppServiceEndpointDetail(ipAddress, port, latency, isAccessible); } @@ -893,9 +914,9 @@ public static AppServiceEndpointDetail AppServiceEndpointDetail(IPAddress ipAddr /// Private IPAddresses mapped to the remote private endpoint. /// Kind of resource. /// A new instance for mocking. - public static RemotePrivateEndpointConnectionARMResourceData RemotePrivateEndpointConnectionARMResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string provisioningState = null, ResourceIdentifier privateEndpointId = null, PrivateLinkConnectionState privateLinkServiceConnectionState = null, IEnumerable ipAddresses = null, string kind = null) + public static RemotePrivateEndpointConnectionARMResourceData RemotePrivateEndpointConnectionARMResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string provisioningState = null, ResourceIdentifier privateEndpointId = null, PrivateLinkConnectionState privateLinkServiceConnectionState = null, IEnumerable ipAddresses = null, string kind = null) { - ipAddresses ??= new List(); + ipAddresses ??= new List(); return new RemotePrivateEndpointConnectionARMResourceData(id, name, resourceType, systemData, provisioningState, privateEndpointId != null ? ResourceManagerModelFactory.SubResource(privateEndpointId) : null, privateLinkServiceConnectionState, ipAddresses?.ToList(), kind); } @@ -952,6 +973,7 @@ public static AppServicePrivateLinkResourceProperties AppServicePrivateLinkResou /// App Service plan subscription. /// Specification for the App Service Environment to use for the App Service plan. /// Maximum number of instances that can be assigned to this App Service plan. + /// The number of instances that are assigned to this App Service plan. /// Geographical location for the App Service plan. /// /// If <code>true</code>, apps assigned to this App Service plan can be scaled independently. @@ -977,11 +999,11 @@ public static AppServicePrivateLinkResourceProperties AppServicePrivateLinkResou /// /// Kind of resource. /// A new instance for mocking. - public static AppServicePlanData AppServicePlanData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, AppServiceSkuDescription sku = null, ExtendedLocation extendedLocation = null, string workerTierName = null, AppServicePlanStatus? status = null, string subscription = null, HostingEnvironmentProfile hostingEnvironmentProfile = null, int? maximumNumberOfWorkers = null, string geoRegion = null, bool? isPerSiteScaling = null, bool? isElasticScaleEnabled = null, int? maximumElasticWorkerCount = null, int? numberOfSites = null, bool? isSpot = null, DateTimeOffset? spotExpireOn = null, DateTimeOffset? freeOfferExpireOn = null, string resourceGroup = null, bool? isReserved = null, bool? isXenon = null, bool? isHyperV = null, int? targetWorkerCount = null, int? targetWorkerSizeId = null, ProvisioningState? provisioningState = null, KubeEnvironmentProfile kubeEnvironmentProfile = null, bool? isZoneRedundant = null, string kind = null) + public static AppServicePlanData AppServicePlanData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, AppServiceSkuDescription sku = null, ExtendedLocation extendedLocation = null, string workerTierName = null, AppServicePlanStatus? status = null, string subscription = null, HostingEnvironmentProfile hostingEnvironmentProfile = null, int? maximumNumberOfWorkers = null, int? numberOfWorkers = null, string geoRegion = null, bool? isPerSiteScaling = null, bool? isElasticScaleEnabled = null, int? maximumElasticWorkerCount = null, int? numberOfSites = null, bool? isSpot = null, DateTimeOffset? spotExpireOn = null, DateTimeOffset? freeOfferExpireOn = null, string resourceGroup = null, bool? isReserved = null, bool? isXenon = null, bool? isHyperV = null, int? targetWorkerCount = null, int? targetWorkerSizeId = null, ProvisioningState? provisioningState = null, KubeEnvironmentProfile kubeEnvironmentProfile = null, bool? isZoneRedundant = null, string kind = null) { tags ??= new Dictionary(); - return new AppServicePlanData(id, name, resourceType, systemData, tags, location, sku, extendedLocation, workerTierName, status, subscription, hostingEnvironmentProfile, maximumNumberOfWorkers, geoRegion, isPerSiteScaling, isElasticScaleEnabled, maximumElasticWorkerCount, numberOfSites, isSpot, spotExpireOn, freeOfferExpireOn, resourceGroup, isReserved, isXenon, isHyperV, targetWorkerCount, targetWorkerSizeId, provisioningState, kubeEnvironmentProfile, isZoneRedundant, kind); + return new AppServicePlanData(id, name, resourceType, systemData, tags, location, sku, extendedLocation, workerTierName, status, subscription, hostingEnvironmentProfile, maximumNumberOfWorkers, numberOfWorkers, geoRegion, isPerSiteScaling, isElasticScaleEnabled, maximumElasticWorkerCount, numberOfSites, isSpot, spotExpireOn, freeOfferExpireOn, resourceGroup, isReserved, isXenon, isHyperV, targetWorkerCount, targetWorkerSizeId, provisioningState, kubeEnvironmentProfile, isZoneRedundant, kind); } /// Initializes a new instance of HostingEnvironmentProfile. @@ -1029,7 +1051,13 @@ public static KubeEnvironmentProfile KubeEnvironmentProfile(ResourceIdentifier i /// Obsolete: Hyper-V sandbox. /// Hyper-V sandbox. /// Last time the app was modified, in UTC. Read-only. + /// Virtual Network Route All enabled. This causes all outbound traffic to have Virtual Network Security Groups and User Defined Routes applied. + /// To enable pulling image over Virtual Network. + /// To enable accessing content over virtual network. /// Configuration of the app. + /// Dapr configuration of the app. + /// Workload profile name for function app to execute on. + /// Function app resource requirements. /// Azure Traffic Manager hostnames associated with the app. Read-only. /// <code>true</code> to stop SCM (KUDU) site when the app is stopped; otherwise, <code>false</code>. The default is <code>false</code>. /// Specifies which deployment slot this app will swap into. Read-only. @@ -1068,15 +1096,17 @@ public static KubeEnvironmentProfile KubeEnvironmentProfile(ResourceIdentifier i /// /// Site redundancy mode. /// Specifies an operation id if this site has a pending operation. + /// Property to allow or block all public traffic. Allowed Values: 'Enabled', 'Disabled' or an empty string. /// Checks if Customer provided storage account is required. /// Identity to use for Key Vault Reference authentication. /// /// Azure Resource Manager ID of the Virtual network and subnet to be joined by Regional VNET Integration. /// This must be of the form /subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName} /// + /// Azure Resource Manager ID of the customer's selected Managed Environment on which to host this app. This must be of the form /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.App/managedEnvironments/{managedEnvironmentName}. /// Kind of resource. /// A new instance for mocking. - public static WebSiteData WebSiteData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, ExtendedLocation extendedLocation = null, string state = null, IEnumerable hostNames = null, string repositorySiteName = null, AppServiceUsageState? usageState = null, bool? isEnabled = null, IEnumerable enabledHostNames = null, WebSiteAvailabilityState? availabilityState = null, IEnumerable hostNameSslStates = null, ResourceIdentifier appServicePlanId = null, bool? isReserved = null, bool? isXenon = null, bool? isHyperV = null, DateTimeOffset? lastModifiedTimeUtc = null, SiteConfigProperties siteConfig = null, IEnumerable trafficManagerHostNames = null, bool? isScmSiteAlsoStopped = null, string targetSwapSlot = null, HostingEnvironmentProfile hostingEnvironmentProfile = null, bool? isClientAffinityEnabled = null, bool? isClientCertEnabled = null, ClientCertMode? clientCertMode = null, string clientCertExclusionPaths = null, bool? isHostNameDisabled = null, string customDomainVerificationId = null, string outboundIPAddresses = null, string possibleOutboundIPAddresses = null, int? containerSize = null, int? dailyMemoryTimeQuota = null, DateTimeOffset? suspendOn = null, int? maxNumberOfWorkers = null, CloningInfo cloningInfo = null, string resourceGroup = null, bool? isDefaultContainer = null, string defaultHostName = null, SlotSwapStatus slotSwapStatus = null, bool? isHttpsOnly = null, RedundancyMode? redundancyMode = null, Guid? inProgressOperationId = null, bool? isStorageAccountRequired = null, string keyVaultReferenceIdentity = null, ResourceIdentifier virtualNetworkSubnetId = null, string kind = null) + public static WebSiteData WebSiteData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, ExtendedLocation extendedLocation = null, string state = null, IEnumerable hostNames = null, string repositorySiteName = null, AppServiceUsageState? usageState = null, bool? isEnabled = null, IEnumerable enabledHostNames = null, WebSiteAvailabilityState? availabilityState = null, IEnumerable hostNameSslStates = null, ResourceIdentifier appServicePlanId = null, bool? isReserved = null, bool? isXenon = null, bool? isHyperV = null, DateTimeOffset? lastModifiedTimeUtc = null, bool? vnetRouteAllEnabled = null, bool? vnetImagePullEnabled = null, bool? vnetContentShareEnabled = null, SiteConfigProperties siteConfig = null, DaprConfig daprConfig = null, string workloadProfileName = null, ResourceConfig resourceConfig = null, IEnumerable trafficManagerHostNames = null, bool? isScmSiteAlsoStopped = null, string targetSwapSlot = null, HostingEnvironmentProfile hostingEnvironmentProfile = null, bool? isClientAffinityEnabled = null, bool? isClientCertEnabled = null, ClientCertMode? clientCertMode = null, string clientCertExclusionPaths = null, bool? isHostNameDisabled = null, string customDomainVerificationId = null, string outboundIPAddresses = null, string possibleOutboundIPAddresses = null, int? containerSize = null, int? dailyMemoryTimeQuota = null, DateTimeOffset? suspendOn = null, int? maxNumberOfWorkers = null, CloningInfo cloningInfo = null, string resourceGroup = null, bool? isDefaultContainer = null, string defaultHostName = null, SlotSwapStatus slotSwapStatus = null, bool? isHttpsOnly = null, RedundancyMode? redundancyMode = null, Guid? inProgressOperationId = null, string publicNetworkAccess = null, bool? isStorageAccountRequired = null, string keyVaultReferenceIdentity = null, ResourceIdentifier virtualNetworkSubnetId = null, string managedEnvironmentId = null, string kind = null) { tags ??= new Dictionary(); hostNames ??= new List(); @@ -1084,7 +1114,7 @@ public static WebSiteData WebSiteData(ResourceIdentifier id = null, string name hostNameSslStates ??= new List(); trafficManagerHostNames ??= new List(); - return new WebSiteData(id, name, resourceType, systemData, tags, location, identity, extendedLocation, state, hostNames?.ToList(), repositorySiteName, usageState, isEnabled, enabledHostNames?.ToList(), availabilityState, hostNameSslStates?.ToList(), appServicePlanId, isReserved, isXenon, isHyperV, lastModifiedTimeUtc, siteConfig, trafficManagerHostNames?.ToList(), isScmSiteAlsoStopped, targetSwapSlot, hostingEnvironmentProfile, isClientAffinityEnabled, isClientCertEnabled, clientCertMode, clientCertExclusionPaths, isHostNameDisabled, customDomainVerificationId, outboundIPAddresses, possibleOutboundIPAddresses, containerSize, dailyMemoryTimeQuota, suspendOn, maxNumberOfWorkers, cloningInfo, resourceGroup, isDefaultContainer, defaultHostName, slotSwapStatus, isHttpsOnly, redundancyMode, inProgressOperationId, isStorageAccountRequired, keyVaultReferenceIdentity, virtualNetworkSubnetId, kind); + return new WebSiteData(id, name, resourceType, systemData, tags, location, identity, extendedLocation, state, hostNames?.ToList(), repositorySiteName, usageState, isEnabled, enabledHostNames?.ToList(), availabilityState, hostNameSslStates?.ToList(), appServicePlanId, isReserved, isXenon, isHyperV, lastModifiedTimeUtc, vnetRouteAllEnabled, vnetImagePullEnabled, vnetContentShareEnabled, siteConfig, daprConfig, workloadProfileName, resourceConfig, trafficManagerHostNames?.ToList(), isScmSiteAlsoStopped, targetSwapSlot, hostingEnvironmentProfile, isClientAffinityEnabled, isClientCertEnabled, clientCertMode, clientCertExclusionPaths, isHostNameDisabled, customDomainVerificationId, outboundIPAddresses, possibleOutboundIPAddresses, containerSize, dailyMemoryTimeQuota, suspendOn, maxNumberOfWorkers, cloningInfo, resourceGroup, isDefaultContainer, defaultHostName, slotSwapStatus, isHttpsOnly, redundancyMode, inProgressOperationId, publicNetworkAccess, isStorageAccountRequired, keyVaultReferenceIdentity, virtualNetworkSubnetId, managedEnvironmentId, kind); } /// Initializes a new instance of SiteConfigProperties. @@ -1108,6 +1138,7 @@ public static WebSiteData WebSiteData(ResourceIdentifier id = null, string name /// <code>true</code> if detailed error logging is enabled; otherwise, <code>false</code>. /// Publishing user name. /// Application settings. + /// Application metadata. This property cannot be retrieved, since it may contain secrets. /// Connection strings. /// Site MachineKey. /// Handler mappings. @@ -1141,10 +1172,13 @@ public static WebSiteData WebSiteData(ResourceIdentifier id = null, string name /// Explicit Managed Service Identity Id. /// Identity to use for Key Vault Reference authentication. /// IP security restrictions for main. + /// Default action for main access restriction if no rules are matched. /// IP security restrictions for scm. + /// Default action for scm access restriction if no rules are matched. /// IP security restrictions for scm to use main. /// Http20Enabled: configures a web site to allow clients to connect over http2.0. /// MinTlsVersion: configures the minimum version of TLS required for SSL requests. + /// The minimum strength TLS cipher suite allowed for an application. /// ScmMinTlsVersion: configures the minimum version of TLS required for SSL requests for SCM site. /// State of FTP / FTPS service. /// @@ -1155,6 +1189,10 @@ public static WebSiteData WebSiteData(ResourceIdentifier id = null, string name /// Maximum number of workers that a site can scale out to. /// This setting only applies to the Consumption and Elastic Premium Plans /// + /// + /// Maximum number of workers that a site can scale out to. + /// This setting only applies to apps in plans where ElasticScaleEnabled is <code>true</code> + /// /// Health check path. /// /// Gets or sets a value indicating whether functions runtime scale monitoring is enabled. When enabled, @@ -1169,10 +1207,11 @@ public static WebSiteData WebSiteData(ResourceIdentifier id = null, string name /// List of Azure Storage Accounts. /// Property to allow or block all public traffic. /// A new instance for mocking. - public static SiteConfigProperties SiteConfigProperties(int? numberOfWorkers = null, IEnumerable defaultDocuments = null, string netFrameworkVersion = null, string phpVersion = null, string pythonVersion = null, string nodeVersion = null, string powerShellVersion = null, string linuxFxVersion = null, string windowsFxVersion = null, bool? isRequestTracingEnabled = null, DateTimeOffset? requestTracingExpirationOn = null, bool? isRemoteDebuggingEnabled = null, string remoteDebuggingVersion = null, bool? isHttpLoggingEnabled = null, bool? useManagedIdentityCreds = null, string acrUserManagedIdentityId = null, int? logsDirectorySizeLimit = null, bool? isDetailedErrorLoggingEnabled = null, string publishingUsername = null, IEnumerable appSettings = null, IEnumerable connectionStrings = null, SiteMachineKey machineKey = null, IEnumerable handlerMappings = null, string documentRoot = null, ScmType? scmType = null, bool? use32BitWorkerProcess = null, bool? isWebSocketsEnabled = null, bool? isAlwaysOn = null, string javaVersion = null, string javaContainer = null, string javaContainerVersion = null, string appCommandLine = null, ManagedPipelineMode? managedPipelineMode = null, IEnumerable virtualApplications = null, SiteLoadBalancing? loadBalancing = null, IEnumerable experimentsRampUpRules = null, SiteLimits limits = null, bool? isAutoHealEnabled = null, AutoHealRules autoHealRules = null, string tracingOptions = null, string vnetName = null, bool? isVnetRouteAllEnabled = null, int? vnetPrivatePortsCount = null, AppServiceCorsSettings cors = null, WebAppPushSettings push = null, Uri apiDefinitionUri = null, string apiManagementConfigId = null, string autoSwapSlotName = null, bool? isLocalMySqlEnabled = null, int? managedServiceIdentityId = null, int? xManagedServiceIdentityId = null, string keyVaultReferenceIdentity = null, IEnumerable ipSecurityRestrictions = null, IEnumerable scmIPSecurityRestrictions = null, bool? allowIPSecurityRestrictionsForScmToUseMain = null, bool? isHttp20Enabled = null, AppServiceSupportedTlsVersion? minTlsVersion = null, AppServiceSupportedTlsVersion? scmMinTlsVersion = null, AppServiceFtpsState? ftpsState = null, int? preWarmedInstanceCount = null, int? functionAppScaleLimit = null, string healthCheckPath = null, bool? isFunctionsRuntimeScaleMonitoringEnabled = null, string websiteTimeZone = null, int? minimumElasticInstanceCount = null, IDictionary azureStorageAccounts = null, string publicNetworkAccess = null) + public static SiteConfigProperties SiteConfigProperties(int? numberOfWorkers = null, IEnumerable defaultDocuments = null, string netFrameworkVersion = null, string phpVersion = null, string pythonVersion = null, string nodeVersion = null, string powerShellVersion = null, string linuxFxVersion = null, string windowsFxVersion = null, bool? isRequestTracingEnabled = null, DateTimeOffset? requestTracingExpirationOn = null, bool? isRemoteDebuggingEnabled = null, string remoteDebuggingVersion = null, bool? isHttpLoggingEnabled = null, bool? useManagedIdentityCreds = null, string acrUserManagedIdentityId = null, int? logsDirectorySizeLimit = null, bool? isDetailedErrorLoggingEnabled = null, string publishingUsername = null, IEnumerable appSettings = null, IEnumerable metadata = null, IEnumerable connectionStrings = null, SiteMachineKey machineKey = null, IEnumerable handlerMappings = null, string documentRoot = null, ScmType? scmType = null, bool? use32BitWorkerProcess = null, bool? isWebSocketsEnabled = null, bool? isAlwaysOn = null, string javaVersion = null, string javaContainer = null, string javaContainerVersion = null, string appCommandLine = null, ManagedPipelineMode? managedPipelineMode = null, IEnumerable virtualApplications = null, SiteLoadBalancing? loadBalancing = null, IEnumerable experimentsRampUpRules = null, SiteLimits limits = null, bool? isAutoHealEnabled = null, AutoHealRules autoHealRules = null, string tracingOptions = null, string vnetName = null, bool? isVnetRouteAllEnabled = null, int? vnetPrivatePortsCount = null, AppServiceCorsSettings cors = null, WebAppPushSettings push = null, Uri apiDefinitionUri = null, string apiManagementConfigId = null, string autoSwapSlotName = null, bool? isLocalMySqlEnabled = null, int? managedServiceIdentityId = null, int? xManagedServiceIdentityId = null, string keyVaultReferenceIdentity = null, IEnumerable ipSecurityRestrictions = null, DefaultAction? ipSecurityRestrictionsDefaultAction = null, IEnumerable scmIPSecurityRestrictions = null, DefaultAction? scmIPSecurityRestrictionsDefaultAction = null, bool? allowIPSecurityRestrictionsForScmToUseMain = null, bool? isHttp20Enabled = null, AppServiceSupportedTlsVersion? minTlsVersion = null, TlsCipherSuite? minTlsCipherSuite = null, AppServiceSupportedTlsVersion? scmMinTlsVersion = null, AppServiceFtpsState? ftpsState = null, int? preWarmedInstanceCount = null, int? functionAppScaleLimit = null, int? elasticWebAppScaleLimit = null, string healthCheckPath = null, bool? isFunctionsRuntimeScaleMonitoringEnabled = null, string websiteTimeZone = null, int? minimumElasticInstanceCount = null, IDictionary azureStorageAccounts = null, string publicNetworkAccess = null) { defaultDocuments ??= new List(); appSettings ??= new List(); + metadata ??= new List(); connectionStrings ??= new List(); handlerMappings ??= new List(); virtualApplications ??= new List(); @@ -1181,7 +1220,7 @@ public static SiteConfigProperties SiteConfigProperties(int? numberOfWorkers = n scmIPSecurityRestrictions ??= new List(); azureStorageAccounts ??= new Dictionary(); - return new SiteConfigProperties(numberOfWorkers, defaultDocuments?.ToList(), netFrameworkVersion, phpVersion, pythonVersion, nodeVersion, powerShellVersion, linuxFxVersion, windowsFxVersion, isRequestTracingEnabled, requestTracingExpirationOn, isRemoteDebuggingEnabled, remoteDebuggingVersion, isHttpLoggingEnabled, useManagedIdentityCreds, acrUserManagedIdentityId, logsDirectorySizeLimit, isDetailedErrorLoggingEnabled, publishingUsername, appSettings?.ToList(), connectionStrings?.ToList(), machineKey, handlerMappings?.ToList(), documentRoot, scmType, use32BitWorkerProcess, isWebSocketsEnabled, isAlwaysOn, javaVersion, javaContainer, javaContainerVersion, appCommandLine, managedPipelineMode, virtualApplications?.ToList(), loadBalancing, experimentsRampUpRules != null ? new RoutingRuleExperiments(experimentsRampUpRules?.ToList()) : null, limits, isAutoHealEnabled, autoHealRules, tracingOptions, vnetName, isVnetRouteAllEnabled, vnetPrivatePortsCount, cors, push, apiDefinitionUri != null ? new AppServiceApiDefinitionInfo(apiDefinitionUri) : null, apiManagementConfigId != null ? new ApiManagementConfig(apiManagementConfigId) : null, autoSwapSlotName, isLocalMySqlEnabled, managedServiceIdentityId, xManagedServiceIdentityId, keyVaultReferenceIdentity, ipSecurityRestrictions?.ToList(), scmIPSecurityRestrictions?.ToList(), allowIPSecurityRestrictionsForScmToUseMain, isHttp20Enabled, minTlsVersion, scmMinTlsVersion, ftpsState, preWarmedInstanceCount, functionAppScaleLimit, healthCheckPath, isFunctionsRuntimeScaleMonitoringEnabled, websiteTimeZone, minimumElasticInstanceCount, azureStorageAccounts, publicNetworkAccess); + return new SiteConfigProperties(numberOfWorkers, defaultDocuments?.ToList(), netFrameworkVersion, phpVersion, pythonVersion, nodeVersion, powerShellVersion, linuxFxVersion, windowsFxVersion, isRequestTracingEnabled, requestTracingExpirationOn, isRemoteDebuggingEnabled, remoteDebuggingVersion, isHttpLoggingEnabled, useManagedIdentityCreds, acrUserManagedIdentityId, logsDirectorySizeLimit, isDetailedErrorLoggingEnabled, publishingUsername, appSettings?.ToList(), metadata?.ToList(), connectionStrings?.ToList(), machineKey, handlerMappings?.ToList(), documentRoot, scmType, use32BitWorkerProcess, isWebSocketsEnabled, isAlwaysOn, javaVersion, javaContainer, javaContainerVersion, appCommandLine, managedPipelineMode, virtualApplications?.ToList(), loadBalancing, experimentsRampUpRules != null ? new RoutingRuleExperiments(experimentsRampUpRules?.ToList()) : null, limits, isAutoHealEnabled, autoHealRules, tracingOptions, vnetName, isVnetRouteAllEnabled, vnetPrivatePortsCount, cors, push, apiDefinitionUri != null ? new AppServiceApiDefinitionInfo(apiDefinitionUri) : null, apiManagementConfigId != null ? new ApiManagementConfig(apiManagementConfigId) : null, autoSwapSlotName, isLocalMySqlEnabled, managedServiceIdentityId, xManagedServiceIdentityId, keyVaultReferenceIdentity, ipSecurityRestrictions?.ToList(), ipSecurityRestrictionsDefaultAction, scmIPSecurityRestrictions?.ToList(), scmIPSecurityRestrictionsDefaultAction, allowIPSecurityRestrictionsForScmToUseMain, isHttp20Enabled, minTlsVersion, minTlsCipherSuite, scmMinTlsVersion, ftpsState, preWarmedInstanceCount, functionAppScaleLimit, elasticWebAppScaleLimit, healthCheckPath, isFunctionsRuntimeScaleMonitoringEnabled, websiteTimeZone, minimumElasticInstanceCount, azureStorageAccounts, publicNetworkAccess); } /// Initializes a new instance of SiteMachineKey. @@ -1270,6 +1309,7 @@ public static LocalizableString LocalizableString(string value = null, string lo /// App Service plan subscription. /// Specification for the App Service Environment to use for the App Service plan. /// Maximum number of instances that can be assigned to this App Service plan. + /// The number of instances that are assigned to this App Service plan. /// Geographical location for the App Service plan. /// /// If <code>true</code>, apps assigned to this App Service plan can be scaled independently. @@ -1295,9 +1335,9 @@ public static LocalizableString LocalizableString(string value = null, string lo /// /// Kind of resource. /// A new instance for mocking. - public static AppServicePlanPatch AppServicePlanPatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string workerTierName = null, AppServicePlanStatus? status = null, string subscription = null, HostingEnvironmentProfile hostingEnvironmentProfile = null, int? maximumNumberOfWorkers = null, string geoRegion = null, bool? isPerSiteScaling = null, bool? isElasticScaleEnabled = null, int? maximumElasticWorkerCount = null, int? numberOfSites = null, bool? isSpot = null, DateTimeOffset? spotExpirationOn = null, DateTimeOffset? freeOfferExpirationOn = null, string resourceGroup = null, bool? isReserved = null, bool? isXenon = null, bool? isHyperV = null, int? targetWorkerCount = null, int? targetWorkerSizeId = null, ProvisioningState? provisioningState = null, KubeEnvironmentProfile kubeEnvironmentProfile = null, bool? isZoneRedundant = null, string kind = null) + public static AppServicePlanPatch AppServicePlanPatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string workerTierName = null, AppServicePlanStatus? status = null, string subscription = null, HostingEnvironmentProfile hostingEnvironmentProfile = null, int? maximumNumberOfWorkers = null, int? numberOfWorkers = null, string geoRegion = null, bool? isPerSiteScaling = null, bool? isElasticScaleEnabled = null, int? maximumElasticWorkerCount = null, int? numberOfSites = null, bool? isSpot = null, DateTimeOffset? spotExpirationOn = null, DateTimeOffset? freeOfferExpirationOn = null, string resourceGroup = null, bool? isReserved = null, bool? isXenon = null, bool? isHyperV = null, int? targetWorkerCount = null, int? targetWorkerSizeId = null, ProvisioningState? provisioningState = null, KubeEnvironmentProfile kubeEnvironmentProfile = null, bool? isZoneRedundant = null, string kind = null) { - return new AppServicePlanPatch(id, name, resourceType, systemData, workerTierName, status, subscription, hostingEnvironmentProfile, maximumNumberOfWorkers, geoRegion, isPerSiteScaling, isElasticScaleEnabled, maximumElasticWorkerCount, numberOfSites, isSpot, spotExpirationOn, freeOfferExpirationOn, resourceGroup, isReserved, isXenon, isHyperV, targetWorkerCount, targetWorkerSizeId, provisioningState, kubeEnvironmentProfile, isZoneRedundant, kind); + return new AppServicePlanPatch(id, name, resourceType, systemData, workerTierName, status, subscription, hostingEnvironmentProfile, maximumNumberOfWorkers, numberOfWorkers, geoRegion, isPerSiteScaling, isElasticScaleEnabled, maximumElasticWorkerCount, numberOfSites, isSpot, spotExpirationOn, freeOfferExpirationOn, resourceGroup, isReserved, isXenon, isHyperV, targetWorkerCount, targetWorkerSizeId, provisioningState, kubeEnvironmentProfile, isZoneRedundant, kind); } /// Initializes a new instance of HybridConnectionData. @@ -1503,6 +1543,84 @@ public static AppCertificatePatch AppCertificatePatch(ResourceIdentifier id = nu return new AppCertificatePatch(id, name, resourceType, systemData, password, friendlyName, subjectName, hostNames?.ToList(), pfxBlob, siteName, selfLink, issuer, issueOn, expireOn, thumbprintString, isValid, cerBlob, publicKeyHash, hostingEnvironmentProfile, keyVaultId, keyVaultSecretName, keyVaultSecretStatus, serverFarmId, canonicalName, domainValidationMethod, kind); } + /// Initializes a new instance of ContainerAppData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Provisioning state of the Container App. + /// Resource ID of the Container App's KubeEnvironment. + /// Name of the latest revision of the Container App. + /// Fully Qualified Domain Name of the latest revision of the Container App. + /// Non versioned Container App configuration properties. + /// Container App versioned application definition. + /// Kind of resource. + /// A new instance for mocking. + public static ContainerAppData ContainerAppData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ContainerAppProvisioningState? provisioningState = null, string kubeEnvironmentId = null, string latestRevisionName = null, string latestRevisionFqdn = null, Configuration configuration = null, Template template = null, string kind = null) + { + tags ??= new Dictionary(); + + return new ContainerAppData(id, name, resourceType, systemData, tags, location, provisioningState, kubeEnvironmentId, latestRevisionName, latestRevisionFqdn, configuration, template, kind); + } + + /// Initializes a new instance of Ingress. + /// Hostname. + /// Bool indicating if app exposes an external http endpoint. + /// Target Port in containers for traffic from ingress. + /// Ingress transport protocol. + /// + /// Bool indicating if HTTP connections to is allowed. If set to false HTTP connections are automatically redirected to HTTPS connections. + /// A new instance for mocking. + public static Ingress Ingress(string fqdn = null, bool? external = null, int? targetPort = null, IngressTransportMethod? transport = null, IEnumerable traffic = null, bool? allowInsecure = null) + { + traffic ??= new List(); + + return new Ingress(fqdn, external, targetPort, transport, traffic?.ToList(), allowInsecure); + } + + /// Initializes a new instance of ContainerAppSecret. + /// Secret Name. + /// Secret Value. + /// A new instance for mocking. + public static ContainerAppSecret ContainerAppSecret(string name = null, string value = null) + { + return new ContainerAppSecret(name, value); + } + + /// Initializes a new instance of RevisionData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// + /// Timestamp describing when the revision was created + /// by controller + /// + /// Fully qualified domain name of the revision. + /// + /// Container App Revision Template with all possible settings and the + /// defaults if user did not provide them. The defaults are populated + /// as they were at the creation time + /// + /// Boolean describing if the Revision is Active. + /// Number of pods currently running for this revision. + /// Traffic weight assigned to this revision. + /// Optional Field - Platform Error Message. + /// Current health State of the revision. + /// Current provisioning State of the revision. + /// Kind of resource. + /// A new instance for mocking. + public static RevisionData RevisionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, DateTimeOffset? createdOn = null, string fqdn = null, Template template = null, bool? active = null, int? replicas = null, int? trafficWeight = null, string provisioningError = null, RevisionHealthState? healthState = null, RevisionProvisioningState? provisioningState = null, string kind = null) + { + tags ??= new Dictionary(); + + return new RevisionData(id, name, resourceType, systemData, tags, location, createdOn, fqdn, template, active, replicas, trafficWeight, provisioningError, healthState, provisioningState, kind); + } + /// Initializes a new instance of DeletedSiteData. /// The id. /// The name. @@ -1647,6 +1765,7 @@ public static AppSnapshot AppSnapshot(ResourceIdentifier id = null, string name /// Only visible within Vnet/Subnet. /// Default Domain Name for the cluster. /// Static IP of the KubeEnvironment. + /// Type of Kubernetes Environment. Only supported for Container App Environments with value as Managed. /// /// Cluster configuration which determines the ARC cluster /// components types. Eg: Choosing between BuildService kind, @@ -1657,14 +1776,15 @@ public static AppSnapshot AppSnapshot(ResourceIdentifier id = null, string name /// app logs to a destination. Currently only "log-analytics" is /// supported /// + /// Cluster configuration for Container Apps Environments to configure Dapr Instrumentation Key and VNET Configuration. /// /// Kind of resource. /// A new instance for mocking. - public static KubeEnvironmentData KubeEnvironmentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedLocation extendedLocation = null, KubeEnvironmentProvisioningState? provisioningState = null, string deploymentErrors = null, bool? isInternalLoadBalancerEnabled = null, string defaultDomain = null, string staticIP = null, ArcConfiguration arcConfiguration = null, AppLogsConfiguration appLogsConfiguration = null, ResourceIdentifier aksResourceId = null, string kind = null) + public static KubeEnvironmentData KubeEnvironmentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedLocation extendedLocation = null, KubeEnvironmentProvisioningState? provisioningState = null, string deploymentErrors = null, bool? isInternalLoadBalancerEnabled = null, string defaultDomain = null, string staticIP = null, string environmentType = null, ArcConfiguration arcConfiguration = null, AppLogsConfiguration appLogsConfiguration = null, ContainerAppsConfiguration containerAppsConfiguration = null, ResourceIdentifier aksResourceId = null, string kind = null) { tags ??= new Dictionary(); - return new KubeEnvironmentData(id, name, resourceType, systemData, tags, location, extendedLocation, provisioningState, deploymentErrors, isInternalLoadBalancerEnabled, defaultDomain, staticIP, arcConfiguration, appLogsConfiguration, aksResourceId, kind); + return new KubeEnvironmentData(id, name, resourceType, systemData, tags, location, extendedLocation, provisioningState, deploymentErrors, isInternalLoadBalancerEnabled, defaultDomain, staticIP, environmentType, arcConfiguration, appLogsConfiguration, containerAppsConfiguration, aksResourceId, kind); } /// Initializes a new instance of KubeEnvironmentPatch. @@ -1687,12 +1807,13 @@ public static KubeEnvironmentData KubeEnvironmentData(ResourceIdentifier id = nu /// app logs to a destination. Currently only "log-analytics" is /// supported /// + /// Cluster configuration for Container Apps Environments to configure Dapr Instrumentation Key and VNET Configuration. /// /// Kind of resource. /// A new instance for mocking. - public static KubeEnvironmentPatch KubeEnvironmentPatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, KubeEnvironmentProvisioningState? provisioningState = null, string deploymentErrors = null, bool? isInternalLoadBalancerEnabled = null, string defaultDomain = null, string staticIP = null, ArcConfiguration arcConfiguration = null, AppLogsConfiguration appLogsConfiguration = null, ResourceIdentifier aksResourceId = null, string kind = null) + public static KubeEnvironmentPatch KubeEnvironmentPatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, KubeEnvironmentProvisioningState? provisioningState = null, string deploymentErrors = null, bool? isInternalLoadBalancerEnabled = null, string defaultDomain = null, string staticIP = null, ArcConfiguration arcConfiguration = null, AppLogsConfiguration appLogsConfiguration = null, ContainerAppsConfiguration containerAppsConfiguration = null, ResourceIdentifier aksResourceId = null, string kind = null) { - return new KubeEnvironmentPatch(id, name, resourceType, systemData, provisioningState, deploymentErrors, isInternalLoadBalancerEnabled, defaultDomain, staticIP, arcConfiguration, appLogsConfiguration, aksResourceId, kind); + return new KubeEnvironmentPatch(id, name, resourceType, systemData, provisioningState, deploymentErrors, isInternalLoadBalancerEnabled, defaultDomain, staticIP, arcConfiguration, appLogsConfiguration, containerAppsConfiguration, aksResourceId, kind); } /// Initializes a new instance of ApplicationStackResource. @@ -2062,6 +2183,36 @@ public static ResourceNameAvailability ResourceNameAvailability(bool? isNameAvai return new ResourceNameAvailability(isNameAvailable, reason, message); } + /// Initializes a new instance of CustomHostnameSites. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// + /// + /// Kind of resource. + /// A new instance for mocking. + public static CustomHostnameSites CustomHostnameSites(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string customHostname = null, string region = null, IEnumerable siteResourceIds = null, string kind = null) + { + siteResourceIds ??= new List(); + + return new CustomHostnameSites(id, name, resourceType, systemData, customHostname, region, siteResourceIds?.ToList(), kind); + } + + /// Initializes a new instance of AppServiceIdentifierData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// String representation of the identity. + /// Kind of resource. + /// A new instance for mocking. + public static AppServiceIdentifierData AppServiceIdentifierData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string value = null, string kind = null) + { + return new AppServiceIdentifierData(id, name, resourceType, systemData, value, kind); + } + /// Initializes a new instance of AppServiceDeploymentLocations. /// Available regions. /// Available App Service Environments with full descriptions of the environments. @@ -2100,17 +2251,25 @@ public static HostingEnvironmentDeploymentInfo HostingEnvironmentDeploymentInfo( return new HostingEnvironmentDeploymentInfo(name, location); } - /// Initializes a new instance of AppServiceIdentifierData. + /// Initializes a new instance of AseRegion. /// The id. /// The name. /// The resourceType. /// The systemData. - /// String representation of the identity. + /// Display name for region. + /// Is region standard. + /// Dedicated host enabled. + /// Zone redundant deployment enabled. + /// Available Skus in region. + /// Available OSs in region. /// Kind of resource. - /// A new instance for mocking. - public static AppServiceIdentifierData AppServiceIdentifierData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string value = null, string kind = null) + /// A new instance for mocking. + public static AseRegion AseRegion(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string displayName = null, bool? standard = null, bool? dedicatedHost = null, bool? zoneRedundant = null, IEnumerable availableSku = null, IEnumerable availableOS = null, string kind = null) { - return new AppServiceIdentifierData(id, name, resourceType, systemData, value, kind); + availableSku ??= new List(); + availableOS ??= new List(); + + return new AseRegion(id, name, resourceType, systemData, displayName, standard, dedicatedHost, zoneRedundant, availableSku?.ToList(), availableOS?.ToList(), kind); } /// Initializes a new instance of PremierAddOnOffer. @@ -2281,17 +2440,23 @@ public static StaticSitesWorkflowPreview StaticSitesWorkflowPreview(ResourceIden /// The content distribution endpoint for the static site. /// Identity to use for Key Vault Reference authentication. /// User provided function apps registered with the static site. + /// Backends linked to the static side. /// The provider that submitted the last deployment to the primary environment of the static site. + /// State indicating the status of the enterprise grade CDN serving traffic to the static web app. + /// State indicating whether public traffic are allowed or not for a static web app. Allowed Values: 'Enabled', 'Disabled' or an empty string. + /// Database connections for the static site. /// Kind of resource. /// A new instance for mocking. - public static StaticSiteData StaticSiteData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, AppServiceSkuDescription sku = null, ManagedServiceIdentity identity = null, string defaultHostname = null, Uri repositoryUri = null, string branch = null, IEnumerable customDomains = null, string repositoryToken = null, StaticSiteBuildProperties buildProperties = null, IEnumerable privateEndpointConnections = null, StagingEnvironmentPolicy? stagingEnvironmentPolicy = null, bool? allowConfigFileUpdates = null, StaticSiteTemplate templateProperties = null, string contentDistributionEndpoint = null, string keyVaultReferenceIdentity = null, IEnumerable userProvidedFunctionApps = null, string provider = null, string kind = null) + public static StaticSiteData StaticSiteData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, AppServiceSkuDescription sku = null, ManagedServiceIdentity identity = null, string defaultHostname = null, Uri repositoryUri = null, string branch = null, IEnumerable customDomains = null, string repositoryToken = null, StaticSiteBuildProperties buildProperties = null, IEnumerable privateEndpointConnections = null, StagingEnvironmentPolicy? stagingEnvironmentPolicy = null, bool? allowConfigFileUpdates = null, StaticSiteTemplate templateProperties = null, string contentDistributionEndpoint = null, string keyVaultReferenceIdentity = null, IEnumerable userProvidedFunctionApps = null, IEnumerable linkedBackends = null, string provider = null, EnterpriseGradeCdnStatus? enterpriseGradeCdnStatus = null, string publicNetworkAccess = null, IEnumerable databaseConnections = null, string kind = null) { tags ??= new Dictionary(); customDomains ??= new List(); privateEndpointConnections ??= new List(); userProvidedFunctionApps ??= new List(); + linkedBackends ??= new List(); + databaseConnections ??= new List(); - return new StaticSiteData(id, name, resourceType, systemData, tags, location, sku, identity, defaultHostname, repositoryUri, branch, customDomains?.ToList(), repositoryToken, buildProperties, privateEndpointConnections?.ToList(), stagingEnvironmentPolicy, allowConfigFileUpdates, templateProperties, contentDistributionEndpoint, keyVaultReferenceIdentity, userProvidedFunctionApps?.ToList(), provider, kind); + return new StaticSiteData(id, name, resourceType, systemData, tags, location, sku, identity, defaultHostname, repositoryUri, branch, customDomains?.ToList(), repositoryToken, buildProperties, privateEndpointConnections?.ToList(), stagingEnvironmentPolicy, allowConfigFileUpdates, templateProperties, contentDistributionEndpoint, keyVaultReferenceIdentity, userProvidedFunctionApps?.ToList(), linkedBackends?.ToList(), provider, enterpriseGradeCdnStatus, publicNetworkAccess, databaseConnections?.ToList(), kind); } /// Initializes a new instance of ResponseMessageEnvelopeRemotePrivateEndpointConnection. @@ -2309,7 +2474,7 @@ public static StaticSiteData StaticSiteData(ResourceIdentifier id = null, string /// MSI resource. /// Logical Availability Zones the service is hosted in. /// A new instance for mocking. - public static ResponseMessageEnvelopeRemotePrivateEndpointConnection ResponseMessageEnvelopeRemotePrivateEndpointConnection(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, IReadOnlyDictionary tags = null, AppServiceArmPlan plan = null, RemotePrivateEndpointConnection properties = null, AppServiceSkuDescription sku = null, string status = null, ResponseError error = null, ManagedServiceIdentity identity = null, IEnumerable zones = null) + public static ResponseMessageEnvelopeRemotePrivateEndpointConnection ResponseMessageEnvelopeRemotePrivateEndpointConnection(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, IReadOnlyDictionary tags = null, AppServiceArmPlan plan = null, RemotePrivateEndpointConnection properties = null, AppServiceSkuDescription sku = null, string status = null, ErrorEntity error = null, ManagedServiceIdentity identity = null, IEnumerable zones = null) { tags ??= new Dictionary(); zones ??= new List(); @@ -2340,9 +2505,9 @@ public static AppServiceArmPlan AppServiceArmPlan(string name = null, string pub /// Private IPAddresses mapped to the remote private endpoint. /// Kind of resource. /// A new instance for mocking. - public static RemotePrivateEndpointConnection RemotePrivateEndpointConnection(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string provisioningState = null, ResourceIdentifier privateEndpointId = null, PrivateLinkConnectionState privateLinkServiceConnectionState = null, IEnumerable ipAddresses = null, string kind = null) + public static RemotePrivateEndpointConnection RemotePrivateEndpointConnection(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string provisioningState = null, ResourceIdentifier privateEndpointId = null, PrivateLinkConnectionState privateLinkServiceConnectionState = null, IEnumerable ipAddresses = null, string kind = null) { - ipAddresses ??= new List(); + ipAddresses ??= new List(); return new RemotePrivateEndpointConnection(id, name, resourceType, systemData, provisioningState, privateEndpointId != null ? ResourceManagerModelFactory.SubResource(privateEndpointId) : null, privateLinkServiceConnectionState, ipAddresses?.ToList(), kind); } @@ -2362,6 +2527,41 @@ public static StaticSiteUserProvidedFunctionAppData StaticSiteUserProvidedFuncti return new StaticSiteUserProvidedFunctionAppData(id, name, resourceType, systemData, functionAppResourceId, functionAppRegion, createdOn, kind); } + /// Initializes a new instance of StaticSiteLinkedBackend. + /// The resource id of the backend linked to the static site. + /// The region of the backend linked to the static site. + /// The date and time on which the backend was linked to the static site. + /// The provisioning state of the linking process. + /// A new instance for mocking. + public static StaticSiteLinkedBackend StaticSiteLinkedBackend(string backendResourceId = null, string region = null, DateTimeOffset? createdOn = null, string provisioningState = null) + { + return new StaticSiteLinkedBackend(backendResourceId, region, createdOn, provisioningState); + } + + /// Initializes a new instance of DatabaseConnectionOverview. + /// The resource id of the database. + /// If present, the identity is used in conjunction with connection string to connect to the database. Use of the system-assigned managed identity is indicated with the string 'SystemAssigned', while use of a user-assigned managed identity is indicated with the resource id of the managed identity resource. + /// The region of the database resource. + /// A list of configuration files associated with this database connection. + /// If present, the name of this database connection resource. + /// A new instance for mocking. + public static DatabaseConnectionOverview DatabaseConnectionOverview(string resourceId = null, string connectionIdentity = null, string region = null, IEnumerable configurationFiles = null, string name = null) + { + configurationFiles ??= new List(); + + return new DatabaseConnectionOverview(resourceId, connectionIdentity, region, configurationFiles?.ToList(), name); + } + + /// Initializes a new instance of StaticSiteDatabaseConnectionConfigurationFileOverview. + /// The name of the configuration file. + /// The Base64 encoding of the file contents. + /// The type of configuration file. + /// A new instance for mocking. + public static StaticSiteDatabaseConnectionConfigurationFileOverview StaticSiteDatabaseConnectionConfigurationFileOverview(string fileName = null, string contents = null, string staticSiteDatabaseConnectionConfigurationFileOverviewType = null) + { + return new StaticSiteDatabaseConnectionConfigurationFileOverview(fileName, contents, staticSiteDatabaseConnectionConfigurationFileOverviewType); + } + /// Initializes a new instance of StaticSitePatch. /// The id. /// The name. @@ -2380,16 +2580,22 @@ public static StaticSiteUserProvidedFunctionAppData StaticSiteUserProvidedFuncti /// The content distribution endpoint for the static site. /// Identity to use for Key Vault Reference authentication. /// User provided function apps registered with the static site. + /// Backends linked to the static side. /// The provider that submitted the last deployment to the primary environment of the static site. + /// State indicating the status of the enterprise grade CDN serving traffic to the static web app. + /// State indicating whether public traffic are allowed or not for a static web app. Allowed Values: 'Enabled', 'Disabled' or an empty string. + /// Database connections for the static site. /// Kind of resource. /// A new instance for mocking. - public static StaticSitePatch StaticSitePatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string defaultHostname = null, Uri repositoryUri = null, string branch = null, IEnumerable customDomains = null, string repositoryToken = null, StaticSiteBuildProperties buildProperties = null, IEnumerable privateEndpointConnections = null, StagingEnvironmentPolicy? stagingEnvironmentPolicy = null, bool? allowConfigFileUpdates = null, StaticSiteTemplate templateProperties = null, string contentDistributionEndpoint = null, string keyVaultReferenceIdentity = null, IEnumerable userProvidedFunctionApps = null, string provider = null, string kind = null) + public static StaticSitePatch StaticSitePatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string defaultHostname = null, Uri repositoryUri = null, string branch = null, IEnumerable customDomains = null, string repositoryToken = null, StaticSiteBuildProperties buildProperties = null, IEnumerable privateEndpointConnections = null, StagingEnvironmentPolicy? stagingEnvironmentPolicy = null, bool? allowConfigFileUpdates = null, StaticSiteTemplate templateProperties = null, string contentDistributionEndpoint = null, string keyVaultReferenceIdentity = null, IEnumerable userProvidedFunctionApps = null, IEnumerable linkedBackends = null, string provider = null, EnterpriseGradeCdnStatus? enterpriseGradeCdnStatus = null, string publicNetworkAccess = null, IEnumerable databaseConnections = null, string kind = null) { customDomains ??= new List(); privateEndpointConnections ??= new List(); userProvidedFunctionApps ??= new List(); + linkedBackends ??= new List(); + databaseConnections ??= new List(); - return new StaticSitePatch(id, name, resourceType, systemData, defaultHostname, repositoryUri, branch, customDomains?.ToList(), repositoryToken, buildProperties, privateEndpointConnections?.ToList(), stagingEnvironmentPolicy, allowConfigFileUpdates, templateProperties, contentDistributionEndpoint, keyVaultReferenceIdentity, userProvidedFunctionApps?.ToList(), provider, kind); + return new StaticSitePatch(id, name, resourceType, systemData, defaultHostname, repositoryUri, branch, customDomains?.ToList(), repositoryToken, buildProperties, privateEndpointConnections?.ToList(), stagingEnvironmentPolicy, allowConfigFileUpdates, templateProperties, contentDistributionEndpoint, keyVaultReferenceIdentity, userProvidedFunctionApps?.ToList(), linkedBackends?.ToList(), provider, enterpriseGradeCdnStatus, publicNetworkAccess, databaseConnections?.ToList(), kind); } /// Initializes a new instance of StaticSiteUser. @@ -2421,13 +2627,17 @@ public static StaticSiteUser StaticSiteUser(ResourceIdentifier id = null, string /// When this build was updated. /// The status of the static site build. /// User provided function apps registered with the static site build. + /// Backends linked to the static side build. + /// Database connections for the static site build. /// Kind of resource. /// A new instance for mocking. - public static StaticSiteBuildData StaticSiteBuildData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string buildId = null, string sourceBranch = null, string pullRequestTitle = null, string hostname = null, DateTimeOffset? createdOn = null, DateTimeOffset? lastUpdatedOn = null, StaticSiteBuildStatus? status = null, IEnumerable userProvidedFunctionApps = null, string kind = null) + public static StaticSiteBuildData StaticSiteBuildData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string buildId = null, string sourceBranch = null, string pullRequestTitle = null, string hostname = null, DateTimeOffset? createdOn = null, DateTimeOffset? lastUpdatedOn = null, StaticSiteBuildStatus? status = null, IEnumerable userProvidedFunctionApps = null, IEnumerable linkedBackends = null, IEnumerable databaseConnections = null, string kind = null) { userProvidedFunctionApps ??= new List(); + linkedBackends ??= new List(); + databaseConnections ??= new List(); - return new StaticSiteBuildData(id, name, resourceType, systemData, buildId, sourceBranch, pullRequestTitle, hostname, createdOn, lastUpdatedOn, status, userProvidedFunctionApps?.ToList(), kind); + return new StaticSiteBuildData(id, name, resourceType, systemData, buildId, sourceBranch, pullRequestTitle, hostname, createdOn, lastUpdatedOn, status, userProvidedFunctionApps?.ToList(), linkedBackends?.ToList(), databaseConnections?.ToList(), kind); } /// Initializes a new instance of AppServiceConfigurationDictionary. @@ -2445,6 +2655,25 @@ public static AppServiceConfigurationDictionary AppServiceConfigurationDictionar return new AppServiceConfigurationDictionary(id, name, resourceType, systemData, properties, kind); } + /// Initializes a new instance of DatabaseConnectionData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource id of the database. + /// If present, the identity is used in conjunction with connection string to connect to the database. Use of the system-assigned managed identity is indicated with the string 'SystemAssigned', while use of a user-assigned managed identity is indicated with the resource id of the managed identity resource. + /// The connection string to use to connect to the database. + /// The region of the database resource. + /// A list of configuration files associated with this database connection. + /// Kind of resource. + /// A new instance for mocking. + public static DatabaseConnectionData DatabaseConnectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string resourceId = null, string connectionIdentity = null, string connectionString = null, string region = null, IEnumerable configurationFiles = null, string kind = null) + { + configurationFiles ??= new List(); + + return new DatabaseConnectionData(id, name, resourceType, systemData, resourceId, connectionIdentity, connectionString, region, configurationFiles?.ToList(), kind); + } + /// Initializes a new instance of StaticSiteFunctionOverview. /// The id. /// The name. @@ -2476,6 +2705,25 @@ public static StaticSiteZipDeployment StaticSiteZipDeployment(ResourceIdentifier return new StaticSiteZipDeployment(id, name, resourceType, systemData, appZipUri, apiZipUri, deploymentTitle, provider, functionLanguage, kind); } + /// Initializes a new instance of StaticSiteBasicAuthPropertiesARMResourceData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The password for basic auth. + /// Url to the secret in Key Vault. + /// State indicating if basic auth is enabled and for what environments it is active. + /// The list of enabled environments for Basic Auth if ApplicableEnvironmentsMode is set to SpecifiedEnvironments. + /// State indicating if basic auth has a secret and what type it is. + /// Kind of resource. + /// A new instance for mocking. + public static StaticSiteBasicAuthPropertiesARMResourceData StaticSiteBasicAuthPropertiesARMResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string password = null, Uri secretUri = null, string applicableEnvironmentsMode = null, IEnumerable environments = null, string secretState = null, string kind = null) + { + environments ??= new List(); + + return new StaticSiteBasicAuthPropertiesARMResourceData(id, name, resourceType, systemData, password, secretUri, applicableEnvironmentsMode, environments?.ToList(), secretState, kind); + } + /// Initializes a new instance of StaticSiteUserInvitationContent. /// The id. /// The name. @@ -2566,6 +2814,22 @@ public static StaticSiteResetContent StaticSiteResetContent(ResourceIdentifier i return new StaticSiteResetContent(id, name, resourceType, systemData, repositoryToken, shouldUpdateRepository, kind); } + /// Initializes a new instance of StaticSiteLinkedBackendARMResourceData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource id of the backend linked to the static site. + /// The region of the backend linked to the static site. + /// The date and time on which the backend was linked to the static site. + /// The provisioning state of the linking process. + /// Kind of resource. + /// A new instance for mocking. + public static StaticSiteLinkedBackendARMResourceData StaticSiteLinkedBackendARMResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string backendResourceId = null, string region = null, DateTimeOffset? createdOn = null, string provisioningState = null, string kind = null) + { + return new StaticSiteLinkedBackendARMResourceData(id, name, resourceType, systemData, backendResourceId, region, createdOn, provisioningState, kind); + } + /// Initializes a new instance of SitePatchInfo. /// The id. /// The name. @@ -2663,7 +2927,7 @@ public static SitePatchInfo SitePatchInfo(ResourceIdentifier id = null, string n /// Alternate TXT records controller can see for this hostname. /// Kind of resource. /// A new instance for mocking. - public static CustomHostnameAnalysisResult CustomHostnameAnalysisResult(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, bool? isHostnameAlreadyVerified = null, DnsVerificationTestResult? customDomainVerificationTest = null, ResponseError customDomainVerificationFailureInfo = null, bool? hasConflictOnScaleUnit = null, bool? hasConflictAcrossSubscription = null, string conflictingAppResourceId = null, IEnumerable cNameRecords = null, IEnumerable txtRecords = null, IEnumerable aRecords = null, IEnumerable alternateCNameRecords = null, IEnumerable alternateTxtRecords = null, string kind = null) + public static CustomHostnameAnalysisResult CustomHostnameAnalysisResult(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, bool? isHostnameAlreadyVerified = null, DnsVerificationTestResult? customDomainVerificationTest = null, ErrorEntity customDomainVerificationFailureInfo = null, bool? hasConflictOnScaleUnit = null, bool? hasConflictAcrossSubscription = null, string conflictingAppResourceId = null, IEnumerable cNameRecords = null, IEnumerable txtRecords = null, IEnumerable aRecords = null, IEnumerable alternateCNameRecords = null, IEnumerable alternateTxtRecords = null, string kind = null) { cNameRecords ??= new List(); txtRecords ??= new List(); @@ -2800,6 +3064,7 @@ public static CsmPublishingCredentialsPoliciesEntityData CsmPublishingCredential /// <code>true</code> if detailed error logging is enabled; otherwise, <code>false</code>. /// Publishing user name. /// Application settings. + /// Application metadata. This property cannot be retrieved, since it may contain secrets. /// Connection strings. /// Site MachineKey. /// Handler mappings. @@ -2833,10 +3098,13 @@ public static CsmPublishingCredentialsPoliciesEntityData CsmPublishingCredential /// Explicit Managed Service Identity Id. /// Identity to use for Key Vault Reference authentication. /// IP security restrictions for main. + /// Default action for main access restriction if no rules are matched. /// IP security restrictions for scm. + /// Default action for scm access restriction if no rules are matched. /// IP security restrictions for scm to use main. /// Http20Enabled: configures a web site to allow clients to connect over http2.0. /// MinTlsVersion: configures the minimum version of TLS required for SSL requests. + /// The minimum strength TLS cipher suite allowed for an application. /// ScmMinTlsVersion: configures the minimum version of TLS required for SSL requests for SCM site. /// State of FTP / FTPS service. /// @@ -2847,6 +3115,10 @@ public static CsmPublishingCredentialsPoliciesEntityData CsmPublishingCredential /// Maximum number of workers that a site can scale out to. /// This setting only applies to the Consumption and Elastic Premium Plans /// + /// + /// Maximum number of workers that a site can scale out to. + /// This setting only applies to apps in plans where ElasticScaleEnabled is <code>true</code> + /// /// Health check path. /// /// Gets or sets a value indicating whether functions runtime scale monitoring is enabled. When enabled, @@ -2862,10 +3134,11 @@ public static CsmPublishingCredentialsPoliciesEntityData CsmPublishingCredential /// Property to allow or block all public traffic. /// Kind of resource. /// A new instance for mocking. - public static SiteConfigData SiteConfigData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, int? numberOfWorkers = null, IEnumerable defaultDocuments = null, string netFrameworkVersion = null, string phpVersion = null, string pythonVersion = null, string nodeVersion = null, string powerShellVersion = null, string linuxFxVersion = null, string windowsFxVersion = null, bool? isRequestTracingEnabled = null, DateTimeOffset? requestTracingExpirationOn = null, bool? isRemoteDebuggingEnabled = null, string remoteDebuggingVersion = null, bool? isHttpLoggingEnabled = null, bool? useManagedIdentityCreds = null, string acrUserManagedIdentityId = null, int? logsDirectorySizeLimit = null, bool? isDetailedErrorLoggingEnabled = null, string publishingUsername = null, IEnumerable appSettings = null, IEnumerable connectionStrings = null, SiteMachineKey machineKey = null, IEnumerable handlerMappings = null, string documentRoot = null, ScmType? scmType = null, bool? use32BitWorkerProcess = null, bool? isWebSocketsEnabled = null, bool? isAlwaysOn = null, string javaVersion = null, string javaContainer = null, string javaContainerVersion = null, string appCommandLine = null, ManagedPipelineMode? managedPipelineMode = null, IEnumerable virtualApplications = null, SiteLoadBalancing? loadBalancing = null, IEnumerable experimentsRampUpRules = null, SiteLimits limits = null, bool? isAutoHealEnabled = null, AutoHealRules autoHealRules = null, string tracingOptions = null, string vnetName = null, bool? isVnetRouteAllEnabled = null, int? vnetPrivatePortsCount = null, AppServiceCorsSettings cors = null, WebAppPushSettings push = null, Uri apiDefinitionUri = null, string apiManagementConfigId = null, string autoSwapSlotName = null, bool? isLocalMySqlEnabled = null, int? managedServiceIdentityId = null, int? xManagedServiceIdentityId = null, string keyVaultReferenceIdentity = null, IEnumerable ipSecurityRestrictions = null, IEnumerable scmIPSecurityRestrictions = null, bool? allowIPSecurityRestrictionsForScmToUseMain = null, bool? isHttp20Enabled = null, AppServiceSupportedTlsVersion? minTlsVersion = null, AppServiceSupportedTlsVersion? scmMinTlsVersion = null, AppServiceFtpsState? ftpsState = null, int? preWarmedInstanceCount = null, int? functionAppScaleLimit = null, string healthCheckPath = null, bool? isFunctionsRuntimeScaleMonitoringEnabled = null, string websiteTimeZone = null, int? minimumElasticInstanceCount = null, IDictionary azureStorageAccounts = null, string publicNetworkAccess = null, string kind = null) + public static SiteConfigData SiteConfigData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, int? numberOfWorkers = null, IEnumerable defaultDocuments = null, string netFrameworkVersion = null, string phpVersion = null, string pythonVersion = null, string nodeVersion = null, string powerShellVersion = null, string linuxFxVersion = null, string windowsFxVersion = null, bool? isRequestTracingEnabled = null, DateTimeOffset? requestTracingExpirationOn = null, bool? isRemoteDebuggingEnabled = null, string remoteDebuggingVersion = null, bool? isHttpLoggingEnabled = null, bool? useManagedIdentityCreds = null, string acrUserManagedIdentityId = null, int? logsDirectorySizeLimit = null, bool? isDetailedErrorLoggingEnabled = null, string publishingUsername = null, IEnumerable appSettings = null, IEnumerable metadata = null, IEnumerable connectionStrings = null, SiteMachineKey machineKey = null, IEnumerable handlerMappings = null, string documentRoot = null, ScmType? scmType = null, bool? use32BitWorkerProcess = null, bool? isWebSocketsEnabled = null, bool? isAlwaysOn = null, string javaVersion = null, string javaContainer = null, string javaContainerVersion = null, string appCommandLine = null, ManagedPipelineMode? managedPipelineMode = null, IEnumerable virtualApplications = null, SiteLoadBalancing? loadBalancing = null, IEnumerable experimentsRampUpRules = null, SiteLimits limits = null, bool? isAutoHealEnabled = null, AutoHealRules autoHealRules = null, string tracingOptions = null, string vnetName = null, bool? isVnetRouteAllEnabled = null, int? vnetPrivatePortsCount = null, AppServiceCorsSettings cors = null, WebAppPushSettings push = null, Uri apiDefinitionUri = null, string apiManagementConfigId = null, string autoSwapSlotName = null, bool? isLocalMySqlEnabled = null, int? managedServiceIdentityId = null, int? xManagedServiceIdentityId = null, string keyVaultReferenceIdentity = null, IEnumerable ipSecurityRestrictions = null, DefaultAction? ipSecurityRestrictionsDefaultAction = null, IEnumerable scmIPSecurityRestrictions = null, DefaultAction? scmIPSecurityRestrictionsDefaultAction = null, bool? allowIPSecurityRestrictionsForScmToUseMain = null, bool? isHttp20Enabled = null, AppServiceSupportedTlsVersion? minTlsVersion = null, TlsCipherSuite? minTlsCipherSuite = null, AppServiceSupportedTlsVersion? scmMinTlsVersion = null, AppServiceFtpsState? ftpsState = null, int? preWarmedInstanceCount = null, int? functionAppScaleLimit = null, int? elasticWebAppScaleLimit = null, string healthCheckPath = null, bool? isFunctionsRuntimeScaleMonitoringEnabled = null, string websiteTimeZone = null, int? minimumElasticInstanceCount = null, IDictionary azureStorageAccounts = null, string publicNetworkAccess = null, string kind = null) { defaultDocuments ??= new List(); appSettings ??= new List(); + metadata ??= new List(); connectionStrings ??= new List(); handlerMappings ??= new List(); virtualApplications ??= new List(); @@ -2874,7 +3147,7 @@ public static SiteConfigData SiteConfigData(ResourceIdentifier id = null, string scmIPSecurityRestrictions ??= new List(); azureStorageAccounts ??= new Dictionary(); - return new SiteConfigData(id, name, resourceType, systemData, numberOfWorkers, defaultDocuments?.ToList(), netFrameworkVersion, phpVersion, pythonVersion, nodeVersion, powerShellVersion, linuxFxVersion, windowsFxVersion, isRequestTracingEnabled, requestTracingExpirationOn, isRemoteDebuggingEnabled, remoteDebuggingVersion, isHttpLoggingEnabled, useManagedIdentityCreds, acrUserManagedIdentityId, logsDirectorySizeLimit, isDetailedErrorLoggingEnabled, publishingUsername, appSettings?.ToList(), connectionStrings?.ToList(), machineKey, handlerMappings?.ToList(), documentRoot, scmType, use32BitWorkerProcess, isWebSocketsEnabled, isAlwaysOn, javaVersion, javaContainer, javaContainerVersion, appCommandLine, managedPipelineMode, virtualApplications?.ToList(), loadBalancing, experimentsRampUpRules != null ? new RoutingRuleExperiments(experimentsRampUpRules?.ToList()) : null, limits, isAutoHealEnabled, autoHealRules, tracingOptions, vnetName, isVnetRouteAllEnabled, vnetPrivatePortsCount, cors, push, apiDefinitionUri != null ? new AppServiceApiDefinitionInfo(apiDefinitionUri) : null, apiManagementConfigId != null ? new ApiManagementConfig(apiManagementConfigId) : null, autoSwapSlotName, isLocalMySqlEnabled, managedServiceIdentityId, xManagedServiceIdentityId, keyVaultReferenceIdentity, ipSecurityRestrictions?.ToList(), scmIPSecurityRestrictions?.ToList(), allowIPSecurityRestrictionsForScmToUseMain, isHttp20Enabled, minTlsVersion, scmMinTlsVersion, ftpsState, preWarmedInstanceCount, functionAppScaleLimit, healthCheckPath, isFunctionsRuntimeScaleMonitoringEnabled, websiteTimeZone, minimumElasticInstanceCount, azureStorageAccounts, publicNetworkAccess, kind); + return new SiteConfigData(id, name, resourceType, systemData, numberOfWorkers, defaultDocuments?.ToList(), netFrameworkVersion, phpVersion, pythonVersion, nodeVersion, powerShellVersion, linuxFxVersion, windowsFxVersion, isRequestTracingEnabled, requestTracingExpirationOn, isRemoteDebuggingEnabled, remoteDebuggingVersion, isHttpLoggingEnabled, useManagedIdentityCreds, acrUserManagedIdentityId, logsDirectorySizeLimit, isDetailedErrorLoggingEnabled, publishingUsername, appSettings?.ToList(), metadata?.ToList(), connectionStrings?.ToList(), machineKey, handlerMappings?.ToList(), documentRoot, scmType, use32BitWorkerProcess, isWebSocketsEnabled, isAlwaysOn, javaVersion, javaContainer, javaContainerVersion, appCommandLine, managedPipelineMode, virtualApplications?.ToList(), loadBalancing, experimentsRampUpRules != null ? new RoutingRuleExperiments(experimentsRampUpRules?.ToList()) : null, limits, isAutoHealEnabled, autoHealRules, tracingOptions, vnetName, isVnetRouteAllEnabled, vnetPrivatePortsCount, cors, push, apiDefinitionUri != null ? new AppServiceApiDefinitionInfo(apiDefinitionUri) : null, apiManagementConfigId != null ? new ApiManagementConfig(apiManagementConfigId) : null, autoSwapSlotName, isLocalMySqlEnabled, managedServiceIdentityId, xManagedServiceIdentityId, keyVaultReferenceIdentity, ipSecurityRestrictions?.ToList(), ipSecurityRestrictionsDefaultAction, scmIPSecurityRestrictions?.ToList(), scmIPSecurityRestrictionsDefaultAction, allowIPSecurityRestrictionsForScmToUseMain, isHttp20Enabled, minTlsVersion, minTlsCipherSuite, scmMinTlsVersion, ftpsState, preWarmedInstanceCount, functionAppScaleLimit, elasticWebAppScaleLimit, healthCheckPath, isFunctionsRuntimeScaleMonitoringEnabled, websiteTimeZone, minimumElasticInstanceCount, azureStorageAccounts, publicNetworkAccess, kind); } /// Initializes a new instance of SiteAuthSettings. @@ -2931,7 +3204,7 @@ public static SiteConfigData SiteConfigData(ResourceIdentifier id = null, string /// /// Gets a value indicating whether the issuer should be a valid HTTPS url and be validated as such. /// - /// Allowed audience values to consider when validating JWTs issued by + /// Allowed audience values to consider when validating JSON Web Tokens issued by /// Azure Active Directory. Note that the <code>ClientID</code> value is always considered an /// allowed audience, regardless of this setting. /// @@ -3051,7 +3324,7 @@ public static SiteAuthSettings SiteAuthSettings(ResourceIdentifier id = null, st return new SiteAuthSettings(id, name, resourceType, systemData, isEnabled, runtimeVersion, unauthenticatedClientAction, isTokenStoreEnabled, allowedExternalRedirectUrls?.ToList(), defaultProvider, tokenRefreshExtensionHours, clientId, clientSecret, clientSecretSettingName, clientSecretCertificateThumbprintString, issuer, validateIssuer, allowedAudiences?.ToList(), additionalLoginParams?.ToList(), aadClaimsAuthorization, googleClientId, googleClientSecret, googleClientSecretSettingName, googleOAuthScopes?.ToList(), facebookAppId, facebookAppSecret, facebookAppSecretSettingName, facebookOAuthScopes?.ToList(), gitHubClientId, gitHubClientSecret, gitHubClientSecretSettingName, gitHubOAuthScopes?.ToList(), twitterConsumerKey, twitterConsumerSecret, twitterConsumerSecretSettingName, microsoftAccountClientId, microsoftAccountClientSecret, microsoftAccountClientSecretSettingName, microsoftAccountOAuthScopes?.ToList(), isAuthFromFile, authFilePath, configVersion, kind); } - /// Initializes a new instance of SiteAuthSettingsV2. + /// Initializes a new instance of SiteAuthSettingsV2Data. /// The id. /// The name. /// The resourceType. @@ -3062,10 +3335,10 @@ public static SiteAuthSettings SiteAuthSettings(ResourceIdentifier id = null, st /// The configuration settings of the login flow of users using App Service Authentication/Authorization. /// The configuration settings of the HTTP requests for authentication and authorization requests made against App Service Authentication/Authorization. /// Kind of resource. - /// A new instance for mocking. - public static SiteAuthSettingsV2 SiteAuthSettingsV2(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AuthPlatform platform = null, GlobalValidation globalValidation = null, AppServiceIdentityProviders identityProviders = null, WebAppLoginInfo login = null, AppServiceHttpSettings httpSettings = null, string kind = null) + /// A new instance for mocking. + public static SiteAuthSettingsV2Data SiteAuthSettingsV2Data(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AuthPlatform platform = null, GlobalValidation globalValidation = null, AppServiceIdentityProviders identityProviders = null, WebAppLoginInfo login = null, AppServiceHttpSettings httpSettings = null, string kind = null) { - return new SiteAuthSettingsV2(id, name, resourceType, systemData, platform, globalValidation, identityProviders, login, httpSettings, kind); + return new SiteAuthSettingsV2Data(id, name, resourceType, systemData, platform, globalValidation, identityProviders, login, httpSettings, kind); } /// Initializes a new instance of AzureStoragePropertyDictionary. @@ -3192,6 +3465,28 @@ public static ContinuousWebJobData ContinuousWebJobData(ResourceIdentifier id = return new ContinuousWebJobData(id, name, resourceType, systemData, status, detailedStatus, logUri, runCommand, uri, extraInfoUri, webJobType, error, isUsingSdk, settings, kind); } + /// Initializes a new instance of CsmDeploymentStatusData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Deployment operation id. + /// Deployment build status. + /// Number of site instances currently being provisioned. + /// Number of site instances provisioned successfully. + /// Number of site instances failed to provision. + /// List of URLs pointing to logs for instances which failed to provision. + /// List of errors. + /// Kind of resource. + /// A new instance for mocking. + public static CsmDeploymentStatusData CsmDeploymentStatusData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string deploymentId = null, DeploymentBuildStatus? status = null, int? numberOfInstancesInProgress = null, int? numberOfInstancesSuccessful = null, int? numberOfInstancesFailed = null, IEnumerable failedInstancesLogs = null, IEnumerable errors = null, string kind = null) + { + failedInstancesLogs ??= new List(); + errors ??= new List(); + + return new CsmDeploymentStatusData(id, name, resourceType, systemData, deploymentId, status, numberOfInstancesInProgress, numberOfInstancesSuccessful, numberOfInstancesFailed, failedInstancesLogs?.ToList(), errors?.ToList(), kind); + } + /// Initializes a new instance of WebAppDeploymentData. /// The id. /// The name. @@ -3872,14 +4167,16 @@ public static SiteSourceControlData SiteSourceControlData(ResourceIdentifier id /// Job type. /// Error information. /// Using SDK?. + /// Property to allow or block all public traffic. Allowed Values: 'Enabled', 'Disabled' or an empty string. + /// Checks if Customer provided storage account is required. /// Job settings. /// Kind of resource. /// A new instance for mocking. - public static TriggeredWebJobData TriggeredWebJobData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, TriggeredJobRun latestRun = null, Uri historyUri = null, Uri schedulerLogsUri = null, string runCommand = null, Uri uri = null, Uri extraInfoUri = null, WebJobType? webJobType = null, string error = null, bool? isUsingSdk = null, IDictionary settings = null, string kind = null) + public static TriggeredWebJobData TriggeredWebJobData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, TriggeredJobRun latestRun = null, Uri historyUri = null, Uri schedulerLogsUri = null, string runCommand = null, Uri uri = null, Uri extraInfoUri = null, WebJobType? webJobType = null, string error = null, bool? isUsingSdk = null, string publicNetworkAccess = null, bool? storageAccountRequired = null, IDictionary settings = null, string kind = null) { settings ??= new Dictionary(); - return new TriggeredWebJobData(id, name, resourceType, systemData, latestRun, historyUri, schedulerLogsUri, runCommand, uri, extraInfoUri, webJobType, error, isUsingSdk, settings, kind); + return new TriggeredWebJobData(id, name, resourceType, systemData, latestRun, historyUri, schedulerLogsUri, runCommand, uri, extraInfoUri, webJobType, error, isUsingSdk, publicNetworkAccess, storageAccountRequired, settings, kind); } /// Initializes a new instance of TriggeredJobHistoryData. @@ -3917,5 +4214,446 @@ public static WebJobData WebJobData(ResourceIdentifier id = null, string name = return new WebJobData(id, name, resourceType, systemData, runCommand, uri, extraInfoUri, webJobType, error, isUsingSdk, settings, kind); } + + /// Initializes a new instance of WorkflowEnvelopeData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource kind. + /// The resource location. + /// Additional workflow properties. + /// A new instance for mocking. + public static WorkflowEnvelopeData WorkflowEnvelopeData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string kind = null, AzureLocation? location = null, WorkflowEnvelopeProperties properties = null) + { + return new WorkflowEnvelopeData(id, name, resourceType, systemData, kind, location, properties); + } + + /// Initializes a new instance of WorkflowEnvelopeProperties. + /// Gets or sets the files. + /// Gets or sets the state of the workflow. + /// Gets or sets workflow health. + /// A new instance for mocking. + public static WorkflowEnvelopeProperties WorkflowEnvelopeProperties(IReadOnlyDictionary files = null, WorkflowState? flowState = null, WorkflowHealth health = null) + { + files ??= new Dictionary(); + + return new WorkflowEnvelopeProperties(files, flowState, health); + } + + /// Initializes a new instance of WorkflowHealth. + /// Gets or sets the workflow health state. + /// Gets or sets the workflow error. + /// A new instance for mocking. + public static WorkflowHealth WorkflowHealth(WorkflowHealthState state = default, ErrorEntity error = null) + { + return new WorkflowHealth(state, error); + } + + /// Initializes a new instance of WorkflowRunData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Gets the wait end time. + /// Gets the start time. + /// Gets the end time. + /// Gets the status. + /// Gets the code. + /// Gets the error. + /// Gets the correlation id. + /// The run correlation. + /// Gets the reference to workflow version. + /// Gets the fired trigger. + /// Gets the outputs. + /// Gets the response of the flow run. + /// A new instance for mocking. + public static WorkflowRunData WorkflowRunData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DateTimeOffset? waitEndOn = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, WorkflowStatus? status = null, string code = null, BinaryData error = null, string correlationId = null, string correlationClientTrackingId = null, ResourceReference workflow = null, WorkflowRunTrigger trigger = null, IReadOnlyDictionary outputs = null, WorkflowRunTrigger response = null) + { + outputs ??= new Dictionary(); + + return new WorkflowRunData(id, name, resourceType, systemData, waitEndOn, startOn, endOn, status, code, error, correlationId, correlationClientTrackingId != null ? new Correlation(correlationClientTrackingId) : null, workflow, trigger, outputs, response); + } + + /// Initializes a new instance of ResourceReference. + /// The resource id. + /// Gets the resource name. + /// Gets the resource type. + /// A new instance for mocking. + public static ResourceReference ResourceReference(string id = null, string name = null, string resourceType = null) + { + return new ResourceReference(id, name, resourceType); + } + + /// Initializes a new instance of WorkflowRunTrigger. + /// Gets the name. + /// Gets the inputs. + /// Gets the link to inputs. + /// Gets the outputs. + /// Gets the link to outputs. + /// Gets the scheduled time. + /// Gets the start time. + /// Gets the end time. + /// Gets the tracking id. + /// The run correlation. + /// Gets the code. + /// Gets the status. + /// Gets the error. + /// Gets the tracked properties. + /// A new instance for mocking. + public static WorkflowRunTrigger WorkflowRunTrigger(string name = null, BinaryData inputs = null, ContentLink inputsLink = null, BinaryData outputs = null, ContentLink outputsLink = null, DateTimeOffset? scheduledOn = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, string trackingId = null, string correlationClientTrackingId = null, string code = null, WorkflowStatus? status = null, BinaryData error = null, BinaryData trackedProperties = null) + { + return new WorkflowRunTrigger(name, inputs, inputsLink, outputs, outputsLink, scheduledOn, startOn, endOn, trackingId, correlationClientTrackingId != null ? new Correlation(correlationClientTrackingId) : null, code, status, error, trackedProperties); + } + + /// Initializes a new instance of ContentLink. + /// The content link URI. + /// The content version. + /// The content size. + /// The content hash. + /// The metadata. + /// A new instance for mocking. + public static ContentLink ContentLink(Uri uri = null, string contentVersion = null, long? contentSize = null, ContentHash contentHash = null, BinaryData metadata = null) + { + return new ContentLink(uri, contentVersion, contentSize, contentHash, metadata); + } + + /// Initializes a new instance of ContentHash. + /// The algorithm of the content hash. + /// The value of the content hash. + /// A new instance for mocking. + public static ContentHash ContentHash(string algorithm = null, string value = null) + { + return new ContentHash(algorithm, value); + } + + /// Initializes a new instance of WorkflowOutputParameter. + /// The type. + /// The value. + /// The metadata. + /// The description. + /// Gets the error. + /// A new instance for mocking. + public static WorkflowOutputParameter WorkflowOutputParameter(ParameterType? parameterType = null, BinaryData value = null, BinaryData metadata = null, string description = null, BinaryData error = null) + { + return new WorkflowOutputParameter(parameterType, value, metadata, description, error); + } + + /// Initializes a new instance of WorkflowRunActionData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Gets the start time. + /// Gets the end time. + /// Gets the status. + /// Gets the code. + /// Gets the error. + /// Gets the tracking id. + /// The correlation properties. + /// Gets the link to inputs. + /// Gets the link to outputs. + /// Gets the tracked properties. + /// Gets the retry histories. + /// A new instance for mocking. + public static WorkflowRunActionData WorkflowRunActionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, WorkflowStatus? status = null, string code = null, BinaryData error = null, string trackingId = null, RunActionCorrelation correlation = null, ContentLink inputsLink = null, ContentLink outputsLink = null, BinaryData trackedProperties = null, IEnumerable retryHistory = null) + { + retryHistory ??= new List(); + + return new WorkflowRunActionData(id, name, resourceType, systemData, startOn, endOn, status, code, error, trackingId, correlation, inputsLink, outputsLink, trackedProperties, retryHistory?.ToList()); + } + + /// Initializes a new instance of ExpressionRoot. + /// The text. + /// Anything. + /// The sub expressions. + /// The azure resource error info. + /// The path. + /// A new instance for mocking. + public static ExpressionRoot ExpressionRoot(string text = null, BinaryData value = null, IEnumerable subexpressions = null, AzureResourceErrorInfo error = null, string path = null) + { + subexpressions ??= new List(); + + return new ExpressionRoot(text, value, subexpressions?.ToList(), error, path); + } + + /// Initializes a new instance of Expression. + /// The text. + /// Anything. + /// The sub expressions. + /// The azure resource error info. + /// A new instance for mocking. + public static Expression Expression(string text = null, BinaryData value = null, IEnumerable subexpressions = null, AzureResourceErrorInfo error = null) + { + subexpressions ??= new List(); + + return new Expression(text, value, subexpressions?.ToList(), error); + } + + /// Initializes a new instance of AzureResourceErrorInfo. + /// The error code. + /// The error message. + /// The error details. + /// is null. + /// A new instance for mocking. + public static AzureResourceErrorInfo AzureResourceErrorInfo(string code = null, string message = null, IEnumerable details = null) + { + if (code == null) + { + throw new ArgumentNullException(nameof(code)); + } + details ??= new List(); + + return new AzureResourceErrorInfo(code, message, details?.ToList()); + } + + /// Initializes a new instance of ErrorInfo. + /// The error code. + /// is null. + /// A new instance for mocking. + public static ErrorInfo ErrorInfo(string code = null) + { + if (code == null) + { + throw new ArgumentNullException(nameof(code)); + } + + return new ErrorInfo(code); + } + + /// Initializes a new instance of WorkflowRunActionRepetitionDefinitionData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The start time of the workflow scope repetition. + /// The end time of the workflow scope repetition. + /// The correlation properties. + /// The status of the workflow scope repetition. + /// The workflow scope repetition code. + /// Anything. + /// Gets the tracking id. + /// Gets the inputs. + /// Gets the link to inputs. + /// Gets the outputs. + /// Gets the link to outputs. + /// Gets the tracked properties. + /// Gets the retry histories. + /// + /// The repetition indexes. + /// A new instance for mocking. + public static WorkflowRunActionRepetitionDefinitionData WorkflowRunActionRepetitionDefinitionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, RunActionCorrelation correlation = null, WorkflowStatus? status = null, string code = null, BinaryData error = null, string trackingId = null, BinaryData inputs = null, ContentLink inputsLink = null, BinaryData outputs = null, ContentLink outputsLink = null, BinaryData trackedProperties = null, IEnumerable retryHistory = null, int? iterationCount = null, IEnumerable repetitionIndexes = null) + { + tags ??= new Dictionary(); + retryHistory ??= new List(); + repetitionIndexes ??= new List(); + + return new WorkflowRunActionRepetitionDefinitionData(id, name, resourceType, systemData, tags, location, startOn, endOn, correlation, status, code, error, trackingId, inputs, inputsLink, outputs, outputsLink, trackedProperties, retryHistory?.ToList(), iterationCount, repetitionIndexes?.ToList()); + } + + /// Initializes a new instance of RequestHistoryData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The request history properties. + /// A new instance for mocking. + public static RequestHistoryData RequestHistoryData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, RequestHistoryProperties properties = null) + { + tags ??= new Dictionary(); + + return new RequestHistoryData(id, name, resourceType, systemData, tags, location, properties); + } + + /// Initializes a new instance of WorkflowTriggerData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Gets the provisioning state. + /// Gets the created time. + /// Gets the changed time. + /// Gets the state. + /// Gets the status. + /// Gets the last execution time. + /// Gets the next execution time. + /// Gets the workflow trigger recurrence. + /// Gets the reference to workflow. + /// A new instance for mocking. + public static WorkflowTriggerData WorkflowTriggerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, WorkflowTriggerProvisioningState? provisioningState = null, DateTimeOffset? createdOn = null, DateTimeOffset? changedOn = null, WorkflowState? state = null, WorkflowStatus? status = null, DateTimeOffset? lastExecutionOn = null, DateTimeOffset? nextExecutionOn = null, WorkflowTriggerRecurrence recurrence = null, ResourceReference workflow = null) + { + return new WorkflowTriggerData(id, name, resourceType, systemData, provisioningState, createdOn, changedOn, state, status, lastExecutionOn, nextExecutionOn, recurrence, workflow); + } + + /// Initializes a new instance of WorkflowTriggerRecurrence. + /// The frequency. + /// The interval. + /// The start time. + /// The end time. + /// The time zone. + /// The recurrence schedule. + /// A new instance for mocking. + public static WorkflowTriggerRecurrence WorkflowTriggerRecurrence(RecurrenceFrequency? frequency = null, int? interval = null, string startTime = null, string endTime = null, string timeZone = null, RecurrenceSchedule schedule = null) + { + return new WorkflowTriggerRecurrence(frequency, interval, startTime, endTime, timeZone, schedule); + } + + /// Initializes a new instance of RecurrenceSchedule. + /// The minutes. + /// The hours. + /// The days of the week. + /// The month days. + /// The monthly occurrences. + /// A new instance for mocking. + public static RecurrenceSchedule RecurrenceSchedule(IEnumerable minutes = null, IEnumerable hours = null, IEnumerable weekDays = null, IEnumerable monthDays = null, IEnumerable monthlyOccurrences = null) + { + minutes ??= new List(); + hours ??= new List(); + weekDays ??= new List(); + monthDays ??= new List(); + monthlyOccurrences ??= new List(); + + return new RecurrenceSchedule(minutes?.ToList(), hours?.ToList(), weekDays?.ToList(), monthDays?.ToList(), monthlyOccurrences?.ToList()); + } + + /// Initializes a new instance of RecurrenceScheduleOccurrence. + /// The day of the week. + /// The occurrence. + /// A new instance for mocking. + public static RecurrenceScheduleOccurrence RecurrenceScheduleOccurrence(DayOfWeek? day = null, int? occurrence = null) + { + return new RecurrenceScheduleOccurrence(day, occurrence); + } + + /// Initializes a new instance of WorkflowTriggerHistoryData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Gets the start time. + /// Gets the end time. + /// The scheduled time. + /// Gets the status. + /// Gets the code. + /// Gets the error. + /// Gets the tracking id. + /// The run correlation. + /// Gets the link to input parameters. + /// Gets the link to output parameters. + /// The value indicating whether trigger was fired. + /// Gets the reference to workflow run. + /// A new instance for mocking. + public static WorkflowTriggerHistoryData WorkflowTriggerHistoryData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, DateTimeOffset? scheduledOn = null, WorkflowStatus? status = null, string code = null, BinaryData error = null, string trackingId = null, string correlationClientTrackingId = null, ContentLink inputsLink = null, ContentLink outputsLink = null, bool? fired = null, ResourceReference run = null) + { + return new WorkflowTriggerHistoryData(id, name, resourceType, systemData, startOn, endOn, scheduledOn, status, code, error, trackingId, correlationClientTrackingId != null ? new Correlation(correlationClientTrackingId) : null, inputsLink, outputsLink, fired, run); + } + + /// Initializes a new instance of WorkflowTriggerCallbackUri. + /// Gets the workflow trigger callback URL. + /// Gets the workflow trigger callback URL HTTP method. + /// Gets the workflow trigger callback URL base path. + /// Gets the workflow trigger callback URL relative path. + /// Gets the workflow trigger callback URL relative path parameters. + /// Gets the workflow trigger callback URL query parameters. + /// A new instance for mocking. + public static WorkflowTriggerCallbackUri WorkflowTriggerCallbackUri(string value = null, string method = null, string basePath = null, string relativePath = null, IEnumerable relativePathParameters = null, WorkflowTriggerListCallbackUrlQueries queries = null) + { + relativePathParameters ??= new List(); + + return new WorkflowTriggerCallbackUri(value, method, basePath, relativePath, relativePathParameters?.ToList(), queries); + } + + /// Initializes a new instance of WorkflowTriggerListCallbackUrlQueries. + /// The api version. + /// The SAS permissions. + /// The SAS version. + /// The SAS signature. + /// The SAS timestamp. + /// A new instance for mocking. + public static WorkflowTriggerListCallbackUrlQueries WorkflowTriggerListCallbackUrlQueries(string apiVersion = null, string sp = null, string sv = null, string sig = null, string se = null) + { + return new WorkflowTriggerListCallbackUrlQueries(apiVersion, sp, sv, sig, se); + } + + /// Initializes a new instance of JsonSchema. + /// The JSON title. + /// The JSON content. + /// A new instance for mocking. + public static JsonSchema JsonSchema(string title = null, string content = null) + { + return new JsonSchema(title, content); + } + + /// Initializes a new instance of Workflow. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Managed service identity. + /// Gets the provisioning state. + /// Gets the created time. + /// Gets the changed time. + /// The state. + /// Gets the version. + /// Gets the access endpoint. + /// The endpoints configuration. + /// The access control configuration. + /// The sku. + /// The integration account. + /// The integration service environment. + /// The definition. + /// The parameters. + /// The workflow kind. + /// A new instance for mocking. + public static Workflow Workflow(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, WorkflowProvisioningState? provisioningState = null, DateTimeOffset? createdOn = null, DateTimeOffset? changedOn = null, WorkflowState? state = null, string version = null, string accessEndpoint = null, FlowEndpointsConfiguration endpointsConfiguration = null, FlowAccessControlConfiguration accessControl = null, WorkflowSku sku = null, ResourceReference integrationAccount = null, ResourceReference integrationServiceEnvironment = null, BinaryData definition = null, IDictionary parameters = null, AppServiceKind? kind = null) + { + tags ??= new Dictionary(); + parameters ??= new Dictionary(); + + return new Workflow(id, name, resourceType, systemData, tags, location, identity, provisioningState, createdOn, changedOn, state, version, accessEndpoint, endpointsConfiguration, accessControl, sku, integrationAccount, integrationServiceEnvironment, definition, parameters, kind); + } + + /// Initializes a new instance of WorkflowSku. + /// The name. + /// The reference to plan. + /// A new instance for mocking. + public static WorkflowSku WorkflowSku(WorkflowSkuName name = default, ResourceReference plan = null) + { + return new WorkflowSku(name, plan); + } + + /// Initializes a new instance of WorkflowVersionData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The provisioning state. + /// Gets the created time. + /// Gets the changed time. + /// The state. + /// Gets the version. + /// Gets the access endpoint. + /// The endpoints configuration. + /// The access control configuration. + /// The sku. + /// The integration account. + /// The definition. + /// The parameters. + /// A new instance for mocking. + public static WorkflowVersionData WorkflowVersionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, WorkflowProvisioningState? provisioningState = null, DateTimeOffset? createdOn = null, DateTimeOffset? changedOn = null, WorkflowState? state = null, string version = null, string accessEndpoint = null, FlowEndpointsConfiguration endpointsConfiguration = null, FlowAccessControlConfiguration accessControl = null, WorkflowSku sku = null, ResourceReference integrationAccount = null, BinaryData definition = null, IDictionary parameters = null) + { + tags ??= new Dictionary(); + parameters ??= new Dictionary(); + + return new WorkflowVersionData(id, name, resourceType, systemData, tags, location, provisioningState, createdOn, changedOn, state, version, accessEndpoint, endpointsConfiguration, accessControl, sku, integrationAccount, definition, parameters); + } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AseV3NetworkingConfigurationData.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AseV3NetworkingConfigurationData.cs index 1cc6b0bd9bf4..0b8314f7af83 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AseV3NetworkingConfigurationData.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AseV3NetworkingConfigurationData.cs @@ -37,14 +37,20 @@ public AseV3NetworkingConfigurationData() /// /// /// Property to enable and disable new private endpoint connection creation on ASE. + /// Property to enable and disable FTP on ASEV3. + /// Property to enable and disable Remote Debug on ASEV3. + /// Customer provided Inbound IP Address. Only able to be set on Ase create. /// Kind of resource. - internal AseV3NetworkingConfigurationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IReadOnlyList windowsOutboundIPAddresses, IReadOnlyList linuxOutboundIPAddresses, IReadOnlyList externalInboundIPAddresses, IReadOnlyList internalInboundIPAddresses, bool? allowNewPrivateEndpointConnections, string kind) : base(id, name, resourceType, systemData) + internal AseV3NetworkingConfigurationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IReadOnlyList windowsOutboundIPAddresses, IReadOnlyList linuxOutboundIPAddresses, IReadOnlyList externalInboundIPAddresses, IReadOnlyList internalInboundIPAddresses, bool? allowNewPrivateEndpointConnections, bool? ftpEnabled, bool? remoteDebugEnabled, string inboundIPAddressOverride, string kind) : base(id, name, resourceType, systemData) { WindowsOutboundIPAddresses = windowsOutboundIPAddresses; LinuxOutboundIPAddresses = linuxOutboundIPAddresses; ExternalInboundIPAddresses = externalInboundIPAddresses; InternalInboundIPAddresses = internalInboundIPAddresses; AllowNewPrivateEndpointConnections = allowNewPrivateEndpointConnections; + FtpEnabled = ftpEnabled; + RemoteDebugEnabled = remoteDebugEnabled; + InboundIPAddressOverride = inboundIPAddressOverride; Kind = kind; } @@ -58,6 +64,12 @@ internal AseV3NetworkingConfigurationData(ResourceIdentifier id, string name, Re public IReadOnlyList InternalInboundIPAddresses { get; } /// Property to enable and disable new private endpoint connection creation on ASE. public bool? AllowNewPrivateEndpointConnections { get; set; } + /// Property to enable and disable FTP on ASEV3. + public bool? FtpEnabled { get; set; } + /// Property to enable and disable Remote Debug on ASEV3. + public bool? RemoteDebugEnabled { get; set; } + /// Customer provided Inbound IP Address. Only able to be set on Ase create. + public string InboundIPAddressOverride { get; set; } /// Kind of resource. public string Kind { get; set; } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AuthsettingsV2SiteConfigResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AuthsettingsV2SiteConfigResource.cs new file mode 100644 index 000000000000..f2c2dc133fe1 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AuthsettingsV2SiteConfigResource.cs @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.AppService +{ + /// + /// A Class representing an AuthsettingsV2SiteConfig along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetAuthsettingsV2SiteConfigResource method. + /// Otherwise you can get one from its parent resource using the GetAuthsettingsV2SiteConfig method. + /// + public partial class AuthsettingsV2SiteConfigResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The name. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string name) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _authsettingsV2SiteConfigWebAppsClientDiagnostics; + private readonly WebAppsRestOperations _authsettingsV2SiteConfigWebAppsRestClient; + private readonly SiteAuthSettingsV2Data _data; + + /// Initializes a new instance of the class for mocking. + protected AuthsettingsV2SiteConfigResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AuthsettingsV2SiteConfigResource(ArmClient client, SiteAuthSettingsV2Data data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal AuthsettingsV2SiteConfigResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _authsettingsV2SiteConfigWebAppsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppService", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string authsettingsV2SiteConfigWebAppsApiVersion); + _authsettingsV2SiteConfigWebAppsRestClient = new WebAppsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, authsettingsV2SiteConfigWebAppsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Web/sites/config"; + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual SiteAuthSettingsV2Data Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Description for Gets site's Authentication / Authorization settings for apps via the V2 format + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2 + /// + /// + /// Operation Id + /// WebApps_GetAuthSettingsV2WithoutSecrets + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _authsettingsV2SiteConfigWebAppsClientDiagnostics.CreateScope("AuthsettingsV2SiteConfigResource.Get"); + scope.Start(); + try + { + var response = await _authsettingsV2SiteConfigWebAppsRestClient.GetAuthSettingsV2WithoutSecretsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AuthsettingsV2SiteConfigResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Gets site's Authentication / Authorization settings for apps via the V2 format + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2 + /// + /// + /// Operation Id + /// WebApps_GetAuthSettingsV2WithoutSecrets + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _authsettingsV2SiteConfigWebAppsClientDiagnostics.CreateScope("AuthsettingsV2SiteConfigResource.Get"); + scope.Start(); + try + { + var response = _authsettingsV2SiteConfigWebAppsRestClient.GetAuthSettingsV2WithoutSecrets(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AuthsettingsV2SiteConfigResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Updates site's Authentication / Authorization settings for apps via the V2 format + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2 + /// + /// + /// Operation Id + /// WebApps_UpdateAuthSettingsV2 + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Auth settings associated with web app. + /// The cancellation token to use. + /// is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, SiteAuthSettingsV2Data data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _authsettingsV2SiteConfigWebAppsClientDiagnostics.CreateScope("AuthsettingsV2SiteConfigResource.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _authsettingsV2SiteConfigWebAppsRestClient.UpdateAuthSettingsV2Async(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new AppServiceArmOperation(Response.FromValue(new AuthsettingsV2SiteConfigResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Updates site's Authentication / Authorization settings for apps via the V2 format + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2 + /// + /// + /// Operation Id + /// WebApps_UpdateAuthSettingsV2 + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Auth settings associated with web app. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, SiteAuthSettingsV2Data data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _authsettingsV2SiteConfigWebAppsClientDiagnostics.CreateScope("AuthsettingsV2SiteConfigResource.CreateOrUpdate"); + scope.Start(); + try + { + var response = _authsettingsV2SiteConfigWebAppsRestClient.UpdateAuthSettingsV2(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data, cancellationToken); + var operation = new AppServiceArmOperation(Response.FromValue(new AuthsettingsV2SiteConfigResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Gets site's Authentication / Authorization settings for apps via the V2 format + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2/list + /// + /// + /// Operation Id + /// WebApps_GetAuthSettingsV2 + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAuthSettingsV2Async(CancellationToken cancellationToken = default) + { + using var scope = _authsettingsV2SiteConfigWebAppsClientDiagnostics.CreateScope("AuthsettingsV2SiteConfigResource.GetAuthSettingsV2"); + scope.Start(); + try + { + var response = await _authsettingsV2SiteConfigWebAppsRestClient.GetAuthSettingsV2Async(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new AuthsettingsV2SiteConfigResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Gets site's Authentication / Authorization settings for apps via the V2 format + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2/list + /// + /// + /// Operation Id + /// WebApps_GetAuthSettingsV2 + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetAuthSettingsV2(CancellationToken cancellationToken = default) + { + using var scope = _authsettingsV2SiteConfigWebAppsClientDiagnostics.CreateScope("AuthsettingsV2SiteConfigResource.GetAuthSettingsV2"); + scope.Start(); + try + { + var response = _authsettingsV2SiteConfigWebAppsRestClient.GetAuthSettingsV2(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken); + return Response.FromValue(new AuthsettingsV2SiteConfigResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AuthsettingsV2SiteSlotConfigResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AuthsettingsV2SiteSlotConfigResource.cs new file mode 100644 index 000000000000..32c485da9418 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/AuthsettingsV2SiteSlotConfigResource.cs @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.AppService +{ + /// + /// A Class representing an AuthsettingsV2SiteSlotConfig along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetAuthsettingsV2SiteSlotConfigResource method. + /// Otherwise you can get one from its parent resource using the GetAuthsettingsV2SiteSlotConfig method. + /// + public partial class AuthsettingsV2SiteSlotConfigResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The name. + /// The slot. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string name, string slot) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _authsettingsV2SiteSlotConfigWebAppsClientDiagnostics; + private readonly WebAppsRestOperations _authsettingsV2SiteSlotConfigWebAppsRestClient; + private readonly SiteAuthSettingsV2Data _data; + + /// Initializes a new instance of the class for mocking. + protected AuthsettingsV2SiteSlotConfigResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AuthsettingsV2SiteSlotConfigResource(ArmClient client, SiteAuthSettingsV2Data data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal AuthsettingsV2SiteSlotConfigResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _authsettingsV2SiteSlotConfigWebAppsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppService", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string authsettingsV2SiteSlotConfigWebAppsApiVersion); + _authsettingsV2SiteSlotConfigWebAppsRestClient = new WebAppsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, authsettingsV2SiteSlotConfigWebAppsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Web/sites/slots/config"; + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual SiteAuthSettingsV2Data Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets site's Authentication / Authorization settings for apps via the V2 format + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2 + /// + /// + /// Operation Id + /// WebApps_GetAuthSettingsV2WithoutSecretsSlot + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _authsettingsV2SiteSlotConfigWebAppsClientDiagnostics.CreateScope("AuthsettingsV2SiteSlotConfigResource.Get"); + scope.Start(); + try + { + var response = await _authsettingsV2SiteSlotConfigWebAppsRestClient.GetAuthSettingsV2WithoutSecretsSlotAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AuthsettingsV2SiteSlotConfigResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets site's Authentication / Authorization settings for apps via the V2 format + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2 + /// + /// + /// Operation Id + /// WebApps_GetAuthSettingsV2WithoutSecretsSlot + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _authsettingsV2SiteSlotConfigWebAppsClientDiagnostics.CreateScope("AuthsettingsV2SiteSlotConfigResource.Get"); + scope.Start(); + try + { + var response = _authsettingsV2SiteSlotConfigWebAppsRestClient.GetAuthSettingsV2WithoutSecretsSlot(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AuthsettingsV2SiteSlotConfigResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Updates site's Authentication / Authorization settings for apps via the V2 format + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2 + /// + /// + /// Operation Id + /// WebApps_UpdateAuthSettingsV2Slot + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Auth settings associated with web app. + /// The cancellation token to use. + /// is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, SiteAuthSettingsV2Data data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _authsettingsV2SiteSlotConfigWebAppsClientDiagnostics.CreateScope("AuthsettingsV2SiteSlotConfigResource.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _authsettingsV2SiteSlotConfigWebAppsRestClient.UpdateAuthSettingsV2SlotAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new AppServiceArmOperation(Response.FromValue(new AuthsettingsV2SiteSlotConfigResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Updates site's Authentication / Authorization settings for apps via the V2 format + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2 + /// + /// + /// Operation Id + /// WebApps_UpdateAuthSettingsV2Slot + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Auth settings associated with web app. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, SiteAuthSettingsV2Data data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _authsettingsV2SiteSlotConfigWebAppsClientDiagnostics.CreateScope("AuthsettingsV2SiteSlotConfigResource.CreateOrUpdate"); + scope.Start(); + try + { + var response = _authsettingsV2SiteSlotConfigWebAppsRestClient.UpdateAuthSettingsV2Slot(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, data, cancellationToken); + var operation = new AppServiceArmOperation(Response.FromValue(new AuthsettingsV2SiteSlotConfigResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Gets site's Authentication / Authorization settings for apps via the V2 format + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2/list + /// + /// + /// Operation Id + /// WebApps_GetAuthSettingsV2Slot + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAuthSettingsV2SlotAsync(CancellationToken cancellationToken = default) + { + using var scope = _authsettingsV2SiteSlotConfigWebAppsClientDiagnostics.CreateScope("AuthsettingsV2SiteSlotConfigResource.GetAuthSettingsV2Slot"); + scope.Start(); + try + { + var response = await _authsettingsV2SiteSlotConfigWebAppsRestClient.GetAuthSettingsV2SlotAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new AuthsettingsV2SiteSlotConfigResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Gets site's Authentication / Authorization settings for apps via the V2 format + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2/list + /// + /// + /// Operation Id + /// WebApps_GetAuthSettingsV2Slot + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetAuthSettingsV2Slot(CancellationToken cancellationToken = default) + { + using var scope = _authsettingsV2SiteSlotConfigWebAppsClientDiagnostics.CreateScope("AuthsettingsV2SiteSlotConfigResource.GetAuthSettingsV2Slot"); + scope.Start(); + try + { + var response = _authsettingsV2SiteSlotConfigWebAppsRestClient.GetAuthSettingsV2Slot(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken); + return Response.FromValue(new AuthsettingsV2SiteSlotConfigResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ContainerAppCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ContainerAppCollection.cs new file mode 100644 index 000000000000..b8a002a4b679 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ContainerAppCollection.cs @@ -0,0 +1,416 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.AppService +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetContainerApps method from an instance of . + /// + public partial class ContainerAppCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _containerAppClientDiagnostics; + private readonly ContainerAppsRestOperations _containerAppRestClient; + + /// Initializes a new instance of the class for mocking. + protected ContainerAppCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal ContainerAppCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _containerAppClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppService", ContainerAppResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ContainerAppResource.ResourceType, out string containerAppApiVersion); + _containerAppRestClient = new ContainerAppsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerAppApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Description for Create or update a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_CreateOrUpdate + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the Container App. + /// The ContainerApp to use. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string name, ContainerAppData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _containerAppRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, name, data, cancellationToken).ConfigureAwait(false); + var operation = new AppServiceArmOperation(new ContainerAppOperationSource(Client), _containerAppClientDiagnostics, Pipeline, _containerAppRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Create or update a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_CreateOrUpdate + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the Container App. + /// The ContainerApp to use. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string name, ContainerAppData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _containerAppRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, name, data, cancellationToken); + var operation = new AppServiceArmOperation(new ContainerAppOperationSource(Client), _containerAppClientDiagnostics, Pipeline, _containerAppRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the properties of a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// Name of the Container App. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppCollection.Get"); + scope.Start(); + try + { + var response = await _containerAppRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerAppResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the properties of a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// Name of the Container App. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppCollection.Get"); + scope.Start(); + try + { + var response = _containerAppRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerAppResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the Container Apps in a given resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps + /// + /// + /// Operation Id + /// ContainerApps_ListByResourceGroup + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerAppRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerAppRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerAppResource(Client, ContainerAppData.DeserializeContainerAppData(e)), _containerAppClientDiagnostics, Pipeline, "ContainerAppCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Get the Container Apps in a given resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps + /// + /// + /// Operation Id + /// ContainerApps_ListByResourceGroup + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _containerAppRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerAppRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerAppResource(Client, ContainerAppData.DeserializeContainerAppData(e)), _containerAppClientDiagnostics, Pipeline, "ContainerAppCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// Name of the Container App. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppCollection.Exists"); + scope.Start(); + try + { + var response = await _containerAppRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, name, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// Name of the Container App. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppCollection.Exists"); + scope.Start(); + try + { + var response = _containerAppRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, name, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// Name of the Container App. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _containerAppRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, name, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ContainerAppResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// Name of the Container App. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppCollection.GetIfExists"); + scope.Start(); + try + { + var response = _containerAppRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, name, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ContainerAppResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ContainerAppData.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ContainerAppData.cs new file mode 100644 index 000000000000..6ab030d9c0b2 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ContainerAppData.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.AppService.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppService +{ + /// + /// A class representing the ContainerApp data model. + /// Container App. + /// + public partial class ContainerAppData : TrackedResourceData + { + /// Initializes a new instance of ContainerAppData. + /// The location. + public ContainerAppData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of ContainerAppData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Provisioning state of the Container App. + /// Resource ID of the Container App's KubeEnvironment. + /// Name of the latest revision of the Container App. + /// Fully Qualified Domain Name of the latest revision of the Container App. + /// Non versioned Container App configuration properties. + /// Container App versioned application definition. + /// Kind of resource. + internal ContainerAppData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ContainerAppProvisioningState? provisioningState, string kubeEnvironmentId, string latestRevisionName, string latestRevisionFqdn, Configuration configuration, Template template, string kind) : base(id, name, resourceType, systemData, tags, location) + { + ProvisioningState = provisioningState; + KubeEnvironmentId = kubeEnvironmentId; + LatestRevisionName = latestRevisionName; + LatestRevisionFqdn = latestRevisionFqdn; + Configuration = configuration; + Template = template; + Kind = kind; + } + + /// Provisioning state of the Container App. + public ContainerAppProvisioningState? ProvisioningState { get; } + /// Resource ID of the Container App's KubeEnvironment. + public string KubeEnvironmentId { get; set; } + /// Name of the latest revision of the Container App. + public string LatestRevisionName { get; } + /// Fully Qualified Domain Name of the latest revision of the Container App. + public string LatestRevisionFqdn { get; } + /// Non versioned Container App configuration properties. + public Configuration Configuration { get; set; } + /// Container App versioned application definition. + public Template Template { get; set; } + /// Kind of resource. + public string Kind { get; set; } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ContainerAppResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ContainerAppResource.cs new file mode 100644 index 000000000000..d412955aeb98 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/ContainerAppResource.cs @@ -0,0 +1,643 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.AppService +{ + /// + /// A Class representing a ContainerApp along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetContainerAppResource method. + /// Otherwise you can get one from its parent resource using the GetContainerApp method. + /// + public partial class ContainerAppResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The name. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string name) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _containerAppClientDiagnostics; + private readonly ContainerAppsRestOperations _containerAppRestClient; + private readonly ContainerAppData _data; + + /// Initializes a new instance of the class for mocking. + protected ContainerAppResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ContainerAppResource(ArmClient client, ContainerAppData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal ContainerAppResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _containerAppClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppService", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string containerAppApiVersion); + _containerAppRestClient = new ContainerAppsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerAppApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Web/containerApps"; + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual ContainerAppData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of RevisionResources in the ContainerApp. + /// An object representing collection of RevisionResources and their operations over a RevisionResource. + public virtual RevisionCollection GetRevisions() + { + return GetCachedClient(client => new RevisionCollection(client, Id)); + } + + /// + /// Get a revision of a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{containerAppName}/revisions/{name} + /// + /// + /// Operation Id + /// ContainerAppsRevisions_GetRevision + /// + /// + /// + /// Name of the Container App Revision. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRevisionAsync(string name, CancellationToken cancellationToken = default) + { + return await GetRevisions().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a revision of a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{containerAppName}/revisions/{name} + /// + /// + /// Operation Id + /// ContainerAppsRevisions_GetRevision + /// + /// + /// + /// Name of the Container App Revision. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRevision(string name, CancellationToken cancellationToken = default) + { + return GetRevisions().Get(name, cancellationToken); + } + + /// + /// Get the properties of a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppResource.Get"); + scope.Start(); + try + { + var response = await _containerAppRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerAppResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the properties of a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppResource.Get"); + scope.Start(); + try + { + var response = _containerAppRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ContainerAppResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Delete a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Delete + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppResource.Delete"); + scope.Start(); + try + { + var response = await _containerAppRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new AppServiceArmOperation(_containerAppClientDiagnostics, Pipeline, _containerAppRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Delete a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Delete + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppResource.Delete"); + scope.Start(); + try + { + var response = _containerAppRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new AppServiceArmOperation(_containerAppClientDiagnostics, Pipeline, _containerAppRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Create or update a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_CreateOrUpdate + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The ContainerApp to use. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerAppData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppResource.Update"); + scope.Start(); + try + { + var response = await _containerAppRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new AppServiceArmOperation(new ContainerAppOperationSource(Client), _containerAppClientDiagnostics, Pipeline, _containerAppRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Description for Create or update a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_CreateOrUpdate + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The ContainerApp to use. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ContainerAppData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppResource.Update"); + scope.Start(); + try + { + var response = _containerAppRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data, cancellationToken); + var operation = new AppServiceArmOperation(new ContainerAppOperationSource(Client), _containerAppClientDiagnostics, Pipeline, _containerAppRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _containerAppRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ContainerAppResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + current.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, current, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _containerAppRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ContainerAppResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + current.Tags[key] = value; + var result = Update(WaitUntil.Completed, current, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _containerAppRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ContainerAppResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + current.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, current, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _containerAppRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ContainerAppResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + current.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, current, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _containerAppRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ContainerAppResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + current.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, current, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _containerAppClientDiagnostics.CreateScope("ContainerAppResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _containerAppRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ContainerAppResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + current.Tags.Remove(key); + var result = Update(WaitUntil.Completed, current, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/CsmDeploymentStatusData.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/CsmDeploymentStatusData.cs new file mode 100644 index 000000000000..05331ccc4d64 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/CsmDeploymentStatusData.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.AppService.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppService +{ + /// + /// A class representing the CsmDeploymentStatus data model. + /// Deployment status response payload. + /// + public partial class CsmDeploymentStatusData : ResourceData + { + /// Initializes a new instance of CsmDeploymentStatusData. + public CsmDeploymentStatusData() + { + FailedInstancesLogs = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + } + + /// Initializes a new instance of CsmDeploymentStatusData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Deployment operation id. + /// Deployment build status. + /// Number of site instances currently being provisioned. + /// Number of site instances provisioned successfully. + /// Number of site instances failed to provision. + /// List of URLs pointing to logs for instances which failed to provision. + /// List of errors. + /// Kind of resource. + internal CsmDeploymentStatusData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string deploymentId, DeploymentBuildStatus? status, int? numberOfInstancesInProgress, int? numberOfInstancesSuccessful, int? numberOfInstancesFailed, IList failedInstancesLogs, IList errors, string kind) : base(id, name, resourceType, systemData) + { + DeploymentId = deploymentId; + Status = status; + NumberOfInstancesInProgress = numberOfInstancesInProgress; + NumberOfInstancesSuccessful = numberOfInstancesSuccessful; + NumberOfInstancesFailed = numberOfInstancesFailed; + FailedInstancesLogs = failedInstancesLogs; + Errors = errors; + Kind = kind; + } + + /// Deployment operation id. + public string DeploymentId { get; set; } + /// Deployment build status. + public DeploymentBuildStatus? Status { get; set; } + /// Number of site instances currently being provisioned. + public int? NumberOfInstancesInProgress { get; set; } + /// Number of site instances provisioned successfully. + public int? NumberOfInstancesSuccessful { get; set; } + /// Number of site instances failed to provision. + public int? NumberOfInstancesFailed { get; set; } + /// List of URLs pointing to logs for instances which failed to provision. + public IList FailedInstancesLogs { get; } + /// List of errors. + public IList Errors { get; } + /// Kind of resource. + public string Kind { get; set; } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/CustomDnsSuffixConfigurationData.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/CustomDnsSuffixConfigurationData.cs new file mode 100644 index 000000000000..9ca7d5b087fb --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/CustomDnsSuffixConfigurationData.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; +using Azure.ResourceManager.AppService.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppService +{ + /// + /// A class representing the CustomDnsSuffixConfiguration data model. + /// Full view of the custom domain suffix configuration for ASEv3. + /// + public partial class CustomDnsSuffixConfigurationData : ResourceData + { + /// Initializes a new instance of CustomDnsSuffixConfigurationData. + public CustomDnsSuffixConfigurationData() + { + } + + /// Initializes a new instance of CustomDnsSuffixConfigurationData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// + /// The default custom domain suffix to use for all sites deployed on the ASE. + /// The URL referencing the Azure Key Vault certificate secret that should be used as the default SSL/TLS certificate for sites with the custom domain suffix. + /// The user-assigned identity to use for resolving the key vault certificate reference. If not specified, the system-assigned ASE identity will be used if available. + /// Kind of resource. + internal CustomDnsSuffixConfigurationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, CustomDnsSuffixProvisioningState? provisioningState, string provisioningDetails, string dnsSuffix, Uri certificateUri, string keyVaultReferenceIdentity, string kind) : base(id, name, resourceType, systemData) + { + ProvisioningState = provisioningState; + ProvisioningDetails = provisioningDetails; + DnsSuffix = dnsSuffix; + CertificateUri = certificateUri; + KeyVaultReferenceIdentity = keyVaultReferenceIdentity; + Kind = kind; + } + + /// Gets the provisioning state. + public CustomDnsSuffixProvisioningState? ProvisioningState { get; } + /// Gets the provisioning details. + public string ProvisioningDetails { get; } + /// The default custom domain suffix to use for all sites deployed on the ASE. + public string DnsSuffix { get; set; } + /// The URL referencing the Azure Key Vault certificate secret that should be used as the default SSL/TLS certificate for sites with the custom domain suffix. + public Uri CertificateUri { get; set; } + /// The user-assigned identity to use for resolving the key vault certificate reference. If not specified, the system-assigned ASE identity will be used if available. + public string KeyVaultReferenceIdentity { get; set; } + /// Kind of resource. + public string Kind { get; set; } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/CustomDnsSuffixConfigurationResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/CustomDnsSuffixConfigurationResource.cs new file mode 100644 index 000000000000..e6abf3baa8d6 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/CustomDnsSuffixConfigurationResource.cs @@ -0,0 +1,300 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.AppService +{ + /// + /// A Class representing a CustomDnsSuffixConfiguration along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetCustomDnsSuffixConfigurationResource method. + /// Otherwise you can get one from its parent resource using the GetCustomDnsSuffixConfiguration method. + /// + public partial class CustomDnsSuffixConfigurationResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The name. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string name) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/customdnssuffix"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _customDnsSuffixConfigurationAppServiceEnvironmentsClientDiagnostics; + private readonly AppServiceEnvironmentsRestOperations _customDnsSuffixConfigurationAppServiceEnvironmentsRestClient; + private readonly CustomDnsSuffixConfigurationData _data; + + /// Initializes a new instance of the class for mocking. + protected CustomDnsSuffixConfigurationResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal CustomDnsSuffixConfigurationResource(ArmClient client, CustomDnsSuffixConfigurationData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal CustomDnsSuffixConfigurationResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _customDnsSuffixConfigurationAppServiceEnvironmentsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.AppService", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string customDnsSuffixConfigurationAppServiceEnvironmentsApiVersion); + _customDnsSuffixConfigurationAppServiceEnvironmentsRestClient = new AppServiceEnvironmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, customDnsSuffixConfigurationAppServiceEnvironmentsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Web/hostingEnvironments/configurations"; + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual CustomDnsSuffixConfigurationData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get Custom Dns Suffix configuration of an App Service Environment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/customdnssuffix + /// + /// + /// Operation Id + /// AppServiceEnvironments_GetAseCustomDnsSuffixConfiguration + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _customDnsSuffixConfigurationAppServiceEnvironmentsClientDiagnostics.CreateScope("CustomDnsSuffixConfigurationResource.Get"); + scope.Start(); + try + { + var response = await _customDnsSuffixConfigurationAppServiceEnvironmentsRestClient.GetAseCustomDnsSuffixConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CustomDnsSuffixConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get Custom Dns Suffix configuration of an App Service Environment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/customdnssuffix + /// + /// + /// Operation Id + /// AppServiceEnvironments_GetAseCustomDnsSuffixConfiguration + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _customDnsSuffixConfigurationAppServiceEnvironmentsClientDiagnostics.CreateScope("CustomDnsSuffixConfigurationResource.Get"); + scope.Start(); + try + { + var response = _customDnsSuffixConfigurationAppServiceEnvironmentsRestClient.GetAseCustomDnsSuffixConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CustomDnsSuffixConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete Custom Dns Suffix configuration of an App Service Environment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/customdnssuffix + /// + /// + /// Operation Id + /// AppServiceEnvironments_DeleteAseCustomDnsSuffixConfiguration + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task> DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _customDnsSuffixConfigurationAppServiceEnvironmentsClientDiagnostics.CreateScope("CustomDnsSuffixConfigurationResource.Delete"); + scope.Start(); + try + { + var response = await _customDnsSuffixConfigurationAppServiceEnvironmentsRestClient.DeleteAseCustomDnsSuffixConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false); + var operation = new AppServiceArmOperation(response); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete Custom Dns Suffix configuration of an App Service Environment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/customdnssuffix + /// + /// + /// Operation Id + /// AppServiceEnvironments_DeleteAseCustomDnsSuffixConfiguration + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _customDnsSuffixConfigurationAppServiceEnvironmentsClientDiagnostics.CreateScope("CustomDnsSuffixConfigurationResource.Delete"); + scope.Start(); + try + { + var response = _customDnsSuffixConfigurationAppServiceEnvironmentsRestClient.DeleteAseCustomDnsSuffixConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken); + var operation = new AppServiceArmOperation(response); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update Custom Dns Suffix configuration of an App Service Environment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/customdnssuffix + /// + /// + /// Operation Id + /// AppServiceEnvironments_UpdateAseCustomDnsSuffixConfiguration + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The CustomDnsSuffixConfiguration to use. + /// The cancellation token to use. + /// is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, CustomDnsSuffixConfigurationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _customDnsSuffixConfigurationAppServiceEnvironmentsClientDiagnostics.CreateScope("CustomDnsSuffixConfigurationResource.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _customDnsSuffixConfigurationAppServiceEnvironmentsRestClient.UpdateAseCustomDnsSuffixConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new AppServiceArmOperation(Response.FromValue(new CustomDnsSuffixConfigurationResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update Custom Dns Suffix configuration of an App Service Environment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/customdnssuffix + /// + /// + /// Operation Id + /// AppServiceEnvironments_UpdateAseCustomDnsSuffixConfiguration + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The CustomDnsSuffixConfiguration to use. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, CustomDnsSuffixConfigurationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _customDnsSuffixConfigurationAppServiceEnvironmentsClientDiagnostics.CreateScope("CustomDnsSuffixConfigurationResource.CreateOrUpdate"); + scope.Start(); + try + { + var response = _customDnsSuffixConfigurationAppServiceEnvironmentsRestClient.UpdateAseCustomDnsSuffixConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data, cancellationToken); + var operation = new AppServiceArmOperation(Response.FromValue(new CustomDnsSuffixConfigurationResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/DatabaseConnectionData.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/DatabaseConnectionData.cs new file mode 100644 index 000000000000..9d08fcf5130d --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/DatabaseConnectionData.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.AppService.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppService +{ + /// + /// A class representing the DatabaseConnection data model. + /// Static Site Database Connection resource. + /// + public partial class DatabaseConnectionData : ResourceData + { + /// Initializes a new instance of DatabaseConnectionData. + public DatabaseConnectionData() + { + ConfigurationFiles = new ChangeTrackingList(); + } + + /// Initializes a new instance of DatabaseConnectionData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource id of the database. + /// If present, the identity is used in conjunction with connection string to connect to the database. Use of the system-assigned managed identity is indicated with the string 'SystemAssigned', while use of a user-assigned managed identity is indicated with the resource id of the managed identity resource. + /// The connection string to use to connect to the database. + /// The region of the database resource. + /// A list of configuration files associated with this database connection. + /// Kind of resource. + internal DatabaseConnectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string resourceId, string connectionIdentity, string connectionString, string region, IReadOnlyList configurationFiles, string kind) : base(id, name, resourceType, systemData) + { + ResourceId = resourceId; + ConnectionIdentity = connectionIdentity; + ConnectionString = connectionString; + Region = region; + ConfigurationFiles = configurationFiles; + Kind = kind; + } + + /// The resource id of the database. + public string ResourceId { get; set; } + /// If present, the identity is used in conjunction with connection string to connect to the database. Use of the system-assigned managed identity is indicated with the string 'SystemAssigned', while use of a user-assigned managed identity is indicated with the resource id of the managed identity resource. + public string ConnectionIdentity { get; set; } + /// The connection string to use to connect to the database. + public string ConnectionString { get; set; } + /// The region of the database resource. + public string Region { get; set; } + /// A list of configuration files associated with this database connection. + public IReadOnlyList ConfigurationFiles { get; } + /// Kind of resource. + public string Kind { get; set; } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/AppServiceExtensions.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/AppServiceExtensions.cs index a26905af1132..dd13c6387bdf 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/AppServiceExtensions.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/AppServiceExtensions.cs @@ -200,6 +200,22 @@ public static AppServiceEnvironmentResource GetAppServiceEnvironmentResource(thi return GetMockableAppServiceArmClient(client).GetAppServiceEnvironmentResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static CustomDnsSuffixConfigurationResource GetCustomDnsSuffixConfigurationResource(this ArmClient client, ResourceIdentifier id) + { + return GetMockableAppServiceArmClient(client).GetCustomDnsSuffixConfigurationResource(id); + } + /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. @@ -504,6 +520,38 @@ public static AppCertificateResource GetAppCertificateResource(this ArmClient cl return GetMockableAppServiceArmClient(client).GetAppCertificateResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static ContainerAppResource GetContainerAppResource(this ArmClient client, ResourceIdentifier id) + { + return GetMockableAppServiceArmClient(client).GetContainerAppResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static RevisionResource GetRevisionResource(this ArmClient client, ResourceIdentifier id) + { + return GetMockableAppServiceArmClient(client).GetRevisionResource(id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -760,6 +808,38 @@ public static StaticSiteBuildResource GetStaticSiteBuildResource(this ArmClient return GetMockableAppServiceArmClient(client).GetStaticSiteBuildResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static StaticSiteBuildDatabaseConnectionResource GetStaticSiteBuildDatabaseConnectionResource(this ArmClient client, ResourceIdentifier id) + { + return GetMockableAppServiceArmClient(client).GetStaticSiteBuildDatabaseConnectionResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static StaticSiteDatabaseConnectionResource GetStaticSiteDatabaseConnectionResource(this ArmClient client, ResourceIdentifier id) + { + return GetMockableAppServiceArmClient(client).GetStaticSiteDatabaseConnectionResource(id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -792,6 +872,22 @@ public static StaticSiteUserProvidedFunctionAppResource GetStaticSiteUserProvide return GetMockableAppServiceArmClient(client).GetStaticSiteUserProvidedFunctionAppResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static StaticSiteBasicAuthPropertiesARMResource GetStaticSiteBasicAuthPropertiesARMResource(this ArmClient client, ResourceIdentifier id) + { + return GetMockableAppServiceArmClient(client).GetStaticSiteBasicAuthPropertiesARMResource(id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -808,6 +904,38 @@ public static StaticSiteCustomDomainOverviewResource GetStaticSiteCustomDomainOv return GetMockableAppServiceArmClient(client).GetStaticSiteCustomDomainOverviewResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static StaticSiteLinkedBackendResource GetStaticSiteLinkedBackendResource(this ArmClient client, ResourceIdentifier id) + { + return GetMockableAppServiceArmClient(client).GetStaticSiteLinkedBackendResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static StaticSiteBuildLinkedBackendResource GetStaticSiteBuildLinkedBackendResource(this ArmClient client, ResourceIdentifier id) + { + return GetMockableAppServiceArmClient(client).GetStaticSiteBuildLinkedBackendResource(id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -936,6 +1064,38 @@ public static ScmSiteSlotBasicPublishingCredentialsPolicyResource GetScmSiteSlot return GetMockableAppServiceArmClient(client).GetScmSiteSlotBasicPublishingCredentialsPolicyResource(id); } + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static AuthsettingsV2SiteConfigResource GetAuthsettingsV2SiteConfigResource(this ArmClient client, ResourceIdentifier id) + { + return GetMockableAppServiceArmClient(client).GetAuthsettingsV2SiteConfigResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static AuthsettingsV2SiteSlotConfigResource GetAuthsettingsV2SiteSlotConfigResource(this ArmClient client, ResourceIdentifier id) + { + return GetMockableAppServiceArmClient(client).GetAuthsettingsV2SiteSlotConfigResource(id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -1144,6 +1304,38 @@ public static WebSiteSlotContinuousWebJobResource GetWebSiteSlotContinuousWebJob return GetMockableAppServiceArmClient(client).GetWebSiteSlotContinuousWebJobResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static SiteDeploymentStatuResource GetSiteDeploymentStatuResource(this ArmClient client, ResourceIdentifier id) + { + return GetMockableAppServiceArmClient(client).GetSiteDeploymentStatuResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static SiteSlotDeploymentStatuResource GetSiteSlotDeploymentStatuResource(this ArmClient client, ResourceIdentifier id) + { + return GetMockableAppServiceArmClient(client).GetSiteSlotDeploymentStatuResource(id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -1784,6 +1976,166 @@ public static WebSiteWebJobResource GetWebSiteWebJobResource(this ArmClient clie return GetMockableAppServiceArmClient(client).GetWebSiteWebJobResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static SiteSlotWorkflowResource GetSiteSlotWorkflowResource(this ArmClient client, ResourceIdentifier id) + { + return GetMockableAppServiceArmClient(client).GetSiteSlotWorkflowResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static SiteWorkflowResource GetSiteWorkflowResource(this ArmClient client, ResourceIdentifier id) + { + return GetMockableAppServiceArmClient(client).GetSiteWorkflowResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static WorkflowRunResource GetWorkflowRunResource(this ArmClient client, ResourceIdentifier id) + { + return GetMockableAppServiceArmClient(client).GetWorkflowRunResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static WorkflowRunActionResource GetWorkflowRunActionResource(this ArmClient client, ResourceIdentifier id) + { + return GetMockableAppServiceArmClient(client).GetWorkflowRunActionResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource GetSiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource(this ArmClient client, ResourceIdentifier id) + { + return GetMockableAppServiceArmClient(client).GetSiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource GetSiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource(this ArmClient client, ResourceIdentifier id) + { + return GetMockableAppServiceArmClient(client).GetSiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static RequestHistoryResource GetRequestHistoryResource(this ArmClient client, ResourceIdentifier id) + { + return GetMockableAppServiceArmClient(client).GetRequestHistoryResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static WorkflowTriggerResource GetWorkflowTriggerResource(this ArmClient client, ResourceIdentifier id) + { + return GetMockableAppServiceArmClient(client).GetWorkflowTriggerResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static WorkflowTriggerHistoryResource GetWorkflowTriggerHistoryResource(this ArmClient client, ResourceIdentifier id) + { + return GetMockableAppServiceArmClient(client).GetWorkflowTriggerHistoryResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static WorkflowVersionResource GetWorkflowVersionResource(this ArmClient client, ResourceIdentifier id) + { + return GetMockableAppServiceArmClient(client).GetWorkflowVersionResource(id); + } + /// /// Gets a collection of AppServiceCertificateOrderResources in the ResourceGroupResource. /// @@ -2134,6 +2486,76 @@ public static Response GetAppCertificate(this ResourceGr return GetMockableAppServiceResourceGroupResource(resourceGroupResource).GetAppCertificate(name, cancellationToken); } + /// + /// Gets a collection of ContainerAppResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// An object representing collection of ContainerAppResources and their operations over a ContainerAppResource. + public static ContainerAppCollection GetContainerApps(this ResourceGroupResource resourceGroupResource) + { + return GetMockableAppServiceResourceGroupResource(resourceGroupResource).GetContainerApps(); + } + + /// + /// Get the properties of a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the Container App. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetContainerAppAsync(this ResourceGroupResource resourceGroupResource, string name, CancellationToken cancellationToken = default) + { + return await GetMockableAppServiceResourceGroupResource(resourceGroupResource).GetContainerAppAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the properties of a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the Container App. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetContainerApp(this ResourceGroupResource resourceGroupResource, string name, CancellationToken cancellationToken = default) + { + return GetMockableAppServiceResourceGroupResource(resourceGroupResource).GetContainerApp(name, cancellationToken); + } + /// /// Gets a collection of KubeEnvironmentResources in the ResourceGroupResource. /// @@ -3002,6 +3424,112 @@ public static Pageable GetAppCertificates(this Subscript return GetMockableAppServiceSubscriptionResource(subscriptionResource).GetAppCertificates(filter, cancellationToken); } + /// + /// Get the Container Apps in a given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/containerApps + /// + /// + /// Operation Id + /// ContainerApps_ListBySubscription + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetContainerAppsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + return GetMockableAppServiceSubscriptionResource(subscriptionResource).GetContainerAppsAsync(cancellationToken); + } + + /// + /// Get the Container Apps in a given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/containerApps + /// + /// + /// Operation Id + /// ContainerApps_ListBySubscription + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetContainerApps(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + return GetMockableAppServiceSubscriptionResource(subscriptionResource).GetContainerApps(cancellationToken); + } + + /// + /// List secrets for a container app + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/containerApps/{name}/listSecrets + /// + /// + /// Operation Id + /// ContainerApps_ListSecrets + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the Container App. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetSecretsContainerAppsAsync(this SubscriptionResource subscriptionResource, string name, CancellationToken cancellationToken = default) + { + return GetMockableAppServiceSubscriptionResource(subscriptionResource).GetSecretsContainerAppsAsync(name, cancellationToken); + } + + /// + /// List secrets for a container app + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/containerApps/{name}/listSecrets + /// + /// + /// Operation Id + /// ContainerApps_ListSecrets + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the Container App. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetSecretsContainerApps(this SubscriptionResource subscriptionResource, string name, CancellationToken cancellationToken = default) + { + return GetMockableAppServiceSubscriptionResource(subscriptionResource).GetSecretsContainerApps(name, cancellationToken); + } + /// /// Description for Get all deleted apps for a subscription at location /// @@ -3524,6 +4052,58 @@ public static Response CheckAppServiceNameAvailability return GetMockableAppServiceSubscriptionResource(subscriptionResource).CheckAppServiceNameAvailability(content, cancellationToken); } + /// + /// Get custom hostnames under this subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/customhostnameSites + /// + /// + /// Operation Id + /// ListCustomHostNameSites + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Specific hostname. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetCustomHostNameSitesAsync(this SubscriptionResource subscriptionResource, string hostname = null, CancellationToken cancellationToken = default) + { + return GetMockableAppServiceSubscriptionResource(subscriptionResource).GetCustomHostNameSitesAsync(hostname, cancellationToken); + } + + /// + /// Get custom hostnames under this subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/customhostnameSites + /// + /// + /// Operation Id + /// ListCustomHostNameSites + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Specific hostname. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetCustomHostNameSites(this SubscriptionResource subscriptionResource, string hostname = null, CancellationToken cancellationToken = default) + { + return GetMockableAppServiceSubscriptionResource(subscriptionResource).GetCustomHostNameSites(hostname, cancellationToken); + } + /// /// Description for Gets list of available geo regions plus ministamps /// @@ -3572,6 +4152,56 @@ public static Response GetAppServiceDeploymentLoc return GetMockableAppServiceSubscriptionResource(subscriptionResource).GetAppServiceDeploymentLocations(cancellationToken); } + /// + /// Description for get a list of available ASE regions and its supported Skus. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/aseRegions + /// + /// + /// Operation Id + /// ListAseRegions + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetAseRegionsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + return GetMockableAppServiceSubscriptionResource(subscriptionResource).GetAseRegionsAsync(cancellationToken); + } + + /// + /// Description for get a list of available ASE regions and its supported Skus. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/aseRegions + /// + /// + /// Operation Id + /// ListAseRegions + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetAseRegions(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + return GetMockableAppServiceSubscriptionResource(subscriptionResource).GetAseRegions(cancellationToken); + } + /// /// Description for Get a list of available geographical regions. /// @@ -3780,6 +4410,58 @@ public static Response VerifyHostingEnvi return GetMockableAppServiceSubscriptionResource(subscriptionResource).VerifyHostingEnvironmentVnet(content, cancellationToken); } + /// + /// List usages in cores for all skus used by a subscription in a given location, for a specific quota type. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/usages + /// + /// + /// Operation Id + /// GetUsagesInLocation_list + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetGetUsagesInLocationsAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) + { + return GetMockableAppServiceSubscriptionResource(subscriptionResource).GetGetUsagesInLocationsAsync(location, cancellationToken); + } + + /// + /// List usages in cores for all skus used by a subscription in a given location, for a specific quota type. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/usages + /// + /// + /// Operation Id + /// GetUsagesInLocation_list + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetGetUsagesInLocations(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) + { + return GetMockableAppServiceSubscriptionResource(subscriptionResource).GetGetUsagesInLocations(location, cancellationToken); + } + /// /// Description for Generates a preview workflow file for the static site /// diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/MockableAppServiceArmClient.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/MockableAppServiceArmClient.cs index c7b8e6773d6a..30209d4da6b9 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/MockableAppServiceArmClient.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/MockableAppServiceArmClient.cs @@ -156,6 +156,18 @@ public virtual AppServiceEnvironmentResource GetAppServiceEnvironmentResource(Re return new AppServiceEnvironmentResource(Client, id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual CustomDnsSuffixConfigurationResource GetCustomDnsSuffixConfigurationResource(ResourceIdentifier id) + { + CustomDnsSuffixConfigurationResource.ValidateResourceId(id); + return new CustomDnsSuffixConfigurationResource(Client, id); + } + /// /// Gets an object representing an along with the instance operations that can be performed on it but with no data. /// You can use to create an from its components. @@ -384,6 +396,30 @@ public virtual AppCertificateResource GetAppCertificateResource(ResourceIdentifi return new AppCertificateResource(Client, id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ContainerAppResource GetContainerAppResource(ResourceIdentifier id) + { + ContainerAppResource.ValidateResourceId(id); + return new ContainerAppResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual RevisionResource GetRevisionResource(ResourceIdentifier id) + { + RevisionResource.ValidateResourceId(id); + return new RevisionResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -576,6 +612,30 @@ public virtual StaticSiteBuildResource GetStaticSiteBuildResource(ResourceIdenti return new StaticSiteBuildResource(Client, id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual StaticSiteBuildDatabaseConnectionResource GetStaticSiteBuildDatabaseConnectionResource(ResourceIdentifier id) + { + StaticSiteBuildDatabaseConnectionResource.ValidateResourceId(id); + return new StaticSiteBuildDatabaseConnectionResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual StaticSiteDatabaseConnectionResource GetStaticSiteDatabaseConnectionResource(ResourceIdentifier id) + { + StaticSiteDatabaseConnectionResource.ValidateResourceId(id); + return new StaticSiteDatabaseConnectionResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -600,6 +660,18 @@ public virtual StaticSiteUserProvidedFunctionAppResource GetStaticSiteUserProvid return new StaticSiteUserProvidedFunctionAppResource(Client, id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual StaticSiteBasicAuthPropertiesARMResource GetStaticSiteBasicAuthPropertiesARMResource(ResourceIdentifier id) + { + StaticSiteBasicAuthPropertiesARMResource.ValidateResourceId(id); + return new StaticSiteBasicAuthPropertiesARMResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -612,6 +684,30 @@ public virtual StaticSiteCustomDomainOverviewResource GetStaticSiteCustomDomainO return new StaticSiteCustomDomainOverviewResource(Client, id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual StaticSiteLinkedBackendResource GetStaticSiteLinkedBackendResource(ResourceIdentifier id) + { + StaticSiteLinkedBackendResource.ValidateResourceId(id); + return new StaticSiteLinkedBackendResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual StaticSiteBuildLinkedBackendResource GetStaticSiteBuildLinkedBackendResource(ResourceIdentifier id) + { + StaticSiteBuildLinkedBackendResource.ValidateResourceId(id); + return new StaticSiteBuildLinkedBackendResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -708,6 +804,30 @@ public virtual ScmSiteSlotBasicPublishingCredentialsPolicyResource GetScmSiteSlo return new ScmSiteSlotBasicPublishingCredentialsPolicyResource(Client, id); } + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AuthsettingsV2SiteConfigResource GetAuthsettingsV2SiteConfigResource(ResourceIdentifier id) + { + AuthsettingsV2SiteConfigResource.ValidateResourceId(id); + return new AuthsettingsV2SiteConfigResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AuthsettingsV2SiteSlotConfigResource GetAuthsettingsV2SiteSlotConfigResource(ResourceIdentifier id) + { + AuthsettingsV2SiteSlotConfigResource.ValidateResourceId(id); + return new AuthsettingsV2SiteSlotConfigResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -864,6 +984,30 @@ public virtual WebSiteSlotContinuousWebJobResource GetWebSiteSlotContinuousWebJo return new WebSiteSlotContinuousWebJobResource(Client, id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual SiteDeploymentStatuResource GetSiteDeploymentStatuResource(ResourceIdentifier id) + { + SiteDeploymentStatuResource.ValidateResourceId(id); + return new SiteDeploymentStatuResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual SiteSlotDeploymentStatuResource GetSiteSlotDeploymentStatuResource(ResourceIdentifier id) + { + SiteSlotDeploymentStatuResource.ValidateResourceId(id); + return new SiteSlotDeploymentStatuResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -1343,5 +1487,125 @@ public virtual WebSiteWebJobResource GetWebSiteWebJobResource(ResourceIdentifier WebSiteWebJobResource.ValidateResourceId(id); return new WebSiteWebJobResource(Client, id); } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual SiteSlotWorkflowResource GetSiteSlotWorkflowResource(ResourceIdentifier id) + { + SiteSlotWorkflowResource.ValidateResourceId(id); + return new SiteSlotWorkflowResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual SiteWorkflowResource GetSiteWorkflowResource(ResourceIdentifier id) + { + SiteWorkflowResource.ValidateResourceId(id); + return new SiteWorkflowResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual WorkflowRunResource GetWorkflowRunResource(ResourceIdentifier id) + { + WorkflowRunResource.ValidateResourceId(id); + return new WorkflowRunResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual WorkflowRunActionResource GetWorkflowRunActionResource(ResourceIdentifier id) + { + WorkflowRunActionResource.ValidateResourceId(id); + return new WorkflowRunActionResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource GetSiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource(ResourceIdentifier id) + { + SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource.ValidateResourceId(id); + return new SiteHostruntimeWebhookApiWorkflowRunActionRepetitionResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource GetSiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource(ResourceIdentifier id) + { + SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource.ValidateResourceId(id); + return new SiteHostruntimeWebhookApiWorkflowRunActionScopeRepetitionResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual RequestHistoryResource GetRequestHistoryResource(ResourceIdentifier id) + { + RequestHistoryResource.ValidateResourceId(id); + return new RequestHistoryResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual WorkflowTriggerResource GetWorkflowTriggerResource(ResourceIdentifier id) + { + WorkflowTriggerResource.ValidateResourceId(id); + return new WorkflowTriggerResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual WorkflowTriggerHistoryResource GetWorkflowTriggerHistoryResource(ResourceIdentifier id) + { + WorkflowTriggerHistoryResource.ValidateResourceId(id); + return new WorkflowTriggerHistoryResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual WorkflowVersionResource GetWorkflowVersionResource(ResourceIdentifier id) + { + WorkflowVersionResource.ValidateResourceId(id); + return new WorkflowVersionResource(Client, id); + } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/MockableAppServiceResourceGroupResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/MockableAppServiceResourceGroupResource.cs index 6c38ae7206f7..a452d21c47e1 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/MockableAppServiceResourceGroupResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/MockableAppServiceResourceGroupResource.cs @@ -314,6 +314,59 @@ public virtual Response GetAppCertificate(string name, C return GetAppCertificates().Get(name, cancellationToken); } + /// Gets a collection of ContainerAppResources in the ResourceGroupResource. + /// An object representing collection of ContainerAppResources and their operations over a ContainerAppResource. + public virtual ContainerAppCollection GetContainerApps() + { + return GetCachedClient(client => new ContainerAppCollection(client, Id)); + } + + /// + /// Get the properties of a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// Name of the Container App. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetContainerAppAsync(string name, CancellationToken cancellationToken = default) + { + return await GetContainerApps().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the properties of a Container App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name} + /// + /// + /// Operation Id + /// ContainerApps_Get + /// + /// + /// + /// Name of the Container App. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetContainerApp(string name, CancellationToken cancellationToken = default) + { + return GetContainerApps().Get(name, cancellationToken); + } + /// Gets a collection of KubeEnvironmentResources in the ResourceGroupResource. /// An object representing collection of KubeEnvironmentResources and their operations over a KubeEnvironmentResource. public virtual KubeEnvironmentCollection GetKubeEnvironments() diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/MockableAppServiceSubscriptionResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/MockableAppServiceSubscriptionResource.cs index d6b66dc029c4..f4f6c85a7cb1 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/MockableAppServiceSubscriptionResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Extensions/MockableAppServiceSubscriptionResource.cs @@ -35,6 +35,8 @@ public partial class MockableAppServiceSubscriptionResource : ArmResource private AppServicePlansRestOperations _appServicePlanRestClient; private ClientDiagnostics _appCertificateCertificatesClientDiagnostics; private CertificatesRestOperations _appCertificateCertificatesRestClient; + private ClientDiagnostics _containerAppClientDiagnostics; + private ContainerAppsRestOperations _containerAppRestClient; private ClientDiagnostics _deletedSiteDeletedWebAppsClientDiagnostics; private DeletedWebAppsRestOperations _deletedSiteDeletedWebAppsRestClient; private ClientDiagnostics _kubeEnvironmentClientDiagnostics; @@ -47,6 +49,8 @@ public partial class MockableAppServiceSubscriptionResource : ArmResource private ResourceHealthMetadataRestOperations _resourceHealthMetadataRestClient; private ClientDiagnostics _defaultClientDiagnostics; private WebSiteManagementRestOperations _defaultRestClient; + private ClientDiagnostics _getUsagesInLocationClientDiagnostics; + private GetUsagesInLocationRestOperations _getUsagesInLocationRestClient; private ClientDiagnostics _staticSitesClientDiagnostics; private StaticSitesRestOperations _staticSitesRestClient; private ClientDiagnostics _staticSiteClientDiagnostics; @@ -80,6 +84,8 @@ internal MockableAppServiceSubscriptionResource(ArmClient client, ResourceIdenti private AppServicePlansRestOperations AppServicePlanRestClient => _appServicePlanRestClient ??= new AppServicePlansRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(AppServicePlanResource.ResourceType)); private ClientDiagnostics AppCertificateCertificatesClientDiagnostics => _appCertificateCertificatesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.AppService", AppCertificateResource.ResourceType.Namespace, Diagnostics); private CertificatesRestOperations AppCertificateCertificatesRestClient => _appCertificateCertificatesRestClient ??= new CertificatesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(AppCertificateResource.ResourceType)); + private ClientDiagnostics ContainerAppClientDiagnostics => _containerAppClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.AppService", ContainerAppResource.ResourceType.Namespace, Diagnostics); + private ContainerAppsRestOperations ContainerAppRestClient => _containerAppRestClient ??= new ContainerAppsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(ContainerAppResource.ResourceType)); private ClientDiagnostics DeletedSiteDeletedWebAppsClientDiagnostics => _deletedSiteDeletedWebAppsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.AppService", DeletedSiteResource.ResourceType.Namespace, Diagnostics); private DeletedWebAppsRestOperations DeletedSiteDeletedWebAppsRestClient => _deletedSiteDeletedWebAppsRestClient ??= new DeletedWebAppsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(DeletedSiteResource.ResourceType)); private ClientDiagnostics KubeEnvironmentClientDiagnostics => _kubeEnvironmentClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.AppService", KubeEnvironmentResource.ResourceType.Namespace, Diagnostics); @@ -92,6 +98,8 @@ internal MockableAppServiceSubscriptionResource(ArmClient client, ResourceIdenti private ResourceHealthMetadataRestOperations ResourceHealthMetadataRestClient => _resourceHealthMetadataRestClient ??= new ResourceHealthMetadataRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); private ClientDiagnostics DefaultClientDiagnostics => _defaultClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.AppService", ProviderConstants.DefaultProviderNamespace, Diagnostics); private WebSiteManagementRestOperations DefaultRestClient => _defaultRestClient ??= new WebSiteManagementRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics GetUsagesInLocationClientDiagnostics => _getUsagesInLocationClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.AppService", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private GetUsagesInLocationRestOperations GetUsagesInLocationRestClient => _getUsagesInLocationRestClient ??= new GetUsagesInLocationRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); private ClientDiagnostics StaticSitesClientDiagnostics => _staticSitesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.AppService", ProviderConstants.DefaultProviderNamespace, Diagnostics); private StaticSitesRestOperations StaticSitesRestClient => _staticSitesRestClient ??= new StaticSitesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); private ClientDiagnostics StaticSiteClientDiagnostics => _staticSiteClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.AppService", StaticSiteResource.ResourceType.Namespace, Diagnostics); @@ -689,6 +697,102 @@ public virtual Pageable GetAppCertificates(string filter return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AppCertificateResource(Client, AppCertificateData.DeserializeAppCertificateData(e)), AppCertificateCertificatesClientDiagnostics, Pipeline, "MockableAppServiceSubscriptionResource.GetAppCertificates", "value", "nextLink", cancellationToken); } + /// + /// Get the Container Apps in a given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/containerApps + /// + /// + /// Operation Id + /// ContainerApps_ListBySubscription + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetContainerAppsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerAppRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ContainerAppRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerAppResource(Client, ContainerAppData.DeserializeContainerAppData(e)), ContainerAppClientDiagnostics, Pipeline, "MockableAppServiceSubscriptionResource.GetContainerApps", "value", "nextLink", cancellationToken); + } + + /// + /// Get the Container Apps in a given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/containerApps + /// + /// + /// Operation Id + /// ContainerApps_ListBySubscription + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetContainerApps(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerAppRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ContainerAppRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerAppResource(Client, ContainerAppData.DeserializeContainerAppData(e)), ContainerAppClientDiagnostics, Pipeline, "MockableAppServiceSubscriptionResource.GetContainerApps", "value", "nextLink", cancellationToken); + } + + /// + /// List secrets for a container app + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/containerApps/{name}/listSecrets + /// + /// + /// Operation Id + /// ContainerApps_ListSecrets + /// + /// + /// + /// Name of the Container App. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetSecretsContainerAppsAsync(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerAppRestClient.CreateListSecretsRequest(Id.SubscriptionId, name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ContainerAppSecret.DeserializeContainerAppSecret, ContainerAppClientDiagnostics, Pipeline, "MockableAppServiceSubscriptionResource.GetSecretsContainerApps", "value", null, cancellationToken); + } + + /// + /// List secrets for a container app + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/containerApps/{name}/listSecrets + /// + /// + /// Operation Id + /// ContainerApps_ListSecrets + /// + /// + /// + /// Name of the Container App. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetSecretsContainerApps(string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => ContainerAppRestClient.CreateListSecretsRequest(Id.SubscriptionId, name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, ContainerAppSecret.DeserializeContainerAppSecret, ContainerAppClientDiagnostics, Pipeline, "MockableAppServiceSubscriptionResource.GetSecretsContainerApps", "value", null, cancellationToken); + } + /// /// Description for Get all deleted apps for a subscription at location /// @@ -1235,6 +1339,52 @@ public virtual Response CheckAppServiceNameAvailabilit } } + /// + /// Get custom hostnames under this subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/customhostnameSites + /// + /// + /// Operation Id + /// ListCustomHostNameSites + /// + /// + /// + /// Specific hostname. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetCustomHostNameSitesAsync(string hostname = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListCustomHostNameSitesRequest(Id.SubscriptionId, hostname); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListCustomHostNameSitesNextPageRequest(nextLink, Id.SubscriptionId, hostname); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, CustomHostnameSites.DeserializeCustomHostnameSites, DefaultClientDiagnostics, Pipeline, "MockableAppServiceSubscriptionResource.GetCustomHostNameSites", "value", "nextLink", cancellationToken); + } + + /// + /// Get custom hostnames under this subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/customhostnameSites + /// + /// + /// Operation Id + /// ListCustomHostNameSites + /// + /// + /// + /// Specific hostname. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetCustomHostNameSites(string hostname = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListCustomHostNameSitesRequest(Id.SubscriptionId, hostname); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListCustomHostNameSitesNextPageRequest(nextLink, Id.SubscriptionId, hostname); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, CustomHostnameSites.DeserializeCustomHostnameSites, DefaultClientDiagnostics, Pipeline, "MockableAppServiceSubscriptionResource.GetCustomHostNameSites", "value", "nextLink", cancellationToken); + } + /// /// Description for Gets list of available geo regions plus ministamps /// @@ -1295,6 +1445,50 @@ public virtual Response GetAppServiceDeploymentLo } } + /// + /// Description for get a list of available ASE regions and its supported Skus. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/aseRegions + /// + /// + /// Operation Id + /// ListAseRegions + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAseRegionsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListAseRegionsRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListAseRegionsNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, AseRegion.DeserializeAseRegion, DefaultClientDiagnostics, Pipeline, "MockableAppServiceSubscriptionResource.GetAseRegions", "value", "nextLink", cancellationToken); + } + + /// + /// Description for get a list of available ASE regions and its supported Skus. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/aseRegions + /// + /// + /// Operation Id + /// ListAseRegions + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAseRegions(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListAseRegionsRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListAseRegionsNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, AseRegion.DeserializeAseRegion, DefaultClientDiagnostics, Pipeline, "MockableAppServiceSubscriptionResource.GetAseRegions", "value", "nextLink", cancellationToken); + } + /// /// Description for Get a list of available geographical regions. /// @@ -1519,6 +1713,52 @@ public virtual Response VerifyHostingEnv } } + /// + /// List usages in cores for all skus used by a subscription in a given location, for a specific quota type. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/usages + /// + /// + /// Operation Id + /// GetUsagesInLocation_list + /// + /// + /// + /// The name of the Azure region. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetGetUsagesInLocationsAsync(AzureLocation location, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => GetUsagesInLocationRestClient.CreateListRequest(Id.SubscriptionId, location); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => GetUsagesInLocationRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, CsmUsageQuota.DeserializeCsmUsageQuota, GetUsagesInLocationClientDiagnostics, Pipeline, "MockableAppServiceSubscriptionResource.GetGetUsagesInLocations", "value", "nextLink", cancellationToken); + } + + /// + /// List usages in cores for all skus used by a subscription in a given location, for a specific quota type. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/usages + /// + /// + /// Operation Id + /// GetUsagesInLocation_list + /// + /// + /// + /// The name of the Azure region. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetGetUsagesInLocations(AzureLocation location, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => GetUsagesInLocationRestClient.CreateListRequest(Id.SubscriptionId, location); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => GetUsagesInLocationRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, CsmUsageQuota.DeserializeCsmUsageQuota, GetUsagesInLocationClientDiagnostics, Pipeline, "MockableAppServiceSubscriptionResource.GetGetUsagesInLocations", "value", "nextLink", cancellationToken); + } + /// /// Description for Generates a preview workflow file for the static site /// diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/KubeEnvironmentData.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/KubeEnvironmentData.cs index ffcc2b1480c1..a646941512f0 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/KubeEnvironmentData.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/KubeEnvironmentData.cs @@ -38,6 +38,7 @@ public KubeEnvironmentData(AzureLocation location) : base(location) /// Only visible within Vnet/Subnet. /// Default Domain Name for the cluster. /// Static IP of the KubeEnvironment. + /// Type of Kubernetes Environment. Only supported for Container App Environments with value as Managed. /// /// Cluster configuration which determines the ARC cluster /// components types. Eg: Choosing between BuildService kind, @@ -48,9 +49,10 @@ public KubeEnvironmentData(AzureLocation location) : base(location) /// app logs to a destination. Currently only "log-analytics" is /// supported /// + /// Cluster configuration for Container Apps Environments to configure Dapr Instrumentation Key and VNET Configuration. /// /// Kind of resource. - internal KubeEnvironmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedLocation extendedLocation, KubeEnvironmentProvisioningState? provisioningState, string deploymentErrors, bool? isInternalLoadBalancerEnabled, string defaultDomain, string staticIP, ArcConfiguration arcConfiguration, AppLogsConfiguration appLogsConfiguration, ResourceIdentifier aksResourceId, string kind) : base(id, name, resourceType, systemData, tags, location) + internal KubeEnvironmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedLocation extendedLocation, KubeEnvironmentProvisioningState? provisioningState, string deploymentErrors, bool? isInternalLoadBalancerEnabled, string defaultDomain, string staticIP, string environmentType, ArcConfiguration arcConfiguration, AppLogsConfiguration appLogsConfiguration, ContainerAppsConfiguration containerAppsConfiguration, ResourceIdentifier aksResourceId, string kind) : base(id, name, resourceType, systemData, tags, location) { ExtendedLocation = extendedLocation; ProvisioningState = provisioningState; @@ -58,8 +60,10 @@ internal KubeEnvironmentData(ResourceIdentifier id, string name, ResourceType re IsInternalLoadBalancerEnabled = isInternalLoadBalancerEnabled; DefaultDomain = defaultDomain; StaticIP = staticIP; + EnvironmentType = environmentType; ArcConfiguration = arcConfiguration; AppLogsConfiguration = appLogsConfiguration; + ContainerAppsConfiguration = containerAppsConfiguration; AksResourceId = aksResourceId; Kind = kind; } @@ -76,6 +80,8 @@ internal KubeEnvironmentData(ResourceIdentifier id, string name, ResourceType re public string DefaultDomain { get; } /// Static IP of the KubeEnvironment. public string StaticIP { get; set; } + /// Type of Kubernetes Environment. Only supported for Container App Environments with value as Managed. + public string EnvironmentType { get; set; } /// /// Cluster configuration which determines the ARC cluster /// components types. Eg: Choosing between BuildService kind, @@ -88,6 +94,8 @@ internal KubeEnvironmentData(ResourceIdentifier id, string name, ResourceType re /// supported /// public AppLogsConfiguration AppLogsConfiguration { get; set; } + /// Cluster configuration for Container Apps Environments to configure Dapr Instrumentation Key and VNET Configuration. + public ContainerAppsConfiguration ContainerAppsConfiguration { get; set; } /// Gets or sets the aks resource id. public ResourceIdentifier AksResourceId { get; set; } /// Kind of resource. diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/ContainerAppOperationSource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/ContainerAppOperationSource.cs new file mode 100644 index 000000000000..87317201f6df --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/ContainerAppOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.AppService +{ + internal class ContainerAppOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ContainerAppOperationSource(ArmClient client) + { + _client = client; + } + + ContainerAppResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = ContainerAppData.DeserializeContainerAppData(document.RootElement); + return new ContainerAppResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = ContainerAppData.DeserializeContainerAppData(document.RootElement); + return new ContainerAppResource(_client, data); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/SiteDeploymentStatuOperationSource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/SiteDeploymentStatuOperationSource.cs new file mode 100644 index 000000000000..5668094a18cb --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/SiteDeploymentStatuOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.AppService +{ + internal class SiteDeploymentStatuOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal SiteDeploymentStatuOperationSource(ArmClient client) + { + _client = client; + } + + SiteDeploymentStatuResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = CsmDeploymentStatusData.DeserializeCsmDeploymentStatusData(document.RootElement); + return new SiteDeploymentStatuResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = CsmDeploymentStatusData.DeserializeCsmDeploymentStatusData(document.RootElement); + return new SiteDeploymentStatuResource(_client, data); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/SiteSlotDeploymentStatuOperationSource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/SiteSlotDeploymentStatuOperationSource.cs new file mode 100644 index 000000000000..71aa3b08ea4d --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/SiteSlotDeploymentStatuOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.AppService +{ + internal class SiteSlotDeploymentStatuOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal SiteSlotDeploymentStatuOperationSource(ArmClient client) + { + _client = client; + } + + SiteSlotDeploymentStatuResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = CsmDeploymentStatusData.DeserializeCsmDeploymentStatusData(document.RootElement); + return new SiteSlotDeploymentStatuResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = CsmDeploymentStatusData.DeserializeCsmDeploymentStatusData(document.RootElement); + return new SiteSlotDeploymentStatuResource(_client, data); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/StaticSiteBuildLinkedBackendOperationSource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/StaticSiteBuildLinkedBackendOperationSource.cs new file mode 100644 index 000000000000..7a5deaeef5be --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/StaticSiteBuildLinkedBackendOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.AppService +{ + internal class StaticSiteBuildLinkedBackendOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal StaticSiteBuildLinkedBackendOperationSource(ArmClient client) + { + _client = client; + } + + StaticSiteBuildLinkedBackendResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = StaticSiteLinkedBackendARMResourceData.DeserializeStaticSiteLinkedBackendARMResourceData(document.RootElement); + return new StaticSiteBuildLinkedBackendResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = StaticSiteLinkedBackendARMResourceData.DeserializeStaticSiteLinkedBackendARMResourceData(document.RootElement); + return new StaticSiteBuildLinkedBackendResource(_client, data); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/StaticSiteLinkedBackendOperationSource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/StaticSiteLinkedBackendOperationSource.cs new file mode 100644 index 000000000000..1147e5f305d8 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/LongRunningOperation/StaticSiteLinkedBackendOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.AppService +{ + internal class StaticSiteLinkedBackendOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal StaticSiteLinkedBackendOperationSource(ArmClient client) + { + _client = client; + } + + StaticSiteLinkedBackendResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = StaticSiteLinkedBackendARMResourceData.DeserializeStaticSiteLinkedBackendARMResourceData(document.RootElement); + return new StaticSiteLinkedBackendResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = StaticSiteLinkedBackendARMResourceData.DeserializeStaticSiteLinkedBackendARMResourceData(document.RootElement); + return new StaticSiteLinkedBackendResource(_client, data); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ActiveRevisionsMode.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ActiveRevisionsMode.cs new file mode 100644 index 000000000000..45f14711d2e7 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ActiveRevisionsMode.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.AppService.Models +{ + /// + /// ActiveRevisionsMode controls how active revisions are handled for the Container app: + /// <list><item>Multiple: multiple revisions can be active. If no value if provided, this is the default</item><item>Single: Only one revision can be active at a time. Revision weights can not be used in this mode</item></list> + /// + public readonly partial struct ActiveRevisionsMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ActiveRevisionsMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MultipleValue = "multiple"; + private const string SingleValue = "single"; + + /// multiple. + public static ActiveRevisionsMode Multiple { get; } = new ActiveRevisionsMode(MultipleValue); + /// single. + public static ActiveRevisionsMode Single { get; } = new ActiveRevisionsMode(SingleValue); + /// Determines if two values are the same. + public static bool operator ==(ActiveRevisionsMode left, ActiveRevisionsMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ActiveRevisionsMode left, ActiveRevisionsMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ActiveRevisionsMode(string value) => new ActiveRevisionsMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ActiveRevisionsMode other && Equals(other); + /// + public bool Equals(ActiveRevisionsMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceCertificateEmail.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceCertificateEmail.Serialization.cs index b2cbd66aca5a..f8b56ddee188 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceCertificateEmail.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceCertificateEmail.Serialization.cs @@ -8,108 +8,37 @@ using System; using System.Text.Json; using Azure.Core; -using Azure.ResourceManager.Models; namespace Azure.ResourceManager.AppService.Models { - public partial class AppServiceCertificateEmail : IUtf8JsonSerializable + public partial class AppServiceCertificateEmail { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(EmailId)) - { - writer.WritePropertyName("emailId"u8); - writer.WriteStringValue(EmailId); - } - if (Optional.IsDefined(TimeStamp)) - { - writer.WritePropertyName("timeStamp"u8); - writer.WriteStringValue(TimeStamp.Value, "O"); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - internal static AppServiceCertificateEmail DeserializeAppServiceCertificateEmail(JsonElement element) { if (element.ValueKind == JsonValueKind.Null) { return null; } - Optional kind = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; Optional emailId = default; Optional timeStamp = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("kind"u8)) + if (property.NameEquals("emailId"u8)) { - kind = property.Value.GetString(); + emailId = property.Value.GetString(); continue; } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) + if (property.NameEquals("timeStamp"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("emailId"u8)) - { - emailId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("timeStamp"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - timeStamp = property0.Value.GetDateTimeOffset("O"); - continue; - } - } + timeStamp = property.Value.GetDateTimeOffset("O"); continue; } } - return new AppServiceCertificateEmail(id, name, type, systemData.Value, emailId.Value, Optional.ToNullable(timeStamp), kind.Value); + return new AppServiceCertificateEmail(emailId.Value, Optional.ToNullable(timeStamp)); } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceCertificateEmail.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceCertificateEmail.cs index 31e8d4a67777..f818e7065562 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceCertificateEmail.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceCertificateEmail.cs @@ -6,39 +6,29 @@ #nullable disable using System; -using Azure.Core; -using Azure.ResourceManager.Models; namespace Azure.ResourceManager.AppService.Models { /// SSL certificate email. - public partial class AppServiceCertificateEmail : ResourceData + public partial class AppServiceCertificateEmail { /// Initializes a new instance of AppServiceCertificateEmail. - public AppServiceCertificateEmail() + internal AppServiceCertificateEmail() { } /// Initializes a new instance of AppServiceCertificateEmail. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. /// Email id. /// Time stamp. - /// Kind of resource. - internal AppServiceCertificateEmail(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string emailId, DateTimeOffset? timeStamp, string kind) : base(id, name, resourceType, systemData) + internal AppServiceCertificateEmail(string emailId, DateTimeOffset? timeStamp) { EmailId = emailId; TimeStamp = timeStamp; - Kind = kind; } /// Email id. - public string EmailId { get; set; } + public string EmailId { get; } /// Time stamp. - public DateTimeOffset? TimeStamp { get; set; } - /// Kind of resource. - public string Kind { get; set; } + public DateTimeOffset? TimeStamp { get; } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEndpointDetail.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEndpointDetail.Serialization.cs index f9382348be76..eebfeefd501d 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEndpointDetail.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEndpointDetail.Serialization.cs @@ -19,7 +19,7 @@ internal static AppServiceEndpointDetail DeserializeAppServiceEndpointDetail(Jso { return null; } - Optional ipAddress = default; + Optional ipAddress = default; Optional port = default; Optional latency = default; Optional isAccessible = default; @@ -31,7 +31,7 @@ internal static AppServiceEndpointDetail DeserializeAppServiceEndpointDetail(Jso { continue; } - ipAddress = IPAddress.Parse(property.Value.GetString()); + ipAddress = System.Net.IPAddress.Parse(property.Value.GetString()); continue; } if (property.NameEquals("port"u8)) diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEndpointDetail.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEndpointDetail.cs index a9e49d1e20d6..7eb74656aefd 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEndpointDetail.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEndpointDetail.cs @@ -22,7 +22,7 @@ internal AppServiceEndpointDetail() /// The port an endpoint is connected to. /// The time in milliseconds it takes for a TCP connection to be created from the App Service Environment to this IpAddress at this Port. /// Whether it is possible to create a TCP connection from the App Service Environment to this IpAddress at this Port. - internal AppServiceEndpointDetail(IPAddress ipAddress, int? port, double? latency, bool? isAccessible) + internal AppServiceEndpointDetail(System.Net.IPAddress ipAddress, int? port, double? latency, bool? isAccessible) { IPAddress = ipAddress; Port = port; @@ -31,7 +31,7 @@ internal AppServiceEndpointDetail(IPAddress ipAddress, int? port, double? latenc } /// An IP Address that Domain Name currently resolves to. - public IPAddress IPAddress { get; } + public System.Net.IPAddress IPAddress { get; } /// The port an endpoint is connected to. public int? Port { get; } /// The time in milliseconds it takes for a TCP connection to be created from the App Service Environment to this IpAddress at this Port. diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentAddressResult.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentAddressResult.Serialization.cs index 71562dadab83..c9db4e15b7c5 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentAddressResult.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentAddressResult.Serialization.cs @@ -75,9 +75,9 @@ internal static AppServiceEnvironmentAddressResult DeserializeAppServiceEnvironm string name = default; ResourceType type = default; Optional systemData = default; - Optional serviceIPAddress = default; - Optional internalIPAddress = default; - Optional> outboundIPAddresses = default; + Optional serviceIPAddress = default; + Optional internalIPAddress = default; + Optional> outboundIPAddresses = default; Optional> vipMappings = default; foreach (var property in element.EnumerateObject()) { @@ -125,7 +125,7 @@ internal static AppServiceEnvironmentAddressResult DeserializeAppServiceEnvironm { continue; } - serviceIPAddress = IPAddress.Parse(property0.Value.GetString()); + serviceIPAddress = System.Net.IPAddress.Parse(property0.Value.GetString()); continue; } if (property0.NameEquals("internalIpAddress"u8)) @@ -134,7 +134,7 @@ internal static AppServiceEnvironmentAddressResult DeserializeAppServiceEnvironm { continue; } - internalIPAddress = IPAddress.Parse(property0.Value.GetString()); + internalIPAddress = System.Net.IPAddress.Parse(property0.Value.GetString()); continue; } if (property0.NameEquals("outboundIpAddresses"u8)) @@ -143,7 +143,7 @@ internal static AppServiceEnvironmentAddressResult DeserializeAppServiceEnvironm { continue; } - List array = new List(); + List array = new List(); foreach (var item in property0.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) @@ -152,7 +152,7 @@ internal static AppServiceEnvironmentAddressResult DeserializeAppServiceEnvironm } else { - array.Add(IPAddress.Parse(item.GetString())); + array.Add(System.Net.IPAddress.Parse(item.GetString())); } } outboundIPAddresses = array; diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentAddressResult.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentAddressResult.cs index 32d569351f22..6494af12a9ee 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentAddressResult.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentAddressResult.cs @@ -18,7 +18,7 @@ public partial class AppServiceEnvironmentAddressResult : ResourceData /// Initializes a new instance of AppServiceEnvironmentAddressResult. public AppServiceEnvironmentAddressResult() { - OutboundIPAddresses = new ChangeTrackingList(); + OutboundIPAddresses = new ChangeTrackingList(); VirtualIPMappings = new ChangeTrackingList(); } @@ -32,7 +32,7 @@ public AppServiceEnvironmentAddressResult() /// IP addresses appearing on outbound connections. /// Additional virtual IPs. /// Kind of resource. - internal AppServiceEnvironmentAddressResult(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IPAddress serviceIPAddress, IPAddress internalIPAddress, IList outboundIPAddresses, IList virtualIPMappings, string kind) : base(id, name, resourceType, systemData) + internal AppServiceEnvironmentAddressResult(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, System.Net.IPAddress serviceIPAddress, System.Net.IPAddress internalIPAddress, IList outboundIPAddresses, IList virtualIPMappings, string kind) : base(id, name, resourceType, systemData) { ServiceIPAddress = serviceIPAddress; InternalIPAddress = internalIPAddress; @@ -42,11 +42,11 @@ internal AppServiceEnvironmentAddressResult(ResourceIdentifier id, string name, } /// Main public virtual IP. - public IPAddress ServiceIPAddress { get; set; } + public System.Net.IPAddress ServiceIPAddress { get; set; } /// Virtual Network internal IP address of the App Service Environment if it is in internal load-balancing mode. - public IPAddress InternalIPAddress { get; set; } + public System.Net.IPAddress InternalIPAddress { get; set; } /// IP addresses appearing on outbound connections. - public IList OutboundIPAddresses { get; } + public IList OutboundIPAddresses { get; } /// Additional virtual IPs. public IList VirtualIPMappings { get; } /// Kind of resource. diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentData.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentData.Serialization.cs index 93022784d557..1be8e82e4f2b 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentData.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentData.Serialization.cs @@ -88,6 +88,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WriteEndArray(); } + if (Optional.IsDefined(UpgradePreference)) + { + writer.WritePropertyName("upgradePreference"u8); + writer.WriteStringValue(UpgradePreference.Value.ToString()); + } if (Optional.IsDefined(DedicatedHostCount)) { writer.WritePropertyName("dedicatedHostCount"u8); @@ -98,6 +103,16 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("zoneRedundant"u8); writer.WriteBooleanValue(IsZoneRedundant.Value); } + if (Optional.IsDefined(CustomDnsSuffixConfiguration)) + { + writer.WritePropertyName("customDnsSuffixConfiguration"u8); + writer.WriteObjectValue(CustomDnsSuffixConfiguration); + } + if (Optional.IsDefined(NetworkingConfiguration)) + { + writer.WritePropertyName("networkingConfiguration"u8); + writer.WriteObjectValue(NetworkingConfiguration); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -129,8 +144,12 @@ internal static AppServiceEnvironmentData DeserializeAppServiceEnvironmentData(J Optional> clusterSettings = default; Optional> userWhitelistedIPRanges = default; Optional hasLinuxWorkers = default; + Optional upgradePreference = default; Optional dedicatedHostCount = default; Optional zoneRedundant = default; + Optional customDnsSuffixConfiguration = default; + Optional networkingConfiguration = default; + Optional upgradeAvailability = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("kind"u8)) @@ -318,6 +337,15 @@ internal static AppServiceEnvironmentData DeserializeAppServiceEnvironmentData(J hasLinuxWorkers = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("upgradePreference"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + upgradePreference = new UpgradePreference(property0.Value.GetString()); + continue; + } if (property0.NameEquals("dedicatedHostCount"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -336,11 +364,38 @@ internal static AppServiceEnvironmentData DeserializeAppServiceEnvironmentData(J zoneRedundant = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("customDnsSuffixConfiguration"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customDnsSuffixConfiguration = CustomDnsSuffixConfigurationData.DeserializeCustomDnsSuffixConfigurationData(property0.Value); + continue; + } + if (property0.NameEquals("networkingConfiguration"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkingConfiguration = AseV3NetworkingConfigurationData.DeserializeAseV3NetworkingConfigurationData(property0.Value); + continue; + } + if (property0.NameEquals("upgradeAvailability"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + upgradeAvailability = new UpgradeAvailability(property0.Value.GetString()); + continue; + } } continue; } } - return new AppServiceEnvironmentData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, Optional.ToNullable(provisioningState), Optional.ToNullable(status), virtualNetwork.Value, Optional.ToNullable(internalLoadBalancingMode), multiSize.Value, Optional.ToNullable(multiRoleCount), Optional.ToNullable(ipSslAddressCount), dnsSuffix.Value, Optional.ToNullable(maximumNumberOfMachines), Optional.ToNullable(frontEndScaleFactor), Optional.ToNullable(suspended), Optional.ToList(clusterSettings), Optional.ToList(userWhitelistedIPRanges), Optional.ToNullable(hasLinuxWorkers), Optional.ToNullable(dedicatedHostCount), Optional.ToNullable(zoneRedundant), kind.Value); + return new AppServiceEnvironmentData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, Optional.ToNullable(provisioningState), Optional.ToNullable(status), virtualNetwork.Value, Optional.ToNullable(internalLoadBalancingMode), multiSize.Value, Optional.ToNullable(multiRoleCount), Optional.ToNullable(ipSslAddressCount), dnsSuffix.Value, Optional.ToNullable(maximumNumberOfMachines), Optional.ToNullable(frontEndScaleFactor), Optional.ToNullable(suspended), Optional.ToList(clusterSettings), Optional.ToList(userWhitelistedIPRanges), Optional.ToNullable(hasLinuxWorkers), Optional.ToNullable(upgradePreference), Optional.ToNullable(dedicatedHostCount), Optional.ToNullable(zoneRedundant), customDnsSuffixConfiguration.Value, networkingConfiguration.Value, Optional.ToNullable(upgradeAvailability), kind.Value); } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentPatch.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentPatch.Serialization.cs index 733c11b13a4e..f013f0e73303 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentPatch.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentPatch.Serialization.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.AppService; using Azure.ResourceManager.Models; namespace Azure.ResourceManager.AppService.Models @@ -74,6 +75,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WriteEndArray(); } + if (Optional.IsDefined(UpgradePreference)) + { + writer.WritePropertyName("upgradePreference"u8); + writer.WriteStringValue(UpgradePreference.Value.ToString()); + } if (Optional.IsDefined(DedicatedHostCount)) { writer.WritePropertyName("dedicatedHostCount"u8); @@ -84,6 +90,16 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("zoneRedundant"u8); writer.WriteBooleanValue(IsZoneRedundant.Value); } + if (Optional.IsDefined(CustomDnsSuffixConfiguration)) + { + writer.WritePropertyName("customDnsSuffixConfiguration"u8); + writer.WriteObjectValue(CustomDnsSuffixConfiguration); + } + if (Optional.IsDefined(NetworkingConfiguration)) + { + writer.WritePropertyName("networkingConfiguration"u8); + writer.WriteObjectValue(NetworkingConfiguration); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -113,8 +129,12 @@ internal static AppServiceEnvironmentPatch DeserializeAppServiceEnvironmentPatch Optional> clusterSettings = default; Optional> userWhitelistedIPRanges = default; Optional hasLinuxWorkers = default; + Optional upgradePreference = default; Optional dedicatedHostCount = default; Optional zoneRedundant = default; + Optional customDnsSuffixConfiguration = default; + Optional networkingConfiguration = default; + Optional upgradeAvailability = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("kind"u8)) @@ -283,6 +303,15 @@ internal static AppServiceEnvironmentPatch DeserializeAppServiceEnvironmentPatch hasLinuxWorkers = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("upgradePreference"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + upgradePreference = new UpgradePreference(property0.Value.GetString()); + continue; + } if (property0.NameEquals("dedicatedHostCount"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -301,11 +330,38 @@ internal static AppServiceEnvironmentPatch DeserializeAppServiceEnvironmentPatch zoneRedundant = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("customDnsSuffixConfiguration"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customDnsSuffixConfiguration = CustomDnsSuffixConfigurationData.DeserializeCustomDnsSuffixConfigurationData(property0.Value); + continue; + } + if (property0.NameEquals("networkingConfiguration"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkingConfiguration = AseV3NetworkingConfigurationData.DeserializeAseV3NetworkingConfigurationData(property0.Value); + continue; + } + if (property0.NameEquals("upgradeAvailability"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + upgradeAvailability = new UpgradeAvailability(property0.Value.GetString()); + continue; + } } continue; } } - return new AppServiceEnvironmentPatch(id, name, type, systemData.Value, Optional.ToNullable(provisioningState), Optional.ToNullable(status), virtualNetwork.Value, Optional.ToNullable(internalLoadBalancingMode), multiSize.Value, Optional.ToNullable(multiRoleCount), Optional.ToNullable(ipSslAddressCount), dnsSuffix.Value, Optional.ToNullable(maximumNumberOfMachines), Optional.ToNullable(frontEndScaleFactor), Optional.ToNullable(suspended), Optional.ToList(clusterSettings), Optional.ToList(userWhitelistedIPRanges), Optional.ToNullable(hasLinuxWorkers), Optional.ToNullable(dedicatedHostCount), Optional.ToNullable(zoneRedundant), kind.Value); + return new AppServiceEnvironmentPatch(id, name, type, systemData.Value, Optional.ToNullable(provisioningState), Optional.ToNullable(status), virtualNetwork.Value, Optional.ToNullable(internalLoadBalancingMode), multiSize.Value, Optional.ToNullable(multiRoleCount), Optional.ToNullable(ipSslAddressCount), dnsSuffix.Value, Optional.ToNullable(maximumNumberOfMachines), Optional.ToNullable(frontEndScaleFactor), Optional.ToNullable(suspended), Optional.ToList(clusterSettings), Optional.ToList(userWhitelistedIPRanges), Optional.ToNullable(hasLinuxWorkers), Optional.ToNullable(upgradePreference), Optional.ToNullable(dedicatedHostCount), Optional.ToNullable(zoneRedundant), customDnsSuffixConfiguration.Value, networkingConfiguration.Value, Optional.ToNullable(upgradeAvailability), kind.Value); } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentPatch.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentPatch.cs index 2cdc0b45ae5e..8a91d898e64c 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentPatch.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentPatch.cs @@ -7,6 +7,7 @@ using System.Collections.Generic; using Azure.Core; +using Azure.ResourceManager.AppService; using Azure.ResourceManager.Models; namespace Azure.ResourceManager.AppService.Models @@ -43,10 +44,14 @@ public AppServiceEnvironmentPatch() /// Custom settings for changing the behavior of the App Service Environment. /// User added ip ranges to whitelist on ASE db. /// Flag that displays whether an ASE has linux workers or not. + /// Upgrade Preference. /// Dedicated Host Count. /// Whether or not this App Service Environment is zone-redundant. + /// Full view of the custom domain suffix configuration for ASEv3. + /// Full view of networking configuration for an ASE. + /// Whether an upgrade is available for this App Service Environment. /// Kind of resource. - internal AppServiceEnvironmentPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ProvisioningState? provisioningState, HostingEnvironmentStatus? status, AppServiceVirtualNetworkProfile virtualNetwork, LoadBalancingMode? internalLoadBalancingMode, string multiSize, int? multiRoleCount, int? ipSslAddressCount, string dnsSuffix, int? maximumNumberOfMachines, int? frontEndScaleFactor, bool? isSuspended, IList clusterSettings, IList userWhitelistedIPRanges, bool? hasLinuxWorkers, int? dedicatedHostCount, bool? isZoneRedundant, string kind) : base(id, name, resourceType, systemData) + internal AppServiceEnvironmentPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ProvisioningState? provisioningState, HostingEnvironmentStatus? status, AppServiceVirtualNetworkProfile virtualNetwork, LoadBalancingMode? internalLoadBalancingMode, string multiSize, int? multiRoleCount, int? ipSslAddressCount, string dnsSuffix, int? maximumNumberOfMachines, int? frontEndScaleFactor, bool? isSuspended, IList clusterSettings, IList userWhitelistedIPRanges, bool? hasLinuxWorkers, UpgradePreference? upgradePreference, int? dedicatedHostCount, bool? isZoneRedundant, CustomDnsSuffixConfigurationData customDnsSuffixConfiguration, AseV3NetworkingConfigurationData networkingConfiguration, UpgradeAvailability? upgradeAvailability, string kind) : base(id, name, resourceType, systemData) { ProvisioningState = provisioningState; Status = status; @@ -62,8 +67,12 @@ internal AppServiceEnvironmentPatch(ResourceIdentifier id, string name, Resource ClusterSettings = clusterSettings; UserWhitelistedIPRanges = userWhitelistedIPRanges; HasLinuxWorkers = hasLinuxWorkers; + UpgradePreference = upgradePreference; DedicatedHostCount = dedicatedHostCount; IsZoneRedundant = isZoneRedundant; + CustomDnsSuffixConfiguration = customDnsSuffixConfiguration; + NetworkingConfiguration = networkingConfiguration; + UpgradeAvailability = upgradeAvailability; Kind = kind; } @@ -98,10 +107,18 @@ internal AppServiceEnvironmentPatch(ResourceIdentifier id, string name, Resource public IList UserWhitelistedIPRanges { get; } /// Flag that displays whether an ASE has linux workers or not. public bool? HasLinuxWorkers { get; } + /// Upgrade Preference. + public UpgradePreference? UpgradePreference { get; set; } /// Dedicated Host Count. public int? DedicatedHostCount { get; set; } /// Whether or not this App Service Environment is zone-redundant. public bool? IsZoneRedundant { get; set; } + /// Full view of the custom domain suffix configuration for ASEv3. + public CustomDnsSuffixConfigurationData CustomDnsSuffixConfiguration { get; set; } + /// Full view of networking configuration for an ASE. + public AseV3NetworkingConfigurationData NetworkingConfiguration { get; set; } + /// Whether an upgrade is available for this App Service Environment. + public UpgradeAvailability? UpgradeAvailability { get; } /// Kind of resource. public string Kind { get; set; } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentProperties.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentProperties.Serialization.cs index 0a491f438284..7b2b5a90f92a 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentProperties.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentProperties.Serialization.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.AppService; namespace Azure.ResourceManager.AppService.Models { @@ -63,6 +64,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WriteEndArray(); } + if (Optional.IsDefined(UpgradePreference)) + { + writer.WritePropertyName("upgradePreference"u8); + writer.WriteStringValue(UpgradePreference.Value.ToString()); + } if (Optional.IsDefined(DedicatedHostCount)) { writer.WritePropertyName("dedicatedHostCount"u8); @@ -73,6 +79,16 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("zoneRedundant"u8); writer.WriteBooleanValue(IsZoneRedundant.Value); } + if (Optional.IsDefined(CustomDnsSuffixConfiguration)) + { + writer.WritePropertyName("customDnsSuffixConfiguration"u8); + writer.WriteObjectValue(CustomDnsSuffixConfiguration); + } + if (Optional.IsDefined(NetworkingConfiguration)) + { + writer.WritePropertyName("networkingConfiguration"u8); + writer.WriteObjectValue(NetworkingConfiguration); + } writer.WriteEndObject(); } @@ -96,8 +112,12 @@ internal static AppServiceEnvironmentProperties DeserializeAppServiceEnvironment Optional> clusterSettings = default; Optional> userWhitelistedIPRanges = default; Optional hasLinuxWorkers = default; + Optional upgradePreference = default; Optional dedicatedHostCount = default; Optional zoneRedundant = default; + Optional customDnsSuffixConfiguration = default; + Optional networkingConfiguration = default; + Optional upgradeAvailability = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("provisioningState"u8)) @@ -224,6 +244,15 @@ internal static AppServiceEnvironmentProperties DeserializeAppServiceEnvironment hasLinuxWorkers = property.Value.GetBoolean(); continue; } + if (property.NameEquals("upgradePreference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + upgradePreference = new UpgradePreference(property.Value.GetString()); + continue; + } if (property.NameEquals("dedicatedHostCount"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -242,8 +271,35 @@ internal static AppServiceEnvironmentProperties DeserializeAppServiceEnvironment zoneRedundant = property.Value.GetBoolean(); continue; } + if (property.NameEquals("customDnsSuffixConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customDnsSuffixConfiguration = CustomDnsSuffixConfigurationData.DeserializeCustomDnsSuffixConfigurationData(property.Value); + continue; + } + if (property.NameEquals("networkingConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkingConfiguration = AseV3NetworkingConfigurationData.DeserializeAseV3NetworkingConfigurationData(property.Value); + continue; + } + if (property.NameEquals("upgradeAvailability"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + upgradeAvailability = new UpgradeAvailability(property.Value.GetString()); + continue; + } } - return new AppServiceEnvironmentProperties(Optional.ToNullable(provisioningState), Optional.ToNullable(status), virtualNetwork, Optional.ToNullable(internalLoadBalancingMode), multiSize.Value, Optional.ToNullable(multiRoleCount), Optional.ToNullable(ipSslAddressCount), dnsSuffix.Value, Optional.ToNullable(maximumNumberOfMachines), Optional.ToNullable(frontEndScaleFactor), Optional.ToNullable(suspended), Optional.ToList(clusterSettings), Optional.ToList(userWhitelistedIPRanges), Optional.ToNullable(hasLinuxWorkers), Optional.ToNullable(dedicatedHostCount), Optional.ToNullable(zoneRedundant)); + return new AppServiceEnvironmentProperties(Optional.ToNullable(provisioningState), Optional.ToNullable(status), virtualNetwork, Optional.ToNullable(internalLoadBalancingMode), multiSize.Value, Optional.ToNullable(multiRoleCount), Optional.ToNullable(ipSslAddressCount), dnsSuffix.Value, Optional.ToNullable(maximumNumberOfMachines), Optional.ToNullable(frontEndScaleFactor), Optional.ToNullable(suspended), Optional.ToList(clusterSettings), Optional.ToList(userWhitelistedIPRanges), Optional.ToNullable(hasLinuxWorkers), Optional.ToNullable(upgradePreference), Optional.ToNullable(dedicatedHostCount), Optional.ToNullable(zoneRedundant), customDnsSuffixConfiguration.Value, networkingConfiguration.Value, Optional.ToNullable(upgradeAvailability)); } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentProperties.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentProperties.cs index fcd329514bfe..4f9c9eb55071 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentProperties.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceEnvironmentProperties.cs @@ -8,6 +8,7 @@ using System; using System.Collections.Generic; using Azure.Core; +using Azure.ResourceManager.AppService; namespace Azure.ResourceManager.AppService.Models { @@ -44,9 +45,13 @@ public AppServiceEnvironmentProperties(AppServiceVirtualNetworkProfile virtualNe /// Custom settings for changing the behavior of the App Service Environment. /// User added ip ranges to whitelist on ASE db. /// Flag that displays whether an ASE has linux workers or not. + /// Upgrade Preference. /// Dedicated Host Count. /// Whether or not this App Service Environment is zone-redundant. - internal AppServiceEnvironmentProperties(ProvisioningState? provisioningState, HostingEnvironmentStatus? status, AppServiceVirtualNetworkProfile virtualNetwork, LoadBalancingMode? internalLoadBalancingMode, string multiSize, int? multiRoleCount, int? ipSslAddressCount, string dnsSuffix, int? maximumNumberOfMachines, int? frontEndScaleFactor, bool? isSuspended, IList clusterSettings, IList userWhitelistedIPRanges, bool? hasLinuxWorkers, int? dedicatedHostCount, bool? isZoneRedundant) + /// Full view of the custom domain suffix configuration for ASEv3. + /// Full view of networking configuration for an ASE. + /// Whether an upgrade is available for this App Service Environment. + internal AppServiceEnvironmentProperties(ProvisioningState? provisioningState, HostingEnvironmentStatus? status, AppServiceVirtualNetworkProfile virtualNetwork, LoadBalancingMode? internalLoadBalancingMode, string multiSize, int? multiRoleCount, int? ipSslAddressCount, string dnsSuffix, int? maximumNumberOfMachines, int? frontEndScaleFactor, bool? isSuspended, IList clusterSettings, IList userWhitelistedIPRanges, bool? hasLinuxWorkers, UpgradePreference? upgradePreference, int? dedicatedHostCount, bool? isZoneRedundant, CustomDnsSuffixConfigurationData customDnsSuffixConfiguration, AseV3NetworkingConfigurationData networkingConfiguration, UpgradeAvailability? upgradeAvailability) { ProvisioningState = provisioningState; Status = status; @@ -62,8 +67,12 @@ internal AppServiceEnvironmentProperties(ProvisioningState? provisioningState, H ClusterSettings = clusterSettings; UserWhitelistedIPRanges = userWhitelistedIPRanges; HasLinuxWorkers = hasLinuxWorkers; + UpgradePreference = upgradePreference; DedicatedHostCount = dedicatedHostCount; IsZoneRedundant = isZoneRedundant; + CustomDnsSuffixConfiguration = customDnsSuffixConfiguration; + NetworkingConfiguration = networkingConfiguration; + UpgradeAvailability = upgradeAvailability; } /// Provisioning state of the App Service Environment. @@ -97,9 +106,17 @@ internal AppServiceEnvironmentProperties(ProvisioningState? provisioningState, H public IList UserWhitelistedIPRanges { get; } /// Flag that displays whether an ASE has linux workers or not. public bool? HasLinuxWorkers { get; } + /// Upgrade Preference. + public UpgradePreference? UpgradePreference { get; set; } /// Dedicated Host Count. public int? DedicatedHostCount { get; set; } /// Whether or not this App Service Environment is zone-redundant. public bool? IsZoneRedundant { get; set; } + /// Full view of the custom domain suffix configuration for ASEv3. + public CustomDnsSuffixConfigurationData CustomDnsSuffixConfiguration { get; set; } + /// Full view of networking configuration for an ASE. + public AseV3NetworkingConfigurationData NetworkingConfiguration { get; set; } + /// Whether an upgrade is available for this App Service Environment. + public UpgradeAvailability? UpgradeAvailability { get; } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceKind.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceKind.cs new file mode 100644 index 000000000000..7e3041c75c5f --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceKind.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.AppService.Models +{ + /// The workflow kind. + public readonly partial struct AppServiceKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AppServiceKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StatefulValue = "Stateful"; + private const string StatelessValue = "Stateless"; + + /// Stateful. + public static AppServiceKind Stateful { get; } = new AppServiceKind(StatefulValue); + /// Stateless. + public static AppServiceKind Stateless { get; } = new AppServiceKind(StatelessValue); + /// Determines if two values are the same. + public static bool operator ==(AppServiceKind left, AppServiceKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AppServiceKind left, AppServiceKind right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator AppServiceKind(string value) => new AppServiceKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AppServiceKind other && Equals(other); + /// + public bool Equals(AppServiceKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceOperation.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceOperation.Serialization.cs index 9dbeb7807639..fddce8731343 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceOperation.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceOperation.Serialization.cs @@ -8,7 +8,6 @@ using System; using System.Collections.Generic; using System.Text.Json; -using Azure; using Azure.Core; namespace Azure.ResourceManager.AppService.Models @@ -24,7 +23,7 @@ internal static AppServiceOperation DeserializeAppServiceOperation(JsonElement e Optional id = default; Optional name = default; Optional status = default; - Optional> errors = default; + Optional> errors = default; Optional createdTime = default; Optional modifiedTime = default; Optional expirationTime = default; @@ -56,10 +55,10 @@ internal static AppServiceOperation DeserializeAppServiceOperation(JsonElement e { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(JsonSerializer.Deserialize(item.GetRawText())); + array.Add(ErrorEntity.DeserializeErrorEntity(item)); } errors = array; continue; diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceOperation.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceOperation.cs index 953a406bd7c0..b1e84db0ef3e 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceOperation.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServiceOperation.cs @@ -7,7 +7,6 @@ using System; using System.Collections.Generic; -using Azure; using Azure.Core; namespace Azure.ResourceManager.AppService.Models @@ -18,7 +17,7 @@ public partial class AppServiceOperation /// Initializes a new instance of AppServiceOperation. internal AppServiceOperation() { - Errors = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); } /// Initializes a new instance of AppServiceOperation. @@ -30,7 +29,7 @@ internal AppServiceOperation() /// Time when operation has been updated. /// Time when operation will expire. /// Applicable only for stamp operation ids. - internal AppServiceOperation(string id, string name, AppServiceOperationStatus? status, IReadOnlyList errors, DateTimeOffset? createdOn, DateTimeOffset? modifiedOn, DateTimeOffset? expireOn, Guid? geoMasterOperationId) + internal AppServiceOperation(string id, string name, AppServiceOperationStatus? status, IReadOnlyList errors, DateTimeOffset? createdOn, DateTimeOffset? modifiedOn, DateTimeOffset? expireOn, Guid? geoMasterOperationId) { Id = id; Name = name; @@ -49,7 +48,7 @@ internal AppServiceOperation(string id, string name, AppServiceOperationStatus? /// The current status of the operation. public AppServiceOperationStatus? Status { get; } /// Any errors associate with the operation. - public IReadOnlyList Errors { get; } + public IReadOnlyList Errors { get; } /// Time when operation has started. public DateTimeOffset? CreatedOn { get; } /// Time when operation has been updated. diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanData.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanData.Serialization.cs index ca07066cd9c1..304628223a76 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanData.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanData.Serialization.cs @@ -177,6 +177,7 @@ internal static AppServicePlanData DeserializeAppServicePlanData(JsonElement ele Optional subscription = default; Optional hostingEnvironmentProfile = default; Optional maximumNumberOfWorkers = default; + Optional numberOfWorkers = default; Optional geoRegion = default; Optional perSiteScaling = default; Optional elasticScaleEnabled = default; @@ -309,6 +310,15 @@ internal static AppServicePlanData DeserializeAppServicePlanData(JsonElement ele maximumNumberOfWorkers = property0.Value.GetInt32(); continue; } + if (property0.NameEquals("numberOfWorkers"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfWorkers = property0.Value.GetInt32(); + continue; + } if (property0.NameEquals("geoRegion"u8)) { geoRegion = property0.Value.GetString(); @@ -461,7 +471,7 @@ internal static AppServicePlanData DeserializeAppServicePlanData(JsonElement ele continue; } } - return new AppServicePlanData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, sku.Value, extendedLocation, workerTierName.Value, Optional.ToNullable(status), subscription.Value, hostingEnvironmentProfile.Value, Optional.ToNullable(maximumNumberOfWorkers), geoRegion.Value, Optional.ToNullable(perSiteScaling), Optional.ToNullable(elasticScaleEnabled), Optional.ToNullable(maximumElasticWorkerCount), Optional.ToNullable(numberOfSites), Optional.ToNullable(isSpot), Optional.ToNullable(spotExpirationTime), Optional.ToNullable(freeOfferExpirationTime), resourceGroup.Value, Optional.ToNullable(reserved), Optional.ToNullable(isXenon), Optional.ToNullable(hyperV), Optional.ToNullable(targetWorkerCount), Optional.ToNullable(targetWorkerSizeId), Optional.ToNullable(provisioningState), kubeEnvironmentProfile.Value, Optional.ToNullable(zoneRedundant), kind.Value); + return new AppServicePlanData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, sku.Value, extendedLocation, workerTierName.Value, Optional.ToNullable(status), subscription.Value, hostingEnvironmentProfile.Value, Optional.ToNullable(maximumNumberOfWorkers), Optional.ToNullable(numberOfWorkers), geoRegion.Value, Optional.ToNullable(perSiteScaling), Optional.ToNullable(elasticScaleEnabled), Optional.ToNullable(maximumElasticWorkerCount), Optional.ToNullable(numberOfSites), Optional.ToNullable(isSpot), Optional.ToNullable(spotExpirationTime), Optional.ToNullable(freeOfferExpirationTime), resourceGroup.Value, Optional.ToNullable(reserved), Optional.ToNullable(isXenon), Optional.ToNullable(hyperV), Optional.ToNullable(targetWorkerCount), Optional.ToNullable(targetWorkerSizeId), Optional.ToNullable(provisioningState), kubeEnvironmentProfile.Value, Optional.ToNullable(zoneRedundant), kind.Value); } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanPatch.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanPatch.Serialization.cs index 34fe7f6f6be8..a802170de082 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanPatch.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanPatch.Serialization.cs @@ -119,6 +119,7 @@ internal static AppServicePlanPatch DeserializeAppServicePlanPatch(JsonElement e Optional subscription = default; Optional hostingEnvironmentProfile = default; Optional maximumNumberOfWorkers = default; + Optional numberOfWorkers = default; Optional geoRegion = default; Optional perSiteScaling = default; Optional elasticScaleEnabled = default; @@ -213,6 +214,15 @@ internal static AppServicePlanPatch DeserializeAppServicePlanPatch(JsonElement e maximumNumberOfWorkers = property0.Value.GetInt32(); continue; } + if (property0.NameEquals("numberOfWorkers"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + numberOfWorkers = property0.Value.GetInt32(); + continue; + } if (property0.NameEquals("geoRegion"u8)) { geoRegion = property0.Value.GetString(); @@ -362,7 +372,7 @@ internal static AppServicePlanPatch DeserializeAppServicePlanPatch(JsonElement e continue; } } - return new AppServicePlanPatch(id, name, type, systemData.Value, workerTierName.Value, Optional.ToNullable(status), subscription.Value, hostingEnvironmentProfile.Value, Optional.ToNullable(maximumNumberOfWorkers), geoRegion.Value, Optional.ToNullable(perSiteScaling), Optional.ToNullable(elasticScaleEnabled), Optional.ToNullable(maximumElasticWorkerCount), Optional.ToNullable(numberOfSites), Optional.ToNullable(isSpot), Optional.ToNullable(spotExpirationTime), Optional.ToNullable(freeOfferExpirationTime), resourceGroup.Value, Optional.ToNullable(reserved), Optional.ToNullable(isXenon), Optional.ToNullable(hyperV), Optional.ToNullable(targetWorkerCount), Optional.ToNullable(targetWorkerSizeId), Optional.ToNullable(provisioningState), kubeEnvironmentProfile.Value, Optional.ToNullable(zoneRedundant), kind.Value); + return new AppServicePlanPatch(id, name, type, systemData.Value, workerTierName.Value, Optional.ToNullable(status), subscription.Value, hostingEnvironmentProfile.Value, Optional.ToNullable(maximumNumberOfWorkers), Optional.ToNullable(numberOfWorkers), geoRegion.Value, Optional.ToNullable(perSiteScaling), Optional.ToNullable(elasticScaleEnabled), Optional.ToNullable(maximumElasticWorkerCount), Optional.ToNullable(numberOfSites), Optional.ToNullable(isSpot), Optional.ToNullable(spotExpirationTime), Optional.ToNullable(freeOfferExpirationTime), resourceGroup.Value, Optional.ToNullable(reserved), Optional.ToNullable(isXenon), Optional.ToNullable(hyperV), Optional.ToNullable(targetWorkerCount), Optional.ToNullable(targetWorkerSizeId), Optional.ToNullable(provisioningState), kubeEnvironmentProfile.Value, Optional.ToNullable(zoneRedundant), kind.Value); } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanPatch.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanPatch.cs index 931c95fa92bf..747c616f4ffb 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanPatch.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AppServicePlanPatch.cs @@ -29,6 +29,7 @@ public AppServicePlanPatch() /// App Service plan subscription. /// Specification for the App Service Environment to use for the App Service plan. /// Maximum number of instances that can be assigned to this App Service plan. + /// The number of instances that are assigned to this App Service plan. /// Geographical location for the App Service plan. /// /// If <code>true</code>, apps assigned to this App Service plan can be scaled independently. @@ -53,13 +54,14 @@ public AppServicePlanPatch() /// If <code>false</code>, this App Service Plan will not perform availability zone balancing. /// /// Kind of resource. - internal AppServicePlanPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string workerTierName, AppServicePlanStatus? status, string subscription, HostingEnvironmentProfile hostingEnvironmentProfile, int? maximumNumberOfWorkers, string geoRegion, bool? isPerSiteScaling, bool? isElasticScaleEnabled, int? maximumElasticWorkerCount, int? numberOfSites, bool? isSpot, DateTimeOffset? spotExpirationOn, DateTimeOffset? freeOfferExpirationOn, string resourceGroup, bool? isReserved, bool? isXenon, bool? isHyperV, int? targetWorkerCount, int? targetWorkerSizeId, ProvisioningState? provisioningState, KubeEnvironmentProfile kubeEnvironmentProfile, bool? isZoneRedundant, string kind) : base(id, name, resourceType, systemData) + internal AppServicePlanPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string workerTierName, AppServicePlanStatus? status, string subscription, HostingEnvironmentProfile hostingEnvironmentProfile, int? maximumNumberOfWorkers, int? numberOfWorkers, string geoRegion, bool? isPerSiteScaling, bool? isElasticScaleEnabled, int? maximumElasticWorkerCount, int? numberOfSites, bool? isSpot, DateTimeOffset? spotExpirationOn, DateTimeOffset? freeOfferExpirationOn, string resourceGroup, bool? isReserved, bool? isXenon, bool? isHyperV, int? targetWorkerCount, int? targetWorkerSizeId, ProvisioningState? provisioningState, KubeEnvironmentProfile kubeEnvironmentProfile, bool? isZoneRedundant, string kind) : base(id, name, resourceType, systemData) { WorkerTierName = workerTierName; Status = status; Subscription = subscription; HostingEnvironmentProfile = hostingEnvironmentProfile; MaximumNumberOfWorkers = maximumNumberOfWorkers; + NumberOfWorkers = numberOfWorkers; GeoRegion = geoRegion; IsPerSiteScaling = isPerSiteScaling; IsElasticScaleEnabled = isElasticScaleEnabled; @@ -90,6 +92,8 @@ internal AppServicePlanPatch(ResourceIdentifier id, string name, ResourceType re public HostingEnvironmentProfile HostingEnvironmentProfile { get; set; } /// Maximum number of instances that can be assigned to this App Service plan. public int? MaximumNumberOfWorkers { get; } + /// The number of instances that are assigned to this App Service plan. + public int? NumberOfWorkers { get; } /// Geographical location for the App Service plan. public string GeoRegion { get; } /// diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AseRegion.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AseRegion.Serialization.cs new file mode 100644 index 000000000000..58d2549dc8f2 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AseRegion.Serialization.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppService.Models +{ + public partial class AseRegion : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(AvailableSku)) + { + writer.WritePropertyName("availableSku"u8); + writer.WriteStartArray(); + foreach (var item in AvailableSku) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(AvailableOS)) + { + writer.WritePropertyName("availableOS"u8); + writer.WriteStartArray(); + foreach (var item in AvailableOS) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static AseRegion DeserializeAseRegion(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional kind = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + Optional displayName = default; + Optional standard = default; + Optional dedicatedHost = default; + Optional zoneRedundant = default; + Optional> availableSku = default; + Optional> availableOS = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("kind"u8)) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("displayName"u8)) + { + displayName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("standard"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + standard = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("dedicatedHost"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dedicatedHost = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("zoneRedundant"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + zoneRedundant = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("availableSku"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + availableSku = array; + continue; + } + if (property0.NameEquals("availableOS"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + availableOS = array; + continue; + } + } + continue; + } + } + return new AseRegion(id, name, type, systemData.Value, displayName.Value, Optional.ToNullable(standard), Optional.ToNullable(dedicatedHost), Optional.ToNullable(zoneRedundant), Optional.ToList(availableSku), Optional.ToList(availableOS), kind.Value); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AseRegion.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AseRegion.cs new file mode 100644 index 000000000000..b925882fe3b6 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AseRegion.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppService.Models +{ + /// ASE region. + public partial class AseRegion : ResourceData + { + /// Initializes a new instance of AseRegion. + public AseRegion() + { + AvailableSku = new ChangeTrackingList(); + AvailableOS = new ChangeTrackingList(); + } + + /// Initializes a new instance of AseRegion. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Display name for region. + /// Is region standard. + /// Dedicated host enabled. + /// Zone redundant deployment enabled. + /// Available Skus in region. + /// Available OSs in region. + /// Kind of resource. + internal AseRegion(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string displayName, bool? standard, bool? dedicatedHost, bool? zoneRedundant, IList availableSku, IList availableOS, string kind) : base(id, name, resourceType, systemData) + { + DisplayName = displayName; + Standard = standard; + DedicatedHost = dedicatedHost; + ZoneRedundant = zoneRedundant; + AvailableSku = availableSku; + AvailableOS = availableOS; + Kind = kind; + } + + /// Display name for region. + public string DisplayName { get; } + /// Is region standard. + public bool? Standard { get; } + /// Dedicated host enabled. + public bool? DedicatedHost { get; } + /// Zone redundant deployment enabled. + public bool? ZoneRedundant { get; } + /// Available Skus in region. + public IList AvailableSku { get; } + /// Available OSs in region. + public IList AvailableOS { get; } + /// Kind of resource. + public string Kind { get; set; } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AseRegionCollection.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AseRegionCollection.Serialization.cs new file mode 100644 index 000000000000..091a6ffd8d2e --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AseRegionCollection.Serialization.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppService.Models +{ + internal partial class AseRegionCollection + { + internal static AseRegionCollection DeserializeAseRegionCollection(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AseRegion.DeserializeAseRegion(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new AseRegionCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AseRegionCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AseRegionCollection.cs new file mode 100644 index 000000000000..fa9470cbfc6c --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AseRegionCollection.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.ResourceManager.AppService.Models +{ + /// Collection of ASE regions. + internal partial class AseRegionCollection + { + /// Initializes a new instance of AseRegionCollection. + /// Collection of resources. + /// is null. + internal AseRegionCollection(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of AseRegionCollection. + /// Collection of resources. + /// Link to next page of resources. + internal AseRegionCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AseV3NetworkingConfigurationData.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AseV3NetworkingConfigurationData.Serialization.cs index d28425405574..373285fb1a1c 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AseV3NetworkingConfigurationData.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AseV3NetworkingConfigurationData.Serialization.cs @@ -30,6 +30,21 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("allowNewPrivateEndpointConnections"u8); writer.WriteBooleanValue(AllowNewPrivateEndpointConnections.Value); } + if (Optional.IsDefined(FtpEnabled)) + { + writer.WritePropertyName("ftpEnabled"u8); + writer.WriteBooleanValue(FtpEnabled.Value); + } + if (Optional.IsDefined(RemoteDebugEnabled)) + { + writer.WritePropertyName("remoteDebugEnabled"u8); + writer.WriteBooleanValue(RemoteDebugEnabled.Value); + } + if (Optional.IsDefined(InboundIPAddressOverride)) + { + writer.WritePropertyName("inboundIpAddressOverride"u8); + writer.WriteStringValue(InboundIPAddressOverride); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -50,6 +65,9 @@ internal static AseV3NetworkingConfigurationData DeserializeAseV3NetworkingConfi Optional> externalInboundIPAddresses = default; Optional> internalInboundIPAddresses = default; Optional allowNewPrivateEndpointConnections = default; + Optional ftpEnabled = default; + Optional remoteDebugEnabled = default; + Optional inboundIPAddressOverride = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("kind"u8)) @@ -183,11 +201,34 @@ internal static AseV3NetworkingConfigurationData DeserializeAseV3NetworkingConfi allowNewPrivateEndpointConnections = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("ftpEnabled"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ftpEnabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("remoteDebugEnabled"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + remoteDebugEnabled = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("inboundIpAddressOverride"u8)) + { + inboundIPAddressOverride = property0.Value.GetString(); + continue; + } } continue; } } - return new AseV3NetworkingConfigurationData(id, name, type, systemData.Value, Optional.ToList(windowsOutboundIPAddresses), Optional.ToList(linuxOutboundIPAddresses), Optional.ToList(externalInboundIPAddresses), Optional.ToList(internalInboundIPAddresses), Optional.ToNullable(allowNewPrivateEndpointConnections), kind.Value); + return new AseV3NetworkingConfigurationData(id, name, type, systemData.Value, Optional.ToList(windowsOutboundIPAddresses), Optional.ToList(linuxOutboundIPAddresses), Optional.ToList(externalInboundIPAddresses), Optional.ToList(internalInboundIPAddresses), Optional.ToNullable(allowNewPrivateEndpointConnections), Optional.ToNullable(ftpEnabled), Optional.ToNullable(remoteDebugEnabled), inboundIPAddressOverride.Value, kind.Value); } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AzureResourceErrorInfo.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AzureResourceErrorInfo.Serialization.cs new file mode 100644 index 000000000000..8c6e5434b5c5 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AzureResourceErrorInfo.Serialization.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppService.Models +{ + public partial class AzureResourceErrorInfo + { + internal static AzureResourceErrorInfo DeserializeAzureResourceErrorInfo(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string message = default; + Optional> details = default; + string code = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("details"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeserializeAzureResourceErrorInfo(item)); + } + details = array; + continue; + } + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + } + return new AzureResourceErrorInfo(code, message, Optional.ToList(details)); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AzureResourceErrorInfo.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AzureResourceErrorInfo.cs new file mode 100644 index 000000000000..8e0e99d8e096 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/AzureResourceErrorInfo.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.AppService.Models +{ + /// The azure resource error info. + public partial class AzureResourceErrorInfo : ErrorInfo + { + /// Initializes a new instance of AzureResourceErrorInfo. + /// The error code. + /// The error message. + /// or is null. + internal AzureResourceErrorInfo(string code, string message) : base(code) + { + Argument.AssertNotNull(code, nameof(code)); + Argument.AssertNotNull(message, nameof(message)); + + Message = message; + Details = new ChangeTrackingList(); + } + + /// Initializes a new instance of AzureResourceErrorInfo. + /// The error code. + /// The error message. + /// The error details. + /// is null. + internal AzureResourceErrorInfo(string code, string message, IReadOnlyList details) : base(code) + { + Argument.AssertNotNull(code, nameof(code)); + + Message = message; + Details = details; + } + + /// The error message. + public string Message { get; } + /// The error details. + public IReadOnlyList Details { get; } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/BasicAuthName.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/BasicAuthName.cs new file mode 100644 index 000000000000..ed247a28ae4c --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/BasicAuthName.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.AppService.Models +{ + /// The BasicAuthName. + public readonly partial struct BasicAuthName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public BasicAuthName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DefaultValue = "default"; + + /// default. + public static BasicAuthName Default { get; } = new BasicAuthName(DefaultValue); + /// Determines if two values are the same. + public static bool operator ==(BasicAuthName left, BasicAuthName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BasicAuthName left, BasicAuthName right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator BasicAuthName(string value) => new BasicAuthName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BasicAuthName other && Equals(other); + /// + public bool Equals(BasicAuthName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CertificateOrderAction.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CertificateOrderAction.Serialization.cs index 45e80dbf2b62..0de710834240 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CertificateOrderAction.Serialization.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CertificateOrderAction.Serialization.cs @@ -8,102 +8,41 @@ using System; using System.Text.Json; using Azure.Core; -using Azure.ResourceManager.Models; namespace Azure.ResourceManager.AppService.Models { - public partial class CertificateOrderAction : IUtf8JsonSerializable + public partial class CertificateOrderAction { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - internal static CertificateOrderAction DeserializeCertificateOrderAction(JsonElement element) { if (element.ValueKind == JsonValueKind.Null) { return null; } - Optional kind = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; Optional actionType = default; Optional createdAt = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("kind"u8)) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) + if (property.NameEquals("actionType"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + actionType = property.Value.GetString().ToCertificateOrderActionType(); continue; } - if (property.NameEquals("properties"u8)) + if (property.NameEquals("createdAt"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { - property.ThrowNonNullablePropertyIsNull(); continue; } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("actionType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - actionType = property0.Value.GetString().ToCertificateOrderActionType(); - continue; - } - if (property0.NameEquals("createdAt"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - createdAt = property0.Value.GetDateTimeOffset("O"); - continue; - } - } + createdAt = property.Value.GetDateTimeOffset("O"); continue; } } - return new CertificateOrderAction(id, name, type, systemData.Value, Optional.ToNullable(actionType), Optional.ToNullable(createdAt), kind.Value); + return new CertificateOrderAction(Optional.ToNullable(actionType), Optional.ToNullable(createdAt)); } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CertificateOrderAction.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CertificateOrderAction.cs index 381a5c4fe2cf..87dd5eb2c3b5 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CertificateOrderAction.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/CertificateOrderAction.cs @@ -6,39 +6,29 @@ #nullable disable using System; -using Azure.Core; -using Azure.ResourceManager.Models; namespace Azure.ResourceManager.AppService.Models { /// Certificate order action. - public partial class CertificateOrderAction : ResourceData + public partial class CertificateOrderAction { /// Initializes a new instance of CertificateOrderAction. - public CertificateOrderAction() + internal CertificateOrderAction() { } /// Initializes a new instance of CertificateOrderAction. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. /// Action type. /// Time at which the certificate action was performed. - /// Kind of resource. - internal CertificateOrderAction(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, CertificateOrderActionType? actionType, DateTimeOffset? createdOn, string kind) : base(id, name, resourceType, systemData) + internal CertificateOrderAction(CertificateOrderActionType? actionType, DateTimeOffset? createdOn) { ActionType = actionType; CreatedOn = createdOn; - Kind = kind; } /// Action type. public CertificateOrderActionType? ActionType { get; } /// Time at which the certificate action was performed. public DateTimeOffset? CreatedOn { get; } - /// Kind of resource. - public string Kind { get; set; } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Configuration.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Configuration.Serialization.cs new file mode 100644 index 000000000000..50cfb8a48adc --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Configuration.Serialization.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppService.Models +{ + public partial class Configuration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Secrets)) + { + writer.WritePropertyName("secrets"u8); + writer.WriteStartArray(); + foreach (var item in Secrets) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ActiveRevisionsMode)) + { + writer.WritePropertyName("activeRevisionsMode"u8); + writer.WriteStringValue(ActiveRevisionsMode.Value.ToString()); + } + if (Optional.IsDefined(Ingress)) + { + writer.WritePropertyName("ingress"u8); + writer.WriteObjectValue(Ingress); + } + if (Optional.IsCollectionDefined(Registries)) + { + writer.WritePropertyName("registries"u8); + writer.WriteStartArray(); + foreach (var item in Registries) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static Configuration DeserializeConfiguration(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> secrets = default; + Optional activeRevisionsMode = default; + Optional ingress = default; + Optional> registries = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("secrets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Secret.DeserializeSecret(item)); + } + secrets = array; + continue; + } + if (property.NameEquals("activeRevisionsMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + activeRevisionsMode = new ActiveRevisionsMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("ingress"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ingress = Ingress.DeserializeIngress(property.Value); + continue; + } + if (property.NameEquals("registries"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RegistryCredentials.DeserializeRegistryCredentials(item)); + } + registries = array; + continue; + } + } + return new Configuration(Optional.ToList(secrets), Optional.ToNullable(activeRevisionsMode), ingress.Value, Optional.ToList(registries)); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Configuration.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Configuration.cs new file mode 100644 index 000000000000..23e5335b0eb7 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Configuration.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.AppService.Models +{ + /// Non versioned Container App configuration properties that define the mutable settings of a Container app. + public partial class Configuration + { + /// Initializes a new instance of Configuration. + public Configuration() + { + Secrets = new ChangeTrackingList(); + Registries = new ChangeTrackingList(); + } + + /// Initializes a new instance of Configuration. + /// Collection of secrets used by a Container app. + /// + /// ActiveRevisionsMode controls how active revisions are handled for the Container app: + /// <list><item>Multiple: multiple revisions can be active. If no value if provided, this is the default</item><item>Single: Only one revision can be active at a time. Revision weights can not be used in this mode</item></list> + /// + /// Ingress configurations. + /// Collection of private container registry credentials for containers used by the Container app. + internal Configuration(IList secrets, ActiveRevisionsMode? activeRevisionsMode, Ingress ingress, IList registries) + { + Secrets = secrets; + ActiveRevisionsMode = activeRevisionsMode; + Ingress = ingress; + Registries = registries; + } + + /// Collection of secrets used by a Container app. + public IList Secrets { get; } + /// + /// ActiveRevisionsMode controls how active revisions are handled for the Container app: + /// <list><item>Multiple: multiple revisions can be active. If no value if provided, this is the default</item><item>Single: Only one revision can be active at a time. Revision weights can not be used in this mode</item></list> + /// + public ActiveRevisionsMode? ActiveRevisionsMode { get; set; } + /// Ingress configurations. + public Ingress Ingress { get; set; } + /// Collection of private container registry credentials for containers used by the Container app. + public IList Registries { get; } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Container.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Container.Serialization.cs new file mode 100644 index 000000000000..210b28539e16 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Container.Serialization.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AppService.Models +{ + public partial class Container : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Image)) + { + writer.WritePropertyName("image"u8); + writer.WriteStringValue(Image); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsCollectionDefined(Command)) + { + writer.WritePropertyName("command"u8); + writer.WriteStartArray(); + foreach (var item in Command) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Args)) + { + writer.WritePropertyName("args"u8); + writer.WriteStartArray(); + foreach (var item in Args) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Env)) + { + writer.WritePropertyName("env"u8); + writer.WriteStartArray(); + foreach (var item in Env) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Resources)) + { + writer.WritePropertyName("resources"u8); + writer.WriteObjectValue(Resources); + } + writer.WriteEndObject(); + } + + internal static Container DeserializeContainer(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional image = default; + Optional name = default; + Optional> command = default; + Optional> args = default; + Optional> env = default; + Optional resources = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("image"u8)) + { + image = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("command"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + command = array; + continue; + } + if (property.NameEquals("args"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + args = array; + continue; + } + if (property.NameEquals("env"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EnvironmentVar.DeserializeEnvironmentVar(item)); + } + env = array; + continue; + } + if (property.NameEquals("resources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resources = ContainerResources.DeserializeContainerResources(property.Value); + continue; + } + } + return new Container(image.Value, name.Value, Optional.ToList(command), Optional.ToList(args), Optional.ToList(env), resources.Value); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Container.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Container.cs new file mode 100644 index 000000000000..6bbfffabdb04 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/Container.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.AppService.Models +{ + /// Container App container definition. + public partial class Container + { + /// Initializes a new instance of Container. + public Container() + { + Command = new ChangeTrackingList(); + Args = new ChangeTrackingList(); + Env = new ChangeTrackingList(); + } + + /// Initializes a new instance of Container. + /// Container image tag. + /// Custom container name. + /// Container start command. + /// Container start command arguments. + /// Container environment variables. + /// Container resource requirements. + internal Container(string image, string name, IList command, IList args, IList env, ContainerResources resources) + { + Image = image; + Name = name; + Command = command; + Args = args; + Env = env; + Resources = resources; + } + + /// Container image tag. + public string Image { get; set; } + /// Custom container name. + public string Name { get; set; } + /// Container start command. + public IList Command { get; } + /// Container start command arguments. + public IList Args { get; } + /// Container environment variables. + public IList Env { get; } + /// Container resource requirements. + public ContainerResources Resources { get; set; } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContainerAppCollection.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContainerAppCollection.Serialization.cs new file mode 100644 index 000000000000..5dcdfa0514ff --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContainerAppCollection.Serialization.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Models +{ + internal partial class ContainerAppCollection + { + internal static ContainerAppCollection DeserializeContainerAppCollection(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ContainerAppData.DeserializeContainerAppData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new ContainerAppCollection(value, nextLink.Value); + } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContainerAppCollection.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContainerAppCollection.cs new file mode 100644 index 000000000000..55632547f10e --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContainerAppCollection.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; +using Azure.ResourceManager.AppService; + +namespace Azure.ResourceManager.AppService.Models +{ + /// Container App collection ARM resource. + internal partial class ContainerAppCollection + { + /// Initializes a new instance of ContainerAppCollection. + /// Collection of resources. + /// is null. + internal ContainerAppCollection(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of ContainerAppCollection. + /// Collection of resources. + /// Link to next page of resources. + internal ContainerAppCollection(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of resources. + public IReadOnlyList Value { get; } + /// Link to next page of resources. + public string NextLink { get; } + } +} diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContainerAppData.Serialization.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContainerAppData.Serialization.cs new file mode 100644 index 000000000000..d23e116ddcb3 --- /dev/null +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/ContainerAppData.Serialization.cs @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.AppService.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.AppService +{ + public partial class ContainerAppData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind); + } + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(KubeEnvironmentId)) + { + writer.WritePropertyName("kubeEnvironmentId"u8); + writer.WriteStringValue(KubeEnvironmentId); + } + if (Optional.IsDefined(Configuration)) + { + writer.WritePropertyName("configuration"u8); + writer.WriteObjectValue(Configuration); + } + if (Optional.IsDefined(Template)) + { + writer.WritePropertyName("template"u8); + writer.WriteObjectValue(Template); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static ContainerAppData DeserializeContainerAppData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional kind = default; + Optional> tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + Optional provisioningState = default; + Optional kubeEnvironmentId = default; + Optional latestRevisionName = default; + Optional latestRevisionFqdn = default; + Optional configuration = default; + Optional