Ejemplo n.º 1
0
 public void Dispose()
 {
     NotificationChannelClient.DeleteNotificationChannel(
         NotificationChannelName.Parse(Channel.Name), true);
     AlertPolicyClient.DeleteAlertPolicy(
         AlertPolicyName.Parse(Alert.Name));
 }
Ejemplo n.º 2
0
        public void TestReplaceChannels()
        {
            var result = _alert.Run("replace-channels", "-p", _fixture.ProjectId,
                                    "-a", AlertPolicyName.Parse(_fixture.Alert.Name).AlertPolicyId,
                                    "-c", NotificationChannelName.Parse(_fixture.Channel.Name)
                                    .NotificationChannelId);

            Assert.Equal(0, result.ExitCode);
        }
Ejemplo n.º 3
0
    public void DeleteNotificationChannel(
        string channelName = "projects/your-project-id/notificationChannels/123")
    {
        var client = NotificationChannelServiceClient.Create();

        client.DeleteNotificationChannel(
            name: NotificationChannelName.Parse(channelName),
            force: true);
        Console.WriteLine("Deleted {0}.", channelName);
    }