1. Packages
  2. Googleworkspace Provider
  3. API Docs
  4. getGroupMembers
googleworkspace 0.7.0 published on Wednesday, Jan 15, 2025 by hashicorp

googleworkspace.getGroupMembers

Explore with Pulumi AI

googleworkspace logo
googleworkspace 0.7.0 published on Wednesday, Jan 15, 2025 by hashicorp

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as googleworkspace from "@pulumi/googleworkspace";
    
    const salesGroup = googleworkspace.getGroup({
        email: "sales@example.com",
    });
    const salesGroupMembers = salesGroup.then(salesGroup => googleworkspace.getGroupMembers({
        groupId: salesGroup.id,
    }));
    export const groupMembers = salesGroupMembers.then(salesGroupMembers => salesGroupMembers.members);
    
    import pulumi
    import pulumi_googleworkspace as googleworkspace
    
    sales_group = googleworkspace.get_group(email="sales@example.com")
    sales_group_members = googleworkspace.get_group_members(group_id=sales_group.id)
    pulumi.export("groupMembers", sales_group_members.members)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/googleworkspace/googleworkspace"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		salesGroup, err := googleworkspace.LookupGroup(ctx, &googleworkspace.LookupGroupArgs{
    			Email: pulumi.StringRef("sales@example.com"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		salesGroupMembers, err := googleworkspace.LookupGroupMembers(ctx, &googleworkspace.LookupGroupMembersArgs{
    			GroupId: salesGroup.Id,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("groupMembers", salesGroupMembers.Members)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Googleworkspace = Pulumi.Googleworkspace;
    
    return await Deployment.RunAsync(() => 
    {
        var salesGroup = Googleworkspace.GetGroup.Invoke(new()
        {
            Email = "sales@example.com",
        });
    
        var salesGroupMembers = Googleworkspace.GetGroupMembers.Invoke(new()
        {
            GroupId = salesGroup.Apply(getGroupResult => getGroupResult.Id),
        });
    
        return new Dictionary<string, object?>
        {
            ["groupMembers"] = salesGroupMembers.Apply(getGroupMembersResult => getGroupMembersResult.Members),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.googleworkspace.GoogleworkspaceFunctions;
    import com.pulumi.googleworkspace.inputs.GetGroupArgs;
    import com.pulumi.googleworkspace.inputs.GetGroupMembersArgs;
    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 salesGroup = GoogleworkspaceFunctions.getGroup(GetGroupArgs.builder()
                .email("sales@example.com")
                .build());
    
            final var salesGroupMembers = GoogleworkspaceFunctions.getGroupMembers(GetGroupMembersArgs.builder()
                .groupId(salesGroup.applyValue(getGroupResult -> getGroupResult.id()))
                .build());
    
            ctx.export("groupMembers", salesGroupMembers.applyValue(getGroupMembersResult -> getGroupMembersResult.members()));
        }
    }
    
    variables:
      salesGroup:
        fn::invoke:
          function: googleworkspace:getGroup
          arguments:
            email: sales@example.com
      salesGroupMembers:
        fn::invoke:
          function: googleworkspace:getGroupMembers
          arguments:
            groupId: ${salesGroup.id}
    outputs:
      groupMembers: ${salesGroupMembers.members}
    

    Using getGroupMembers

    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 getGroupMembers(args: GetGroupMembersArgs, opts?: InvokeOptions): Promise<GetGroupMembersResult>
    function getGroupMembersOutput(args: GetGroupMembersOutputArgs, opts?: InvokeOptions): Output<GetGroupMembersResult>
    def get_group_members(group_id: Optional[str] = None,
                          include_derived_membership: Optional[bool] = None,
                          opts: Optional[InvokeOptions] = None) -> GetGroupMembersResult
    def get_group_members_output(group_id: Optional[pulumi.Input[str]] = None,
                          include_derived_membership: Optional[pulumi.Input[bool]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetGroupMembersResult]
    func LookupGroupMembers(ctx *Context, args *LookupGroupMembersArgs, opts ...InvokeOption) (*LookupGroupMembersResult, error)
    func LookupGroupMembersOutput(ctx *Context, args *LookupGroupMembersOutputArgs, opts ...InvokeOption) LookupGroupMembersResultOutput

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

    public static class GetGroupMembers 
    {
        public static Task<GetGroupMembersResult> InvokeAsync(GetGroupMembersArgs args, InvokeOptions? opts = null)
        public static Output<GetGroupMembersResult> Invoke(GetGroupMembersInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetGroupMembersResult> getGroupMembers(GetGroupMembersArgs args, InvokeOptions options)
    public static Output<GetGroupMembersResult> getGroupMembers(GetGroupMembersArgs args, InvokeOptions options)
    
    fn::invoke:
      function: googleworkspace:index/getGroupMembers:getGroupMembers
      arguments:
        # arguments dictionary

    The following arguments are supported:

    GroupId string
    Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.
    IncludeDerivedMembership bool
    If true, lists indirect group memberships
    GroupId string
    Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.
    IncludeDerivedMembership bool
    If true, lists indirect group memberships
    groupId String
    Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.
    includeDerivedMembership Boolean
    If true, lists indirect group memberships
    groupId string
    Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.
    includeDerivedMembership boolean
    If true, lists indirect group memberships
    group_id str
    Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.
    include_derived_membership bool
    If true, lists indirect group memberships
    groupId String
    Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.
    includeDerivedMembership Boolean
    If true, lists indirect group memberships

    getGroupMembers Result

    The following output properties are available:

    Etag string
    ETag of the resource.
    GroupId string
    Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.
    Id string
    The ID of this resource.
    Members List<GetGroupMembersMember>
    The members of the group
    IncludeDerivedMembership bool
    If true, lists indirect group memberships
    Etag string
    ETag of the resource.
    GroupId string
    Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.
    Id string
    The ID of this resource.
    Members []GetGroupMembersMember
    The members of the group
    IncludeDerivedMembership bool
    If true, lists indirect group memberships
    etag String
    ETag of the resource.
    groupId String
    Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.
    id String
    The ID of this resource.
    members List<GetGroupMembersMember>
    The members of the group
    includeDerivedMembership Boolean
    If true, lists indirect group memberships
    etag string
    ETag of the resource.
    groupId string
    Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.
    id string
    The ID of this resource.
    members GetGroupMembersMember[]
    The members of the group
    includeDerivedMembership boolean
    If true, lists indirect group memberships
    etag str
    ETag of the resource.
    group_id str
    Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.
    id str
    The ID of this resource.
    members Sequence[GetGroupMembersMember]
    The members of the group
    include_derived_membership bool
    If true, lists indirect group memberships
    etag String
    ETag of the resource.
    groupId String
    Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID.
    id String
    The ID of this resource.
    members List<Property Map>
    The members of the group
    includeDerivedMembership Boolean
    If true, lists indirect group memberships

    Supporting Types

    GetGroupMembersMember

    DeliverySettings string
    Email string
    Id string
    Role string
    Status string
    Type string
    DeliverySettings string
    Email string
    Id string
    Role string
    Status string
    Type string
    deliverySettings String
    email String
    id String
    role String
    status String
    type String
    deliverySettings string
    email string
    id string
    role string
    status string
    type string
    deliverySettings String
    email String
    id String
    role String
    status String
    type String

    Package Details

    Repository
    googleworkspace hashicorp/terraform-provider-googleworkspace
    License
    Notes
    This Pulumi package is based on the googleworkspace Terraform Provider.
    googleworkspace logo
    googleworkspace 0.7.0 published on Wednesday, Jan 15, 2025 by hashicorp