1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. directmail
  5. getReceivers
Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi

alicloud.directmail.getReceivers

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi

    This data source provides the Direct Mail Receiverses of the current Alibaba Cloud user.

    NOTE: Available in v1.125.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const example = alicloud.directmail.getReceivers({
        ids: ["ca73b1e4fb0df7c935a5097a****"],
        nameRegex: "the_resource_name",
    });
    export const firstDirectMailReceiversId = example.then(example => example.receiverses?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    example = alicloud.directmail.get_receivers(ids=["ca73b1e4fb0df7c935a5097a****"],
        name_regex="the_resource_name")
    pulumi.export("firstDirectMailReceiversId", example.receiverses[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/directmail"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := directmail.LookupReceivers(ctx, &directmail.LookupReceiversArgs{
    			Ids: []string{
    				"ca73b1e4fb0df7c935a5097a****",
    			},
    			NameRegex: pulumi.StringRef("the_resource_name"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firstDirectMailReceiversId", example.Receiverses[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = AliCloud.DirectMail.GetReceivers.Invoke(new()
        {
            Ids = new[]
            {
                "ca73b1e4fb0df7c935a5097a****",
            },
            NameRegex = "the_resource_name",
        });
    
        return new Dictionary<string, object?>
        {
            ["firstDirectMailReceiversId"] = example.Apply(getReceiversResult => getReceiversResult.Receiverses[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.directmail.DirectmailFunctions;
    import com.pulumi.alicloud.directmail.inputs.GetReceiversArgs;
    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 example = DirectmailFunctions.getReceivers(GetReceiversArgs.builder()
                .ids("ca73b1e4fb0df7c935a5097a****")
                .nameRegex("the_resource_name")
                .build());
    
            ctx.export("firstDirectMailReceiversId", example.applyValue(getReceiversResult -> getReceiversResult.receiverses()[0].id()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: alicloud:directmail:getReceivers
          Arguments:
            ids:
              - ca73b1e4fb0df7c935a5097a****
            nameRegex: the_resource_name
    outputs:
      firstDirectMailReceiversId: ${example.receiverses[0].id}
    

    Using getReceivers

    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 getReceivers(args: GetReceiversArgs, opts?: InvokeOptions): Promise<GetReceiversResult>
    function getReceiversOutput(args: GetReceiversOutputArgs, opts?: InvokeOptions): Output<GetReceiversResult>
    def get_receivers(ids: Optional[Sequence[str]] = None,
                      key_word: Optional[str] = None,
                      name_regex: Optional[str] = None,
                      output_file: Optional[str] = None,
                      status: Optional[int] = None,
                      opts: Optional[InvokeOptions] = None) -> GetReceiversResult
    def get_receivers_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                      key_word: Optional[pulumi.Input[str]] = None,
                      name_regex: Optional[pulumi.Input[str]] = None,
                      output_file: Optional[pulumi.Input[str]] = None,
                      status: Optional[pulumi.Input[int]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetReceiversResult]
    func LookupReceivers(ctx *Context, args *LookupReceiversArgs, opts ...InvokeOption) (*LookupReceiversResult, error)
    func LookupReceiversOutput(ctx *Context, args *LookupReceiversOutputArgs, opts ...InvokeOption) LookupReceiversResultOutput

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

    public static class GetReceivers 
    {
        public static Task<GetReceiversResult> InvokeAsync(GetReceiversArgs args, InvokeOptions? opts = null)
        public static Output<GetReceiversResult> Invoke(GetReceiversInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetReceiversResult> getReceivers(GetReceiversArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:directmail/getReceivers:getReceivers
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A list of Receivers IDs.
    KeyWord string
    The key word.
    NameRegex string
    A regex string to filter results by Receivers name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Status int
    The status of the resource.
    Ids []string
    A list of Receivers IDs.
    KeyWord string
    The key word.
    NameRegex string
    A regex string to filter results by Receivers name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Status int
    The status of the resource.
    ids List<String>
    A list of Receivers IDs.
    keyWord String
    The key word.
    nameRegex String
    A regex string to filter results by Receivers name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    status Integer
    The status of the resource.
    ids string[]
    A list of Receivers IDs.
    keyWord string
    The key word.
    nameRegex string
    A regex string to filter results by Receivers name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    status number
    The status of the resource.
    ids Sequence[str]
    A list of Receivers IDs.
    key_word str
    The key word.
    name_regex str
    A regex string to filter results by Receivers name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    status int
    The status of the resource.
    ids List<String>
    A list of Receivers IDs.
    keyWord String
    The key word.
    nameRegex String
    A regex string to filter results by Receivers name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    status Number
    The status of the resource.

    getReceivers Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    Receiverses List<Pulumi.AliCloud.DirectMail.Outputs.GetReceiversReceiverse>
    KeyWord string
    NameRegex string
    OutputFile string
    Status int
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    Receiverses []GetReceiversReceiverse
    KeyWord string
    NameRegex string
    OutputFile string
    Status int
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    receiverses List<GetReceiversReceiverse>
    keyWord String
    nameRegex String
    outputFile String
    status Integer
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    receiverses GetReceiversReceiverse[]
    keyWord string
    nameRegex string
    outputFile string
    status number
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    receiverses Sequence[GetReceiversReceiverse]
    key_word str
    name_regex str
    output_file str
    status int
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    receiverses List<Property Map>
    keyWord String
    nameRegex String
    outputFile String
    status Number

    Supporting Types

    GetReceiversReceiverse

    CreateTime string
    The creation time of the resource.
    Description string
    The description.
    Id string
    The ID of the Receivers.
    ReceiversAlias string
    The Receivers Alias.
    ReceiversId string
    The first ID of the resource.
    ReceiversName string
    The name of the resource.
    Status int
    The status of the resource.
    CreateTime string
    The creation time of the resource.
    Description string
    The description.
    Id string
    The ID of the Receivers.
    ReceiversAlias string
    The Receivers Alias.
    ReceiversId string
    The first ID of the resource.
    ReceiversName string
    The name of the resource.
    Status int
    The status of the resource.
    createTime String
    The creation time of the resource.
    description String
    The description.
    id String
    The ID of the Receivers.
    receiversAlias String
    The Receivers Alias.
    receiversId String
    The first ID of the resource.
    receiversName String
    The name of the resource.
    status Integer
    The status of the resource.
    createTime string
    The creation time of the resource.
    description string
    The description.
    id string
    The ID of the Receivers.
    receiversAlias string
    The Receivers Alias.
    receiversId string
    The first ID of the resource.
    receiversName string
    The name of the resource.
    status number
    The status of the resource.
    create_time str
    The creation time of the resource.
    description str
    The description.
    id str
    The ID of the Receivers.
    receivers_alias str
    The Receivers Alias.
    receivers_id str
    The first ID of the resource.
    receivers_name str
    The name of the resource.
    status int
    The status of the resource.
    createTime String
    The creation time of the resource.
    description String
    The description.
    id String
    The ID of the Receivers.
    receiversAlias String
    The Receivers Alias.
    receiversId String
    The first ID of the resource.
    receiversName String
    The name of the resource.
    status Number
    The status of the resource.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi