Skip to content

Commit

Permalink
Auto-generated API code
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine committed Mar 27, 2023
1 parent f14efc5 commit b65941b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 30 deletions.
29 changes: 14 additions & 15 deletions elasticsearch/_async/client/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,20 +572,18 @@ async def put_component_template(
*,
name: str,
template: t.Mapping[str, t.Any],
aliases: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
allow_auto_create: t.Optional[bool] = None,
create: t.Optional[bool] = None,
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
] = None,
human: t.Optional[bool] = None,
mappings: t.Optional[t.Mapping[str, t.Any]] = None,
master_timeout: t.Optional[
t.Union["t.Literal[-1]", "t.Literal[0]", str]
] = None,
meta: t.Optional[t.Mapping[str, t.Any]] = None,
pretty: t.Optional[bool] = None,
settings: t.Optional[t.Mapping[str, t.Any]] = None,
version: t.Optional[int] = None,
) -> ObjectApiResponse[t.Any]:
"""
Expand All @@ -594,15 +592,20 @@ async def put_component_template(
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.7/indices-component-template.html>`_
:param name: The name of the template
:param template:
:param aliases:
:param template: The template to be applied which includes mappings, settings,
or aliases configuration.
:param allow_auto_create: This setting overrides the value of the `action.auto_create_index`
cluster setting. If set to `true` in a template, then indices can be automatically
created using that template even if auto-creation of indices is disabled
via `actions.auto_create_index`. If set to `false` then data streams matching
the template must always be explicitly created.
:param create: Whether the index template should only be added if new or can
also replace an existing one
:param mappings:
:param master_timeout: Specify timeout for connection to master
:param meta:
:param settings:
:param version:
:param meta: Optional user metadata about the component template. May have any
contents. This map is not automatically generated by Elasticsearch.
:param version: Version number used to manage component templates externally.
This number isn't automatically generated or incremented by Elasticsearch.
"""
if name in SKIP_IN_PATH:
raise ValueError("Empty value passed for parameter 'name'")
Expand All @@ -613,8 +616,8 @@ async def put_component_template(
__query: t.Dict[str, t.Any] = {}
if template is not None:
__body["template"] = template
if aliases is not None:
__body["aliases"] = aliases
if allow_auto_create is not None:
__body["allow_auto_create"] = allow_auto_create
if create is not None:
__query["create"] = create
if error_trace is not None:
Expand All @@ -623,16 +626,12 @@ async def put_component_template(
__query["filter_path"] = filter_path
if human is not None:
__query["human"] = human
if mappings is not None:
__body["mappings"] = mappings
if master_timeout is not None:
__query["master_timeout"] = master_timeout
if meta is not None:
__body["_meta"] = meta
if pretty is not None:
__query["pretty"] = pretty
if settings is not None:
__body["settings"] = settings
if version is not None:
__body["version"] = version
__headers = {"accept": "application/json", "content-type": "application/json"}
Expand Down
29 changes: 14 additions & 15 deletions elasticsearch/_sync/client/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,20 +572,18 @@ def put_component_template(
*,
name: str,
template: t.Mapping[str, t.Any],
aliases: t.Optional[t.Mapping[str, t.Mapping[str, t.Any]]] = None,
allow_auto_create: t.Optional[bool] = None,
create: t.Optional[bool] = None,
error_trace: t.Optional[bool] = None,
filter_path: t.Optional[
t.Union[str, t.Union[t.List[str], t.Tuple[str, ...]]]
] = None,
human: t.Optional[bool] = None,
mappings: t.Optional[t.Mapping[str, t.Any]] = None,
master_timeout: t.Optional[
t.Union["t.Literal[-1]", "t.Literal[0]", str]
] = None,
meta: t.Optional[t.Mapping[str, t.Any]] = None,
pretty: t.Optional[bool] = None,
settings: t.Optional[t.Mapping[str, t.Any]] = None,
version: t.Optional[int] = None,
) -> ObjectApiResponse[t.Any]:
"""
Expand All @@ -594,15 +592,20 @@ def put_component_template(
`<https://www.elastic.co/guide/en/elasticsearch/reference/8.7/indices-component-template.html>`_
:param name: The name of the template
:param template:
:param aliases:
:param template: The template to be applied which includes mappings, settings,
or aliases configuration.
:param allow_auto_create: This setting overrides the value of the `action.auto_create_index`
cluster setting. If set to `true` in a template, then indices can be automatically
created using that template even if auto-creation of indices is disabled
via `actions.auto_create_index`. If set to `false` then data streams matching
the template must always be explicitly created.
:param create: Whether the index template should only be added if new or can
also replace an existing one
:param mappings:
:param master_timeout: Specify timeout for connection to master
:param meta:
:param settings:
:param version:
:param meta: Optional user metadata about the component template. May have any
contents. This map is not automatically generated by Elasticsearch.
:param version: Version number used to manage component templates externally.
This number isn't automatically generated or incremented by Elasticsearch.
"""
if name in SKIP_IN_PATH:
raise ValueError("Empty value passed for parameter 'name'")
Expand All @@ -613,8 +616,8 @@ def put_component_template(
__query: t.Dict[str, t.Any] = {}
if template is not None:
__body["template"] = template
if aliases is not None:
__body["aliases"] = aliases
if allow_auto_create is not None:
__body["allow_auto_create"] = allow_auto_create
if create is not None:
__query["create"] = create
if error_trace is not None:
Expand All @@ -623,16 +626,12 @@ def put_component_template(
__query["filter_path"] = filter_path
if human is not None:
__query["human"] = human
if mappings is not None:
__body["mappings"] = mappings
if master_timeout is not None:
__query["master_timeout"] = master_timeout
if meta is not None:
__body["_meta"] = meta
if pretty is not None:
__query["pretty"] = pretty
if settings is not None:
__body["settings"] = settings
if version is not None:
__body["version"] = version
__headers = {"accept": "application/json", "content-type": "application/json"}
Expand Down

0 comments on commit b65941b

Please sign in to comment.