Skip to content

Commit

Permalink
Autogenerate google_compute_url_map
Browse files Browse the repository at this point in the history
  • Loading branch information
rileykarson authored and modular-magician committed Oct 12, 2018
1 parent 40ebce2 commit 336bdad
Show file tree
Hide file tree
Showing 8 changed files with 934 additions and 523 deletions.
1 change: 1 addition & 0 deletions google/provider_compute_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@ var GeneratedComputeResourcesMap = map[string]*schema.Resource{
"google_compute_target_ssl_proxy": resourceComputeTargetSslProxy(),
"google_compute_target_tcp_proxy": resourceComputeTargetTcpProxy(),
"google_compute_vpn_gateway": resourceComputeVpnGateway(),
"google_compute_url_map": resourceComputeUrlMap(),
"google_compute_vpn_tunnel": resourceComputeVpnTunnel(),
}
18 changes: 16 additions & 2 deletions google/resource_compute_disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,12 @@ func resourceComputeDiskCreate(d *schema.ResourceData, meta interface{}) error {
config := meta.(*Config)

obj := make(map[string]interface{})
labelFingerprintProp, err := expandComputeDiskLabelFingerprint(d.Get("label_fingerprint"), d, config)
if err != nil {
return err
} else if v, ok := d.GetOkExists("label_fingerprint"); !isEmptyValue(reflect.ValueOf(labelFingerprintProp)) && (ok || !reflect.DeepEqual(v, labelFingerprintProp)) {
obj["labelFingerprint"] = labelFingerprintProp
}
descriptionProp, err := expandComputeDiskDescription(d.Get("description"), d, config)
if err != nil {
return err
Expand Down Expand Up @@ -626,8 +632,12 @@ func resourceComputeDiskUpdate(d *schema.ResourceData, meta interface{}) error {

if d.HasChange("label_fingerprint") || d.HasChange("labels") {
obj := make(map[string]interface{})
labelFingerprintProp := d.Get("label_fingerprint")
obj["labelFingerprint"] = labelFingerprintProp
labelFingerprintProp, err := expandComputeDiskLabelFingerprint(d.Get("label_fingerprint"), d, config)
if err != nil {
return err
} else if v, ok := d.GetOkExists("label_fingerprint"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, labelFingerprintProp)) {
obj["labelFingerprint"] = labelFingerprintProp
}
labelsProp, err := expandComputeDiskLabels(d.Get("labels"), d, config)
if err != nil {
return err
Expand Down Expand Up @@ -973,6 +983,10 @@ func flattenComputeDiskSourceSnapshotId(v interface{}) interface{} {
return v
}

func expandComputeDiskLabelFingerprint(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
return v, nil
}

func expandComputeDiskDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
return v, nil
}
Expand Down
18 changes: 16 additions & 2 deletions google/resource_compute_region_disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ func resourceComputeRegionDiskCreate(d *schema.ResourceData, meta interface{}) e
config := meta.(*Config)

obj := make(map[string]interface{})
labelFingerprintProp, err := expandComputeRegionDiskLabelFingerprint(d.Get("label_fingerprint"), d, config)
if err != nil {
return err
} else if v, ok := d.GetOkExists("label_fingerprint"); !isEmptyValue(reflect.ValueOf(labelFingerprintProp)) && (ok || !reflect.DeepEqual(v, labelFingerprintProp)) {
obj["labelFingerprint"] = labelFingerprintProp
}
descriptionProp, err := expandComputeRegionDiskDescription(d.Get("description"), d, config)
if err != nil {
return err
Expand Down Expand Up @@ -379,8 +385,12 @@ func resourceComputeRegionDiskUpdate(d *schema.ResourceData, meta interface{}) e

if d.HasChange("label_fingerprint") || d.HasChange("labels") {
obj := make(map[string]interface{})
labelFingerprintProp := d.Get("label_fingerprint")
obj["labelFingerprint"] = labelFingerprintProp
labelFingerprintProp, err := expandComputeRegionDiskLabelFingerprint(d.Get("label_fingerprint"), d, config)
if err != nil {
return err
} else if v, ok := d.GetOkExists("label_fingerprint"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, labelFingerprintProp)) {
obj["labelFingerprint"] = labelFingerprintProp
}
labelsProp, err := expandComputeRegionDiskLabels(d.Get("labels"), d, config)
if err != nil {
return err
Expand Down Expand Up @@ -679,6 +689,10 @@ func flattenComputeRegionDiskSourceSnapshotId(v interface{}) interface{} {
return v
}

func expandComputeRegionDiskLabelFingerprint(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
return v, nil
}

func expandComputeRegionDiskDescription(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
return v, nil
}
Expand Down
18 changes: 16 additions & 2 deletions google/resource_compute_subnetwork.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,12 @@ func resourceComputeSubnetworkCreate(d *schema.ResourceData, meta interface{}) e
} else if v, ok := d.GetOkExists("enable_flow_logs"); ok || !reflect.DeepEqual(v, enableFlowLogsProp) {
obj["enableFlowLogs"] = enableFlowLogsProp
}
fingerprintProp, err := expandComputeSubnetworkFingerprint(d.Get("fingerprint"), d, config)
if err != nil {
return err
} else if v, ok := d.GetOkExists("fingerprint"); !isEmptyValue(reflect.ValueOf(fingerprintProp)) && (ok || !reflect.DeepEqual(v, fingerprintProp)) {
obj["fingerprint"] = fingerprintProp
}
secondaryIpRangesProp, err := expandComputeSubnetworkSecondaryIpRange(d.Get("secondary_ip_range"), d, config)
if err != nil {
return err
Expand Down Expand Up @@ -407,8 +413,12 @@ func resourceComputeSubnetworkUpdate(d *schema.ResourceData, meta interface{}) e
} else if v, ok := d.GetOkExists("enable_flow_logs"); ok || !reflect.DeepEqual(v, enableFlowLogsProp) {
obj["enableFlowLogs"] = enableFlowLogsProp
}
fingerprintProp := d.Get("fingerprint")
obj["fingerprint"] = fingerprintProp
fingerprintProp, err := expandComputeSubnetworkFingerprint(d.Get("fingerprint"), d, config)
if err != nil {
return err
} else if v, ok := d.GetOkExists("fingerprint"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, fingerprintProp)) {
obj["fingerprint"] = fingerprintProp
}
secondaryIpRangesProp, err := expandComputeSubnetworkSecondaryIpRange(d.Get("secondary_ip_range"), d, config)
if err != nil {
return err
Expand Down Expand Up @@ -635,6 +645,10 @@ func expandComputeSubnetworkEnableFlowLogs(v interface{}, d *schema.ResourceData
return v, nil
}

func expandComputeSubnetworkFingerprint(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
return v, nil
}

func expandComputeSubnetworkSecondaryIpRange(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
req := make([]interface{}, 0, len(l))
Expand Down
Loading

0 comments on commit 336bdad

Please sign in to comment.