/
apigee_envgroup_attachment.go
63 lines (55 loc) · 2.15 KB
/
apigee_envgroup_attachment.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// ----------------------------------------------------------------------------
//
// *** 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 google
import "reflect"
const ApigeeEnvgroupAttachmentAssetType string = "apigee.googleapis.com/EnvgroupAttachment"
func resourceConverterApigeeEnvgroupAttachment() ResourceConverter {
return ResourceConverter{
AssetType: ApigeeEnvgroupAttachmentAssetType,
Convert: GetApigeeEnvgroupAttachmentCaiObject,
}
}
func GetApigeeEnvgroupAttachmentCaiObject(d TerraformResourceData, config *Config) ([]Asset, error) {
name, err := assetName(d, config, "//apigee.googleapis.com/{{envgroup_id}}/attachments/{{name}}")
if err != nil {
return []Asset{}, err
}
if obj, err := GetApigeeEnvgroupAttachmentApiObject(d, config); err == nil {
return []Asset{{
Name: name,
Type: ApigeeEnvgroupAttachmentAssetType,
Resource: &AssetResource{
Version: "v1",
DiscoveryDocumentURI: "https://www.googleapis.com/discovery/v1/apis/apigee/v1/rest",
DiscoveryName: "EnvgroupAttachment",
Data: obj,
},
}}, nil
} else {
return []Asset{}, err
}
}
func GetApigeeEnvgroupAttachmentApiObject(d TerraformResourceData, config *Config) (map[string]interface{}, error) {
obj := make(map[string]interface{})
environmentProp, err := expandApigeeEnvgroupAttachmentEnvironment(d.Get("environment"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("environment"); !isEmptyValue(reflect.ValueOf(environmentProp)) && (ok || !reflect.DeepEqual(v, environmentProp)) {
obj["environment"] = environmentProp
}
return obj, nil
}
func expandApigeeEnvgroupAttachmentEnvironment(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
return v, nil
}