-
Notifications
You must be signed in to change notification settings - Fork 9
/
repositoryDeployKey.go
126 lines (113 loc) · 4.22 KB
/
repositoryDeployKey.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
120
121
122
123
124
125
126
// *** 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 repository deploy key resource.
//
// A deploy key is an SSH key that is stored on your server and grants
// access to a single GitHub repository. This key is attached directly to the repository instead of to a personal user
// account.
//
// This resource allows you to add/remove repository deploy keys.
//
// Further documentation on GitHub repository deploy keys:
// - [About deploy keys](https://developer.github.com/guides/managing-deploy-keys/#deploy-keys)
type RepositoryDeployKey struct {
pulumi.CustomResourceState
Etag pulumi.StringOutput `pulumi:"etag"`
// A SSH key.
Key pulumi.StringOutput `pulumi:"key"`
// A boolean qualifying the key to be either read only or read/write.
ReadOnly pulumi.BoolPtrOutput `pulumi:"readOnly"`
// Name of the GitHub repository.
Repository pulumi.StringOutput `pulumi:"repository"`
// A title.
Title pulumi.StringOutput `pulumi:"title"`
}
// NewRepositoryDeployKey registers a new resource with the given unique name, arguments, and options.
func NewRepositoryDeployKey(ctx *pulumi.Context,
name string, args *RepositoryDeployKeyArgs, opts ...pulumi.ResourceOption) (*RepositoryDeployKey, error) {
if args == nil || args.Key == nil {
return nil, errors.New("missing required argument 'Key'")
}
if args == nil || args.Repository == nil {
return nil, errors.New("missing required argument 'Repository'")
}
if args == nil || args.Title == nil {
return nil, errors.New("missing required argument 'Title'")
}
if args == nil {
args = &RepositoryDeployKeyArgs{}
}
var resource RepositoryDeployKey
err := ctx.RegisterResource("github:index/repositoryDeployKey:RepositoryDeployKey", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetRepositoryDeployKey gets an existing RepositoryDeployKey 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 GetRepositoryDeployKey(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *RepositoryDeployKeyState, opts ...pulumi.ResourceOption) (*RepositoryDeployKey, error) {
var resource RepositoryDeployKey
err := ctx.ReadResource("github:index/repositoryDeployKey:RepositoryDeployKey", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering RepositoryDeployKey resources.
type repositoryDeployKeyState struct {
Etag *string `pulumi:"etag"`
// A SSH key.
Key *string `pulumi:"key"`
// A boolean qualifying the key to be either read only or read/write.
ReadOnly *bool `pulumi:"readOnly"`
// Name of the GitHub repository.
Repository *string `pulumi:"repository"`
// A title.
Title *string `pulumi:"title"`
}
type RepositoryDeployKeyState struct {
Etag pulumi.StringPtrInput
// A SSH key.
Key pulumi.StringPtrInput
// A boolean qualifying the key to be either read only or read/write.
ReadOnly pulumi.BoolPtrInput
// Name of the GitHub repository.
Repository pulumi.StringPtrInput
// A title.
Title pulumi.StringPtrInput
}
func (RepositoryDeployKeyState) ElementType() reflect.Type {
return reflect.TypeOf((*repositoryDeployKeyState)(nil)).Elem()
}
type repositoryDeployKeyArgs struct {
// A SSH key.
Key string `pulumi:"key"`
// A boolean qualifying the key to be either read only or read/write.
ReadOnly *bool `pulumi:"readOnly"`
// Name of the GitHub repository.
Repository string `pulumi:"repository"`
// A title.
Title string `pulumi:"title"`
}
// The set of arguments for constructing a RepositoryDeployKey resource.
type RepositoryDeployKeyArgs struct {
// A SSH key.
Key pulumi.StringInput
// A boolean qualifying the key to be either read only or read/write.
ReadOnly pulumi.BoolPtrInput
// Name of the GitHub repository.
Repository pulumi.StringInput
// A title.
Title pulumi.StringInput
}
func (RepositoryDeployKeyArgs) ElementType() reflect.Type {
return reflect.TypeOf((*repositoryDeployKeyArgs)(nil)).Elem()
}