104
105
106
107
108
109
110
111
112
113
114
115
116
|
# File 'lib/boxr/metadata.rb', line 104
def create_metadata_template(display_name, template_key: nil, fields: [], hidden: nil)
uri = "#{METADATA_TEMPLATES_URI}/schema"
schema = {
scope: 'enterprise',
displayName: display_name
}
schema[:templateKey] = template_key unless template_key.nil?
schema[:hidden] = hidden unless hidden.nil?
schema[:fields] = fields unless fields.empty?
metadata_template, = post(uri, schema, content_type: 'application/json')
metadata_template
end
|