/
getReplay.go
103 lines (85 loc) · 4.18 KB
/
getReplay.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
// 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"
)
// Gets the specified Replay. Each `Replay` is available for at least 7 days.
func LookupReplay(ctx *pulumi.Context, args *LookupReplayArgs, opts ...pulumi.InvokeOption) (*LookupReplayResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupReplayResult
err := ctx.Invoke("google-native:policysimulator/v1:getReplay", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupReplayArgs struct {
Location string `pulumi:"location"`
Project *string `pulumi:"project"`
ReplayId string `pulumi:"replayId"`
}
type LookupReplayResult struct {
// The configuration used for the `Replay`.
Config GoogleCloudPolicysimulatorV1ReplayConfigResponse `pulumi:"config"`
// The resource name of the `Replay`, which has the following format: `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, where `{resource-id}` is the ID of the project, folder, or organization that owns the Replay. Example: `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36`
Name string `pulumi:"name"`
// Summary statistics about the replayed log entries.
ResultsSummary GoogleCloudPolicysimulatorV1ReplayResultsSummaryResponse `pulumi:"resultsSummary"`
// The current state of the `Replay`.
State string `pulumi:"state"`
}
func LookupReplayOutput(ctx *pulumi.Context, args LookupReplayOutputArgs, opts ...pulumi.InvokeOption) LookupReplayResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupReplayResult, error) {
args := v.(LookupReplayArgs)
r, err := LookupReplay(ctx, &args, opts...)
var s LookupReplayResult
if r != nil {
s = *r
}
return s, err
}).(LookupReplayResultOutput)
}
type LookupReplayOutputArgs struct {
Location pulumi.StringInput `pulumi:"location"`
Project pulumi.StringPtrInput `pulumi:"project"`
ReplayId pulumi.StringInput `pulumi:"replayId"`
}
func (LookupReplayOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupReplayArgs)(nil)).Elem()
}
type LookupReplayResultOutput struct{ *pulumi.OutputState }
func (LookupReplayResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupReplayResult)(nil)).Elem()
}
func (o LookupReplayResultOutput) ToLookupReplayResultOutput() LookupReplayResultOutput {
return o
}
func (o LookupReplayResultOutput) ToLookupReplayResultOutputWithContext(ctx context.Context) LookupReplayResultOutput {
return o
}
// The configuration used for the `Replay`.
func (o LookupReplayResultOutput) Config() GoogleCloudPolicysimulatorV1ReplayConfigResponseOutput {
return o.ApplyT(func(v LookupReplayResult) GoogleCloudPolicysimulatorV1ReplayConfigResponse { return v.Config }).(GoogleCloudPolicysimulatorV1ReplayConfigResponseOutput)
}
// The resource name of the `Replay`, which has the following format: `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}`, where `{resource-id}` is the ID of the project, folder, or organization that owns the Replay. Example: `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce1833c36`
func (o LookupReplayResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupReplayResult) string { return v.Name }).(pulumi.StringOutput)
}
// Summary statistics about the replayed log entries.
func (o LookupReplayResultOutput) ResultsSummary() GoogleCloudPolicysimulatorV1ReplayResultsSummaryResponseOutput {
return o.ApplyT(func(v LookupReplayResult) GoogleCloudPolicysimulatorV1ReplayResultsSummaryResponse {
return v.ResultsSummary
}).(GoogleCloudPolicysimulatorV1ReplayResultsSummaryResponseOutput)
}
// The current state of the `Replay`.
func (o LookupReplayResultOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v LookupReplayResult) string { return v.State }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupReplayResultOutput{})
}