/
service.go
129 lines (103 loc) · 4.53 KB
/
service.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
// 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 v1
import (
"context"
"reflect"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Creates a new managed service. A managed service is immutable, and is subject to mandatory 30-day data retention. You cannot move a service or recreate it within 30 days after deletion. One producer project can own no more than 500 services. For security and reliability purposes, a production service should be hosted in a dedicated producer project. Operation
// Auto-naming is currently not supported for this resource.
type Service struct {
pulumi.CustomResourceState
// ID of the project that produces and owns this service.
ProducerProjectId pulumi.StringOutput `pulumi:"producerProjectId"`
// The name of the service. See the [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements.
ServiceName pulumi.StringOutput `pulumi:"serviceName"`
}
// NewService registers a new resource with the given unique name, arguments, and options.
func NewService(ctx *pulumi.Context,
name string, args *ServiceArgs, opts ...pulumi.ResourceOption) (*Service, error) {
if args == nil {
args = &ServiceArgs{}
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Service
err := ctx.RegisterResource("google-native:servicemanagement/v1:Service", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetService gets an existing Service 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 GetService(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ServiceState, opts ...pulumi.ResourceOption) (*Service, error) {
var resource Service
err := ctx.ReadResource("google-native:servicemanagement/v1:Service", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Service resources.
type serviceState struct {
}
type ServiceState struct {
}
func (ServiceState) ElementType() reflect.Type {
return reflect.TypeOf((*serviceState)(nil)).Elem()
}
type serviceArgs struct {
// ID of the project that produces and owns this service.
ProducerProjectId *string `pulumi:"producerProjectId"`
// The name of the service. See the [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements.
ServiceName *string `pulumi:"serviceName"`
}
// The set of arguments for constructing a Service resource.
type ServiceArgs struct {
// ID of the project that produces and owns this service.
ProducerProjectId pulumi.StringPtrInput
// The name of the service. See the [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements.
ServiceName pulumi.StringPtrInput
}
func (ServiceArgs) ElementType() reflect.Type {
return reflect.TypeOf((*serviceArgs)(nil)).Elem()
}
type ServiceInput interface {
pulumi.Input
ToServiceOutput() ServiceOutput
ToServiceOutputWithContext(ctx context.Context) ServiceOutput
}
func (*Service) ElementType() reflect.Type {
return reflect.TypeOf((**Service)(nil)).Elem()
}
func (i *Service) ToServiceOutput() ServiceOutput {
return i.ToServiceOutputWithContext(context.Background())
}
func (i *Service) ToServiceOutputWithContext(ctx context.Context) ServiceOutput {
return pulumi.ToOutputWithContext(ctx, i).(ServiceOutput)
}
type ServiceOutput struct{ *pulumi.OutputState }
func (ServiceOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Service)(nil)).Elem()
}
func (o ServiceOutput) ToServiceOutput() ServiceOutput {
return o
}
func (o ServiceOutput) ToServiceOutputWithContext(ctx context.Context) ServiceOutput {
return o
}
// ID of the project that produces and owns this service.
func (o ServiceOutput) ProducerProjectId() pulumi.StringOutput {
return o.ApplyT(func(v *Service) pulumi.StringOutput { return v.ProducerProjectId }).(pulumi.StringOutput)
}
// The name of the service. See the [overview](https://cloud.google.com/service-infrastructure/docs/overview) for naming requirements.
func (o ServiceOutput) ServiceName() pulumi.StringOutput {
return o.ApplyT(func(v *Service) pulumi.StringOutput { return v.ServiceName }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ServiceInput)(nil)).Elem(), &Service{})
pulumi.RegisterOutputType(ServiceOutput{})
}