in tfplan2cai/converters/google/resources/services/cloudfunctions/cloudfunctions_cloud_function.go [41:147]
func GetCloudFunctionsCloudFunctionApiObject(d tpgresource.TerraformResourceData, config *transport_tpg.Config) (map[string]interface{}, error) {
obj := make(map[string]interface{})
nameProp, err := expandCloudFunctionsCloudFunctionName(d.Get("name"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("name"); !tpgresource.IsEmptyValue(reflect.ValueOf(nameProp)) && (ok || !reflect.DeepEqual(v, nameProp)) {
obj["name"] = nameProp
}
descriptionProp, err := expandCloudFunctionsCloudFunctionDescription(d.Get("description"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("description"); !tpgresource.IsEmptyValue(reflect.ValueOf(descriptionProp)) && (ok || !reflect.DeepEqual(v, descriptionProp)) {
obj["description"] = descriptionProp
}
entryPointProp, err := expandCloudFunctionsCloudFunctionEntryPoint(d.Get("entry_point"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("entry_point"); !tpgresource.IsEmptyValue(reflect.ValueOf(entryPointProp)) && (ok || !reflect.DeepEqual(v, entryPointProp)) {
obj["entryPoint"] = entryPointProp
}
runtimeProp, err := expandCloudFunctionsCloudFunctionRuntime(d.Get("runtime"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("runtime"); !tpgresource.IsEmptyValue(reflect.ValueOf(runtimeProp)) && (ok || !reflect.DeepEqual(v, runtimeProp)) {
obj["runtime"] = runtimeProp
}
timeoutProp, err := expandCloudFunctionsCloudFunctionTimeout(d.Get("timeout"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("timeout"); !tpgresource.IsEmptyValue(reflect.ValueOf(timeoutProp)) && (ok || !reflect.DeepEqual(v, timeoutProp)) {
obj["timeout"] = timeoutProp
}
availableMemoryMbProp, err := expandCloudFunctionsCloudFunctionAvailableMemoryMb(d.Get("available_memory_mb"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("available_memory_mb"); !tpgresource.IsEmptyValue(reflect.ValueOf(availableMemoryMbProp)) && (ok || !reflect.DeepEqual(v, availableMemoryMbProp)) {
obj["availableMemoryMb"] = availableMemoryMbProp
}
labelsProp, err := expandCloudFunctionsCloudFunctionLabels(d.Get("labels"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("labels"); !tpgresource.IsEmptyValue(reflect.ValueOf(labelsProp)) && (ok || !reflect.DeepEqual(v, labelsProp)) {
obj["labels"] = labelsProp
}
environmentVariablesProp, err := expandCloudFunctionsCloudFunctionEnvironmentVariables(d.Get("environment_variables"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("environment_variables"); !tpgresource.IsEmptyValue(reflect.ValueOf(environmentVariablesProp)) && (ok || !reflect.DeepEqual(v, environmentVariablesProp)) {
obj["environmentVariables"] = environmentVariablesProp
}
sourceArchiveUrlProp, err := expandCloudFunctionsCloudFunctionSourceArchiveUrl(d.Get("source_archive_url"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("source_archive_url"); !tpgresource.IsEmptyValue(reflect.ValueOf(sourceArchiveUrlProp)) && (ok || !reflect.DeepEqual(v, sourceArchiveUrlProp)) {
obj["sourceArchiveUrl"] = sourceArchiveUrlProp
}
sourceUploadUrlProp, err := expandCloudFunctionsCloudFunctionSourceUploadUrl(d.Get("source_upload_url"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("source_upload_url"); !tpgresource.IsEmptyValue(reflect.ValueOf(sourceUploadUrlProp)) && (ok || !reflect.DeepEqual(v, sourceUploadUrlProp)) {
obj["sourceUploadUrl"] = sourceUploadUrlProp
}
sourceRepositoryProp, err := expandCloudFunctionsCloudFunctionSourceRepository(d.Get("source_repository"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("source_repository"); !tpgresource.IsEmptyValue(reflect.ValueOf(sourceRepositoryProp)) && (ok || !reflect.DeepEqual(v, sourceRepositoryProp)) {
obj["sourceRepository"] = sourceRepositoryProp
}
httpsTriggerProp, err := expandCloudFunctionsCloudFunctionHttpsTriggerUrl(d.Get("https_trigger_url"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("https_trigger_url"); !tpgresource.IsEmptyValue(reflect.ValueOf(httpsTriggerProp)) && (ok || !reflect.DeepEqual(v, httpsTriggerProp)) {
obj["httpsTriggerUrl"] = httpsTriggerProp
}
eventTriggerProp, err := expandCloudFunctionsCloudFunctionEventTrigger(d.Get("event_trigger"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("event_trigger"); !tpgresource.IsEmptyValue(reflect.ValueOf(eventTriggerProp)) && (ok || !reflect.DeepEqual(v, eventTriggerProp)) {
obj["eventTrigger"] = eventTriggerProp
}
locationProp, err := expandCloudFunctionsCloudFunctionRegion(d.Get("region"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("region"); !tpgresource.IsEmptyValue(reflect.ValueOf(locationProp)) && (ok || !reflect.DeepEqual(v, locationProp)) {
obj["location"] = locationProp
}
trigger_httpProp, err := expandCloudFunctionsCloudFunctionTriggerHttp(d.Get("trigger_http"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("trigger_http"); !tpgresource.IsEmptyValue(reflect.ValueOf(trigger_httpProp)) && (ok || !reflect.DeepEqual(v, trigger_httpProp)) {
obj["trigger_http"] = trigger_httpProp
}
vpcConnectorProp, err := expandCloudFunctionsCloudFunctionvpcConnector(d.Get("vpc_connector"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("vpc_connector"); !tpgresource.IsEmptyValue(reflect.ValueOf(vpcConnectorProp)) && (ok || !reflect.DeepEqual(v, vpcConnectorProp)) {
obj["vpcConnector"] = vpcConnectorProp
}
vpcConnectorEgressSettingsProp, err := expandCloudFunctionsCloudFunctionvpcConnectorEgressSettings(d.Get("vpc_connector_egress_settings"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("vpc_connector_egress_settings"); !tpgresource.IsEmptyValue(reflect.ValueOf(vpcConnectorEgressSettingsProp)) && (ok || !reflect.DeepEqual(v, vpcConnectorEgressSettingsProp)) {
obj["vpcConnectorEgressSettings"] = vpcConnectorEgressSettingsProp
}
return obj, nil
}