@@ -14,6 +14,8 @@ type Cluster struct {
1414 InseredAt types.String `tfsdk:"inserted_at"`
1515 Name types.String `tfsdk:"name"`
1616 Handle types.String `tfsdk:"handle"`
17+ Version types.String `tfsdk:"version"`
18+ ProviderId types.String `tfsdk:"provider_id"`
1719 Cloud types.String `tfsdk:"cloud"`
1820 CloudSettings ClusterCloudSettings `tfsdk:"cloud_settings"`
1921 Protect types.Bool `tfsdk:"protect"`
@@ -120,24 +122,39 @@ func (c *Cluster) CreateAttributes() console.ClusterAttributes {
120122 return console.ClusterAttributes {
121123 Name : c .Name .ValueString (),
122124 Handle : c .Handle .ValueStringPointer (),
123- Protect : c .Protect .ValueBoolPointer (),
125+ Version : c .Version .ValueStringPointer (),
126+ ProviderID : c .ProviderId .ValueStringPointer (),
124127 CloudSettings : c .CloudSettingsAttributes (),
125128 Tags : c .TagsAttribute (),
129+ Protect : c .Protect .ValueBoolPointer (),
126130 }
127131}
128132
129133func (c * Cluster ) UpdateAttributes () console.ClusterUpdateAttributes {
130134 return console.ClusterUpdateAttributes {
131135 Handle : c .Handle .ValueStringPointer (),
136+ Version : c .Version .ValueStringPointer (),
132137 Protect : c .Protect .ValueBoolPointer (),
133138 }
134139}
135140
141+ func (c * Cluster ) TagsFrom (tags []* console.ClusterTags ) {
142+ elements := map [string ]attr.Value {}
143+ for _ , v := range tags {
144+ elements [v .Name ] = types .StringValue (v .Value )
145+ }
146+
147+ tagsValue , _ := types .MapValue (types .StringType , elements ) // TODO: Skipped diagnostics.
148+ c .Tags = tagsValue
149+ }
150+
136151func (c * Cluster ) From (cl * console.ClusterFragment ) {
137152 c .Id = types .StringValue (cl .ID )
138153 c .InseredAt = types .StringPointerValue (cl .InsertedAt )
139154 c .Name = types .StringValue (cl .Name )
140155 c .Handle = types .StringPointerValue (cl .Handle )
156+ c .Version = types .StringPointerValue (cl .Version )
157+ c .ProviderId = types .StringValue (cl .Provider .ID )
141158 c .Protect = types .BoolPointerValue (cl .Protect )
142159 c .TagsFrom (cl .Tags )
143160}
@@ -147,16 +164,8 @@ func (c *Cluster) FromCreate(cc *console.CreateCluster) {
147164 c .InseredAt = types .StringPointerValue (cc .CreateCluster .InsertedAt )
148165 c .Name = types .StringValue (cc .CreateCluster .Name )
149166 c .Handle = types .StringPointerValue (cc .CreateCluster .Handle )
167+ c .Version = types .StringPointerValue (cc .CreateCluster .Version )
168+ c .ProviderId = types .StringValue (cc .CreateCluster .Provider .ID )
150169 c .Protect = types .BoolPointerValue (cc .CreateCluster .Protect )
151170 c .TagsFrom (cc .CreateCluster .Tags )
152171}
153-
154- func (c * Cluster ) TagsFrom (tags []* console.ClusterTags ) {
155- elements := map [string ]attr.Value {}
156- for _ , v := range tags {
157- elements [v .Name ] = types .StringValue (v .Value )
158- }
159-
160- tagsValue , _ := types .MapValue (types .StringType , elements ) // TODO: Skipped diagnostics.
161- c .Tags = tagsValue
162- }
0 commit comments