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

alicloud.directmail.getMailAddresses

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 Mail Addresses of the current Alibaba Cloud user.

    NOTE: Available in v1.134.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.directmail.getMailAddresses({
        ids: ["example_id"],
    });
    export const directMailMailAddressId1 = ids.then(ids => ids.addresses?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.directmail.get_mail_addresses(ids=["example_id"])
    pulumi.export("directMailMailAddressId1", ids.addresses[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 {
    		ids, err := directmail.GetMailAddresses(ctx, &directmail.GetMailAddressesArgs{
    			Ids: []string{
    				"example_id",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("directMailMailAddressId1", ids.Addresses[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.DirectMail.GetMailAddresses.Invoke(new()
        {
            Ids = new[]
            {
                "example_id",
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["directMailMailAddressId1"] = ids.Apply(getMailAddressesResult => getMailAddressesResult.Addresses[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.GetMailAddressesArgs;
    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 ids = DirectmailFunctions.getMailAddresses(GetMailAddressesArgs.builder()
                .ids("example_id")
                .build());
    
            ctx.export("directMailMailAddressId1", ids.applyValue(getMailAddressesResult -> getMailAddressesResult.addresses()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:directmail:getMailAddresses
          Arguments:
            ids:
              - example_id
    outputs:
      directMailMailAddressId1: ${ids.addresses[0].id}
    

    Using getMailAddresses

    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 getMailAddresses(args: GetMailAddressesArgs, opts?: InvokeOptions): Promise<GetMailAddressesResult>
    function getMailAddressesOutput(args: GetMailAddressesOutputArgs, opts?: InvokeOptions): Output<GetMailAddressesResult>
    def get_mail_addresses(ids: Optional[Sequence[str]] = None,
                           key_word: Optional[str] = None,
                           output_file: Optional[str] = None,
                           sendtype: Optional[str] = None,
                           status: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetMailAddressesResult
    def get_mail_addresses_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                           key_word: Optional[pulumi.Input[str]] = None,
                           output_file: Optional[pulumi.Input[str]] = None,
                           sendtype: Optional[pulumi.Input[str]] = None,
                           status: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetMailAddressesResult]
    func GetMailAddresses(ctx *Context, args *GetMailAddressesArgs, opts ...InvokeOption) (*GetMailAddressesResult, error)
    func GetMailAddressesOutput(ctx *Context, args *GetMailAddressesOutputArgs, opts ...InvokeOption) GetMailAddressesResultOutput

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

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

    The following arguments are supported:

    Ids List<string>
    A list of Mail Address IDs.
    KeyWord string
    The key word about account email address.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Sendtype string
    Account type.
    Status string
    Account Status. Valid values: 0, 1. Freeze: 1, normal: 0.
    Ids []string
    A list of Mail Address IDs.
    KeyWord string
    The key word about account email address.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Sendtype string
    Account type.
    Status string
    Account Status. Valid values: 0, 1. Freeze: 1, normal: 0.
    ids List<String>
    A list of Mail Address IDs.
    keyWord String
    The key word about account email address.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    sendtype String
    Account type.
    status String
    Account Status. Valid values: 0, 1. Freeze: 1, normal: 0.
    ids string[]
    A list of Mail Address IDs.
    keyWord string
    The key word about account email address.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    sendtype string
    Account type.
    status string
    Account Status. Valid values: 0, 1. Freeze: 1, normal: 0.
    ids Sequence[str]
    A list of Mail Address IDs.
    key_word str
    The key word about account email address.
    output_file str
    File name where to save data source results (after running pulumi preview).
    sendtype str
    Account type.
    status str
    Account Status. Valid values: 0, 1. Freeze: 1, normal: 0.
    ids List<String>
    A list of Mail Address IDs.
    keyWord String
    The key word about account email address.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    sendtype String
    Account type.
    status String
    Account Status. Valid values: 0, 1. Freeze: 1, normal: 0.

    getMailAddresses Result

    The following output properties are available:

    Addresses List<Pulumi.AliCloud.DirectMail.Outputs.GetMailAddressesAddress>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    KeyWord string
    OutputFile string
    Sendtype string
    Status string
    Addresses []GetMailAddressesAddress
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    KeyWord string
    OutputFile string
    Sendtype string
    Status string
    addresses List<GetMailAddressesAddress>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    keyWord String
    outputFile String
    sendtype String
    status String
    addresses GetMailAddressesAddress[]
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    keyWord string
    outputFile string
    sendtype string
    status string
    addresses Sequence[GetMailAddressesAddress]
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    key_word str
    output_file str
    sendtype str
    status str
    addresses List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    keyWord String
    outputFile String
    sendtype String
    status String

    Supporting Types

    GetMailAddressesAddress

    AccountName string
    The sender address.
    CreateTime string
    The creation of the record time.
    DailyCount string
    On the quota limit.
    DailyReqCount string
    On the quota.
    DomainStatus string
    Domain name status. Valid values: 0, 1.
    Id string
    The ID of the Mail Address.
    MailAddressId string
    The sender address ID.
    MonthCount string
    Monthly quota limit.
    MonthReqCount string
    Months amount.
    ReplyAddress string
    Return address.
    ReplyStatus string
    If using STMP address status.
    Sendtype string
    Account type.
    Status string
    Account Status. Valid values: 0, 1. Freeze: 1, normal: 0.
    AccountName string
    The sender address.
    CreateTime string
    The creation of the record time.
    DailyCount string
    On the quota limit.
    DailyReqCount string
    On the quota.
    DomainStatus string
    Domain name status. Valid values: 0, 1.
    Id string
    The ID of the Mail Address.
    MailAddressId string
    The sender address ID.
    MonthCount string
    Monthly quota limit.
    MonthReqCount string
    Months amount.
    ReplyAddress string
    Return address.
    ReplyStatus string
    If using STMP address status.
    Sendtype string
    Account type.
    Status string
    Account Status. Valid values: 0, 1. Freeze: 1, normal: 0.
    accountName String
    The sender address.
    createTime String
    The creation of the record time.
    dailyCount String
    On the quota limit.
    dailyReqCount String
    On the quota.
    domainStatus String
    Domain name status. Valid values: 0, 1.
    id String
    The ID of the Mail Address.
    mailAddressId String
    The sender address ID.
    monthCount String
    Monthly quota limit.
    monthReqCount String
    Months amount.
    replyAddress String
    Return address.
    replyStatus String
    If using STMP address status.
    sendtype String
    Account type.
    status String
    Account Status. Valid values: 0, 1. Freeze: 1, normal: 0.
    accountName string
    The sender address.
    createTime string
    The creation of the record time.
    dailyCount string
    On the quota limit.
    dailyReqCount string
    On the quota.
    domainStatus string
    Domain name status. Valid values: 0, 1.
    id string
    The ID of the Mail Address.
    mailAddressId string
    The sender address ID.
    monthCount string
    Monthly quota limit.
    monthReqCount string
    Months amount.
    replyAddress string
    Return address.
    replyStatus string
    If using STMP address status.
    sendtype string
    Account type.
    status string
    Account Status. Valid values: 0, 1. Freeze: 1, normal: 0.
    account_name str
    The sender address.
    create_time str
    The creation of the record time.
    daily_count str
    On the quota limit.
    daily_req_count str
    On the quota.
    domain_status str
    Domain name status. Valid values: 0, 1.
    id str
    The ID of the Mail Address.
    mail_address_id str
    The sender address ID.
    month_count str
    Monthly quota limit.
    month_req_count str
    Months amount.
    reply_address str
    Return address.
    reply_status str
    If using STMP address status.
    sendtype str
    Account type.
    status str
    Account Status. Valid values: 0, 1. Freeze: 1, normal: 0.
    accountName String
    The sender address.
    createTime String
    The creation of the record time.
    dailyCount String
    On the quota limit.
    dailyReqCount String
    On the quota.
    domainStatus String
    Domain name status. Valid values: 0, 1.
    id String
    The ID of the Mail Address.
    mailAddressId String
    The sender address ID.
    monthCount String
    Monthly quota limit.
    monthReqCount String
    Months amount.
    replyAddress String
    Return address.
    replyStatus String
    If using STMP address status.
    sendtype String
    Account type.
    status String
    Account Status. Valid values: 0, 1. Freeze: 1, normal: 0.

    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