/
getCase.go
178 lines (149 loc) · 8.57 KB
/
getCase.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
// 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 v2
import (
"context"
"reflect"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Retrieve a case. EXAMPLES: cURL: ``` shell case="projects/some-project/cases/16033687" curl \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://cloudsupport.googleapis.com/v2/$case" ``` Python: ``` python import googleapiclient.discovery api_version = "v2" supportApiService = googleapiclient.discovery.build( serviceName="cloudsupport", version=api_version, discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}", ) request = supportApiService.cases().get( name="projects/some-project/cases/43595344", ) print(request.execute()) ```
func LookupCase(ctx *pulumi.Context, args *LookupCaseArgs, opts ...pulumi.InvokeOption) (*LookupCaseResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupCaseResult
err := ctx.Invoke("google-native:cloudsupport/v2:getCase", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupCaseArgs struct {
CaseId string `pulumi:"caseId"`
V2Id string `pulumi:"v2Id"`
V2Id1 string `pulumi:"v2Id1"`
}
type LookupCaseResult struct {
// The issue classification applicable to this case.
Classification CaseClassificationResponse `pulumi:"classification"`
// A user-supplied email address to send case update notifications for. This should only be used in BYOID flows, where we cannot infer the user's email address directly from their EUCs.
ContactEmail string `pulumi:"contactEmail"`
// The time this case was created.
CreateTime string `pulumi:"createTime"`
// The user who created the case. Note: The name and email will be obfuscated if the case was created by Google Support.
Creator ActorResponse `pulumi:"creator"`
// A broad description of the issue.
Description string `pulumi:"description"`
// The short summary of the issue reported in this case.
DisplayName string `pulumi:"displayName"`
// Whether the case is currently escalated.
Escalated bool `pulumi:"escalated"`
// The language the user has requested to receive support in. This should be a BCP 47 language code (e.g., `"en"`, `"zh-CN"`, `"zh-TW"`, `"ja"`, `"ko"`). If no language or an unsupported language is specified, this field defaults to English (en). Language selection during case creation may affect your available support options. For a list of supported languages and their support working hours, see: https://cloud.google.com/support/docs/language-working-hours
LanguageCode string `pulumi:"languageCode"`
// The resource name for the case.
Name string `pulumi:"name"`
// The priority of this case.
Priority string `pulumi:"priority"`
// The current status of the support case.
State string `pulumi:"state"`
// The email addresses to receive updates on this case.
SubscriberEmailAddresses []string `pulumi:"subscriberEmailAddresses"`
// Whether this case was created for internal API testing and should not be acted on by the support team.
TestCase bool `pulumi:"testCase"`
// The timezone of the user who created the support case. It should be in a format IANA recognizes: https://www.iana.org/time-zones. There is no additional validation done by the API.
TimeZone string `pulumi:"timeZone"`
// The time this case was last updated.
UpdateTime string `pulumi:"updateTime"`
}
func LookupCaseOutput(ctx *pulumi.Context, args LookupCaseOutputArgs, opts ...pulumi.InvokeOption) LookupCaseResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupCaseResult, error) {
args := v.(LookupCaseArgs)
r, err := LookupCase(ctx, &args, opts...)
var s LookupCaseResult
if r != nil {
s = *r
}
return s, err
}).(LookupCaseResultOutput)
}
type LookupCaseOutputArgs struct {
CaseId pulumi.StringInput `pulumi:"caseId"`
V2Id pulumi.StringInput `pulumi:"v2Id"`
V2Id1 pulumi.StringInput `pulumi:"v2Id1"`
}
func (LookupCaseOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupCaseArgs)(nil)).Elem()
}
type LookupCaseResultOutput struct{ *pulumi.OutputState }
func (LookupCaseResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupCaseResult)(nil)).Elem()
}
func (o LookupCaseResultOutput) ToLookupCaseResultOutput() LookupCaseResultOutput {
return o
}
func (o LookupCaseResultOutput) ToLookupCaseResultOutputWithContext(ctx context.Context) LookupCaseResultOutput {
return o
}
// The issue classification applicable to this case.
func (o LookupCaseResultOutput) Classification() CaseClassificationResponseOutput {
return o.ApplyT(func(v LookupCaseResult) CaseClassificationResponse { return v.Classification }).(CaseClassificationResponseOutput)
}
// A user-supplied email address to send case update notifications for. This should only be used in BYOID flows, where we cannot infer the user's email address directly from their EUCs.
func (o LookupCaseResultOutput) ContactEmail() pulumi.StringOutput {
return o.ApplyT(func(v LookupCaseResult) string { return v.ContactEmail }).(pulumi.StringOutput)
}
// The time this case was created.
func (o LookupCaseResultOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v LookupCaseResult) string { return v.CreateTime }).(pulumi.StringOutput)
}
// The user who created the case. Note: The name and email will be obfuscated if the case was created by Google Support.
func (o LookupCaseResultOutput) Creator() ActorResponseOutput {
return o.ApplyT(func(v LookupCaseResult) ActorResponse { return v.Creator }).(ActorResponseOutput)
}
// A broad description of the issue.
func (o LookupCaseResultOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v LookupCaseResult) string { return v.Description }).(pulumi.StringOutput)
}
// The short summary of the issue reported in this case.
func (o LookupCaseResultOutput) DisplayName() pulumi.StringOutput {
return o.ApplyT(func(v LookupCaseResult) string { return v.DisplayName }).(pulumi.StringOutput)
}
// Whether the case is currently escalated.
func (o LookupCaseResultOutput) Escalated() pulumi.BoolOutput {
return o.ApplyT(func(v LookupCaseResult) bool { return v.Escalated }).(pulumi.BoolOutput)
}
// The language the user has requested to receive support in. This should be a BCP 47 language code (e.g., `"en"`, `"zh-CN"`, `"zh-TW"`, `"ja"`, `"ko"`). If no language or an unsupported language is specified, this field defaults to English (en). Language selection during case creation may affect your available support options. For a list of supported languages and their support working hours, see: https://cloud.google.com/support/docs/language-working-hours
func (o LookupCaseResultOutput) LanguageCode() pulumi.StringOutput {
return o.ApplyT(func(v LookupCaseResult) string { return v.LanguageCode }).(pulumi.StringOutput)
}
// The resource name for the case.
func (o LookupCaseResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupCaseResult) string { return v.Name }).(pulumi.StringOutput)
}
// The priority of this case.
func (o LookupCaseResultOutput) Priority() pulumi.StringOutput {
return o.ApplyT(func(v LookupCaseResult) string { return v.Priority }).(pulumi.StringOutput)
}
// The current status of the support case.
func (o LookupCaseResultOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v LookupCaseResult) string { return v.State }).(pulumi.StringOutput)
}
// The email addresses to receive updates on this case.
func (o LookupCaseResultOutput) SubscriberEmailAddresses() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupCaseResult) []string { return v.SubscriberEmailAddresses }).(pulumi.StringArrayOutput)
}
// Whether this case was created for internal API testing and should not be acted on by the support team.
func (o LookupCaseResultOutput) TestCase() pulumi.BoolOutput {
return o.ApplyT(func(v LookupCaseResult) bool { return v.TestCase }).(pulumi.BoolOutput)
}
// The timezone of the user who created the support case. It should be in a format IANA recognizes: https://www.iana.org/time-zones. There is no additional validation done by the API.
func (o LookupCaseResultOutput) TimeZone() pulumi.StringOutput {
return o.ApplyT(func(v LookupCaseResult) string { return v.TimeZone }).(pulumi.StringOutput)
}
// The time this case was last updated.
func (o LookupCaseResultOutput) UpdateTime() pulumi.StringOutput {
return o.ApplyT(func(v LookupCaseResult) string { return v.UpdateTime }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupCaseResultOutput{})
}