Class DefaultResourceRouteDelegate.Builder<R>
java.lang.Object
com.inductiveautomation.ignition.gateway.config.DefaultResourceRouteDelegate.Builder<R>
- Enclosing class:
- DefaultResourceRouteDelegate<R>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddSearchField(String fieldName) Adds a field to the searchable fields set.build()buildCapabilitySet(@NotNull Consumer<Set<ResourceRouteDelegate.ApiCapability>> capabilitySetBuilder) Builds aResourceActionSetusing the provided builder.codec(JsonResourceCodec<R> codec) Sets theJsonResourceCodecfor the route delegate.codec(UnaryOperator<JsonResourceCodec<R>> codecWrapper) Wraps theJsonResourceCodecfor the route delegate.configSchema(com.inductiveautomation.ignition.common.gson.JsonObject configSchema) Supply a JSON schema for the configuration of this resource type.configSchema(Class<?> configClass) Provide the JSON schema for the configuration by reflectively examining the record class.configSchema(Consumer<SchemaUtil.Builder> builderConsumer) Build a JSON schema for the configuration of this resource type.openApiGroupName(String openApiGroupName) openApiTagName(String openApiTagName) readPermission(PermissionType readPermission) Sets the permission type required to read this resource type.setSearchFields(Set<String> searchFields) Calling this method will set (and overwrite) the searchable fields set.supportsExtraDataFiles(boolean supportsExtraDataFiles) Indicates whether this resource expects any "extra" data files beyond "config.json".withCapabilitySet(@NotNull Set<ResourceRouteDelegate.ApiCapability> capabilities) Provide a constructedResourceActionSetdefining the capabilities this resource exposes to the REST API.writePermission(PermissionType writePermission) Sets the permission type required to write to this resource type.
-
Constructor Details
-
Builder
-
-
Method Details
-
codec
Sets theJsonResourceCodecfor the route delegate. This is optional, and only should be used if you have a custom codec that you want to use for encoding and decoding resources via REST API. Must not be null. -
codec
public DefaultResourceRouteDelegate.Builder<R> codec(UnaryOperator<JsonResourceCodec<R>> codecWrapper) Wraps theJsonResourceCodecfor the route delegate. This is optional, and only should be used if you have a custom codec that you want to use for encoding and decoding resources via REST API. Must not be null.- Parameters:
codecWrapper- the codec wrapperFunctionwhose input is the currently installed codec and the output should be the wrapped codec- Returns:
- this
DefaultResourceRouteDelegate.Builderinstance
-
configSchema
public DefaultResourceRouteDelegate.Builder<R> configSchema(com.inductiveautomation.ignition.common.gson.JsonObject configSchema) Supply a JSON schema for the configuration of this resource type. Use this overload if you have built the schema already. -
configSchema
public DefaultResourceRouteDelegate.Builder<R> configSchema(Consumer<SchemaUtil.Builder> builderConsumer) Build a JSON schema for the configuration of this resource type. Use this overload if you want to build the schema programmatically. -
configSchema
Provide the JSON schema for the configuration by reflectively examining the record class. This is useful when the configuration is a record type. -
supportsExtraDataFiles
public DefaultResourceRouteDelegate.Builder<R> supportsExtraDataFiles(boolean supportsExtraDataFiles) Indicates whether this resource expects any "extra" data files beyond "config.json". Default is false. -
withCapabilitySet
public DefaultResourceRouteDelegate.Builder<R> withCapabilitySet(@NotNull @NotNull Set<ResourceRouteDelegate.ApiCapability> capabilities) Provide a constructedResourceActionSetdefining the capabilities this resource exposes to the REST API.- Throws:
IllegalStateException- ifbuildCapabilitySet(Consumer)was already called.- See Also:
-
buildCapabilitySet
public DefaultResourceRouteDelegate.Builder<R> buildCapabilitySet(@NotNull @NotNull Consumer<Set<ResourceRouteDelegate.ApiCapability>> capabilitySetBuilder) Builds aResourceActionSetusing the provided builder. This allows you to build a custom set of capabilities this resource exposes to the REST API. This set will be in an initial state depending on the value ofsupportsExtraDataFiles(boolean)- either indicating default capabilities or all capabilities. -
openApiGroupName
-
openApiTagName
-
addField
-
addSearchField
Adds a field to the searchable fields set. Note that "name", "description", "enabled", and "mode" are automatically added. Also, any field added throughaddField(String, Function)will be automatically added as a searchable field. To opt-out of this automatic behavior, callsetSearchFields(Set)instead. -
setSearchFields
Calling this method will set (and overwrite) the searchable fields set. By calling this method, you can gain complete control over the set of searchable fields - "name", "description", "enabled", "mode", and any fields added through addField will not be automatically added. -
readPermission
Sets the permission type required to read this resource type. Default is READ. -
writePermission
Sets the permission type required to write to this resource type. Default is WRITE. -
build
-