Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add links support #14261

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/7630.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:new-resource
`google_logging_linked_dataset`
```
73 changes: 73 additions & 0 deletions google/logging_operation.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// ----------------------------------------------------------------------------
//
// *** AUTO GENERATED CODE *** Type: MMv1 ***
//
// ----------------------------------------------------------------------------
//
// This file is automatically generated by Magic Modules and manual
// changes will be clobbered when the file is regenerated.
//
// Please read more about how to change this file in
// .github/CONTRIBUTING.md.
//
// ----------------------------------------------------------------------------

package google

import (
"encoding/json"
"fmt"
"time"
)

type LoggingOperationWaiter struct {
Config *Config
UserAgent string
CommonOperationWaiter
}

func (w *LoggingOperationWaiter) QueryOp() (interface{}, error) {
if w == nil {
return nil, fmt.Errorf("Cannot query operation, it's unset or nil.")
}
// Returns the proper get.
url := fmt.Sprintf("%s%s", w.Config.LoggingBasePath, w.CommonOperationWaiter.Op.Name)

return SendRequest(w.Config, "GET", "", url, w.UserAgent, nil)
}

func createLoggingWaiter(config *Config, op map[string]interface{}, activity, userAgent string) (*LoggingOperationWaiter, error) {
w := &LoggingOperationWaiter{
Config: config,
UserAgent: userAgent,
}
if err := w.CommonOperationWaiter.SetOp(op); err != nil {
return nil, err
}
return w, nil
}

// nolint: deadcode,unused
func LoggingOperationWaitTimeWithResponse(config *Config, op map[string]interface{}, response *map[string]interface{}, activity, userAgent string, timeout time.Duration) error {
w, err := createLoggingWaiter(config, op, activity, userAgent)
if err != nil {
return err
}
if err := OperationWait(w, activity, timeout, config.PollInterval); err != nil {
return err
}
return json.Unmarshal([]byte(w.CommonOperationWaiter.Op.Response), response)
}

func LoggingOperationWaitTime(config *Config, op map[string]interface{}, activity, userAgent string, timeout time.Duration) error {
if val, ok := op["name"]; !ok || val == "" {
// This was a synchronous call - there is no operation to wait for.
return nil
}
w, err := createLoggingWaiter(config, op, activity, userAgent)
if err != nil {
// If w is nil, the op was synchronous.
return err
}
return OperationWait(w, activity, timeout, config.PollInterval)
}
5 changes: 3 additions & 2 deletions google/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -712,9 +712,9 @@ func Provider() *schema.Provider {
return provider
}

// Generated resources: 276
// Generated resources: 277
// Generated IAM resources: 186
// Total generated resources: 462
// Total generated resources: 463
func ResourceMap() map[string]*schema.Resource {
resourceMap, _ := ResourceMapWithErrors()
return resourceMap
Expand Down Expand Up @@ -1070,6 +1070,7 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
"google_kms_key_ring": ResourceKMSKeyRing(),
"google_kms_key_ring_import_job": ResourceKMSKeyRingImportJob(),
"google_kms_secret_ciphertext": ResourceKMSSecretCiphertext(),
"google_logging_linked_dataset": ResourceLoggingLinkedDataset(),
"google_logging_log_view": ResourceLoggingLogView(),
"google_logging_metric": ResourceLoggingMetric(),
"google_memcache_instance": ResourceMemcacheInstance(),
Expand Down
Loading