1. Packages
  2. GitHub
  3. API Docs
  4. TeamSettings
GitHub v6.2.2 published on Tuesday, Jun 18, 2024 by Pulumi

github.TeamSettings

Explore with Pulumi AI

github logo
GitHub v6.2.2 published on Tuesday, Jun 18, 2024 by Pulumi

    This resource manages the team settings (in particular the request review delegation settings) within the organization

    Creating this resource will alter the team Code Review settings.

    The team must both belong to the same organization configured in the provider on GitHub.

    Note: This resource relies on the v4 GraphQl GitHub API. If this API is not available, or the Stone Crop schema preview is not available, then this resource will not work as intended.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as github from "@pulumi/github";
    
    // Add a repository to the team
    const someTeam = new github.Team("some_team", {
        name: "SomeTeam",
        description: "Some cool team",
    });
    const codeReviewSettings = new github.TeamSettings("code_review_settings", {
        teamId: someTeam.id,
        reviewRequestDelegation: {
            algorithm: "ROUND_ROBIN",
            memberCount: 1,
            notify: true,
        },
    });
    
    import pulumi
    import pulumi_github as github
    
    # Add a repository to the team
    some_team = github.Team("some_team",
        name="SomeTeam",
        description="Some cool team")
    code_review_settings = github.TeamSettings("code_review_settings",
        team_id=some_team.id,
        review_request_delegation=github.TeamSettingsReviewRequestDelegationArgs(
            algorithm="ROUND_ROBIN",
            member_count=1,
            notify=True,
        ))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-github/sdk/v6/go/github"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Add a repository to the team
    		someTeam, err := github.NewTeam(ctx, "some_team", &github.TeamArgs{
    			Name:        pulumi.String("SomeTeam"),
    			Description: pulumi.String("Some cool team"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = github.NewTeamSettings(ctx, "code_review_settings", &github.TeamSettingsArgs{
    			TeamId: someTeam.ID(),
    			ReviewRequestDelegation: &github.TeamSettingsReviewRequestDelegationArgs{
    				Algorithm:   pulumi.String("ROUND_ROBIN"),
    				MemberCount: pulumi.Int(1),
    				Notify:      pulumi.Bool(true),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Github = Pulumi.Github;
    
    return await Deployment.RunAsync(() => 
    {
        // Add a repository to the team
        var someTeam = new Github.Team("some_team", new()
        {
            Name = "SomeTeam",
            Description = "Some cool team",
        });
    
        var codeReviewSettings = new Github.TeamSettings("code_review_settings", new()
        {
            TeamId = someTeam.Id,
            ReviewRequestDelegation = new Github.Inputs.TeamSettingsReviewRequestDelegationArgs
            {
                Algorithm = "ROUND_ROBIN",
                MemberCount = 1,
                Notify = true,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.github.Team;
    import com.pulumi.github.TeamArgs;
    import com.pulumi.github.TeamSettings;
    import com.pulumi.github.TeamSettingsArgs;
    import com.pulumi.github.inputs.TeamSettingsReviewRequestDelegationArgs;
    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) {
            // Add a repository to the team
            var someTeam = new Team("someTeam", TeamArgs.builder()
                .name("SomeTeam")
                .description("Some cool team")
                .build());
    
            var codeReviewSettings = new TeamSettings("codeReviewSettings", TeamSettingsArgs.builder()
                .teamId(someTeam.id())
                .reviewRequestDelegation(TeamSettingsReviewRequestDelegationArgs.builder()
                    .algorithm("ROUND_ROBIN")
                    .memberCount(1)
                    .notify(true)
                    .build())
                .build());
    
        }
    }
    
    resources:
      # Add a repository to the team
      someTeam:
        type: github:Team
        name: some_team
        properties:
          name: SomeTeam
          description: Some cool team
      codeReviewSettings:
        type: github:TeamSettings
        name: code_review_settings
        properties:
          teamId: ${someTeam.id}
          reviewRequestDelegation:
            algorithm: ROUND_ROBIN
            memberCount: 1
            notify: true
    

    Create TeamSettings Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new TeamSettings(name: string, args: TeamSettingsArgs, opts?: CustomResourceOptions);
    @overload
    def TeamSettings(resource_name: str,
                     args: TeamSettingsArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def TeamSettings(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     team_id: Optional[str] = None,
                     review_request_delegation: Optional[TeamSettingsReviewRequestDelegationArgs] = None)
    func NewTeamSettings(ctx *Context, name string, args TeamSettingsArgs, opts ...ResourceOption) (*TeamSettings, error)
    public TeamSettings(string name, TeamSettingsArgs args, CustomResourceOptions? opts = null)
    public TeamSettings(String name, TeamSettingsArgs args)
    public TeamSettings(String name, TeamSettingsArgs args, CustomResourceOptions options)
    
    type: github:TeamSettings
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args TeamSettingsArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args TeamSettingsArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args TeamSettingsArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TeamSettingsArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TeamSettingsArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var teamSettingsResource = new Github.TeamSettings("teamSettingsResource", new()
    {
        TeamId = "string",
        ReviewRequestDelegation = new Github.Inputs.TeamSettingsReviewRequestDelegationArgs
        {
            Algorithm = "string",
            MemberCount = 0,
            Notify = false,
        },
    });
    
    example, err := github.NewTeamSettings(ctx, "teamSettingsResource", &github.TeamSettingsArgs{
    	TeamId: pulumi.String("string"),
    	ReviewRequestDelegation: &github.TeamSettingsReviewRequestDelegationArgs{
    		Algorithm:   pulumi.String("string"),
    		MemberCount: pulumi.Int(0),
    		Notify:      pulumi.Bool(false),
    	},
    })
    
    var teamSettingsResource = new TeamSettings("teamSettingsResource", TeamSettingsArgs.builder()
        .teamId("string")
        .reviewRequestDelegation(TeamSettingsReviewRequestDelegationArgs.builder()
            .algorithm("string")
            .memberCount(0)
            .notify(false)
            .build())
        .build());
    
    team_settings_resource = github.TeamSettings("teamSettingsResource",
        team_id="string",
        review_request_delegation=github.TeamSettingsReviewRequestDelegationArgs(
            algorithm="string",
            member_count=0,
            notify=False,
        ))
    
    const teamSettingsResource = new github.TeamSettings("teamSettingsResource", {
        teamId: "string",
        reviewRequestDelegation: {
            algorithm: "string",
            memberCount: 0,
            notify: false,
        },
    });
    
    type: github:TeamSettings
    properties:
        reviewRequestDelegation:
            algorithm: string
            memberCount: 0
            notify: false
        teamId: string
    

    TeamSettings Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The TeamSettings resource accepts the following input properties:

    TeamId string
    The GitHub team id or the GitHub team slug
    ReviewRequestDelegation TeamSettingsReviewRequestDelegation
    The settings for delegating code reviews to individuals on behalf of the team. If this block is present, even without any fields, then review request delegation will be enabled for the team. See GitHub Review Request Delegation below for details. See GitHub's documentation for more configuration details.
    TeamId string
    The GitHub team id or the GitHub team slug
    ReviewRequestDelegation TeamSettingsReviewRequestDelegationArgs
    The settings for delegating code reviews to individuals on behalf of the team. If this block is present, even without any fields, then review request delegation will be enabled for the team. See GitHub Review Request Delegation below for details. See GitHub's documentation for more configuration details.
    teamId String
    The GitHub team id or the GitHub team slug
    reviewRequestDelegation TeamSettingsReviewRequestDelegation
    The settings for delegating code reviews to individuals on behalf of the team. If this block is present, even without any fields, then review request delegation will be enabled for the team. See GitHub Review Request Delegation below for details. See GitHub's documentation for more configuration details.
    teamId string
    The GitHub team id or the GitHub team slug
    reviewRequestDelegation TeamSettingsReviewRequestDelegation
    The settings for delegating code reviews to individuals on behalf of the team. If this block is present, even without any fields, then review request delegation will be enabled for the team. See GitHub Review Request Delegation below for details. See GitHub's documentation for more configuration details.
    team_id str
    The GitHub team id or the GitHub team slug
    review_request_delegation TeamSettingsReviewRequestDelegationArgs
    The settings for delegating code reviews to individuals on behalf of the team. If this block is present, even without any fields, then review request delegation will be enabled for the team. See GitHub Review Request Delegation below for details. See GitHub's documentation for more configuration details.
    teamId String
    The GitHub team id or the GitHub team slug
    reviewRequestDelegation Property Map
    The settings for delegating code reviews to individuals on behalf of the team. If this block is present, even without any fields, then review request delegation will be enabled for the team. See GitHub Review Request Delegation below for details. See GitHub's documentation for more configuration details.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the TeamSettings resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    TeamSlug string
    The slug of the Team within the Organization.
    TeamUid string
    The unique ID of the Team on GitHub. Corresponds to the ID of the 'github_team_settings' resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    TeamSlug string
    The slug of the Team within the Organization.
    TeamUid string
    The unique ID of the Team on GitHub. Corresponds to the ID of the 'github_team_settings' resource.
    id String
    The provider-assigned unique ID for this managed resource.
    teamSlug String
    The slug of the Team within the Organization.
    teamUid String
    The unique ID of the Team on GitHub. Corresponds to the ID of the 'github_team_settings' resource.
    id string
    The provider-assigned unique ID for this managed resource.
    teamSlug string
    The slug of the Team within the Organization.
    teamUid string
    The unique ID of the Team on GitHub. Corresponds to the ID of the 'github_team_settings' resource.
    id str
    The provider-assigned unique ID for this managed resource.
    team_slug str
    The slug of the Team within the Organization.
    team_uid str
    The unique ID of the Team on GitHub. Corresponds to the ID of the 'github_team_settings' resource.
    id String
    The provider-assigned unique ID for this managed resource.
    teamSlug String
    The slug of the Team within the Organization.
    teamUid String
    The unique ID of the Team on GitHub. Corresponds to the ID of the 'github_team_settings' resource.

    Look up Existing TeamSettings Resource

    Get an existing TeamSettings resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: TeamSettingsState, opts?: CustomResourceOptions): TeamSettings
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            review_request_delegation: Optional[TeamSettingsReviewRequestDelegationArgs] = None,
            team_id: Optional[str] = None,
            team_slug: Optional[str] = None,
            team_uid: Optional[str] = None) -> TeamSettings
    func GetTeamSettings(ctx *Context, name string, id IDInput, state *TeamSettingsState, opts ...ResourceOption) (*TeamSettings, error)
    public static TeamSettings Get(string name, Input<string> id, TeamSettingsState? state, CustomResourceOptions? opts = null)
    public static TeamSettings get(String name, Output<String> id, TeamSettingsState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    ReviewRequestDelegation TeamSettingsReviewRequestDelegation
    The settings for delegating code reviews to individuals on behalf of the team. If this block is present, even without any fields, then review request delegation will be enabled for the team. See GitHub Review Request Delegation below for details. See GitHub's documentation for more configuration details.
    TeamId string
    The GitHub team id or the GitHub team slug
    TeamSlug string
    The slug of the Team within the Organization.
    TeamUid string
    The unique ID of the Team on GitHub. Corresponds to the ID of the 'github_team_settings' resource.
    ReviewRequestDelegation TeamSettingsReviewRequestDelegationArgs
    The settings for delegating code reviews to individuals on behalf of the team. If this block is present, even without any fields, then review request delegation will be enabled for the team. See GitHub Review Request Delegation below for details. See GitHub's documentation for more configuration details.
    TeamId string
    The GitHub team id or the GitHub team slug
    TeamSlug string
    The slug of the Team within the Organization.
    TeamUid string
    The unique ID of the Team on GitHub. Corresponds to the ID of the 'github_team_settings' resource.
    reviewRequestDelegation TeamSettingsReviewRequestDelegation
    The settings for delegating code reviews to individuals on behalf of the team. If this block is present, even without any fields, then review request delegation will be enabled for the team. See GitHub Review Request Delegation below for details. See GitHub's documentation for more configuration details.
    teamId String
    The GitHub team id or the GitHub team slug
    teamSlug String
    The slug of the Team within the Organization.
    teamUid String
    The unique ID of the Team on GitHub. Corresponds to the ID of the 'github_team_settings' resource.
    reviewRequestDelegation TeamSettingsReviewRequestDelegation
    The settings for delegating code reviews to individuals on behalf of the team. If this block is present, even without any fields, then review request delegation will be enabled for the team. See GitHub Review Request Delegation below for details. See GitHub's documentation for more configuration details.
    teamId string
    The GitHub team id or the GitHub team slug
    teamSlug string
    The slug of the Team within the Organization.
    teamUid string
    The unique ID of the Team on GitHub. Corresponds to the ID of the 'github_team_settings' resource.
    review_request_delegation TeamSettingsReviewRequestDelegationArgs
    The settings for delegating code reviews to individuals on behalf of the team. If this block is present, even without any fields, then review request delegation will be enabled for the team. See GitHub Review Request Delegation below for details. See GitHub's documentation for more configuration details.
    team_id str
    The GitHub team id or the GitHub team slug
    team_slug str
    The slug of the Team within the Organization.
    team_uid str
    The unique ID of the Team on GitHub. Corresponds to the ID of the 'github_team_settings' resource.
    reviewRequestDelegation Property Map
    The settings for delegating code reviews to individuals on behalf of the team. If this block is present, even without any fields, then review request delegation will be enabled for the team. See GitHub Review Request Delegation below for details. See GitHub's documentation for more configuration details.
    teamId String
    The GitHub team id or the GitHub team slug
    teamSlug String
    The slug of the Team within the Organization.
    teamUid String
    The unique ID of the Team on GitHub. Corresponds to the ID of the 'github_team_settings' resource.

    Supporting Types

    TeamSettingsReviewRequestDelegation, TeamSettingsReviewRequestDelegationArgs

    Algorithm string
    The algorithm to use when assigning pull requests to team members. Supported values are 'ROUND_ROBIN' and 'LOAD_BALANCE'.
    MemberCount int
    The number of team members to assign to a pull request.
    Notify bool
    whether to notify the entire team when at least one member is also assigned to the pull request.
    Algorithm string
    The algorithm to use when assigning pull requests to team members. Supported values are 'ROUND_ROBIN' and 'LOAD_BALANCE'.
    MemberCount int
    The number of team members to assign to a pull request.
    Notify bool
    whether to notify the entire team when at least one member is also assigned to the pull request.
    algorithm String
    The algorithm to use when assigning pull requests to team members. Supported values are 'ROUND_ROBIN' and 'LOAD_BALANCE'.
    memberCount Integer
    The number of team members to assign to a pull request.
    notify_ Boolean
    whether to notify the entire team when at least one member is also assigned to the pull request.
    algorithm string
    The algorithm to use when assigning pull requests to team members. Supported values are 'ROUND_ROBIN' and 'LOAD_BALANCE'.
    memberCount number
    The number of team members to assign to a pull request.
    notify boolean
    whether to notify the entire team when at least one member is also assigned to the pull request.
    algorithm str
    The algorithm to use when assigning pull requests to team members. Supported values are 'ROUND_ROBIN' and 'LOAD_BALANCE'.
    member_count int
    The number of team members to assign to a pull request.
    notify bool
    whether to notify the entire team when at least one member is also assigned to the pull request.
    algorithm String
    The algorithm to use when assigning pull requests to team members. Supported values are 'ROUND_ROBIN' and 'LOAD_BALANCE'.
    memberCount Number
    The number of team members to assign to a pull request.
    notify Boolean
    whether to notify the entire team when at least one member is also assigned to the pull request.

    Import

    GitHub Teams can be imported using the GitHub team ID, or the team slug e.g.

    $ pulumi import github:index/teamSettings:TeamSettings code_review_settings 1234567
    

    or,

    $ pulumi import github:index/teamSettings:TeamSettings code_review_settings SomeTeam
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    GitHub pulumi/pulumi-github
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the github Terraform Provider.
    github logo
    GitHub v6.2.2 published on Tuesday, Jun 18, 2024 by Pulumi