deploymenttheory / terraform-provider-jamfpro

Jamf Pro Terraform Provider/Plugin written with the TF Provider SDK v2. Written in go
Mozilla Public License 2.0
24 stars 9 forks source link

chore: Set some default values for computerextensionattributes resource #205

Closed kenchan0130 closed 2 months ago

kenchan0130 commented 2 months ago

The attributes data_type and inventory_display in the computerextensionattributes have default values and are reflected in the terraform schema.

The following is the simplest example of checking default values.

$ curl -X 'POST' \
  'https://example.jamfcloud.com/JSSResource/computerextensionattributes/id/0' \
  -H 'accept: application/xml' \
  -H 'Authorization: Bearer token' \
  -H 'Content-type: application/xml' \
  -d '<computer_extension_attribute><name>test for terraform</name></computer_extension_attribute>'

<?xml version="1.0" encoding="UTF-8"?>
<computer_extension_attribute>
  <id>35</id>
</computer_extension_attribute>

$ curl -X 'GET' \
  'https://exmaple.jamfcloud.com/JSSResource/computerextensionattributes/id/35' \
  -H 'accept: application/xml' \
  -H 'Authorization: Bearer token'

<?xml version="1.0" encoding="UTF-8"?>
<computer_extension_attribute>
  <id>35</id>
  <name>test for terraform</name>
  <enabled>true</enabled>
  <description/>
  <data_type>String</data_type>
  <input_type>
    <type>Text Field</type>
  </input_type>
  <inventory_display/>
</computer_extension_attribute>