-
Notifications
You must be signed in to change notification settings - Fork 9
/
userSshKey.go
102 lines (89 loc) · 3.26 KB
/
userSshKey.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// *** 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 (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Provides a GitHub user's SSH key resource.
//
// This resource allows you to add/remove SSH keys from your user account.
type UserSshKey struct {
pulumi.CustomResourceState
Etag pulumi.StringOutput `pulumi:"etag"`
// The public SSH key to add to your GitHub account.
Key pulumi.StringOutput `pulumi:"key"`
// A descriptive name for the new key. e.g. `Personal MacBook Air`
Title pulumi.StringOutput `pulumi:"title"`
// The URL of the SSH key
Url pulumi.StringOutput `pulumi:"url"`
}
// NewUserSshKey registers a new resource with the given unique name, arguments, and options.
func NewUserSshKey(ctx *pulumi.Context,
name string, args *UserSshKeyArgs, opts ...pulumi.ResourceOption) (*UserSshKey, error) {
if args == nil || args.Key == nil {
return nil, errors.New("missing required argument 'Key'")
}
if args == nil || args.Title == nil {
return nil, errors.New("missing required argument 'Title'")
}
if args == nil {
args = &UserSshKeyArgs{}
}
var resource UserSshKey
err := ctx.RegisterResource("github:index/userSshKey:UserSshKey", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetUserSshKey gets an existing UserSshKey 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 GetUserSshKey(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *UserSshKeyState, opts ...pulumi.ResourceOption) (*UserSshKey, error) {
var resource UserSshKey
err := ctx.ReadResource("github:index/userSshKey:UserSshKey", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering UserSshKey resources.
type userSshKeyState struct {
Etag *string `pulumi:"etag"`
// The public SSH key to add to your GitHub account.
Key *string `pulumi:"key"`
// A descriptive name for the new key. e.g. `Personal MacBook Air`
Title *string `pulumi:"title"`
// The URL of the SSH key
Url *string `pulumi:"url"`
}
type UserSshKeyState struct {
Etag pulumi.StringPtrInput
// The public SSH key to add to your GitHub account.
Key pulumi.StringPtrInput
// A descriptive name for the new key. e.g. `Personal MacBook Air`
Title pulumi.StringPtrInput
// The URL of the SSH key
Url pulumi.StringPtrInput
}
func (UserSshKeyState) ElementType() reflect.Type {
return reflect.TypeOf((*userSshKeyState)(nil)).Elem()
}
type userSshKeyArgs struct {
// The public SSH key to add to your GitHub account.
Key string `pulumi:"key"`
// A descriptive name for the new key. e.g. `Personal MacBook Air`
Title string `pulumi:"title"`
}
// The set of arguments for constructing a UserSshKey resource.
type UserSshKeyArgs struct {
// The public SSH key to add to your GitHub account.
Key pulumi.StringInput
// A descriptive name for the new key. e.g. `Personal MacBook Air`
Title pulumi.StringInput
}
func (UserSshKeyArgs) ElementType() reflect.Type {
return reflect.TypeOf((*userSshKeyArgs)(nil)).Elem()
}