// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples

[source, js]
----
const response = await client.cluster.putComponentTemplate({
  name: "component_template1",
  template: {
    mappings: {
      properties: {
        "@timestamp": {
          type: "date",
        },
      },
    },
  },
});
console.log(response);

const response1 = await client.cluster.putComponentTemplate({
  name: "runtime_component_template",
  template: {
    mappings: {
      runtime: {
        day_of_week: {
          type: "keyword",
          script: {
            source:
              "emit(doc['@timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ENGLISH))",
          },
        },
      },
    },
  },
});
console.log(response1);
----
