@@ -46,15 +46,24 @@ var (
4646 }
4747
4848 ApigatewayApiRepresentation = map [string ]interface {}{
49- "compartment_id" : acctest.Representation {RepType : acctest .Required , Create : `${var.compartment_id}` },
50- "defined_tags" : acctest.Representation {RepType : acctest .Optional , Create : `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}` , Update : `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}` },
51- "display_name" : acctest.Representation {RepType : acctest .Optional , Create : `displayName` , Update : `displayName2` },
52- "freeform_tags" : acctest.Representation {RepType : acctest .Optional , Create : map [string ]string {"Department" : "Finance" }, Update : map [string ]string {"Department" : "Accounting" }},
49+ "compartment_id" : acctest.Representation {RepType : acctest .Required , Create : `${var.compartment_id}` },
50+ "defined_tags" : acctest.Representation {RepType : acctest .Optional , Create : `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}` , Update : `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}` },
51+ "display_name" : acctest.Representation {RepType : acctest .Optional , Create : `displayName` , Update : `displayName2` },
52+ "freeform_tags" : acctest.Representation {RepType : acctest .Optional , Create : map [string ]string {"Department" : "Finance" }, Update : map [string ]string {"Department" : "Accounting" }},
53+ "locks" : acctest.RepresentationGroup {RepType : acctest .Optional , Group : ApigatewayApiLocksRepresentation },
54+ "is_lock_override" : acctest.Representation {RepType : acctest .Optional , Create : `false` , Update : `true` },
5355 "content" : acctest.Representation {RepType : acctest .Optional ,
5456 Create : `{\"openapi\":\"3.0.0\",\"info\":{\"version\":\"1.0.0\",\"title\":\"test\",\"license\":{\"name\":\"MIT\"}},\"paths\":{\"/ping\":{\"get\":{\"responses\":{\"200\":{\"description\":\"OK\"}}}}}}` ,
5557 Update : `{\"openapi\":\"3.0.0\",\"info\":{\"version\":\"1.0.0\",\"title\":\"test\"}}` },
58+ "lifecycle" : acctest.RepresentationGroup {RepType : acctest .Required , Group : ignoreChangesApiRepresentation },
59+ }
60+ ApigatewayApiLocksRepresentation = map [string ]interface {}{
61+ "type" : acctest.Representation {RepType : acctest .Required , Create : `FULL` },
62+ "message" : acctest.Representation {RepType : acctest .Optional , Create : `message` },
63+ }
64+ ignoreChangesApiRepresentation = map [string ]interface {}{
65+ "ignore_changes" : acctest.Representation {RepType : acctest .Required , Create : []string {`defined_tags` , `locks` , `validation_results` }},
5666 }
57-
5867 ApigatewayApiResourceDependencies = DefinedTagsDependencies
5968)
6069
@@ -108,6 +117,9 @@ func TestApigatewayApiResource_basic(t *testing.T) {
108117 resource .TestCheckResourceAttr (resourceName , "display_name" , "displayName" ),
109118 resource .TestCheckResourceAttr (resourceName , "freeform_tags.%" , "1" ),
110119 resource .TestCheckResourceAttrSet (resourceName , "id" ),
120+ resource .TestCheckResourceAttr (resourceName , "locks.#" , "1" ),
121+ resource .TestCheckResourceAttr (resourceName , "locks.0.message" , "message" ),
122+ resource .TestCheckResourceAttr (resourceName , "locks.0.type" , "FULL" ),
111123
112124 func (s * terraform.State ) (err error ) {
113125 resId , err = acctest .FromInstanceState (s , resourceName , "id" )
@@ -189,6 +201,10 @@ func TestApigatewayApiResource_basic(t *testing.T) {
189201 resource .TestCheckResourceAttr (singularDatasourceName , "display_name" , "displayName2" ),
190202 resource .TestCheckResourceAttr (singularDatasourceName , "freeform_tags.%" , "1" ),
191203 resource .TestCheckResourceAttrSet (singularDatasourceName , "id" ),
204+ resource .TestCheckResourceAttr (singularDatasourceName , "locks.#" , "1" ),
205+ resource .TestCheckResourceAttr (singularDatasourceName , "locks.0.message" , "message" ),
206+ resource .TestCheckResourceAttrSet (singularDatasourceName , "locks.0.time_created" ),
207+ resource .TestCheckResourceAttr (singularDatasourceName , "locks.0.type" , "FULL" ),
192208 resource .TestCheckResourceAttrSet (singularDatasourceName , "specification_type" ),
193209 resource .TestCheckResourceAttrSet (singularDatasourceName , "state" ),
194210 resource .TestCheckResourceAttrSet (singularDatasourceName , "time_created" ),
@@ -201,7 +217,7 @@ func TestApigatewayApiResource_basic(t *testing.T) {
201217 ImportState : true ,
202218 ImportStateVerify : true ,
203219 ImportStateVerifyIgnore : []string {
204- "content" ,
220+ "content" , "is_lock_override" ,
205221 },
206222 ResourceName : resourceName ,
207223 },
@@ -273,6 +289,9 @@ func sweepApigatewayApiResource(compartment string) error {
273289
274290 deleteApiRequest .ApiId = & apiId
275291
292+ var overrideLock = true
293+ deleteApiRequest .IsLockOverride = & overrideLock
294+
276295 deleteApiRequest .RequestMetadata .RetryPolicy = tfresource .GetRetryPolicy (true , "apigateway" )
277296 _ , error := apiGatewayClient .DeleteApi (context .Background (), deleteApiRequest )
278297 if error != nil {
0 commit comments