-
Notifications
You must be signed in to change notification settings - Fork 0
/
userGPGKey.go
98 lines (86 loc) · 3.48 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
// *** 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"
)
// Provides a GitHub user's GPG key resource.
//
// This resource allows you to add/remove GPG keys from your user account.
//
// > This content is derived from https://github.com/terraform-providers/terraform-provider-github/blob/master/website/docs/r/user_gpg_key.html.markdown.
type UserGPGKey struct {
s *pulumi.ResourceState
}
// NewUserGPGKey registers a new resource with the given unique name, arguments, and options.
func NewUserGPGKey(ctx *pulumi.Context,
name string, args *UserGPGKeyArgs, opts ...pulumi.ResourceOpt) (*UserGPGKey, error) {
if args == nil || args.ArmoredPublicKey == nil {
return nil, errors.New("missing required argument 'ArmoredPublicKey'")
}
inputs := make(map[string]interface{})
if args == nil {
inputs["armoredPublicKey"] = nil
} else {
inputs["armoredPublicKey"] = args.ArmoredPublicKey
}
inputs["etag"] = nil
inputs["keyId"] = nil
s, err := ctx.RegisterResource("github:index/userGPGKey:UserGPGKey", name, true, inputs, opts...)
if err != nil {
return nil, err
}
return &UserGPGKey{s: s}, 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.ID, state *UserGPGKeyState, opts ...pulumi.ResourceOpt) (*UserGPGKey, error) {
inputs := make(map[string]interface{})
if state != nil {
inputs["armoredPublicKey"] = state.ArmoredPublicKey
inputs["etag"] = state.Etag
inputs["keyId"] = state.KeyId
}
s, err := ctx.ReadResource("github:index/userGPGKey:UserGPGKey", name, id, inputs, opts...)
if err != nil {
return nil, err
}
return &UserGPGKey{s: s}, nil
}
// URN is this resource's unique name assigned by Pulumi.
func (r *UserGPGKey) URN() *pulumi.URNOutput {
return r.s.URN()
}
// ID is this resource's unique identifier assigned by its provider.
func (r *UserGPGKey) ID() *pulumi.IDOutput {
return r.s.ID()
}
// 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.
func (r *UserGPGKey) ArmoredPublicKey() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["armoredPublicKey"])
}
func (r *UserGPGKey) Etag() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["etag"])
}
// The key ID of the GPG key, e.g. `3262EFF25BA0D270`
func (r *UserGPGKey) KeyId() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["keyId"])
}
// 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 interface{}
Etag interface{}
// The key ID of the GPG key, e.g. `3262EFF25BA0D270`
KeyId interface{}
}
// 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 interface{}
}