/
channel.go
227 lines (191 loc) · 10.2 KB
/
channel.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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package v1beta1
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Creates a new channel in the specified site.
type Channel struct {
pulumi.CustomResourceState
// Required. Immutable. A unique ID within the site that identifies the channel.
ChannelId pulumi.StringOutput `pulumi:"channelId"`
// The time at which the channel was created.
CreateTime pulumi.StringOutput `pulumi:"createTime"`
// The time at which the channel will be automatically deleted. If null, the channel will not be automatically deleted. This field is present in the output whether it's set directly or via the `ttl` field.
ExpireTime pulumi.StringOutput `pulumi:"expireTime"`
// Text labels used for extra metadata and/or filtering.
Labels pulumi.StringMapOutput `pulumi:"labels"`
// The fully-qualified resource name for the channel, in the format: sites/ SITE_ID/channels/CHANNEL_ID
Name pulumi.StringOutput `pulumi:"name"`
Project pulumi.StringOutput `pulumi:"project"`
// The current release for the channel, if any.
Release ReleaseResponseOutput `pulumi:"release"`
// The number of previous releases to retain on the channel for rollback or other purposes. Must be a number between 1-100. Defaults to 10 for new channels.
RetainedReleaseCount pulumi.IntOutput `pulumi:"retainedReleaseCount"`
SiteId pulumi.StringOutput `pulumi:"siteId"`
// Input only. A time-to-live for this channel. Sets `expire_time` to the provided duration past the time of the request.
Ttl pulumi.StringOutput `pulumi:"ttl"`
// The time at which the channel was last updated.
UpdateTime pulumi.StringOutput `pulumi:"updateTime"`
// The URL at which the content of this channel's current release can be viewed. This URL is a Firebase-provided subdomain of `web.app`. The content of this channel's current release can also be viewed at the Firebase-provided subdomain of `firebaseapp.com`. If this channel is the `live` channel for the Hosting site, then the content of this channel's current release can also be viewed at any connected custom domains.
Url pulumi.StringOutput `pulumi:"url"`
}
// NewChannel registers a new resource with the given unique name, arguments, and options.
func NewChannel(ctx *pulumi.Context,
name string, args *ChannelArgs, opts ...pulumi.ResourceOption) (*Channel, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ChannelId == nil {
return nil, errors.New("invalid value for required argument 'ChannelId'")
}
if args.SiteId == nil {
return nil, errors.New("invalid value for required argument 'SiteId'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"channelId",
"project",
"siteId",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource Channel
err := ctx.RegisterResource("google-native:firebasehosting/v1beta1:Channel", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetChannel gets an existing Channel 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 GetChannel(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ChannelState, opts ...pulumi.ResourceOption) (*Channel, error) {
var resource Channel
err := ctx.ReadResource("google-native:firebasehosting/v1beta1:Channel", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Channel resources.
type channelState struct {
}
type ChannelState struct {
}
func (ChannelState) ElementType() reflect.Type {
return reflect.TypeOf((*channelState)(nil)).Elem()
}
type channelArgs struct {
// Required. Immutable. A unique ID within the site that identifies the channel.
ChannelId string `pulumi:"channelId"`
// The time at which the channel will be automatically deleted. If null, the channel will not be automatically deleted. This field is present in the output whether it's set directly or via the `ttl` field.
ExpireTime *string `pulumi:"expireTime"`
// Text labels used for extra metadata and/or filtering.
Labels map[string]string `pulumi:"labels"`
// The fully-qualified resource name for the channel, in the format: sites/ SITE_ID/channels/CHANNEL_ID
Name *string `pulumi:"name"`
Project *string `pulumi:"project"`
// The number of previous releases to retain on the channel for rollback or other purposes. Must be a number between 1-100. Defaults to 10 for new channels.
RetainedReleaseCount *int `pulumi:"retainedReleaseCount"`
SiteId string `pulumi:"siteId"`
// Input only. A time-to-live for this channel. Sets `expire_time` to the provided duration past the time of the request.
Ttl *string `pulumi:"ttl"`
}
// The set of arguments for constructing a Channel resource.
type ChannelArgs struct {
// Required. Immutable. A unique ID within the site that identifies the channel.
ChannelId pulumi.StringInput
// The time at which the channel will be automatically deleted. If null, the channel will not be automatically deleted. This field is present in the output whether it's set directly or via the `ttl` field.
ExpireTime pulumi.StringPtrInput
// Text labels used for extra metadata and/or filtering.
Labels pulumi.StringMapInput
// The fully-qualified resource name for the channel, in the format: sites/ SITE_ID/channels/CHANNEL_ID
Name pulumi.StringPtrInput
Project pulumi.StringPtrInput
// The number of previous releases to retain on the channel for rollback or other purposes. Must be a number between 1-100. Defaults to 10 for new channels.
RetainedReleaseCount pulumi.IntPtrInput
SiteId pulumi.StringInput
// Input only. A time-to-live for this channel. Sets `expire_time` to the provided duration past the time of the request.
Ttl pulumi.StringPtrInput
}
func (ChannelArgs) ElementType() reflect.Type {
return reflect.TypeOf((*channelArgs)(nil)).Elem()
}
type ChannelInput interface {
pulumi.Input
ToChannelOutput() ChannelOutput
ToChannelOutputWithContext(ctx context.Context) ChannelOutput
}
func (*Channel) ElementType() reflect.Type {
return reflect.TypeOf((**Channel)(nil)).Elem()
}
func (i *Channel) ToChannelOutput() ChannelOutput {
return i.ToChannelOutputWithContext(context.Background())
}
func (i *Channel) ToChannelOutputWithContext(ctx context.Context) ChannelOutput {
return pulumi.ToOutputWithContext(ctx, i).(ChannelOutput)
}
type ChannelOutput struct{ *pulumi.OutputState }
func (ChannelOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Channel)(nil)).Elem()
}
func (o ChannelOutput) ToChannelOutput() ChannelOutput {
return o
}
func (o ChannelOutput) ToChannelOutputWithContext(ctx context.Context) ChannelOutput {
return o
}
// Required. Immutable. A unique ID within the site that identifies the channel.
func (o ChannelOutput) ChannelId() pulumi.StringOutput {
return o.ApplyT(func(v *Channel) pulumi.StringOutput { return v.ChannelId }).(pulumi.StringOutput)
}
// The time at which the channel was created.
func (o ChannelOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v *Channel) pulumi.StringOutput { return v.CreateTime }).(pulumi.StringOutput)
}
// The time at which the channel will be automatically deleted. If null, the channel will not be automatically deleted. This field is present in the output whether it's set directly or via the `ttl` field.
func (o ChannelOutput) ExpireTime() pulumi.StringOutput {
return o.ApplyT(func(v *Channel) pulumi.StringOutput { return v.ExpireTime }).(pulumi.StringOutput)
}
// Text labels used for extra metadata and/or filtering.
func (o ChannelOutput) Labels() pulumi.StringMapOutput {
return o.ApplyT(func(v *Channel) pulumi.StringMapOutput { return v.Labels }).(pulumi.StringMapOutput)
}
// The fully-qualified resource name for the channel, in the format: sites/ SITE_ID/channels/CHANNEL_ID
func (o ChannelOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Channel) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
func (o ChannelOutput) Project() pulumi.StringOutput {
return o.ApplyT(func(v *Channel) pulumi.StringOutput { return v.Project }).(pulumi.StringOutput)
}
// The current release for the channel, if any.
func (o ChannelOutput) Release() ReleaseResponseOutput {
return o.ApplyT(func(v *Channel) ReleaseResponseOutput { return v.Release }).(ReleaseResponseOutput)
}
// The number of previous releases to retain on the channel for rollback or other purposes. Must be a number between 1-100. Defaults to 10 for new channels.
func (o ChannelOutput) RetainedReleaseCount() pulumi.IntOutput {
return o.ApplyT(func(v *Channel) pulumi.IntOutput { return v.RetainedReleaseCount }).(pulumi.IntOutput)
}
func (o ChannelOutput) SiteId() pulumi.StringOutput {
return o.ApplyT(func(v *Channel) pulumi.StringOutput { return v.SiteId }).(pulumi.StringOutput)
}
// Input only. A time-to-live for this channel. Sets `expire_time` to the provided duration past the time of the request.
func (o ChannelOutput) Ttl() pulumi.StringOutput {
return o.ApplyT(func(v *Channel) pulumi.StringOutput { return v.Ttl }).(pulumi.StringOutput)
}
// The time at which the channel was last updated.
func (o ChannelOutput) UpdateTime() pulumi.StringOutput {
return o.ApplyT(func(v *Channel) pulumi.StringOutput { return v.UpdateTime }).(pulumi.StringOutput)
}
// The URL at which the content of this channel's current release can be viewed. This URL is a Firebase-provided subdomain of `web.app`. The content of this channel's current release can also be viewed at the Firebase-provided subdomain of `firebaseapp.com`. If this channel is the `live` channel for the Hosting site, then the content of this channel's current release can also be viewed at any connected custom domains.
func (o ChannelOutput) Url() pulumi.StringOutput {
return o.ApplyT(func(v *Channel) pulumi.StringOutput { return v.Url }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ChannelInput)(nil)).Elem(), &Channel{})
pulumi.RegisterOutputType(ChannelOutput{})
}