Skip to content

Commit a56669d

Browse files
Capitalize some function and variable names to make them public (#7368) (#13900)
* Capitalize some function and variable names to make them public * Fix validator * Keep pname Signed-off-by: Modular Magician <magic-modules@google.com>
1 parent 07599f1 commit a56669d

File tree

1,200 files changed

+5618
-5612
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,200 files changed

+5618
-5612
lines changed

.changelog/7368.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:none
2+
3+
```

google/access_context_manager_operation.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func (w *AccessContextManagerOperationWaiter) QueryOp() (interface{}, error) {
3333
// Returns the proper get.
3434
url := fmt.Sprintf("%s%s", w.Config.AccessContextManagerBasePath, w.CommonOperationWaiter.Op.Name)
3535

36-
return sendRequest(w.Config, "GET", "", url, w.UserAgent, nil)
36+
return SendRequest(w.Config, "GET", "", url, w.UserAgent, nil)
3737
}
3838

3939
func createAccessContextManagerWaiter(config *Config, op map[string]interface{}, activity, userAgent string) (*AccessContextManagerOperationWaiter, error) {
@@ -48,7 +48,7 @@ func createAccessContextManagerWaiter(config *Config, op map[string]interface{},
4848
}
4949

5050
// nolint: deadcode,unused
51-
func accessContextManagerOperationWaitTimeWithResponse(config *Config, op map[string]interface{}, response *map[string]interface{}, activity, userAgent string, timeout time.Duration) error {
51+
func AccessContextManagerOperationWaitTimeWithResponse(config *Config, op map[string]interface{}, response *map[string]interface{}, activity, userAgent string, timeout time.Duration) error {
5252
w, err := createAccessContextManagerWaiter(config, op, activity, userAgent)
5353
if err != nil {
5454
return err
@@ -59,7 +59,7 @@ func accessContextManagerOperationWaitTimeWithResponse(config *Config, op map[st
5959
return json.Unmarshal([]byte(w.CommonOperationWaiter.Op.Response), response)
6060
}
6161

62-
func accessContextManagerOperationWaitTime(config *Config, op map[string]interface{}, activity, userAgent string, timeout time.Duration) error {
62+
func AccessContextManagerOperationWaitTime(config *Config, op map[string]interface{}, activity, userAgent string, timeout time.Duration) error {
6363
if val, ok := op["name"]; !ok || val == "" {
6464
// This was a synchronous call - there is no operation to wait for.
6565
return nil

google/active_directory_operation.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func (w *ActiveDirectoryOperationWaiter) QueryOp() (interface{}, error) {
3434
// Returns the proper get.
3535
url := fmt.Sprintf("%s%s", w.Config.ActiveDirectoryBasePath, w.CommonOperationWaiter.Op.Name)
3636

37-
return sendRequest(w.Config, "GET", w.Project, url, w.UserAgent, nil)
37+
return SendRequest(w.Config, "GET", w.Project, url, w.UserAgent, nil)
3838
}
3939

4040
func createActiveDirectoryWaiter(config *Config, op map[string]interface{}, project, activity, userAgent string) (*ActiveDirectoryOperationWaiter, error) {
@@ -50,7 +50,7 @@ func createActiveDirectoryWaiter(config *Config, op map[string]interface{}, proj
5050
}
5151

5252
// nolint: deadcode,unused
53-
func activeDirectoryOperationWaitTimeWithResponse(config *Config, op map[string]interface{}, response *map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error {
53+
func ActiveDirectoryOperationWaitTimeWithResponse(config *Config, op map[string]interface{}, response *map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error {
5454
w, err := createActiveDirectoryWaiter(config, op, project, activity, userAgent)
5555
if err != nil {
5656
return err
@@ -61,7 +61,7 @@ func activeDirectoryOperationWaitTimeWithResponse(config *Config, op map[string]
6161
return json.Unmarshal([]byte(w.CommonOperationWaiter.Op.Response), response)
6262
}
6363

64-
func activeDirectoryOperationWaitTime(config *Config, op map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error {
64+
func ActiveDirectoryOperationWaitTime(config *Config, op map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error {
6565
if val, ok := op["name"]; !ok || val == "" {
6666
// This was a synchronous call - there is no operation to wait for.
6767
return nil

google/alloydb_operation.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func (w *AlloydbOperationWaiter) QueryOp() (interface{}, error) {
3333
// Returns the proper get.
3434
url := fmt.Sprintf("%s%s", w.Config.AlloydbBasePath, w.CommonOperationWaiter.Op.Name)
3535

36-
return sendRequest(w.Config, "GET", w.Project, url, w.UserAgent, nil)
36+
return SendRequest(w.Config, "GET", w.Project, url, w.UserAgent, nil)
3737
}
3838

3939
func createAlloydbWaiter(config *Config, op map[string]interface{}, project, activity, userAgent string) (*AlloydbOperationWaiter, error) {
@@ -48,7 +48,7 @@ func createAlloydbWaiter(config *Config, op map[string]interface{}, project, act
4848
return w, nil
4949
}
5050

51-
func alloydbOperationWaitTime(config *Config, op map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error {
51+
func AlloydbOperationWaitTime(config *Config, op map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error {
5252
if val, ok := op["name"]; !ok || val == "" {
5353
// This was a synchronous call - there is no operation to wait for.
5454
return nil

google/apigee_operation.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func (w *ApigeeOperationWaiter) QueryOp() (interface{}, error) {
3333
// Returns the proper get.
3434
url := fmt.Sprintf("%s%s", w.Config.ApigeeBasePath, w.CommonOperationWaiter.Op.Name)
3535

36-
return sendRequest(w.Config, "GET", "", url, w.UserAgent, nil)
36+
return SendRequest(w.Config, "GET", "", url, w.UserAgent, nil)
3737
}
3838

3939
func createApigeeWaiter(config *Config, op map[string]interface{}, activity, userAgent string) (*ApigeeOperationWaiter, error) {
@@ -48,7 +48,7 @@ func createApigeeWaiter(config *Config, op map[string]interface{}, activity, use
4848
}
4949

5050
// nolint: deadcode,unused
51-
func apigeeOperationWaitTimeWithResponse(config *Config, op map[string]interface{}, response *map[string]interface{}, activity, userAgent string, timeout time.Duration) error {
51+
func ApigeeOperationWaitTimeWithResponse(config *Config, op map[string]interface{}, response *map[string]interface{}, activity, userAgent string, timeout time.Duration) error {
5252
w, err := createApigeeWaiter(config, op, activity, userAgent)
5353
if err != nil {
5454
return err
@@ -59,7 +59,7 @@ func apigeeOperationWaitTimeWithResponse(config *Config, op map[string]interface
5959
return json.Unmarshal([]byte(w.CommonOperationWaiter.Op.Response), response)
6060
}
6161

62-
func apigeeOperationWaitTime(config *Config, op map[string]interface{}, activity, userAgent string, timeout time.Duration) error {
62+
func ApigeeOperationWaitTime(config *Config, op map[string]interface{}, activity, userAgent string, timeout time.Duration) error {
6363
if val, ok := op["name"]; !ok || val == "" {
6464
// This was a synchronous call - there is no operation to wait for.
6565
return nil

google/appengine_operation.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func (w *AppEngineOperationWaiter) QueryOp() (interface{}, error) {
3030
return w.Service.Apps.Operations.Get(w.AppId, matches[1]).Do()
3131
}
3232

33-
func appEngineOperationWaitTimeWithResponse(config *Config, res interface{}, response *map[string]interface{}, appId, activity, userAgent string, timeout time.Duration) error {
33+
func AppEngineOperationWaitTimeWithResponse(config *Config, res interface{}, response *map[string]interface{}, appId, activity, userAgent string, timeout time.Duration) error {
3434
op := &appengine.Operation{}
3535
err := Convert(res, op)
3636
if err != nil {
@@ -51,7 +51,7 @@ func appEngineOperationWaitTimeWithResponse(config *Config, res interface{}, res
5151
return json.Unmarshal([]byte(w.CommonOperationWaiter.Op.Response), response)
5252
}
5353

54-
func appEngineOperationWaitTime(config *Config, res interface{}, appId, activity, userAgent string, timeout time.Duration) error {
54+
func AppEngineOperationWaitTime(config *Config, res interface{}, appId, activity, userAgent string, timeout time.Duration) error {
5555
op := &appengine.Operation{}
5656
err := Convert(res, op)
5757
if err != nil {

google/artifact_registry_operation.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func (w *ArtifactRegistryOperationWaiter) QueryOp() (interface{}, error) {
3434
// Returns the proper get.
3535
url := fmt.Sprintf("%s%s", w.Config.ArtifactRegistryBasePath, w.CommonOperationWaiter.Op.Name)
3636

37-
return sendRequest(w.Config, "GET", w.Project, url, w.UserAgent, nil)
37+
return SendRequest(w.Config, "GET", w.Project, url, w.UserAgent, nil)
3838
}
3939

4040
func createArtifactRegistryWaiter(config *Config, op map[string]interface{}, project, activity, userAgent string) (*ArtifactRegistryOperationWaiter, error) {
@@ -50,7 +50,7 @@ func createArtifactRegistryWaiter(config *Config, op map[string]interface{}, pro
5050
}
5151

5252
// nolint: deadcode,unused
53-
func artifactRegistryOperationWaitTimeWithResponse(config *Config, op map[string]interface{}, response *map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error {
53+
func ArtifactRegistryOperationWaitTimeWithResponse(config *Config, op map[string]interface{}, response *map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error {
5454
w, err := createArtifactRegistryWaiter(config, op, project, activity, userAgent)
5555
if err != nil {
5656
return err
@@ -61,7 +61,7 @@ func artifactRegistryOperationWaitTimeWithResponse(config *Config, op map[string
6161
return json.Unmarshal([]byte(w.CommonOperationWaiter.Op.Response), response)
6262
}
6363

64-
func artifactRegistryOperationWaitTime(config *Config, op map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error {
64+
func ArtifactRegistryOperationWaitTime(config *Config, op map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error {
6565
if val, ok := op["name"]; !ok || val == "" {
6666
// This was a synchronous call - there is no operation to wait for.
6767
return nil

google/batcher.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/hashicorp/errwrap"
1111
)
1212

13-
const defaultBatchSendIntervalSec = 3
13+
const DefaultBatchSendIntervalSec = 3
1414

1515
// RequestBatcher keeps track of batched requests globally.
1616
// It should be created at a provider level. In general, one
@@ -98,8 +98,8 @@ type batchSubscriber struct {
9898

9999
// batchingConfig contains user configuration for controlling batch requests.
100100
type batchingConfig struct {
101-
sendAfter time.Duration
102-
enableBatching bool
101+
SendAfter time.Duration
102+
EnableBatching bool
103103
}
104104

105105
// Initializes a new batcher.
@@ -161,7 +161,7 @@ func (b *RequestBatcher) SendRequestWithTimeout(batchKey string, request *BatchR
161161
if request.SendF == nil {
162162
return nil, fmt.Errorf("error, cannot request batching for BatchRequest with nil SendF")
163163
}
164-
if !b.enableBatching {
164+
if !b.EnableBatching {
165165
log.Printf("[DEBUG] Batching is disabled, sending single request for %q", request.DebugId)
166166
return request.SendF(request.ResourceName, request.Body)
167167
}
@@ -243,7 +243,7 @@ func (b *RequestBatcher) registerBatchRequest(batchKey string, newRequest *Batch
243243
}
244244

245245
// Start a timer to send the request
246-
b.batches[batchKey].timer = time.AfterFunc(b.sendAfter, func() {
246+
b.batches[batchKey].timer = time.AfterFunc(b.SendAfter, func() {
247247
batch := b.popBatch(batchKey)
248248
if batch == nil {
249249
log.Printf("[ERROR] batch should have been added to saved batches - just run as single request %q", newRequest.DebugId)

google/batcher_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ func TestRequestBatcher_disableBatching(t *testing.T) {
2424
"testBatcher",
2525
context.Background(),
2626
&batchingConfig{
27-
sendAfter: time.Duration(1) * time.Second,
28-
enableBatching: false,
27+
SendAfter: time.Duration(1) * time.Second,
28+
EnableBatching: false,
2929
})
3030

3131
testCombine := func(currV interface{}, toAddV interface{}) (interface{}, error) {
@@ -72,8 +72,8 @@ func TestRequestBatcher_errInCombine(t *testing.T) {
7272
"testBatcher",
7373
context.Background(),
7474
&batchingConfig{
75-
sendAfter: time.Duration(5) * time.Second,
76-
enableBatching: true,
75+
SendAfter: time.Duration(5) * time.Second,
76+
EnableBatching: true,
7777
})
7878

7979
combineErrText := "this is an expected error in combine"
@@ -136,8 +136,8 @@ func TestRequestBatcher_errInSend(t *testing.T) {
136136
"testBatcher",
137137
context.Background(),
138138
&batchingConfig{
139-
sendAfter: time.Duration(5) * time.Second,
140-
enableBatching: true,
139+
SendAfter: time.Duration(5) * time.Second,
140+
EnableBatching: true,
141141
})
142142

143143
// combineF keeps track of the batched indexes
@@ -205,8 +205,8 @@ func TestRequestBatcher_errTimeout(t *testing.T) {
205205
"testBatcher",
206206
context.Background(),
207207
&batchingConfig{
208-
sendAfter: time.Duration(5) * time.Second,
209-
enableBatching: true,
208+
SendAfter: time.Duration(5) * time.Second,
209+
EnableBatching: true,
210210
})
211211

212212
testResource := "resource for send error"
@@ -250,8 +250,8 @@ func testBasicCountBatches(t *testing.T, testName string, numBatches int) {
250250
"testBatcher",
251251
context.Background(),
252252
&batchingConfig{
253-
sendAfter: time.Duration(1) * time.Second,
254-
enableBatching: true,
253+
SendAfter: time.Duration(1) * time.Second,
254+
EnableBatching: true,
255255
})
256256

257257
testCombine := func(currV interface{}, toAddV interface{}) (interface{}, error) {

google/beyondcorp_operation.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func (w *BeyondcorpOperationWaiter) QueryOp() (interface{}, error) {
3434
// Returns the proper get.
3535
url := fmt.Sprintf("%s%s", w.Config.BeyondcorpBasePath, w.CommonOperationWaiter.Op.Name)
3636

37-
return sendRequest(w.Config, "GET", w.Project, url, w.UserAgent, nil)
37+
return SendRequest(w.Config, "GET", w.Project, url, w.UserAgent, nil)
3838
}
3939

4040
func createBeyondcorpWaiter(config *Config, op map[string]interface{}, project, activity, userAgent string) (*BeyondcorpOperationWaiter, error) {
@@ -50,7 +50,7 @@ func createBeyondcorpWaiter(config *Config, op map[string]interface{}, project,
5050
}
5151

5252
// nolint: deadcode,unused
53-
func beyondcorpOperationWaitTimeWithResponse(config *Config, op map[string]interface{}, response *map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error {
53+
func BeyondcorpOperationWaitTimeWithResponse(config *Config, op map[string]interface{}, response *map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error {
5454
w, err := createBeyondcorpWaiter(config, op, project, activity, userAgent)
5555
if err != nil {
5656
return err
@@ -61,7 +61,7 @@ func beyondcorpOperationWaitTimeWithResponse(config *Config, op map[string]inter
6161
return json.Unmarshal([]byte(w.CommonOperationWaiter.Op.Response), response)
6262
}
6363

64-
func beyondcorpOperationWaitTime(config *Config, op map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error {
64+
func BeyondcorpOperationWaitTime(config *Config, op map[string]interface{}, project, activity, userAgent string, timeout time.Duration) error {
6565
if val, ok := op["name"]; !ok || val == "" {
6666
// This was a synchronous call - there is no operation to wait for.
6767
return nil

0 commit comments

Comments
 (0)