-
Notifications
You must be signed in to change notification settings - Fork 0
/
governance_group_model.go
61 lines (48 loc) · 1.76 KB
/
governance_group_model.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
package governancegroup
import (
"context"
"github.com/davidsonjon/golang-sdk/beta"
"github.com/hashicorp/terraform-plugin-framework/attr"
"github.com/hashicorp/terraform-plugin-framework/types"
"github.com/hashicorp/terraform-plugin-framework/types/basetypes"
)
// WorkgroupDto struct for WorkgroupDto
type WorkgroupDto struct {
// ID of the object to which this reference applies
Id types.String `tfsdk:"id"`
// Name of the Governance Group
Name types.String `tfsdk:"name"`
// Description of the Governance Group
Description types.String `tfsdk:"description"`
// Number of members in the Governance Group.
MemberCount types.Int64 `tfsdk:"member_count"`
// Number of connections in the Governance Group.
ConnectionCount types.Int64 `tfsdk:"connection_count"`
// AdditionalProperties map[string]interface{}
Owner types.Object `tfsdk:"owner"`
Membership types.Set `tfsdk:"membership"`
}
type BaseReferenceDto1 struct {
Type types.String `tfsdk:"type"`
// ID of the object to which this reference applies
Id types.String `tfsdk:"id"`
// Human-readable display name of the object to which this reference applies
Name types.String `tfsdk:"name"`
// AdditionalProperties map[string]interface{}
}
var baseReferenceDto1Types = map[string]attr.Type{
"name": types.StringType,
"id": types.StringType,
"type": types.StringType,
}
func convertWorkgroupBeta(ctx context.Context, wg *WorkgroupDto) *beta.WorkgroupDto {
betaWg := beta.WorkgroupDto{}
betaWg.Name = wg.Name.ValueStringPointer()
betaWg.Description = wg.Description.ValueStringPointer()
wgOwner := BaseReferenceDto1{}
wg.Owner.As(ctx, &wgOwner, basetypes.ObjectAsOptions{})
betaWgOwner := beta.OwnerDto{}
betaWgOwner.Id = wgOwner.Id.ValueStringPointer()
betaWg.Owner = &betaWgOwner
return &betaWg
}