@@ -231,3 +231,162 @@ func examplecloudZoneRecord() testprovider.Resource {
231231 },
232232 }
233233}
234+
235+ func examplecloudResourceWithEveryIdentitySchemaType () testprovider.Resource {
236+ return testprovider.Resource {
237+ CreateResponse : & resource.CreateResponse {
238+ NewState : tftypes .NewValue (
239+ tftypes.Object {
240+ AttributeTypes : map [string ]tftypes.Type {
241+ "hostname" : tftypes .String ,
242+ "cabinet" : tftypes .String ,
243+ "unit" : tftypes .Number ,
244+ "active" : tftypes .Bool ,
245+ "tags" : tftypes.List {ElementType : tftypes .String },
246+ },
247+ },
248+ map [string ]tftypes.Value {
249+ "hostname" : tftypes .NewValue (tftypes .String , "mail.example.net" ),
250+ "cabinet" : tftypes .NewValue (tftypes .String , "A1" ),
251+ "unit" : tftypes .NewValue (tftypes .Number , 14 ),
252+ "active" : tftypes .NewValue (tftypes .Bool , true ),
253+ "tags" : tftypes .NewValue (tftypes.List {ElementType : tftypes .String }, []tftypes.Value {tftypes .NewValue (tftypes .String , "storage" ), tftypes .NewValue (tftypes .String , "fast" )}),
254+ },
255+ ),
256+ NewIdentity : teststep .Pointer (tftypes .NewValue (
257+ tftypes.Object {
258+ AttributeTypes : map [string ]tftypes.Type {
259+ "cabinet" : tftypes .String ,
260+ "unit" : tftypes .Number ,
261+ "active" : tftypes .Bool ,
262+ "tags" : tftypes.List {ElementType : tftypes .String },
263+ },
264+ },
265+ map [string ]tftypes.Value {
266+ "cabinet" : tftypes .NewValue (tftypes .String , "A1" ),
267+ "unit" : tftypes .NewValue (tftypes .Number , 14 ),
268+ "active" : tftypes .NewValue (tftypes .Bool , true ),
269+ "tags" : tftypes .NewValue (
270+ tftypes.List {ElementType : tftypes .String }, []tftypes.Value {
271+ tftypes .NewValue (tftypes .String , "storage" ),
272+ tftypes .NewValue (tftypes .String , "fast" ),
273+ }),
274+ },
275+ )),
276+ },
277+ ReadResponse : & resource.ReadResponse {
278+ NewState : tftypes .NewValue (
279+ tftypes.Object {
280+ AttributeTypes : map [string ]tftypes.Type {
281+ "hostname" : tftypes .String ,
282+ "cabinet" : tftypes .String ,
283+ "unit" : tftypes .Number ,
284+ "active" : tftypes .Bool ,
285+ "tags" : tftypes.List {ElementType : tftypes .String },
286+ },
287+ },
288+ map [string ]tftypes.Value {
289+ "hostname" : tftypes .NewValue (tftypes .String , "mail.example.net" ),
290+ "cabinet" : tftypes .NewValue (tftypes .String , "A1" ),
291+ "unit" : tftypes .NewValue (tftypes .Number , 14 ),
292+ "active" : tftypes .NewValue (tftypes .Bool , true ),
293+ "tags" : tftypes .NewValue (tftypes.List {ElementType : tftypes .String }, []tftypes.Value {tftypes .NewValue (tftypes .String , "storage" ), tftypes .NewValue (tftypes .String , "fast" )}),
294+ },
295+ ),
296+ NewIdentity : teststep .Pointer (tftypes .NewValue (
297+ tftypes.Object {
298+ AttributeTypes : map [string ]tftypes.Type {
299+ "cabinet" : tftypes .String ,
300+ "unit" : tftypes .Number ,
301+ "active" : tftypes .Bool ,
302+ "tags" : tftypes.List {ElementType : tftypes .String },
303+ },
304+ },
305+ map [string ]tftypes.Value {
306+ "cabinet" : tftypes .NewValue (tftypes .String , "A1" ),
307+ "unit" : tftypes .NewValue (tftypes .Number , 14 ),
308+ "active" : tftypes .NewValue (tftypes .Bool , true ),
309+ "tags" : tftypes .NewValue (tftypes.List {ElementType : tftypes .String }, []tftypes.Value {tftypes .NewValue (tftypes .String , "storage" ), tftypes .NewValue (tftypes .String , "fast" )}),
310+ },
311+ )),
312+ },
313+ ImportStateResponse : & resource.ImportStateResponse {
314+ State : tftypes .NewValue (
315+ tftypes.Object {
316+ AttributeTypes : map [string ]tftypes.Type {
317+ "hostname" : tftypes .String ,
318+ "cabinet" : tftypes .String ,
319+ "unit" : tftypes .Number ,
320+ "active" : tftypes .Bool ,
321+ "tags" : tftypes.List {ElementType : tftypes .String },
322+ },
323+ },
324+ map [string ]tftypes.Value {
325+ "hostname" : tftypes .NewValue (tftypes .String , "mail.example.net" ),
326+ "cabinet" : tftypes .NewValue (tftypes .String , "A1" ),
327+ "unit" : tftypes .NewValue (tftypes .Number , 14 ),
328+ "active" : tftypes .NewValue (tftypes .Bool , true ),
329+ "tags" : tftypes .NewValue (tftypes.List {ElementType : tftypes .String }, []tftypes.Value {tftypes .NewValue (tftypes .String , "storage" ), tftypes .NewValue (tftypes .String , "fast" )}),
330+ },
331+ ),
332+ Identity : teststep .Pointer (tftypes .NewValue (
333+ tftypes.Object {
334+ AttributeTypes : map [string ]tftypes.Type {
335+ "cabinet" : tftypes .String ,
336+ "unit" : tftypes .Number ,
337+ "active" : tftypes .Bool ,
338+ "tags" : tftypes.List {ElementType : tftypes .String },
339+ },
340+ },
341+ map [string ]tftypes.Value {
342+ "cabinet" : tftypes .NewValue (tftypes .String , "A1" ),
343+ "unit" : tftypes .NewValue (tftypes .Number , 14 ),
344+ "active" : tftypes .NewValue (tftypes .Bool , true ),
345+ "tags" : tftypes .NewValue (tftypes.List {ElementType : tftypes .String }, []tftypes.Value {tftypes .NewValue (tftypes .String , "storage" ), tftypes .NewValue (tftypes .String , "fast" )}),
346+ },
347+ )),
348+ },
349+ SchemaResponse : & resource.SchemaResponse {
350+ Schema : & tfprotov6.Schema {
351+ Block : & tfprotov6.SchemaBlock {
352+ Attributes : []* tfprotov6.SchemaAttribute {
353+ ComputedStringAttribute ("hostname" ),
354+ RequiredStringAttribute ("cabinet" ),
355+ RequiredNumberAttribute ("unit" ),
356+ RequiredBoolAttribute ("active" ),
357+ RequiredListAttribute ("tags" , tftypes .String ),
358+ },
359+ },
360+ },
361+ },
362+ IdentitySchemaResponse : & resource.IdentitySchemaResponse {
363+ Schema : & tfprotov6.ResourceIdentitySchema {
364+ Version : 1 ,
365+ IdentityAttributes : []* tfprotov6.ResourceIdentitySchemaAttribute {
366+ {
367+ Name : "cabinet" ,
368+ Type : tftypes .String ,
369+ RequiredForImport : true ,
370+ },
371+ {
372+ Name : "unit" ,
373+ Type : tftypes .Number ,
374+ OptionalForImport : true ,
375+ },
376+ {
377+ Name : "active" ,
378+ Type : tftypes .Bool ,
379+ OptionalForImport : true ,
380+ },
381+ {
382+ Name : "tags" ,
383+ Type : tftypes.List {
384+ ElementType : tftypes .String ,
385+ },
386+ OptionalForImport : true ,
387+ },
388+ },
389+ },
390+ },
391+ }
392+ }
0 commit comments