-
Notifications
You must be signed in to change notification settings - Fork 9
/
userGpgKey.go
119 lines (106 loc) · 4.13 KB
/
userGpgKey.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
// *** 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 GPG key resource.
//
// This resource allows you to add/remove GPG keys from your user account.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "fmt"
//
// "github.com/pulumi/pulumi-github/sdk/go/github"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := github.NewUserGpgKey(ctx, "example", &github.UserGpgKeyArgs{
// ArmoredPublicKey: pulumi.String(fmt.Sprintf("%v%v%v", "-----BEGIN PGP PUBLIC KEY BLOCK-----\n", "...\n", "-----END PGP PUBLIC KEY BLOCK-----\n")),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
type UserGpgKey struct {
pulumi.CustomResourceState
// Your public GPG key, generated in ASCII-armored format.
// See [Generating a new GPG key](https://help.github.com/articles/generating-a-new-gpg-key/) for help on creating a GPG key.
ArmoredPublicKey pulumi.StringOutput `pulumi:"armoredPublicKey"`
Etag pulumi.StringOutput `pulumi:"etag"`
// The key ID of the GPG key, e.g. `3262EFF25BA0D270`
KeyId pulumi.StringOutput `pulumi:"keyId"`
}
// NewUserGpgKey registers a new resource with the given unique name, arguments, and options.
func NewUserGpgKey(ctx *pulumi.Context,
name string, args *UserGpgKeyArgs, opts ...pulumi.ResourceOption) (*UserGpgKey, error) {
if args == nil || args.ArmoredPublicKey == nil {
return nil, errors.New("missing required argument 'ArmoredPublicKey'")
}
if args == nil {
args = &UserGpgKeyArgs{}
}
var resource UserGpgKey
err := ctx.RegisterResource("github:index/userGpgKey:UserGpgKey", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetUserGpgKey gets an existing UserGpgKey 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 GetUserGpgKey(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *UserGpgKeyState, opts ...pulumi.ResourceOption) (*UserGpgKey, error) {
var resource UserGpgKey
err := ctx.ReadResource("github:index/userGpgKey:UserGpgKey", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering UserGpgKey resources.
type userGpgKeyState struct {
// Your public GPG key, generated in ASCII-armored format.
// See [Generating a new GPG key](https://help.github.com/articles/generating-a-new-gpg-key/) for help on creating a GPG key.
ArmoredPublicKey *string `pulumi:"armoredPublicKey"`
Etag *string `pulumi:"etag"`
// The key ID of the GPG key, e.g. `3262EFF25BA0D270`
KeyId *string `pulumi:"keyId"`
}
type UserGpgKeyState struct {
// Your public GPG key, generated in ASCII-armored format.
// See [Generating a new GPG key](https://help.github.com/articles/generating-a-new-gpg-key/) for help on creating a GPG key.
ArmoredPublicKey pulumi.StringPtrInput
Etag pulumi.StringPtrInput
// The key ID of the GPG key, e.g. `3262EFF25BA0D270`
KeyId pulumi.StringPtrInput
}
func (UserGpgKeyState) ElementType() reflect.Type {
return reflect.TypeOf((*userGpgKeyState)(nil)).Elem()
}
type userGpgKeyArgs struct {
// Your public GPG key, generated in ASCII-armored format.
// See [Generating a new GPG key](https://help.github.com/articles/generating-a-new-gpg-key/) for help on creating a GPG key.
ArmoredPublicKey string `pulumi:"armoredPublicKey"`
}
// The set of arguments for constructing a UserGpgKey resource.
type UserGpgKeyArgs struct {
// Your public GPG key, generated in ASCII-armored format.
// See [Generating a new GPG key](https://help.github.com/articles/generating-a-new-gpg-key/) for help on creating a GPG key.
ArmoredPublicKey pulumi.StringInput
}
func (UserGpgKeyArgs) ElementType() reflect.Type {
return reflect.TypeOf((*userGpgKeyArgs)(nil)).Elem()
}