protected bool PutComponentTemplate()

in src/Elastic.Ingest.Elasticsearch/ElasticsearchChannelBase.Bootstrap.cs [137:149]


	protected bool PutComponentTemplate(BootstrapMethod bootstrapMethod, string name, string body)
	{
		var putComponentTemplate = Options.Transport.Request<PutComponentTemplateResponse>
			(HttpMethod.PUT, $"_component_template/{name}", PostData.String(body));
		if (putComponentTemplate.ApiCallDetails.HasSuccessfulStatusCode) return true;

		return bootstrapMethod == BootstrapMethod.Silent
			? false
			: throw new Exception(
				$"Failure to create component template `{name}` for {TemplateWildcard}: {putComponentTemplate}",
				putComponentTemplate.ApiCallDetails.OriginalException
			);
	}