Skip to content

Commit

Permalink
Split tgc converters
Browse files Browse the repository at this point in the history
  • Loading branch information
zli82016 committed Sep 28, 2024
1 parent c0fae5c commit 00910be
Show file tree
Hide file tree
Showing 49 changed files with 123 additions and 127 deletions.
150 changes: 75 additions & 75 deletions mmv1/provider/terraform_tgc.go

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package apikeys

import (
"reflect"
Expand Down Expand Up @@ -125,7 +125,7 @@ func expandApikeysKeyDeleteTime(v interface{}, d tpgresource.TerraformResourceDa
}

func expandApikeysKeyRestrictions(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {

l := v.([]interface{})
if len(l) == 0 || l[0] == nil {
return nil, nil
Expand Down Expand Up @@ -203,7 +203,6 @@ func expandApikeysKeySha1Fingerprint(v interface{}, d tpgresource.TerraformResou
return v, nil
}


func expandApikeysKeyApiTargets(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 || l[0] == nil {
Expand Down Expand Up @@ -238,7 +237,6 @@ func expandApikeysKeyMethods(v interface{}, d tpgresource.TerraformResourceData,
return convertInterfaceToStringArray(v.([]interface{})), nil
}


func expandApikeysKeyDEtag(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
return v, nil
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package appengine

import (
"reflect"
Expand Down Expand Up @@ -55,15 +55,13 @@ func GetAppEngineApplicationApiObject(d tpgresource.TerraformResourceData, confi
obj["location_id"] = locationIdProp
}


return obj, nil
}

func expandAppEngineApplicationId(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
return v, nil
}


func expandAppEngineApplicationLocationId(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
return v, nil
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package appengine

import (
"reflect"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package bigquery

import (
"reflect"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package bigtable

import (
"reflect"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package bigtable

import (
"reflect"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package cloudfunctions

import (
"reflect"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package cloudfunctions

import (
"reflect"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package composer

import (
"reflect"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package compute

import (
"reflect"
Expand Down Expand Up @@ -152,14 +152,14 @@ func GetCommitmentApiObject(d tpgresource.TerraformResourceData, config *transpo
} else if v, ok := d.GetOkExists("start_timestamp"); !tpgresource.IsEmptyValue(reflect.ValueOf(statusMessageProp)) && (ok || !reflect.DeepEqual(v, statusMessageProp)) {
obj["startTimestamp"] = startTimestampProp
}

endTimestampProp, err := expandCommitmentEndTimestamp(d.Get("end_timestamp"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("end_timestamp"); !tpgresource.IsEmptyValue(reflect.ValueOf(endTimestampProp)) && (ok || !reflect.DeepEqual(v, endTimestampProp)) {
obj["endTimestamp"] = endTimestampProp
}

selfLinkProp, err := expandCommitmentSelfLink(d.Get("self_link"), d, config)
if err != nil {
return nil, err
Expand Down Expand Up @@ -323,4 +323,4 @@ func expandCommitmentPlan(v interface{}, d tpgresource.TerraformResourceData, co

func expandCommitmentName(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
return v, nil
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package compute

import (
"reflect"
Expand Down Expand Up @@ -80,7 +80,7 @@ func GetComputeInstanceGroupApiObject(d tpgresource.TerraformResourceData, confi
}
url = url + zoneProp.(string)

obj["zone"] = url
obj["zone"] = url
}
selfLinkProp, err := expandComputeInstanceGroupSelfLink(d.Get("self_link"), d, config)
if err != nil {
Expand Down Expand Up @@ -152,4 +152,4 @@ func expandComputeInstanceGroupRegion(v interface{}, d tpgresource.TerraformReso

func expandComputeInstanceGroupSubnetwork(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
return v, nil
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package compute

import (
"reflect"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package compute

import (
"reflect"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// see https://github.com/GoogleCloudPlatform/magic-modules/pull/2485#issuecomment-545680059
// for the discussion.

package google
package container

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package dataflow

import (
"reflect"
Expand Down Expand Up @@ -302,4 +302,4 @@ func expandDataflowRuntimeUpdatableParams(v interface{}, d tpgresource.Terraform

func expandDataflowSatisfiesPzi(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
return v, nil
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package dataproc

import (
"reflect"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package firebase

import (
"reflect"
Expand Down Expand Up @@ -40,7 +40,7 @@ func GetFirebaseProjectCaiObject(d tpgresource.TerraformResourceData, config *tr

func GetFirebaseProjectApiObject(d tpgresource.TerraformResourceData, config *transport_tpg.Config) (map[string]interface{}, error) {
obj := make(map[string]interface{})

nameProp, err := expandFirebaseProjectName(d.Get("name"), d, config)
if err != nil {
return nil, err
Expand Down Expand Up @@ -102,4 +102,4 @@ func expandFirebaseProjectProjectId(v interface{}, d tpgresource.TerraformResour

func expandFirebaseProjectName(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
return v, nil
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package kms

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package kms

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package logging

import (
"reflect"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package logging

import (
"reflect"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package logging

import (
"reflect"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package logging

import (
"reflect"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package resourcemanager

import (
"time"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package resourcemanager

import (
"github.com/GoogleCloudPlatform/terraform-google-conversion/v5/tfplan2cai/converters/google/resources/cai"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package resourcemanager

import (
"fmt"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package resourcemanager

import (
"reflect"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package resourcemanager

import (
"github.com/GoogleCloudPlatform/terraform-google-conversion/v5/tfplan2cai/converters/google/resources/cai"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package resourcemanager

import (
"fmt"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package resourcemanager

import (
"reflect"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package resourcemanager

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package resourcemanager

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package resourcemanager

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package resourcemanager

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package resourcemanager

import (
"reflect"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// third_party/terraform/resources/resource_sql_database_instance.go.erb.go
//
// ----------------------------------------------------------------------------
package google
package sql

import (
"regexp"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package storage

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// third_party/terraform/resources/resource_storage_bucket.go
//
// ----------------------------------------------------------------------------
package google
package storage

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package google
package storage

import (
"fmt"
Expand Down

0 comments on commit 00910be

Please sign in to comment.