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

googleworkspace.getGroupMember

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 sales = googleworkspace.getGroup({
        email: "sales@example.com",
    });
    const my-group-member = sales.then(sales => googleworkspace.getGroupMember({
        groupId: sales.id,
        email: "michael.scott@example.com",
    }));
    export const groupMemberRole = my_group_member.then(my_group_member => my_group_member.role);
    
    import pulumi
    import pulumi_googleworkspace as googleworkspace
    
    sales = googleworkspace.get_group(email="sales@example.com")
    my_group_member = googleworkspace.get_group_member(group_id=sales.id,
        email="michael.scott@example.com")
    pulumi.export("groupMemberRole", my_group_member.role)
    
    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 {
    		sales, err := googleworkspace.LookupGroup(ctx, &googleworkspace.LookupGroupArgs{
    			Email: pulumi.StringRef("sales@example.com"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		my_group_member, err := googleworkspace.LookupGroupMember(ctx, &googleworkspace.LookupGroupMemberArgs{
    			GroupId: sales.Id,
    			Email:   pulumi.StringRef("michael.scott@example.com"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("groupMemberRole", my_group_member.Role)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Googleworkspace = Pulumi.Googleworkspace;
    
    return await Deployment.RunAsync(() => 
    {
        var sales = Googleworkspace.GetGroup.Invoke(new()
        {
            Email = "sales@example.com",
        });
    
        var my_group_member = Googleworkspace.GetGroupMember.Invoke(new()
        {
            GroupId = sales.Apply(getGroupResult => getGroupResult.Id),
            Email = "michael.scott@example.com",
        });
    
        return new Dictionary<string, object?>
        {
            ["groupMemberRole"] = my_group_member.Apply(my_group_member => my_group_member.Apply(getGroupMemberResult => getGroupMemberResult.Role)),
        };
    });
    
    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.GetGroupMemberArgs;
    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 sales = GoogleworkspaceFunctions.getGroup(GetGroupArgs.builder()
                .email("sales@example.com")
                .build());
    
            final var my-group-member = GoogleworkspaceFunctions.getGroupMember(GetGroupMemberArgs.builder()
                .groupId(sales.applyValue(getGroupResult -> getGroupResult.id()))
                .email("michael.scott@example.com")
                .build());
    
            ctx.export("groupMemberRole", my_group_member.role());
        }
    }
    
    variables:
      sales:
        fn::invoke:
          function: googleworkspace:getGroup
          arguments:
            email: sales@example.com
      my-group-member:
        fn::invoke:
          function: googleworkspace:getGroupMember
          arguments:
            groupId: ${sales.id}
            email: michael.scott@example.com
    outputs:
      groupMemberRole: ${["my-group-member"].role}
    

    Using getGroupMember

    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 getGroupMember(args: GetGroupMemberArgs, opts?: InvokeOptions): Promise<GetGroupMemberResult>
    function getGroupMemberOutput(args: GetGroupMemberOutputArgs, opts?: InvokeOptions): Output<GetGroupMemberResult>
    def get_group_member(email: Optional[str] = None,
                         group_id: Optional[str] = None,
                         member_id: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetGroupMemberResult
    def get_group_member_output(email: Optional[pulumi.Input[str]] = None,
                         group_id: Optional[pulumi.Input[str]] = None,
                         member_id: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetGroupMemberResult]
    func LookupGroupMember(ctx *Context, args *LookupGroupMemberArgs, opts ...InvokeOption) (*LookupGroupMemberResult, error)
    func LookupGroupMemberOutput(ctx *Context, args *LookupGroupMemberOutputArgs, opts ...InvokeOption) LookupGroupMemberResultOutput

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

    public static class GetGroupMember 
    {
        public static Task<GetGroupMemberResult> InvokeAsync(GetGroupMemberArgs args, InvokeOptions? opts = null)
        public static Output<GetGroupMemberResult> Invoke(GetGroupMemberInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetGroupMemberResult> getGroupMember(GetGroupMemberArgs args, InvokeOptions options)
    public static Output<GetGroupMemberResult> getGroupMember(GetGroupMemberArgs args, InvokeOptions options)
    
    fn::invoke:
      function: googleworkspace:index/getGroupMember:getGroupMember
      arguments:
        # arguments dictionary

    The following arguments are supported:

    GroupId string
    Email string
    MemberId string
    GroupId string
    Email string
    MemberId string
    groupId String
    email String
    memberId String
    groupId string
    email string
    memberId string
    groupId String
    email String
    memberId String

    getGroupMember Result

    The following output properties are available:

    DeliverySettings string
    Email string
    Etag string
    GroupId string
    Id string
    MemberId string
    Role string
    Status string
    Type string
    DeliverySettings string
    Email string
    Etag string
    GroupId string
    Id string
    MemberId string
    Role string
    Status string
    Type string
    deliverySettings String
    email String
    etag String
    groupId String
    id String
    memberId String
    role String
    status String
    type String
    deliverySettings string
    email string
    etag string
    groupId string
    id string
    memberId string
    role string
    status string
    type string
    deliverySettings String
    email String
    etag String
    groupId String
    id String
    memberId 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