-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…#18686) [upstream:347145739efc5eebe07a3006b8246b29525d8384] Signed-off-by: Modular Magician <[email protected]>
- Loading branch information
1 parent
800dc59
commit ddad481
Showing
14 changed files
with
1,922 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:enhancement | ||
privilegedaccessmanager: promoted `google_privileged_access_manager_entitlement` resource from beta to ga | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
google/services/privilegedaccessmanager/privileged_access_manager_operation.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
// Copyright (c) HashiCorp, Inc. | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
// ---------------------------------------------------------------------------- | ||
// | ||
// *** 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 privilegedaccessmanager | ||
|
||
import ( | ||
"encoding/json" | ||
"errors" | ||
"fmt" | ||
"time" | ||
|
||
"github.com/hashicorp/terraform-provider-google/google/tpgresource" | ||
transport_tpg "github.com/hashicorp/terraform-provider-google/google/transport" | ||
) | ||
|
||
type PrivilegedAccessManagerOperationWaiter struct { | ||
Config *transport_tpg.Config | ||
UserAgent string | ||
tpgresource.CommonOperationWaiter | ||
} | ||
|
||
func (w *PrivilegedAccessManagerOperationWaiter) 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.PrivilegedAccessManagerBasePath, w.CommonOperationWaiter.Op.Name) | ||
|
||
return transport_tpg.SendRequest(transport_tpg.SendRequestOptions{ | ||
Config: w.Config, | ||
Method: "GET", | ||
RawURL: url, | ||
UserAgent: w.UserAgent, | ||
}) | ||
} | ||
|
||
func createPrivilegedAccessManagerWaiter(config *transport_tpg.Config, op map[string]interface{}, activity, userAgent string) (*PrivilegedAccessManagerOperationWaiter, error) { | ||
w := &PrivilegedAccessManagerOperationWaiter{ | ||
Config: config, | ||
UserAgent: userAgent, | ||
} | ||
if err := w.CommonOperationWaiter.SetOp(op); err != nil { | ||
return nil, err | ||
} | ||
return w, nil | ||
} | ||
|
||
// nolint: deadcode,unused | ||
func PrivilegedAccessManagerOperationWaitTimeWithResponse(config *transport_tpg.Config, op map[string]interface{}, response *map[string]interface{}, activity, userAgent string, timeout time.Duration) error { | ||
w, err := createPrivilegedAccessManagerWaiter(config, op, activity, userAgent) | ||
if err != nil { | ||
return err | ||
} | ||
if err := tpgresource.OperationWait(w, activity, timeout, config.PollInterval); err != nil { | ||
return err | ||
} | ||
rawResponse := []byte(w.CommonOperationWaiter.Op.Response) | ||
if len(rawResponse) == 0 { | ||
return errors.New("`resource` not set in operation response") | ||
} | ||
return json.Unmarshal(rawResponse, response) | ||
} | ||
|
||
func PrivilegedAccessManagerOperationWaitTime(config *transport_tpg.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 := createPrivilegedAccessManagerWaiter(config, op, activity, userAgent) | ||
if err != nil { | ||
// If w is nil, the op was synchronous. | ||
return err | ||
} | ||
return tpgresource.OperationWait(w, activity, timeout, config.PollInterval) | ||
} |
Oops, something went wrong.