// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models.HealthMonitoring;
var requestBody = new AlertConfiguration
{
EmailNotificationConfigurations = new List<EmailNotificationConfiguration>
{
new EmailNotificationConfiguration
{
GroupId = "c5140914-9507-4180-b60c-04d5ec5eddcb",
IsEnabled = true,
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Reports.HealthMonitoring.AlertConfigurations["{alertConfiguration-id}"].PatchAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodelshealthmonitoring "github.com/microsoftgraph/msgraph-beta-sdk-go/models/healthmonitoring"
//other-imports
)
requestBody := graphmodelshealthmonitoring.NewAlertConfiguration()
emailNotificationConfiguration := graphmodelshealthmonitoring.NewEmailNotificationConfiguration()
groupId := "c5140914-9507-4180-b60c-04d5ec5eddcb"
emailNotificationConfiguration.SetGroupId(&groupId)
isEnabled := true
emailNotificationConfiguration.SetIsEnabled(&isEnabled)
emailNotificationConfigurations := []graphmodelshealthmonitoring.EmailNotificationConfigurationable {
emailNotificationConfiguration,
}
requestBody.SetEmailNotificationConfigurations(emailNotificationConfigurations)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
alertConfigurations, err := graphClient.Reports().HealthMonitoring().AlertConfigurations().ByAlertConfigurationId("alertConfiguration-id").Patch(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.models.healthmonitoring.AlertConfiguration alertConfiguration = new com.microsoft.graph.beta.models.healthmonitoring.AlertConfiguration();
LinkedList<com.microsoft.graph.beta.models.healthmonitoring.EmailNotificationConfiguration> emailNotificationConfigurations = new LinkedList<com.microsoft.graph.beta.models.healthmonitoring.EmailNotificationConfiguration>();
com.microsoft.graph.beta.models.healthmonitoring.EmailNotificationConfiguration emailNotificationConfiguration = new com.microsoft.graph.beta.models.healthmonitoring.EmailNotificationConfiguration();
emailNotificationConfiguration.setGroupId("c5140914-9507-4180-b60c-04d5ec5eddcb");
emailNotificationConfiguration.setIsEnabled(true);
emailNotificationConfigurations.add(emailNotificationConfiguration);
alertConfiguration.setEmailNotificationConfigurations(emailNotificationConfigurations);
com.microsoft.graph.models.healthmonitoring.AlertConfiguration result = graphClient.reports().healthMonitoring().alertConfigurations().byAlertConfigurationId("{alertConfiguration-id}").patch(alertConfiguration);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\HealthMonitoring\AlertConfiguration;
use Microsoft\Graph\Beta\Generated\Models\HealthMonitoring\EmailNotificationConfiguration;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new AlertConfiguration();
$emailNotificationConfigurationsEmailNotificationConfiguration1 = new EmailNotificationConfiguration();
$emailNotificationConfigurationsEmailNotificationConfiguration1->setGroupId('c5140914-9507-4180-b60c-04d5ec5eddcb');
$emailNotificationConfigurationsEmailNotificationConfiguration1->setIsEnabled(true);
$emailNotificationConfigurationsArray []= $emailNotificationConfigurationsEmailNotificationConfiguration1;
$requestBody->setEmailNotificationConfigurations($emailNotificationConfigurationsArray);
$result = $graphServiceClient->reports()->healthMonitoring()->alertConfigurations()->byAlertConfigurationId('alertConfiguration-id')->patch($requestBody)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.health_monitoring.alert_configuration import AlertConfiguration
from msgraph_beta.generated.models.health_monitoring.email_notification_configuration import EmailNotificationConfiguration
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = AlertConfiguration(
email_notification_configurations = [
EmailNotificationConfiguration(
group_id = "c5140914-9507-4180-b60c-04d5ec5eddcb",
is_enabled = True,
),
],
)
result = await graph_client.reports.health_monitoring.alert_configurations.by_alert_configuration_id('alertConfiguration-id').patch(request_body)