-
Notifications
You must be signed in to change notification settings - Fork 0
/
organizationBlock.go
84 lines (73 loc) · 2.8 KB
/
organizationBlock.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package github
import (
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// This resource allows you to create and manage blocks for GitHub organizations.
//
// > This content is derived from https://github.com/terraform-providers/terraform-provider-github/blob/master/website/docs/r/organization_block.html.markdown.
type OrganizationBlock struct {
s *pulumi.ResourceState
}
// NewOrganizationBlock registers a new resource with the given unique name, arguments, and options.
func NewOrganizationBlock(ctx *pulumi.Context,
name string, args *OrganizationBlockArgs, opts ...pulumi.ResourceOpt) (*OrganizationBlock, error) {
if args == nil || args.Username == nil {
return nil, errors.New("missing required argument 'Username'")
}
inputs := make(map[string]interface{})
if args == nil {
inputs["username"] = nil
} else {
inputs["username"] = args.Username
}
inputs["etag"] = nil
s, err := ctx.RegisterResource("github:index/organizationBlock:OrganizationBlock", name, true, inputs, opts...)
if err != nil {
return nil, err
}
return &OrganizationBlock{s: s}, nil
}
// GetOrganizationBlock gets an existing OrganizationBlock resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetOrganizationBlock(ctx *pulumi.Context,
name string, id pulumi.ID, state *OrganizationBlockState, opts ...pulumi.ResourceOpt) (*OrganizationBlock, error) {
inputs := make(map[string]interface{})
if state != nil {
inputs["etag"] = state.Etag
inputs["username"] = state.Username
}
s, err := ctx.ReadResource("github:index/organizationBlock:OrganizationBlock", name, id, inputs, opts...)
if err != nil {
return nil, err
}
return &OrganizationBlock{s: s}, nil
}
// URN is this resource's unique name assigned by Pulumi.
func (r *OrganizationBlock) URN() *pulumi.URNOutput {
return r.s.URN()
}
// ID is this resource's unique identifier assigned by its provider.
func (r *OrganizationBlock) ID() *pulumi.IDOutput {
return r.s.ID()
}
func (r *OrganizationBlock) Etag() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["etag"])
}
// The name of the user to block.
func (r *OrganizationBlock) Username() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["username"])
}
// Input properties used for looking up and filtering OrganizationBlock resources.
type OrganizationBlockState struct {
Etag interface{}
// The name of the user to block.
Username interface{}
}
// The set of arguments for constructing a OrganizationBlock resource.
type OrganizationBlockArgs struct {
// The name of the user to block.
Username interface{}
}