1. Registry
  2. Packages
  3. Zenduty Provider
  4. API Docs
  5. getNotificationRules
Viewing docs for zenduty 2.0.0
published on Friday, Aug 14, 2026 by zenduty
Viewing docs for zenduty 2.0.0
published on Friday, Aug 14, 2026 by zenduty

    zenduty.NotificationRules lists the notification rules of a user.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as zenduty from "@pulumi/zenduty";
    
    const user1 = zenduty.getUser({
        email: "demouser@gmail.com",
    });
    const userRules = user1.then(user1 => zenduty.getNotificationRules({
        username: user1.users?.[0]?.username,
    }));
    
    import pulumi
    import pulumi_zenduty as zenduty
    
    user1 = zenduty.get_user(email="demouser@gmail.com")
    user_rules = zenduty.get_notification_rules(username=user1.users[0].username)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/zenduty/v2/zenduty"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		user1, err := zenduty.LookupUser(ctx, &zenduty.LookupUserArgs{
    			Email: "demouser@gmail.com",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = zenduty.LookupNotificationRules(ctx, &zenduty.LookupNotificationRulesArgs{
    			Username: user1.Users[0].Username,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Zenduty = Pulumi.Zenduty;
    
    return await Deployment.RunAsync(() => 
    {
        var user1 = Zenduty.GetUser.Invoke(new()
        {
            Email = "demouser@gmail.com",
        });
    
        var userRules = Zenduty.GetNotificationRules.Invoke(new()
        {
            Username = user1.Apply(getUserResult => getUserResult.Users[0]?.Username),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.zenduty.ZendutyFunctions;
    import com.pulumi.zenduty.inputs.GetUserArgs;
    import com.pulumi.zenduty.inputs.GetNotificationRulesArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var user1 = ZendutyFunctions.getUser(GetUserArgs.builder()
                .email("demouser@gmail.com")
                .build());
    
            final var userRules = ZendutyFunctions.getNotificationRules(GetNotificationRulesArgs.builder()
                .username(user1.users()[0].username())
                .build());
    
        }
    }
    
    variables:
      user1:
        fn::invoke:
          function: zenduty:getUser
          arguments:
            email: demouser@gmail.com
      userRules:
        fn::invoke:
          function: zenduty:getNotificationRules
          arguments:
            username: ${user1.users[0].username}
    
    Example coming soon!
    

    Using getNotificationRules

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getNotificationRules(args: GetNotificationRulesArgs, opts?: InvokeOptions): Promise<GetNotificationRulesResult>
    function getNotificationRulesOutput(args: GetNotificationRulesOutputArgs, opts?: InvokeOutputOptions): Output<GetNotificationRulesResult>
    def get_notification_rules(id: Optional[str] = None,
                               username: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetNotificationRulesResult
    def get_notification_rules_output(id: pulumi.Input[Optional[str]] = None,
                               username: pulumi.Input[Optional[str]] = None,
                               opts: Optional[InvokeOutputOptions] = None) -> Output[GetNotificationRulesResult]
    func LookupNotificationRules(ctx *Context, args *LookupNotificationRulesArgs, opts ...InvokeOption) (*LookupNotificationRulesResult, error)
    func LookupNotificationRulesOutput(ctx *Context, args *LookupNotificationRulesOutputArgs, opts ...InvokeOption) LookupNotificationRulesResultOutput

    > Note: This function is named LookupNotificationRules in the Go SDK.

    public static class GetNotificationRules 
    {
        public static Task<GetNotificationRulesResult> InvokeAsync(GetNotificationRulesArgs args, InvokeOptions? opts = null)
        public static Output<GetNotificationRulesResult> Invoke(GetNotificationRulesInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetNotificationRulesResult> Invoke(GetNotificationRulesInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetNotificationRulesResult> getNotificationRules(GetNotificationRulesArgs args, InvokeOptions options)
    public static Output<GetNotificationRulesResult> getNotificationRules(GetNotificationRulesArgs args, InvokeOptions options)
    public static Output<GetNotificationRulesResult> getNotificationRules(GetNotificationRulesArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: zenduty:index/getNotificationRules:getNotificationRules
      arguments:
        # arguments dictionary
    data "zenduty_get_notification_rules" "name" {
        # arguments
    }

    The following arguments are supported:

    Username string
    The username of the user whose notification rules to list.
    Id string
    Username string
    The username of the user whose notification rules to list.
    Id string
    username string
    The username of the user whose notification rules to list.
    id string
    username String
    The username of the user whose notification rules to list.
    id String
    username string
    The username of the user whose notification rules to list.
    id string
    username str
    The username of the user whose notification rules to list.
    id str
    username String
    The username of the user whose notification rules to list.
    id String

    getNotificationRules Result

    The following output properties are available:

    Id string
    NotificationRules List<GetNotificationRulesNotificationRule>
    The list of notification rules, each with:
    Username string
    Id string
    NotificationRules []GetNotificationRulesNotificationRule
    The list of notification rules, each with:
    Username string
    id string
    notification_rules list(object)
    The list of notification rules, each with:
    username string
    id String
    notificationRules List<GetNotificationRulesNotificationRule>
    The list of notification rules, each with:
    username String
    id string
    notificationRules GetNotificationRulesNotificationRule[]
    The list of notification rules, each with:
    username string
    id str
    notification_rules Sequence[GetNotificationRulesNotificationRule]
    The list of notification rules, each with:
    username str
    id String
    notificationRules List<Property Map>
    The list of notification rules, each with:
    username String

    Supporting Types

    GetNotificationRulesNotificationRule

    Contact string
    The unique_id of the contact method to notify.
    StartDelay double
    Seconds to wait before notifying.
    Type string
    The type of the notification rule.
    UniqueId string
    The unique_id of the notification rule.
    Urgency double
    The urgency the rule applies to: 0 for low, 1 for high.
    Contact string
    The unique_id of the contact method to notify.
    StartDelay float64
    Seconds to wait before notifying.
    Type string
    The type of the notification rule.
    UniqueId string
    The unique_id of the notification rule.
    Urgency float64
    The urgency the rule applies to: 0 for low, 1 for high.
    contact string
    The unique_id of the contact method to notify.
    start_delay number
    Seconds to wait before notifying.
    type string
    The type of the notification rule.
    unique_id string
    The unique_id of the notification rule.
    urgency number
    The urgency the rule applies to: 0 for low, 1 for high.
    contact String
    The unique_id of the contact method to notify.
    startDelay Double
    Seconds to wait before notifying.
    type String
    The type of the notification rule.
    uniqueId String
    The unique_id of the notification rule.
    urgency Double
    The urgency the rule applies to: 0 for low, 1 for high.
    contact string
    The unique_id of the contact method to notify.
    startDelay number
    Seconds to wait before notifying.
    type string
    The type of the notification rule.
    uniqueId string
    The unique_id of the notification rule.
    urgency number
    The urgency the rule applies to: 0 for low, 1 for high.
    contact str
    The unique_id of the contact method to notify.
    start_delay float
    Seconds to wait before notifying.
    type str
    The type of the notification rule.
    unique_id str
    The unique_id of the notification rule.
    urgency float
    The urgency the rule applies to: 0 for low, 1 for high.
    contact String
    The unique_id of the contact method to notify.
    startDelay Number
    Seconds to wait before notifying.
    type String
    The type of the notification rule.
    uniqueId String
    The unique_id of the notification rule.
    urgency Number
    The urgency the rule applies to: 0 for low, 1 for high.

    Package Details

    Repository
    zenduty zenduty/terraform-provider-zenduty
    License
    Notes
    This Pulumi package is based on the zenduty Terraform Provider.
    Viewing docs for zenduty 2.0.0
    published on Friday, Aug 14, 2026 by zenduty

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial