Skip to content

Commit 370e899

Browse files
New Resource : google_dialogflowcx_version (#4870) (#3423)
Signed-off-by: Modular Magician <[email protected]>
1 parent 4f1a7d1 commit 370e899

File tree

8 files changed

+871
-2
lines changed

8 files changed

+871
-2
lines changed

.changelog/4870.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:new-resource
2+
`google_dialogflow_cx_version`
3+
```
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
// ----------------------------------------------------------------------------
2+
//
3+
// *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
4+
//
5+
// ----------------------------------------------------------------------------
6+
//
7+
// This file is automatically generated by Magic Modules and manual
8+
// changes will be clobbered when the file is regenerated.
9+
//
10+
// Please read more about how to change this file in
11+
// .github/CONTRIBUTING.md.
12+
//
13+
// ----------------------------------------------------------------------------
14+
package google
15+
16+
import (
17+
"encoding/json"
18+
"fmt"
19+
"time"
20+
)
21+
22+
type DialogflowCXOperationWaiter struct {
23+
Config *Config
24+
UserAgent string
25+
CommonOperationWaiter
26+
}
27+
28+
func (w *DialogflowCXOperationWaiter) QueryOp() (interface{}, error) {
29+
if w == nil {
30+
return nil, fmt.Errorf("Cannot query operation, it's unset or nil.")
31+
}
32+
// Returns the proper get.
33+
url := fmt.Sprintf("https://dialogflow.googleapis.com/v3/%s", w.CommonOperationWaiter.Op.Name)
34+
35+
return sendRequest(w.Config, "GET", "", url, w.UserAgent, nil)
36+
}
37+
38+
func createDialogflowCXWaiter(config *Config, op map[string]interface{}, activity, userAgent string) (*DialogflowCXOperationWaiter, error) {
39+
w := &DialogflowCXOperationWaiter{
40+
Config: config,
41+
UserAgent: userAgent,
42+
}
43+
if err := w.CommonOperationWaiter.SetOp(op); err != nil {
44+
return nil, err
45+
}
46+
return w, nil
47+
}
48+
49+
// nolint: deadcode,unused
50+
func dialogflowCXOperationWaitTimeWithResponse(config *Config, op map[string]interface{}, response *map[string]interface{}, activity, userAgent string, timeout time.Duration) error {
51+
w, err := createDialogflowCXWaiter(config, op, activity, userAgent)
52+
if err != nil {
53+
return err
54+
}
55+
if err := OperationWait(w, activity, timeout, config.PollInterval); err != nil {
56+
return err
57+
}
58+
return json.Unmarshal([]byte(w.CommonOperationWaiter.Op.Response), response)
59+
}
60+
61+
func dialogflowCXOperationWaitTime(config *Config, op map[string]interface{}, activity, userAgent string, timeout time.Duration) error {
62+
if val, ok := op["name"]; !ok || val == "" {
63+
// This was a synchronous call - there is no operation to wait for.
64+
return nil
65+
}
66+
w, err := createDialogflowCXWaiter(config, op, activity, userAgent)
67+
if err != nil {
68+
// If w is nil, the op was synchronous.
69+
return err
70+
}
71+
return OperationWait(w, activity, timeout, config.PollInterval)
72+
}

google-beta/provider.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -886,9 +886,9 @@ func Provider() *schema.Provider {
886886
return provider
887887
}
888888

889-
// Generated resources: 237
889+
// Generated resources: 238
890890
// Generated IAM resources: 117
891-
// Total generated resources: 354
891+
// Total generated resources: 355
892892
func ResourceMap() map[string]*schema.Resource {
893893
resourceMap, _ := ResourceMapWithErrors()
894894
return resourceMap
@@ -1096,6 +1096,7 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
10961096
"google_dialogflow_cx_agent": resourceDialogflowCXAgent(),
10971097
"google_dialogflow_cx_intent": resourceDialogflowCXIntent(),
10981098
"google_dialogflow_cx_flow": resourceDialogflowCXFlow(),
1099+
"google_dialogflow_cx_version": resourceDialogflowCXVersion(),
10991100
"google_dns_managed_zone": resourceDNSManagedZone(),
11001101
"google_dns_policy": resourceDNSPolicy(),
11011102
"google_dns_record_set": resourceDNSResourceDnsRecordSet(),

0 commit comments

Comments
 (0)