diff --git a/.codegen.json b/.codegen.json index 77fcaa7aa..56a55aeb8 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "f97463c", "specHash": "b7abe0d", "version": "5.2.0" } +{ "engineHash": "b5860f1", "specHash": "1e0848d", "version": "5.2.0" } diff --git a/docs/sdkgen/README.md b/docs/sdkgen/README.md index ebdc4844d..308c5699b 100644 --- a/docs/sdkgen/README.md +++ b/docs/sdkgen/README.md @@ -49,6 +49,7 @@ the SDK are available by topic: * [Listcollaborations](listcollaborations.md) * [Memberships](memberships.md) * [Metadatacascadepolicies](metadatacascadepolicies.md) +* [Metadatataxonomies](metadatataxonomies.md) * [Metadatatemplates](metadatatemplates.md) * [Recentitems](recentitems.md) * [Retentionpolicies](retentionpolicies.md) diff --git a/docs/sdkgen/filemetadata.md b/docs/sdkgen/filemetadata.md index 4a55f9c32..2ccd505b5 100644 --- a/docs/sdkgen/filemetadata.md +++ b/docs/sdkgen/filemetadata.md @@ -25,6 +25,8 @@ client.getFileMetadata().getFileMetadata(file.getId()) - fileId `String` - The unique identifier that represents a file. The ID for any file can be determined by visiting a file in the web application and copying the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the `file_id` is `123`. Example: "12345" +- queryParams `GetFileMetadataQueryParams` + - Query parameters of getFileMetadata method - headers `GetFileMetadataHeaders` - Headers of getFileMetadata method @@ -62,6 +64,8 @@ client.getFileMetadata().getFileMetadataById(file.getId(), GetFileMetadataByIdSc - The scope of the metadata template. Example: "global" - templateKey `String` - The name of the metadata template. Example: "properties" +- queryParams `GetFileMetadataByIdQueryParams` + - Query parameters of getFileMetadataById method - headers `GetFileMetadataByIdHeaders` - Headers of getFileMetadataById method diff --git a/docs/sdkgen/foldermetadata.md b/docs/sdkgen/foldermetadata.md index 307d252f7..02bb0146e 100644 --- a/docs/sdkgen/foldermetadata.md +++ b/docs/sdkgen/foldermetadata.md @@ -26,6 +26,8 @@ client.getFolderMetadata().getFolderMetadata(folder.getId()) - folderId `String` - The unique identifier that represent a folder. The ID for any folder can be determined by visiting this folder in the web application and copying the ID from the URL. For example, for the URL `https://*.app.box.com/folder/123` the `folder_id` is `123`. The root folder of a Box account is always represented by the ID `0`. Example: "12345" +- queryParams `GetFolderMetadataQueryParams` + - Query parameters of getFolderMetadata method - headers `GetFolderMetadataHeaders` - Headers of getFolderMetadata method diff --git a/docs/sdkgen/metadatataxonomies.md b/docs/sdkgen/metadatataxonomies.md new file mode 100644 index 000000000..cf19c1178 --- /dev/null +++ b/docs/sdkgen/metadatataxonomies.md @@ -0,0 +1,474 @@ +# MetadataTaxonomiesManager + + +- [Create metadata taxonomy](#create-metadata-taxonomy) +- [Get metadata taxonomies for namespace](#get-metadata-taxonomies-for-namespace) +- [Get metadata taxonomy by taxonomy key](#get-metadata-taxonomy-by-taxonomy-key) +- [Update metadata taxonomy](#update-metadata-taxonomy) +- [Remove metadata taxonomy](#remove-metadata-taxonomy) +- [Create metadata taxonomy levels](#create-metadata-taxonomy-levels) +- [Update metadata taxonomy level](#update-metadata-taxonomy-level) +- [Add metadata taxonomy level](#add-metadata-taxonomy-level) +- [Delete metadata taxonomy level](#delete-metadata-taxonomy-level) +- [List metadata taxonomy nodes](#list-metadata-taxonomy-nodes) +- [Create metadata taxonomy node](#create-metadata-taxonomy-node) +- [Get metadata taxonomy node by ID](#get-metadata-taxonomy-node-by-id) +- [Update metadata taxonomy node](#update-metadata-taxonomy-node) +- [Remove metadata taxonomy node](#remove-metadata-taxonomy-node) +- [List metadata template's options for taxonomy field](#list-metadata-templates-options-for-taxonomy-field) + +## Create metadata taxonomy + +Creates a new metadata taxonomy that can be used in +metadata templates. + +This operation is performed by calling function `createMetadataTaxonomy`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/post-metadata-taxonomies/). + +*Currently we don't have an example for calling `createMetadataTaxonomy` in integration tests* + +### Arguments + +- requestBody `CreateMetadataTaxonomyRequestBody` + - Request body of createMetadataTaxonomy method +- headers `CreateMetadataTaxonomyHeaders` + - Headers of createMetadataTaxonomy method + + +### Returns + +This function returns a value of type `MetadataTaxonomy`. + +The schema representing the metadata taxonomy created. + + +## Get metadata taxonomies for namespace + +Used to retrieve all metadata taxonomies in a namespace. + +This operation is performed by calling function `getMetadataTaxonomies`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/get-metadata-taxonomies-id/). + +*Currently we don't have an example for calling `getMetadataTaxonomies` in integration tests* + +### Arguments + +- namespace `String` + - The namespace of the metadata taxonomy. Example: "enterprise_123456" +- queryParams `GetMetadataTaxonomiesQueryParams` + - Query parameters of getMetadataTaxonomies method +- headers `GetMetadataTaxonomiesHeaders` + - Headers of getMetadataTaxonomies method + + +### Returns + +This function returns a value of type `MetadataTaxonomies`. + +Returns all of the metadata taxonomies within a namespace +and their corresponding schema. + + +## Get metadata taxonomy by taxonomy key + +Used to retrieve a metadata taxonomy by taxonomy key. + +This operation is performed by calling function `getMetadataTaxonomyByKey`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/get-metadata-taxonomies-id-id/). + +*Currently we don't have an example for calling `getMetadataTaxonomyByKey` in integration tests* + +### Arguments + +- namespace `String` + - The namespace of the metadata taxonomy. Example: "enterprise_123456" +- taxonomyKey `String` + - The key of the metadata taxonomy. Example: "geography" +- headers `GetMetadataTaxonomyByKeyHeaders` + - Headers of getMetadataTaxonomyByKey method + + +### Returns + +This function returns a value of type `MetadataTaxonomy`. + +Returns the metadata taxonomy identified by the taxonomy key. + + +## Update metadata taxonomy + +Updates an existing metadata taxonomy. + +This operation is performed by calling function `updateMetadataTaxonomy`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/patch-metadata-taxonomies-id-id/). + +*Currently we don't have an example for calling `updateMetadataTaxonomy` in integration tests* + +### Arguments + +- namespace `String` + - The namespace of the metadata taxonomy. Example: "enterprise_123456" +- taxonomyKey `String` + - The key of the metadata taxonomy. Example: "geography" +- requestBody `UpdateMetadataTaxonomyRequestBody` + - Request body of updateMetadataTaxonomy method +- headers `UpdateMetadataTaxonomyHeaders` + - Headers of updateMetadataTaxonomy method + + +### Returns + +This function returns a value of type `MetadataTaxonomy`. + +The schema representing the updated metadata taxonomy. + + +## Remove metadata taxonomy + +Delete a metadata taxonomy. +This deletion is permanent and cannot be reverted. + +This operation is performed by calling function `deleteMetadataTaxonomy`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/delete-metadata-taxonomies-id-id/). + +*Currently we don't have an example for calling `deleteMetadataTaxonomy` in integration tests* + +### Arguments + +- namespace `String` + - The namespace of the metadata taxonomy. Example: "enterprise_123456" +- taxonomyKey `String` + - The key of the metadata taxonomy. Example: "geography" +- headers `DeleteMetadataTaxonomyHeaders` + - Headers of deleteMetadataTaxonomy method + + +### Returns + +This function returns a value of type `void`. + +Returns an empty response when the metadata taxonomy is successfully deleted. + + +## Create metadata taxonomy levels + +Creates new metadata taxonomy levels. + +This operation is performed by calling function `createMetadataTaxonomyLevel`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/post-metadata-taxonomies-id-id-levels/). + +*Currently we don't have an example for calling `createMetadataTaxonomyLevel` in integration tests* + +### Arguments + +- namespace `String` + - The namespace of the metadata taxonomy. Example: "enterprise_123456" +- taxonomyKey `String` + - The key of the metadata taxonomy. Example: "geography" +- requestBody `List` + - Request body of createMetadataTaxonomyLevel method +- headers `CreateMetadataTaxonomyLevelHeaders` + - Headers of createMetadataTaxonomyLevel method + + +### Returns + +This function returns a value of type `MetadataTaxonomyLevels`. + +Returns an array of all taxonomy levels. + + +## Update metadata taxonomy level + +Updates an existing metadata taxonomy level. + +This operation is performed by calling function `patchMetadataTaxonomiesIdIdLevelsId`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/patch-metadata-taxonomies-id-id-levels-id/). + +*Currently we don't have an example for calling `patchMetadataTaxonomiesIdIdLevelsId` in integration tests* + +### Arguments + +- namespace `String` + - The namespace of the metadata taxonomy. Example: "enterprise_123456" +- taxonomyKey `String` + - The key of the metadata taxonomy. Example: "geography" +- levelIndex `long` + - The index of the metadata taxonomy level. Example: 1 +- requestBody `PatchMetadataTaxonomiesIdIdLevelsIdRequestBody` + - Request body of patchMetadataTaxonomiesIdIdLevelsId method +- headers `PatchMetadataTaxonomiesIdIdLevelsIdHeaders` + - Headers of patchMetadataTaxonomiesIdIdLevelsId method + + +### Returns + +This function returns a value of type `MetadataTaxonomyLevel`. + +The updated taxonomy level. + + +## Add metadata taxonomy level + +Creates a new metadata taxonomy level and appends it to the existing levels. +If there are no levels defined yet, this will create the first level. + +This operation is performed by calling function `addMetadataTaxonomyLevel`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/post-metadata-taxonomies-id-id-levels:append/). + +*Currently we don't have an example for calling `addMetadataTaxonomyLevel` in integration tests* + +### Arguments + +- namespace `String` + - The namespace of the metadata taxonomy. Example: "enterprise_123456" +- taxonomyKey `String` + - The key of the metadata taxonomy. Example: "geography" +- requestBody `AddMetadataTaxonomyLevelRequestBody` + - Request body of addMetadataTaxonomyLevel method +- headers `AddMetadataTaxonomyLevelHeaders` + - Headers of addMetadataTaxonomyLevel method + + +### Returns + +This function returns a value of type `MetadataTaxonomyLevels`. + +Returns an array of all taxonomy levels. + + +## Delete metadata taxonomy level + +Deletes the last level of the metadata taxonomy. + +This operation is performed by calling function `deleteMetadataTaxonomyLevel`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/post-metadata-taxonomies-id-id-levels:trim/). + +*Currently we don't have an example for calling `deleteMetadataTaxonomyLevel` in integration tests* + +### Arguments + +- namespace `String` + - The namespace of the metadata taxonomy. Example: "enterprise_123456" +- taxonomyKey `String` + - The key of the metadata taxonomy. Example: "geography" +- headers `DeleteMetadataTaxonomyLevelHeaders` + - Headers of deleteMetadataTaxonomyLevel method + + +### Returns + +This function returns a value of type `MetadataTaxonomyLevels`. + +Returns an array of all taxonomy levels. + + +## List metadata taxonomy nodes + +Used to retrieve metadata taxonomy nodes based on the parameters specified. +Results are sorted in lexicographic order unless a `query` parameter is passed. +With a `query` parameter specified, results are sorted in order of relevance. + +This operation is performed by calling function `getMetadataTaxonomyNodes`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/get-metadata-taxonomies-id-id-nodes/). + +*Currently we don't have an example for calling `getMetadataTaxonomyNodes` in integration tests* + +### Arguments + +- namespace `String` + - The namespace of the metadata taxonomy. Example: "enterprise_123456" +- taxonomyKey `String` + - The key of the metadata taxonomy. Example: "geography" +- queryParams `GetMetadataTaxonomyNodesQueryParams` + - Query parameters of getMetadataTaxonomyNodes method +- headers `GetMetadataTaxonomyNodesHeaders` + - Headers of getMetadataTaxonomyNodes method + + +### Returns + +This function returns a value of type `MetadataTaxonomyNodes`. + +Returns a list of the taxonomy nodes that match the specified parameters. + + +## Create metadata taxonomy node + +Creates a new metadata taxonomy node. + +This operation is performed by calling function `createMetadataTaxonomyNode`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/post-metadata-taxonomies-id-id-nodes/). + +*Currently we don't have an example for calling `createMetadataTaxonomyNode` in integration tests* + +### Arguments + +- namespace `String` + - The namespace of the metadata taxonomy. Example: "enterprise_123456" +- taxonomyKey `String` + - The key of the metadata taxonomy. Example: "geography" +- requestBody `CreateMetadataTaxonomyNodeRequestBody` + - Request body of createMetadataTaxonomyNode method +- headers `CreateMetadataTaxonomyNodeHeaders` + - Headers of createMetadataTaxonomyNode method + + +### Returns + +This function returns a value of type `MetadataTaxonomyNode`. + +The schema representing the taxonomy node created. + + +## Get metadata taxonomy node by ID + +Retrieves a metadata taxonomy node by its identifier. + +This operation is performed by calling function `getMetadataTaxonomyNodeById`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/get-metadata-taxonomies-id-id-nodes-id/). + +*Currently we don't have an example for calling `getMetadataTaxonomyNodeById` in integration tests* + +### Arguments + +- namespace `String` + - The namespace of the metadata taxonomy. Example: "enterprise_123456" +- taxonomyKey `String` + - The key of the metadata taxonomy. Example: "geography" +- nodeId `String` + - The identifier of the metadata taxonomy node. Example: "14d3d433-c77f-49c5-b146-9dea370f6e32" +- headers `GetMetadataTaxonomyNodeByIdHeaders` + - Headers of getMetadataTaxonomyNodeById method + + +### Returns + +This function returns a value of type `MetadataTaxonomyNode`. + +Returns the metadata taxonomy node that matches the identifier. + + +## Update metadata taxonomy node + +Updates an existing metadata taxonomy node. + +This operation is performed by calling function `updateMetadataTaxonomyNode`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/patch-metadata-taxonomies-id-id-nodes-id/). + +*Currently we don't have an example for calling `updateMetadataTaxonomyNode` in integration tests* + +### Arguments + +- namespace `String` + - The namespace of the metadata taxonomy. Example: "enterprise_123456" +- taxonomyKey `String` + - The key of the metadata taxonomy. Example: "geography" +- nodeId `String` + - The identifier of the metadata taxonomy node. Example: "14d3d433-c77f-49c5-b146-9dea370f6e32" +- requestBody `UpdateMetadataTaxonomyNodeRequestBody` + - Request body of updateMetadataTaxonomyNode method +- headers `UpdateMetadataTaxonomyNodeHeaders` + - Headers of updateMetadataTaxonomyNode method + + +### Returns + +This function returns a value of type `MetadataTaxonomyNode`. + +The schema representing the updated taxonomy node. + + +## Remove metadata taxonomy node + +Delete a metadata taxonomy node. +This deletion is permanent and cannot be reverted. +Only metadata taxonomy nodes without any children can be deleted. + +This operation is performed by calling function `deleteMetadataTaxonomyNode`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/delete-metadata-taxonomies-id-id-nodes-id/). + +*Currently we don't have an example for calling `deleteMetadataTaxonomyNode` in integration tests* + +### Arguments + +- namespace `String` + - The namespace of the metadata taxonomy. Example: "enterprise_123456" +- taxonomyKey `String` + - The key of the metadata taxonomy. Example: "geography" +- nodeId `String` + - The identifier of the metadata taxonomy node. Example: "14d3d433-c77f-49c5-b146-9dea370f6e32" +- headers `DeleteMetadataTaxonomyNodeHeaders` + - Headers of deleteMetadataTaxonomyNode method + + +### Returns + +This function returns a value of type `void`. + +Returns an empty response when the metadata taxonomy node is successfully deleted. + + +## List metadata template's options for taxonomy field + +Used to retrieve metadata taxonomy nodes which are available for the taxonomy field based +on its configuration and the parameters specified. +Results are sorted in lexicographic order unless a `query` parameter is passed. +With a `query` parameter specified, results are sorted in order of relevance. + +This operation is performed by calling function `getMetadataTemplateFieldOptions`. + +See the endpoint docs at +[API Reference](https://developer.box.com/reference/get-metadata-templates-id-id-fields-id-options/). + +*Currently we don't have an example for calling `getMetadataTemplateFieldOptions` in integration tests* + +### Arguments + +- scope `GetMetadataTemplateFieldOptionsScope` + - The scope of the metadata template. Example: "global" +- templateKey `String` + - The name of the metadata template. Example: "properties" +- fieldKey `String` + - The key of the metadata taxonomy field in the template. Example: "geography" +- queryParams `GetMetadataTemplateFieldOptionsQueryParams` + - Query parameters of getMetadataTemplateFieldOptions method +- headers `GetMetadataTemplateFieldOptionsHeaders` + - Headers of getMetadataTemplateFieldOptions method + + +### Returns + +This function returns a value of type `MetadataTaxonomyNodes`. + +Returns a list of the taxonomy nodes that match the specified parameters. + + diff --git a/src/main/java/com/box/sdkgen/client/BoxClient.java b/src/main/java/com/box/sdkgen/client/BoxClient.java index ddaa620af..8c3b1f25a 100644 --- a/src/main/java/com/box/sdkgen/client/BoxClient.java +++ b/src/main/java/com/box/sdkgen/client/BoxClient.java @@ -47,6 +47,7 @@ import com.box.sdkgen.managers.listcollaborations.ListCollaborationsManager; import com.box.sdkgen.managers.memberships.MembershipsManager; import com.box.sdkgen.managers.metadatacascadepolicies.MetadataCascadePoliciesManager; +import com.box.sdkgen.managers.metadatataxonomies.MetadataTaxonomiesManager; import com.box.sdkgen.managers.metadatatemplates.MetadataTemplatesManager; import com.box.sdkgen.managers.recentitems.RecentItemsManager; import com.box.sdkgen.managers.retentionpolicies.RetentionPoliciesManager; @@ -245,6 +246,8 @@ public class BoxClient { public final AiStudioManager aiStudio; + public final MetadataTaxonomiesManager metadataTaxonomies; + public final DocgenTemplateManager docgenTemplate; public final DocgenManager docgen; @@ -568,6 +571,11 @@ public BoxClient(Authentication auth) { this.ai = new AiManager.Builder().auth(this.auth).networkSession(this.networkSession).build(); this.aiStudio = new AiStudioManager.Builder().auth(this.auth).networkSession(this.networkSession).build(); + this.metadataTaxonomies = + new MetadataTaxonomiesManager.Builder() + .auth(this.auth) + .networkSession(this.networkSession) + .build(); this.docgenTemplate = new DocgenTemplateManager.Builder() .auth(this.auth) @@ -908,6 +916,11 @@ protected BoxClient(Builder builder) { this.ai = new AiManager.Builder().auth(this.auth).networkSession(this.networkSession).build(); this.aiStudio = new AiStudioManager.Builder().auth(this.auth).networkSession(this.networkSession).build(); + this.metadataTaxonomies = + new MetadataTaxonomiesManager.Builder() + .auth(this.auth) + .networkSession(this.networkSession) + .build(); this.docgenTemplate = new DocgenTemplateManager.Builder() .auth(this.auth) @@ -1341,6 +1354,10 @@ public AiStudioManager getAiStudio() { return aiStudio; } + public MetadataTaxonomiesManager getMetadataTaxonomies() { + return metadataTaxonomies; + } + public DocgenTemplateManager getDocgenTemplate() { return docgenTemplate; } diff --git a/src/main/java/com/box/sdkgen/managers/filemetadata/FileMetadataManager.java b/src/main/java/com/box/sdkgen/managers/filemetadata/FileMetadataManager.java index 190f8bf37..25ae5f748 100644 --- a/src/main/java/com/box/sdkgen/managers/filemetadata/FileMetadataManager.java +++ b/src/main/java/com/box/sdkgen/managers/filemetadata/FileMetadataManager.java @@ -1,6 +1,7 @@ package com.box.sdkgen.managers.filemetadata; import static com.box.sdkgen.internal.utils.UtilsManager.convertToString; +import static com.box.sdkgen.internal.utils.UtilsManager.entryOf; import static com.box.sdkgen.internal.utils.UtilsManager.mapOf; import static com.box.sdkgen.internal.utils.UtilsManager.mergeMaps; import static com.box.sdkgen.internal.utils.UtilsManager.prepareParams; @@ -40,7 +41,20 @@ protected FileMetadataManager(Builder builder) { * `file_id` is `123`. Example: "12345" */ public Metadatas getFileMetadata(String fileId) { - return getFileMetadata(fileId, new GetFileMetadataHeaders()); + return getFileMetadata(fileId, new GetFileMetadataQueryParams(), new GetFileMetadataHeaders()); + } + + /** + * Retrieves all metadata for a given file. + * + * @param fileId The unique identifier that represents a file. + *

The ID for any file can be determined by visiting a file in the web application and + * copying the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the + * `file_id` is `123`. Example: "12345" + * @param queryParams Query parameters of getFileMetadata method + */ + public Metadatas getFileMetadata(String fileId, GetFileMetadataQueryParams queryParams) { + return getFileMetadata(fileId, queryParams, new GetFileMetadataHeaders()); } /** @@ -53,6 +67,23 @@ public Metadatas getFileMetadata(String fileId) { * @param headers Headers of getFileMetadata method */ public Metadatas getFileMetadata(String fileId, GetFileMetadataHeaders headers) { + return getFileMetadata(fileId, new GetFileMetadataQueryParams(), headers); + } + + /** + * Retrieves all metadata for a given file. + * + * @param fileId The unique identifier that represents a file. + *

The ID for any file can be determined by visiting a file in the web application and + * copying the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the + * `file_id` is `123`. Example: "12345" + * @param queryParams Query parameters of getFileMetadata method + * @param headers Headers of getFileMetadata method + */ + public Metadatas getFileMetadata( + String fileId, GetFileMetadataQueryParams queryParams, GetFileMetadataHeaders headers) { + Map queryParamsMap = + prepareParams(mapOf(entryOf("view", convertToString(queryParams.getView())))); Map headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders())); FetchResponse response = this.networkSession @@ -66,6 +97,7 @@ public Metadatas getFileMetadata(String fileId, GetFileMetadataHeaders headers) convertToString(fileId), "/metadata"), "GET") + .params(queryParamsMap) .headers(headersMap) .responseFormat(ResponseFormat.JSON) .auth(this.auth) @@ -86,7 +118,52 @@ public Metadatas getFileMetadata(String fileId, GetFileMetadataHeaders headers) */ public MetadataFull getFileMetadataById( String fileId, GetFileMetadataByIdScope scope, String templateKey) { - return getFileMetadataById(fileId, scope, templateKey, new GetFileMetadataByIdHeaders()); + return getFileMetadataById( + fileId, + scope, + templateKey, + new GetFileMetadataByIdQueryParams(), + new GetFileMetadataByIdHeaders()); + } + + /** + * Retrieves the instance of a metadata template that has been applied to a file. + * + * @param fileId The unique identifier that represents a file. + *

The ID for any file can be determined by visiting a file in the web application and + * copying the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the + * `file_id` is `123`. Example: "12345" + * @param scope The scope of the metadata template. Example: "global" + * @param templateKey The name of the metadata template. Example: "properties" + * @param queryParams Query parameters of getFileMetadataById method + */ + public MetadataFull getFileMetadataById( + String fileId, + GetFileMetadataByIdScope scope, + String templateKey, + GetFileMetadataByIdQueryParams queryParams) { + return getFileMetadataById( + fileId, scope, templateKey, queryParams, new GetFileMetadataByIdHeaders()); + } + + /** + * Retrieves the instance of a metadata template that has been applied to a file. + * + * @param fileId The unique identifier that represents a file. + *

The ID for any file can be determined by visiting a file in the web application and + * copying the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the + * `file_id` is `123`. Example: "12345" + * @param scope The scope of the metadata template. Example: "global" + * @param templateKey The name of the metadata template. Example: "properties" + * @param headers Headers of getFileMetadataById method + */ + public MetadataFull getFileMetadataById( + String fileId, + GetFileMetadataByIdScope scope, + String templateKey, + GetFileMetadataByIdHeaders headers) { + return getFileMetadataById( + fileId, scope, templateKey, new GetFileMetadataByIdQueryParams(), headers); } /** @@ -98,13 +175,17 @@ public MetadataFull getFileMetadataById( * `file_id` is `123`. Example: "12345" * @param scope The scope of the metadata template. Example: "global" * @param templateKey The name of the metadata template. Example: "properties" + * @param queryParams Query parameters of getFileMetadataById method * @param headers Headers of getFileMetadataById method */ public MetadataFull getFileMetadataById( String fileId, GetFileMetadataByIdScope scope, String templateKey, + GetFileMetadataByIdQueryParams queryParams, GetFileMetadataByIdHeaders headers) { + Map queryParamsMap = + prepareParams(mapOf(entryOf("view", convertToString(queryParams.getView())))); Map headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders())); FetchResponse response = this.networkSession @@ -121,6 +202,7 @@ public MetadataFull getFileMetadataById( "/", convertToString(templateKey)), "GET") + .params(queryParamsMap) .headers(headersMap) .responseFormat(ResponseFormat.JSON) .auth(this.auth) diff --git a/src/main/java/com/box/sdkgen/managers/filemetadata/GetFileMetadataByIdQueryParams.java b/src/main/java/com/box/sdkgen/managers/filemetadata/GetFileMetadataByIdQueryParams.java new file mode 100644 index 000000000..e7f810882 --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/filemetadata/GetFileMetadataByIdQueryParams.java @@ -0,0 +1,36 @@ +package com.box.sdkgen.managers.filemetadata; + +public class GetFileMetadataByIdQueryParams { + + /** + * Taxonomy field values are returned in `API view` by default, meaning the value is represented + * with a taxonomy node identifier. To retrieve the `Hydrated view`, where taxonomy values are + * represented with the full taxonomy node information, set this parameter to `hydrated`. This is + * the only supported value for this parameter. + */ + public String view; + + public GetFileMetadataByIdQueryParams() {} + + protected GetFileMetadataByIdQueryParams(Builder builder) { + this.view = builder.view; + } + + public String getView() { + return view; + } + + public static class Builder { + + protected String view; + + public Builder view(String view) { + this.view = view; + return this; + } + + public GetFileMetadataByIdQueryParams build() { + return new GetFileMetadataByIdQueryParams(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/filemetadata/GetFileMetadataQueryParams.java b/src/main/java/com/box/sdkgen/managers/filemetadata/GetFileMetadataQueryParams.java new file mode 100644 index 000000000..b4cd334a1 --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/filemetadata/GetFileMetadataQueryParams.java @@ -0,0 +1,36 @@ +package com.box.sdkgen.managers.filemetadata; + +public class GetFileMetadataQueryParams { + + /** + * Taxonomy field values are returned in `API view` by default, meaning the value is represented + * with a taxonomy node identifier. To retrieve the `Hydrated view`, where taxonomy values are + * represented with the full taxonomy node information, set this parameter to `hydrated`. This is + * the only supported value for this parameter. + */ + public String view; + + public GetFileMetadataQueryParams() {} + + protected GetFileMetadataQueryParams(Builder builder) { + this.view = builder.view; + } + + public String getView() { + return view; + } + + public static class Builder { + + protected String view; + + public Builder view(String view) { + this.view = view; + return this; + } + + public GetFileMetadataQueryParams build() { + return new GetFileMetadataQueryParams(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/foldermetadata/FolderMetadataManager.java b/src/main/java/com/box/sdkgen/managers/foldermetadata/FolderMetadataManager.java index 061351ca0..781d380e6 100644 --- a/src/main/java/com/box/sdkgen/managers/foldermetadata/FolderMetadataManager.java +++ b/src/main/java/com/box/sdkgen/managers/foldermetadata/FolderMetadataManager.java @@ -1,6 +1,7 @@ package com.box.sdkgen.managers.foldermetadata; import static com.box.sdkgen.internal.utils.UtilsManager.convertToString; +import static com.box.sdkgen.internal.utils.UtilsManager.entryOf; import static com.box.sdkgen.internal.utils.UtilsManager.mapOf; import static com.box.sdkgen.internal.utils.UtilsManager.mergeMaps; import static com.box.sdkgen.internal.utils.UtilsManager.prepareParams; @@ -41,7 +42,22 @@ protected FolderMetadataManager(Builder builder) { *

The root folder of a Box account is always represented by the ID `0`. Example: "12345" */ public Metadatas getFolderMetadata(String folderId) { - return getFolderMetadata(folderId, new GetFolderMetadataHeaders()); + return getFolderMetadata( + folderId, new GetFolderMetadataQueryParams(), new GetFolderMetadataHeaders()); + } + + /** + * Retrieves all metadata for a given folder. This can not be used on the root folder with ID `0`. + * + * @param folderId The unique identifier that represent a folder. + *

The ID for any folder can be determined by visiting this folder in the web application + * and copying the ID from the URL. For example, for the URL + * `https://*.app.box.com/folder/123` the `folder_id` is `123`. + *

The root folder of a Box account is always represented by the ID `0`. Example: "12345" + * @param queryParams Query parameters of getFolderMetadata method + */ + public Metadatas getFolderMetadata(String folderId, GetFolderMetadataQueryParams queryParams) { + return getFolderMetadata(folderId, queryParams, new GetFolderMetadataHeaders()); } /** @@ -55,6 +71,24 @@ public Metadatas getFolderMetadata(String folderId) { * @param headers Headers of getFolderMetadata method */ public Metadatas getFolderMetadata(String folderId, GetFolderMetadataHeaders headers) { + return getFolderMetadata(folderId, new GetFolderMetadataQueryParams(), headers); + } + + /** + * Retrieves all metadata for a given folder. This can not be used on the root folder with ID `0`. + * + * @param folderId The unique identifier that represent a folder. + *

The ID for any folder can be determined by visiting this folder in the web application + * and copying the ID from the URL. For example, for the URL + * `https://*.app.box.com/folder/123` the `folder_id` is `123`. + *

The root folder of a Box account is always represented by the ID `0`. Example: "12345" + * @param queryParams Query parameters of getFolderMetadata method + * @param headers Headers of getFolderMetadata method + */ + public Metadatas getFolderMetadata( + String folderId, GetFolderMetadataQueryParams queryParams, GetFolderMetadataHeaders headers) { + Map queryParamsMap = + prepareParams(mapOf(entryOf("view", convertToString(queryParams.getView())))); Map headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders())); FetchResponse response = this.networkSession @@ -68,6 +102,7 @@ public Metadatas getFolderMetadata(String folderId, GetFolderMetadataHeaders hea convertToString(folderId), "/metadata"), "GET") + .params(queryParamsMap) .headers(headersMap) .responseFormat(ResponseFormat.JSON) .auth(this.auth) diff --git a/src/main/java/com/box/sdkgen/managers/foldermetadata/GetFolderMetadataQueryParams.java b/src/main/java/com/box/sdkgen/managers/foldermetadata/GetFolderMetadataQueryParams.java new file mode 100644 index 000000000..4dae87218 --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/foldermetadata/GetFolderMetadataQueryParams.java @@ -0,0 +1,36 @@ +package com.box.sdkgen.managers.foldermetadata; + +public class GetFolderMetadataQueryParams { + + /** + * Taxonomy field values are returned in `API view` by default, meaning the value is represented + * with a taxonomy node identifier. To retrieve the `Hydrated view`, where taxonomy values are + * represented with the full taxonomy node information, set this parameter to `hydrated`. This is + * the only supported value for this parameter. + */ + public String view; + + public GetFolderMetadataQueryParams() {} + + protected GetFolderMetadataQueryParams(Builder builder) { + this.view = builder.view; + } + + public String getView() { + return view; + } + + public static class Builder { + + protected String view; + + public Builder view(String view) { + this.view = view; + return this; + } + + public GetFolderMetadataQueryParams build() { + return new GetFolderMetadataQueryParams(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/metadatataxonomies/AddMetadataTaxonomyLevelHeaders.java b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/AddMetadataTaxonomyLevelHeaders.java new file mode 100644 index 000000000..26a90477e --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/AddMetadataTaxonomyLevelHeaders.java @@ -0,0 +1,41 @@ +package com.box.sdkgen.managers.metadatataxonomies; + +import static com.box.sdkgen.internal.utils.UtilsManager.mapOf; + +import java.util.Map; + +public class AddMetadataTaxonomyLevelHeaders { + + /** Extra headers that will be included in the HTTP request. */ + public Map extraHeaders; + + public AddMetadataTaxonomyLevelHeaders() { + this.extraHeaders = mapOf(); + } + + protected AddMetadataTaxonomyLevelHeaders(Builder builder) { + this.extraHeaders = builder.extraHeaders; + } + + public Map getExtraHeaders() { + return extraHeaders; + } + + public static class Builder { + + protected Map extraHeaders; + + public Builder() { + this.extraHeaders = mapOf(); + } + + public Builder extraHeaders(Map extraHeaders) { + this.extraHeaders = extraHeaders; + return this; + } + + public AddMetadataTaxonomyLevelHeaders build() { + return new AddMetadataTaxonomyLevelHeaders(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/metadatataxonomies/AddMetadataTaxonomyLevelRequestBody.java b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/AddMetadataTaxonomyLevelRequestBody.java new file mode 100644 index 000000000..65ef7ebd5 --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/AddMetadataTaxonomyLevelRequestBody.java @@ -0,0 +1,89 @@ +package com.box.sdkgen.managers.metadatataxonomies; + +import com.box.sdkgen.internal.NullableFieldTracker; +import com.box.sdkgen.internal.SerializableObject; +import com.fasterxml.jackson.annotation.JsonFilter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +@JsonFilter("nullablePropertyFilter") +public class AddMetadataTaxonomyLevelRequestBody extends SerializableObject { + + /** The display name of the taxonomy level. */ + protected final String displayName; + + /** The description of the taxonomy level. */ + protected String description; + + public AddMetadataTaxonomyLevelRequestBody(@JsonProperty("displayName") String displayName) { + super(); + this.displayName = displayName; + } + + protected AddMetadataTaxonomyLevelRequestBody(Builder builder) { + super(); + this.displayName = builder.displayName; + this.description = builder.description; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public String getDisplayName() { + return displayName; + } + + public String getDescription() { + return description; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddMetadataTaxonomyLevelRequestBody casted = (AddMetadataTaxonomyLevelRequestBody) o; + return Objects.equals(displayName, casted.displayName) + && Objects.equals(description, casted.description); + } + + @Override + public int hashCode() { + return Objects.hash(displayName, description); + } + + @Override + public String toString() { + return "AddMetadataTaxonomyLevelRequestBody{" + + "displayName='" + + displayName + + '\'' + + ", " + + "description='" + + description + + '\'' + + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected final String displayName; + + protected String description; + + public Builder(String displayName) { + super(); + this.displayName = displayName; + } + + public Builder description(String description) { + this.description = description; + return this; + } + + public AddMetadataTaxonomyLevelRequestBody build() { + return new AddMetadataTaxonomyLevelRequestBody(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/metadatataxonomies/CreateMetadataTaxonomyHeaders.java b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/CreateMetadataTaxonomyHeaders.java new file mode 100644 index 000000000..48539fceb --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/CreateMetadataTaxonomyHeaders.java @@ -0,0 +1,41 @@ +package com.box.sdkgen.managers.metadatataxonomies; + +import static com.box.sdkgen.internal.utils.UtilsManager.mapOf; + +import java.util.Map; + +public class CreateMetadataTaxonomyHeaders { + + /** Extra headers that will be included in the HTTP request. */ + public Map extraHeaders; + + public CreateMetadataTaxonomyHeaders() { + this.extraHeaders = mapOf(); + } + + protected CreateMetadataTaxonomyHeaders(Builder builder) { + this.extraHeaders = builder.extraHeaders; + } + + public Map getExtraHeaders() { + return extraHeaders; + } + + public static class Builder { + + protected Map extraHeaders; + + public Builder() { + this.extraHeaders = mapOf(); + } + + public Builder extraHeaders(Map extraHeaders) { + this.extraHeaders = extraHeaders; + return this; + } + + public CreateMetadataTaxonomyHeaders build() { + return new CreateMetadataTaxonomyHeaders(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/metadatataxonomies/CreateMetadataTaxonomyLevelHeaders.java b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/CreateMetadataTaxonomyLevelHeaders.java new file mode 100644 index 000000000..1acebea77 --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/CreateMetadataTaxonomyLevelHeaders.java @@ -0,0 +1,41 @@ +package com.box.sdkgen.managers.metadatataxonomies; + +import static com.box.sdkgen.internal.utils.UtilsManager.mapOf; + +import java.util.Map; + +public class CreateMetadataTaxonomyLevelHeaders { + + /** Extra headers that will be included in the HTTP request. */ + public Map extraHeaders; + + public CreateMetadataTaxonomyLevelHeaders() { + this.extraHeaders = mapOf(); + } + + protected CreateMetadataTaxonomyLevelHeaders(Builder builder) { + this.extraHeaders = builder.extraHeaders; + } + + public Map getExtraHeaders() { + return extraHeaders; + } + + public static class Builder { + + protected Map extraHeaders; + + public Builder() { + this.extraHeaders = mapOf(); + } + + public Builder extraHeaders(Map extraHeaders) { + this.extraHeaders = extraHeaders; + return this; + } + + public CreateMetadataTaxonomyLevelHeaders build() { + return new CreateMetadataTaxonomyLevelHeaders(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/metadatataxonomies/CreateMetadataTaxonomyNodeHeaders.java b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/CreateMetadataTaxonomyNodeHeaders.java new file mode 100644 index 000000000..70053593b --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/CreateMetadataTaxonomyNodeHeaders.java @@ -0,0 +1,41 @@ +package com.box.sdkgen.managers.metadatataxonomies; + +import static com.box.sdkgen.internal.utils.UtilsManager.mapOf; + +import java.util.Map; + +public class CreateMetadataTaxonomyNodeHeaders { + + /** Extra headers that will be included in the HTTP request. */ + public Map extraHeaders; + + public CreateMetadataTaxonomyNodeHeaders() { + this.extraHeaders = mapOf(); + } + + protected CreateMetadataTaxonomyNodeHeaders(Builder builder) { + this.extraHeaders = builder.extraHeaders; + } + + public Map getExtraHeaders() { + return extraHeaders; + } + + public static class Builder { + + protected Map extraHeaders; + + public Builder() { + this.extraHeaders = mapOf(); + } + + public Builder extraHeaders(Map extraHeaders) { + this.extraHeaders = extraHeaders; + return this; + } + + public CreateMetadataTaxonomyNodeHeaders build() { + return new CreateMetadataTaxonomyNodeHeaders(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/metadatataxonomies/CreateMetadataTaxonomyNodeRequestBody.java b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/CreateMetadataTaxonomyNodeRequestBody.java new file mode 100644 index 000000000..46ee9254f --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/CreateMetadataTaxonomyNodeRequestBody.java @@ -0,0 +1,107 @@ +package com.box.sdkgen.managers.metadatataxonomies; + +import com.box.sdkgen.internal.NullableFieldTracker; +import com.box.sdkgen.internal.SerializableObject; +import com.fasterxml.jackson.annotation.JsonFilter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +@JsonFilter("nullablePropertyFilter") +public class CreateMetadataTaxonomyNodeRequestBody extends SerializableObject { + + /** The display name of the taxonomy node. */ + protected final String displayName; + + /** The level of the taxonomy node. */ + protected final long level; + + /** The identifier of the parent taxonomy node. Omit this field for root-level nodes. */ + protected String parentId; + + public CreateMetadataTaxonomyNodeRequestBody( + @JsonProperty("displayName") String displayName, @JsonProperty("level") long level) { + super(); + this.displayName = displayName; + this.level = level; + } + + protected CreateMetadataTaxonomyNodeRequestBody(Builder builder) { + super(); + this.displayName = builder.displayName; + this.level = builder.level; + this.parentId = builder.parentId; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public String getDisplayName() { + return displayName; + } + + public long getLevel() { + return level; + } + + public String getParentId() { + return parentId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateMetadataTaxonomyNodeRequestBody casted = (CreateMetadataTaxonomyNodeRequestBody) o; + return Objects.equals(displayName, casted.displayName) + && Objects.equals(level, casted.level) + && Objects.equals(parentId, casted.parentId); + } + + @Override + public int hashCode() { + return Objects.hash(displayName, level, parentId); + } + + @Override + public String toString() { + return "CreateMetadataTaxonomyNodeRequestBody{" + + "displayName='" + + displayName + + '\'' + + ", " + + "level='" + + level + + '\'' + + ", " + + "parentId='" + + parentId + + '\'' + + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected final String displayName; + + protected final long level; + + protected String parentId; + + public Builder(String displayName, long level) { + super(); + this.displayName = displayName; + this.level = level; + } + + public Builder parentId(String parentId) { + this.parentId = parentId; + return this; + } + + public CreateMetadataTaxonomyNodeRequestBody build() { + return new CreateMetadataTaxonomyNodeRequestBody(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/metadatataxonomies/CreateMetadataTaxonomyRequestBody.java b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/CreateMetadataTaxonomyRequestBody.java new file mode 100644 index 000000000..a860ca86e --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/CreateMetadataTaxonomyRequestBody.java @@ -0,0 +1,112 @@ +package com.box.sdkgen.managers.metadatataxonomies; + +import com.box.sdkgen.internal.NullableFieldTracker; +import com.box.sdkgen.internal.SerializableObject; +import com.fasterxml.jackson.annotation.JsonFilter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +@JsonFilter("nullablePropertyFilter") +public class CreateMetadataTaxonomyRequestBody extends SerializableObject { + + /** + * The taxonomy key. If it is not provided in the request body, it will be generated from the + * `displayName`. The `displayName` would be converted to lower case, and all spaces and + * non-alphanumeric characters replaced with underscores. + */ + protected String key; + + /** The display name of the taxonomy. */ + protected final String displayName; + + /** The namespace of the metadata taxonomy to create. */ + protected final String namespace; + + public CreateMetadataTaxonomyRequestBody( + @JsonProperty("displayName") String displayName, + @JsonProperty("namespace") String namespace) { + super(); + this.displayName = displayName; + this.namespace = namespace; + } + + protected CreateMetadataTaxonomyRequestBody(Builder builder) { + super(); + this.key = builder.key; + this.displayName = builder.displayName; + this.namespace = builder.namespace; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public String getKey() { + return key; + } + + public String getDisplayName() { + return displayName; + } + + public String getNamespace() { + return namespace; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateMetadataTaxonomyRequestBody casted = (CreateMetadataTaxonomyRequestBody) o; + return Objects.equals(key, casted.key) + && Objects.equals(displayName, casted.displayName) + && Objects.equals(namespace, casted.namespace); + } + + @Override + public int hashCode() { + return Objects.hash(key, displayName, namespace); + } + + @Override + public String toString() { + return "CreateMetadataTaxonomyRequestBody{" + + "key='" + + key + + '\'' + + ", " + + "displayName='" + + displayName + + '\'' + + ", " + + "namespace='" + + namespace + + '\'' + + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected String key; + + protected final String displayName; + + protected final String namespace; + + public Builder(String displayName, String namespace) { + super(); + this.displayName = displayName; + this.namespace = namespace; + } + + public Builder key(String key) { + this.key = key; + return this; + } + + public CreateMetadataTaxonomyRequestBody build() { + return new CreateMetadataTaxonomyRequestBody(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/metadatataxonomies/DeleteMetadataTaxonomyHeaders.java b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/DeleteMetadataTaxonomyHeaders.java new file mode 100644 index 000000000..894858888 --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/DeleteMetadataTaxonomyHeaders.java @@ -0,0 +1,41 @@ +package com.box.sdkgen.managers.metadatataxonomies; + +import static com.box.sdkgen.internal.utils.UtilsManager.mapOf; + +import java.util.Map; + +public class DeleteMetadataTaxonomyHeaders { + + /** Extra headers that will be included in the HTTP request. */ + public Map extraHeaders; + + public DeleteMetadataTaxonomyHeaders() { + this.extraHeaders = mapOf(); + } + + protected DeleteMetadataTaxonomyHeaders(Builder builder) { + this.extraHeaders = builder.extraHeaders; + } + + public Map getExtraHeaders() { + return extraHeaders; + } + + public static class Builder { + + protected Map extraHeaders; + + public Builder() { + this.extraHeaders = mapOf(); + } + + public Builder extraHeaders(Map extraHeaders) { + this.extraHeaders = extraHeaders; + return this; + } + + public DeleteMetadataTaxonomyHeaders build() { + return new DeleteMetadataTaxonomyHeaders(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/metadatataxonomies/DeleteMetadataTaxonomyLevelHeaders.java b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/DeleteMetadataTaxonomyLevelHeaders.java new file mode 100644 index 000000000..b2e81cfa4 --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/DeleteMetadataTaxonomyLevelHeaders.java @@ -0,0 +1,41 @@ +package com.box.sdkgen.managers.metadatataxonomies; + +import static com.box.sdkgen.internal.utils.UtilsManager.mapOf; + +import java.util.Map; + +public class DeleteMetadataTaxonomyLevelHeaders { + + /** Extra headers that will be included in the HTTP request. */ + public Map extraHeaders; + + public DeleteMetadataTaxonomyLevelHeaders() { + this.extraHeaders = mapOf(); + } + + protected DeleteMetadataTaxonomyLevelHeaders(Builder builder) { + this.extraHeaders = builder.extraHeaders; + } + + public Map getExtraHeaders() { + return extraHeaders; + } + + public static class Builder { + + protected Map extraHeaders; + + public Builder() { + this.extraHeaders = mapOf(); + } + + public Builder extraHeaders(Map extraHeaders) { + this.extraHeaders = extraHeaders; + return this; + } + + public DeleteMetadataTaxonomyLevelHeaders build() { + return new DeleteMetadataTaxonomyLevelHeaders(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/metadatataxonomies/DeleteMetadataTaxonomyNodeHeaders.java b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/DeleteMetadataTaxonomyNodeHeaders.java new file mode 100644 index 000000000..e8e4de6c5 --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/DeleteMetadataTaxonomyNodeHeaders.java @@ -0,0 +1,41 @@ +package com.box.sdkgen.managers.metadatataxonomies; + +import static com.box.sdkgen.internal.utils.UtilsManager.mapOf; + +import java.util.Map; + +public class DeleteMetadataTaxonomyNodeHeaders { + + /** Extra headers that will be included in the HTTP request. */ + public Map extraHeaders; + + public DeleteMetadataTaxonomyNodeHeaders() { + this.extraHeaders = mapOf(); + } + + protected DeleteMetadataTaxonomyNodeHeaders(Builder builder) { + this.extraHeaders = builder.extraHeaders; + } + + public Map getExtraHeaders() { + return extraHeaders; + } + + public static class Builder { + + protected Map extraHeaders; + + public Builder() { + this.extraHeaders = mapOf(); + } + + public Builder extraHeaders(Map extraHeaders) { + this.extraHeaders = extraHeaders; + return this; + } + + public DeleteMetadataTaxonomyNodeHeaders build() { + return new DeleteMetadataTaxonomyNodeHeaders(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/metadatataxonomies/GetMetadataTaxonomiesHeaders.java b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/GetMetadataTaxonomiesHeaders.java new file mode 100644 index 000000000..db3c7475b --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/GetMetadataTaxonomiesHeaders.java @@ -0,0 +1,41 @@ +package com.box.sdkgen.managers.metadatataxonomies; + +import static com.box.sdkgen.internal.utils.UtilsManager.mapOf; + +import java.util.Map; + +public class GetMetadataTaxonomiesHeaders { + + /** Extra headers that will be included in the HTTP request. */ + public Map extraHeaders; + + public GetMetadataTaxonomiesHeaders() { + this.extraHeaders = mapOf(); + } + + protected GetMetadataTaxonomiesHeaders(Builder builder) { + this.extraHeaders = builder.extraHeaders; + } + + public Map getExtraHeaders() { + return extraHeaders; + } + + public static class Builder { + + protected Map extraHeaders; + + public Builder() { + this.extraHeaders = mapOf(); + } + + public Builder extraHeaders(Map extraHeaders) { + this.extraHeaders = extraHeaders; + return this; + } + + public GetMetadataTaxonomiesHeaders build() { + return new GetMetadataTaxonomiesHeaders(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/metadatataxonomies/GetMetadataTaxonomiesQueryParams.java b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/GetMetadataTaxonomiesQueryParams.java new file mode 100644 index 000000000..472490489 --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/GetMetadataTaxonomiesQueryParams.java @@ -0,0 +1,51 @@ +package com.box.sdkgen.managers.metadatataxonomies; + +public class GetMetadataTaxonomiesQueryParams { + + /** + * Defines the position marker at which to begin returning results. This is used when paginating + * using marker-based pagination. + * + *

This requires `usemarker` to be set to `true`. + */ + public String marker; + + /** The maximum number of items to return per page. */ + public Long limit; + + public GetMetadataTaxonomiesQueryParams() {} + + protected GetMetadataTaxonomiesQueryParams(Builder builder) { + this.marker = builder.marker; + this.limit = builder.limit; + } + + public String getMarker() { + return marker; + } + + public Long getLimit() { + return limit; + } + + public static class Builder { + + protected String marker; + + protected Long limit; + + public Builder marker(String marker) { + this.marker = marker; + return this; + } + + public Builder limit(Long limit) { + this.limit = limit; + return this; + } + + public GetMetadataTaxonomiesQueryParams build() { + return new GetMetadataTaxonomiesQueryParams(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/metadatataxonomies/GetMetadataTaxonomyByKeyHeaders.java b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/GetMetadataTaxonomyByKeyHeaders.java new file mode 100644 index 000000000..8e96b5050 --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/GetMetadataTaxonomyByKeyHeaders.java @@ -0,0 +1,41 @@ +package com.box.sdkgen.managers.metadatataxonomies; + +import static com.box.sdkgen.internal.utils.UtilsManager.mapOf; + +import java.util.Map; + +public class GetMetadataTaxonomyByKeyHeaders { + + /** Extra headers that will be included in the HTTP request. */ + public Map extraHeaders; + + public GetMetadataTaxonomyByKeyHeaders() { + this.extraHeaders = mapOf(); + } + + protected GetMetadataTaxonomyByKeyHeaders(Builder builder) { + this.extraHeaders = builder.extraHeaders; + } + + public Map getExtraHeaders() { + return extraHeaders; + } + + public static class Builder { + + protected Map extraHeaders; + + public Builder() { + this.extraHeaders = mapOf(); + } + + public Builder extraHeaders(Map extraHeaders) { + this.extraHeaders = extraHeaders; + return this; + } + + public GetMetadataTaxonomyByKeyHeaders build() { + return new GetMetadataTaxonomyByKeyHeaders(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/metadatataxonomies/GetMetadataTaxonomyNodeByIdHeaders.java b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/GetMetadataTaxonomyNodeByIdHeaders.java new file mode 100644 index 000000000..48d751672 --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/GetMetadataTaxonomyNodeByIdHeaders.java @@ -0,0 +1,41 @@ +package com.box.sdkgen.managers.metadatataxonomies; + +import static com.box.sdkgen.internal.utils.UtilsManager.mapOf; + +import java.util.Map; + +public class GetMetadataTaxonomyNodeByIdHeaders { + + /** Extra headers that will be included in the HTTP request. */ + public Map extraHeaders; + + public GetMetadataTaxonomyNodeByIdHeaders() { + this.extraHeaders = mapOf(); + } + + protected GetMetadataTaxonomyNodeByIdHeaders(Builder builder) { + this.extraHeaders = builder.extraHeaders; + } + + public Map getExtraHeaders() { + return extraHeaders; + } + + public static class Builder { + + protected Map extraHeaders; + + public Builder() { + this.extraHeaders = mapOf(); + } + + public Builder extraHeaders(Map extraHeaders) { + this.extraHeaders = extraHeaders; + return this; + } + + public GetMetadataTaxonomyNodeByIdHeaders build() { + return new GetMetadataTaxonomyNodeByIdHeaders(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/metadatataxonomies/GetMetadataTaxonomyNodesHeaders.java b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/GetMetadataTaxonomyNodesHeaders.java new file mode 100644 index 000000000..6c5b5b4d9 --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/GetMetadataTaxonomyNodesHeaders.java @@ -0,0 +1,41 @@ +package com.box.sdkgen.managers.metadatataxonomies; + +import static com.box.sdkgen.internal.utils.UtilsManager.mapOf; + +import java.util.Map; + +public class GetMetadataTaxonomyNodesHeaders { + + /** Extra headers that will be included in the HTTP request. */ + public Map extraHeaders; + + public GetMetadataTaxonomyNodesHeaders() { + this.extraHeaders = mapOf(); + } + + protected GetMetadataTaxonomyNodesHeaders(Builder builder) { + this.extraHeaders = builder.extraHeaders; + } + + public Map getExtraHeaders() { + return extraHeaders; + } + + public static class Builder { + + protected Map extraHeaders; + + public Builder() { + this.extraHeaders = mapOf(); + } + + public Builder extraHeaders(Map extraHeaders) { + this.extraHeaders = extraHeaders; + return this; + } + + public GetMetadataTaxonomyNodesHeaders build() { + return new GetMetadataTaxonomyNodesHeaders(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/metadatataxonomies/GetMetadataTaxonomyNodesQueryParams.java b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/GetMetadataTaxonomyNodesQueryParams.java new file mode 100644 index 000000000..455c9a272 --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/GetMetadataTaxonomyNodesQueryParams.java @@ -0,0 +1,140 @@ +package com.box.sdkgen.managers.metadatataxonomies; + +import java.util.List; + +public class GetMetadataTaxonomyNodesQueryParams { + + /** + * Filters results by taxonomy level. Multiple values can be provided. Results include nodes that + * match any of the specified values. + */ + public List level; + + /** + * Node identifier of a direct parent node. Multiple values can be provided. Results include nodes + * that match any of the specified values. + */ + public List parent; + + /** + * Node identifier of any ancestor node. Multiple values can be provided. Results include nodes + * that match any of the specified values. + */ + public List ancestor; + + /** Query text to search for the taxonomy nodes. */ + public String query; + + /** + * When set to `true` this provides the total number of nodes that matched the query. The response + * will compute counts of up to 10,000 elements. Defaults to `false`. + */ + public Boolean includeTotalResultCount; + + /** + * Defines the position marker at which to begin returning results. This is used when paginating + * using marker-based pagination. + * + *

This requires `usemarker` to be set to `true`. + */ + public String marker; + + /** The maximum number of items to return per page. */ + public Long limit; + + public GetMetadataTaxonomyNodesQueryParams() {} + + protected GetMetadataTaxonomyNodesQueryParams(Builder builder) { + this.level = builder.level; + this.parent = builder.parent; + this.ancestor = builder.ancestor; + this.query = builder.query; + this.includeTotalResultCount = builder.includeTotalResultCount; + this.marker = builder.marker; + this.limit = builder.limit; + } + + public List getLevel() { + return level; + } + + public List getParent() { + return parent; + } + + public List getAncestor() { + return ancestor; + } + + public String getQuery() { + return query; + } + + public Boolean getIncludeTotalResultCount() { + return includeTotalResultCount; + } + + public String getMarker() { + return marker; + } + + public Long getLimit() { + return limit; + } + + public static class Builder { + + protected List level; + + protected List parent; + + protected List ancestor; + + protected String query; + + protected Boolean includeTotalResultCount; + + protected String marker; + + protected Long limit; + + public Builder level(List level) { + this.level = level; + return this; + } + + public Builder parent(List parent) { + this.parent = parent; + return this; + } + + public Builder ancestor(List ancestor) { + this.ancestor = ancestor; + return this; + } + + public Builder query(String query) { + this.query = query; + return this; + } + + public Builder includeTotalResultCount(Boolean includeTotalResultCount) { + this.includeTotalResultCount = includeTotalResultCount; + return this; + } + + public Builder marker(String marker) { + this.marker = marker; + return this; + } + + public Builder limit(Long limit) { + this.limit = limit; + return this; + } + + public GetMetadataTaxonomyNodesQueryParams build() { + return new GetMetadataTaxonomyNodesQueryParams(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/metadatataxonomies/GetMetadataTemplateFieldOptionsHeaders.java b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/GetMetadataTemplateFieldOptionsHeaders.java new file mode 100644 index 000000000..93a0bdb15 --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/GetMetadataTemplateFieldOptionsHeaders.java @@ -0,0 +1,41 @@ +package com.box.sdkgen.managers.metadatataxonomies; + +import static com.box.sdkgen.internal.utils.UtilsManager.mapOf; + +import java.util.Map; + +public class GetMetadataTemplateFieldOptionsHeaders { + + /** Extra headers that will be included in the HTTP request. */ + public Map extraHeaders; + + public GetMetadataTemplateFieldOptionsHeaders() { + this.extraHeaders = mapOf(); + } + + protected GetMetadataTemplateFieldOptionsHeaders(Builder builder) { + this.extraHeaders = builder.extraHeaders; + } + + public Map getExtraHeaders() { + return extraHeaders; + } + + public static class Builder { + + protected Map extraHeaders; + + public Builder() { + this.extraHeaders = mapOf(); + } + + public Builder extraHeaders(Map extraHeaders) { + this.extraHeaders = extraHeaders; + return this; + } + + public GetMetadataTemplateFieldOptionsHeaders build() { + return new GetMetadataTemplateFieldOptionsHeaders(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/metadatataxonomies/GetMetadataTemplateFieldOptionsQueryParams.java b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/GetMetadataTemplateFieldOptionsQueryParams.java new file mode 100644 index 000000000..db9d4eb26 --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/GetMetadataTemplateFieldOptionsQueryParams.java @@ -0,0 +1,159 @@ +package com.box.sdkgen.managers.metadatataxonomies; + +import java.util.List; + +public class GetMetadataTemplateFieldOptionsQueryParams { + + /** + * Filters results by taxonomy level. Multiple values can be provided. Results include nodes that + * match any of the specified values. + */ + public List level; + + /** + * Node identifier of a direct parent node. Multiple values can be provided. Results include nodes + * that match any of the specified values. + */ + public List parent; + + /** + * Node identifier of any ancestor node. Multiple values can be provided. Results include nodes + * that match any of the specified values. + */ + public List ancestor; + + /** Query text to search for the taxonomy nodes. */ + public String query; + + /** + * When set to `true` this provides the total number of nodes that matched the query. The response + * will compute counts of up to 10,000 elements. Defaults to `false`. + */ + public Boolean includeTotalResultCount; + + /** + * When set to `true`, this only returns valid selectable options for this template taxonomy + * field. Otherwise, it returns all taxonomy nodes, whether or not they are selectable. Defaults + * to `true`. + */ + public Boolean onlySelectableOptions; + + /** + * Defines the position marker at which to begin returning results. This is used when paginating + * using marker-based pagination. + * + *

This requires `usemarker` to be set to `true`. + */ + public String marker; + + /** The maximum number of items to return per page. */ + public Long limit; + + public GetMetadataTemplateFieldOptionsQueryParams() {} + + protected GetMetadataTemplateFieldOptionsQueryParams(Builder builder) { + this.level = builder.level; + this.parent = builder.parent; + this.ancestor = builder.ancestor; + this.query = builder.query; + this.includeTotalResultCount = builder.includeTotalResultCount; + this.onlySelectableOptions = builder.onlySelectableOptions; + this.marker = builder.marker; + this.limit = builder.limit; + } + + public List getLevel() { + return level; + } + + public List getParent() { + return parent; + } + + public List getAncestor() { + return ancestor; + } + + public String getQuery() { + return query; + } + + public Boolean getIncludeTotalResultCount() { + return includeTotalResultCount; + } + + public Boolean getOnlySelectableOptions() { + return onlySelectableOptions; + } + + public String getMarker() { + return marker; + } + + public Long getLimit() { + return limit; + } + + public static class Builder { + + protected List level; + + protected List parent; + + protected List ancestor; + + protected String query; + + protected Boolean includeTotalResultCount; + + protected Boolean onlySelectableOptions; + + protected String marker; + + protected Long limit; + + public Builder level(List level) { + this.level = level; + return this; + } + + public Builder parent(List parent) { + this.parent = parent; + return this; + } + + public Builder ancestor(List ancestor) { + this.ancestor = ancestor; + return this; + } + + public Builder query(String query) { + this.query = query; + return this; + } + + public Builder includeTotalResultCount(Boolean includeTotalResultCount) { + this.includeTotalResultCount = includeTotalResultCount; + return this; + } + + public Builder onlySelectableOptions(Boolean onlySelectableOptions) { + this.onlySelectableOptions = onlySelectableOptions; + return this; + } + + public Builder marker(String marker) { + this.marker = marker; + return this; + } + + public Builder limit(Long limit) { + this.limit = limit; + return this; + } + + public GetMetadataTemplateFieldOptionsQueryParams build() { + return new GetMetadataTemplateFieldOptionsQueryParams(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/metadatataxonomies/GetMetadataTemplateFieldOptionsScope.java b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/GetMetadataTemplateFieldOptionsScope.java new file mode 100644 index 000000000..1e6b3e0f8 --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/GetMetadataTemplateFieldOptionsScope.java @@ -0,0 +1,63 @@ +package com.box.sdkgen.managers.metadatataxonomies; + +import com.box.sdkgen.serialization.json.EnumWrapper; +import com.box.sdkgen.serialization.json.Valuable; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; +import java.io.IOException; +import java.util.Arrays; + +public enum GetMetadataTemplateFieldOptionsScope implements Valuable { + GLOBAL("global"), + ENTERPRISE("enterprise"); + + private final String value; + + GetMetadataTemplateFieldOptionsScope(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static class GetMetadataTemplateFieldOptionsScopeDeserializer + extends JsonDeserializer> { + + public GetMetadataTemplateFieldOptionsScopeDeserializer() { + super(); + } + + @Override + public EnumWrapper deserialize( + JsonParser p, DeserializationContext ctxt) throws IOException { + String value = p.getValueAsString(); + return Arrays.stream(GetMetadataTemplateFieldOptionsScope.values()) + .filter((v) -> v.getValue().equalsIgnoreCase(value)) + .findFirst() + .map(EnumWrapper::new) + .orElse(new EnumWrapper(value)); + } + } + + public static class GetMetadataTemplateFieldOptionsScopeSerializer + extends JsonSerializer> { + + public GetMetadataTemplateFieldOptionsScopeSerializer() { + super(); + } + + @Override + public void serialize( + EnumWrapper value, + JsonGenerator gen, + SerializerProvider serializers) + throws IOException { + gen.writeString(value.getStringValue()); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/metadatataxonomies/MetadataTaxonomiesManager.java b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/MetadataTaxonomiesManager.java new file mode 100644 index 000000000..c4bb657b4 --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/MetadataTaxonomiesManager.java @@ -0,0 +1,985 @@ +package com.box.sdkgen.managers.metadatataxonomies; + +import static com.box.sdkgen.internal.utils.UtilsManager.convertToString; +import static com.box.sdkgen.internal.utils.UtilsManager.entryOf; +import static com.box.sdkgen.internal.utils.UtilsManager.mapOf; +import static com.box.sdkgen.internal.utils.UtilsManager.mergeMaps; +import static com.box.sdkgen.internal.utils.UtilsManager.prepareParams; + +import com.box.sdkgen.networking.auth.Authentication; +import com.box.sdkgen.networking.fetchoptions.FetchOptions; +import com.box.sdkgen.networking.fetchoptions.ResponseFormat; +import com.box.sdkgen.networking.fetchresponse.FetchResponse; +import com.box.sdkgen.networking.network.NetworkSession; +import com.box.sdkgen.schemas.metadatataxonomies.MetadataTaxonomies; +import com.box.sdkgen.schemas.metadatataxonomy.MetadataTaxonomy; +import com.box.sdkgen.schemas.metadatataxonomylevel.MetadataTaxonomyLevel; +import com.box.sdkgen.schemas.metadatataxonomylevels.MetadataTaxonomyLevels; +import com.box.sdkgen.schemas.metadatataxonomynode.MetadataTaxonomyNode; +import com.box.sdkgen.schemas.metadatataxonomynodes.MetadataTaxonomyNodes; +import com.box.sdkgen.serialization.json.JsonManager; +import java.util.List; +import java.util.Map; + +public class MetadataTaxonomiesManager { + + public Authentication auth; + + public NetworkSession networkSession; + + public MetadataTaxonomiesManager() { + this.networkSession = new NetworkSession(); + } + + protected MetadataTaxonomiesManager(Builder builder) { + this.auth = builder.auth; + this.networkSession = builder.networkSession; + } + + /** + * Creates a new metadata taxonomy that can be used in metadata templates. + * + * @param requestBody Request body of createMetadataTaxonomy method + */ + public MetadataTaxonomy createMetadataTaxonomy(CreateMetadataTaxonomyRequestBody requestBody) { + return createMetadataTaxonomy(requestBody, new CreateMetadataTaxonomyHeaders()); + } + + /** + * Creates a new metadata taxonomy that can be used in metadata templates. + * + * @param requestBody Request body of createMetadataTaxonomy method + * @param headers Headers of createMetadataTaxonomy method + */ + public MetadataTaxonomy createMetadataTaxonomy( + CreateMetadataTaxonomyRequestBody requestBody, CreateMetadataTaxonomyHeaders headers) { + Map headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders())); + FetchResponse response = + this.networkSession + .getNetworkClient() + .fetch( + new FetchOptions.Builder( + String.join( + "", + this.networkSession.getBaseUrls().getBaseUrl(), + "/2.0/metadata_taxonomies"), + "POST") + .headers(headersMap) + .data(JsonManager.serialize(requestBody)) + .contentType("application/json") + .responseFormat(ResponseFormat.JSON) + .auth(this.auth) + .networkSession(this.networkSession) + .build()); + return JsonManager.deserialize(response.getData(), MetadataTaxonomy.class); + } + + /** + * Used to retrieve all metadata taxonomies in a namespace. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + */ + public MetadataTaxonomies getMetadataTaxonomies(String namespace) { + return getMetadataTaxonomies( + namespace, new GetMetadataTaxonomiesQueryParams(), new GetMetadataTaxonomiesHeaders()); + } + + /** + * Used to retrieve all metadata taxonomies in a namespace. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param queryParams Query parameters of getMetadataTaxonomies method + */ + public MetadataTaxonomies getMetadataTaxonomies( + String namespace, GetMetadataTaxonomiesQueryParams queryParams) { + return getMetadataTaxonomies(namespace, queryParams, new GetMetadataTaxonomiesHeaders()); + } + + /** + * Used to retrieve all metadata taxonomies in a namespace. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param headers Headers of getMetadataTaxonomies method + */ + public MetadataTaxonomies getMetadataTaxonomies( + String namespace, GetMetadataTaxonomiesHeaders headers) { + return getMetadataTaxonomies(namespace, new GetMetadataTaxonomiesQueryParams(), headers); + } + + /** + * Used to retrieve all metadata taxonomies in a namespace. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param queryParams Query parameters of getMetadataTaxonomies method + * @param headers Headers of getMetadataTaxonomies method + */ + public MetadataTaxonomies getMetadataTaxonomies( + String namespace, + GetMetadataTaxonomiesQueryParams queryParams, + GetMetadataTaxonomiesHeaders headers) { + Map queryParamsMap = + prepareParams( + mapOf( + entryOf("marker", convertToString(queryParams.getMarker())), + entryOf("limit", convertToString(queryParams.getLimit())))); + Map headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders())); + FetchResponse response = + this.networkSession + .getNetworkClient() + .fetch( + new FetchOptions.Builder( + String.join( + "", + this.networkSession.getBaseUrls().getBaseUrl(), + "/2.0/metadata_taxonomies/", + convertToString(namespace)), + "GET") + .params(queryParamsMap) + .headers(headersMap) + .responseFormat(ResponseFormat.JSON) + .auth(this.auth) + .networkSession(this.networkSession) + .build()); + return JsonManager.deserialize(response.getData(), MetadataTaxonomies.class); + } + + /** + * Used to retrieve a metadata taxonomy by taxonomy key. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param taxonomyKey The key of the metadata taxonomy. Example: "geography" + */ + public MetadataTaxonomy getMetadataTaxonomyByKey(String namespace, String taxonomyKey) { + return getMetadataTaxonomyByKey(namespace, taxonomyKey, new GetMetadataTaxonomyByKeyHeaders()); + } + + /** + * Used to retrieve a metadata taxonomy by taxonomy key. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param taxonomyKey The key of the metadata taxonomy. Example: "geography" + * @param headers Headers of getMetadataTaxonomyByKey method + */ + public MetadataTaxonomy getMetadataTaxonomyByKey( + String namespace, String taxonomyKey, GetMetadataTaxonomyByKeyHeaders headers) { + Map headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders())); + FetchResponse response = + this.networkSession + .getNetworkClient() + .fetch( + new FetchOptions.Builder( + String.join( + "", + this.networkSession.getBaseUrls().getBaseUrl(), + "/2.0/metadata_taxonomies/", + convertToString(namespace), + "/", + convertToString(taxonomyKey)), + "GET") + .headers(headersMap) + .responseFormat(ResponseFormat.JSON) + .auth(this.auth) + .networkSession(this.networkSession) + .build()); + return JsonManager.deserialize(response.getData(), MetadataTaxonomy.class); + } + + /** + * Updates an existing metadata taxonomy. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param taxonomyKey The key of the metadata taxonomy. Example: "geography" + * @param requestBody Request body of updateMetadataTaxonomy method + */ + public MetadataTaxonomy updateMetadataTaxonomy( + String namespace, String taxonomyKey, UpdateMetadataTaxonomyRequestBody requestBody) { + return updateMetadataTaxonomy( + namespace, taxonomyKey, requestBody, new UpdateMetadataTaxonomyHeaders()); + } + + /** + * Updates an existing metadata taxonomy. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param taxonomyKey The key of the metadata taxonomy. Example: "geography" + * @param requestBody Request body of updateMetadataTaxonomy method + * @param headers Headers of updateMetadataTaxonomy method + */ + public MetadataTaxonomy updateMetadataTaxonomy( + String namespace, + String taxonomyKey, + UpdateMetadataTaxonomyRequestBody requestBody, + UpdateMetadataTaxonomyHeaders headers) { + Map headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders())); + FetchResponse response = + this.networkSession + .getNetworkClient() + .fetch( + new FetchOptions.Builder( + String.join( + "", + this.networkSession.getBaseUrls().getBaseUrl(), + "/2.0/metadata_taxonomies/", + convertToString(namespace), + "/", + convertToString(taxonomyKey)), + "PATCH") + .headers(headersMap) + .data(JsonManager.serialize(requestBody)) + .contentType("application/json") + .responseFormat(ResponseFormat.JSON) + .auth(this.auth) + .networkSession(this.networkSession) + .build()); + return JsonManager.deserialize(response.getData(), MetadataTaxonomy.class); + } + + /** + * Delete a metadata taxonomy. This deletion is permanent and cannot be reverted. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param taxonomyKey The key of the metadata taxonomy. Example: "geography" + */ + public void deleteMetadataTaxonomy(String namespace, String taxonomyKey) { + deleteMetadataTaxonomy(namespace, taxonomyKey, new DeleteMetadataTaxonomyHeaders()); + } + + /** + * Delete a metadata taxonomy. This deletion is permanent and cannot be reverted. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param taxonomyKey The key of the metadata taxonomy. Example: "geography" + * @param headers Headers of deleteMetadataTaxonomy method + */ + public void deleteMetadataTaxonomy( + String namespace, String taxonomyKey, DeleteMetadataTaxonomyHeaders headers) { + Map headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders())); + FetchResponse response = + this.networkSession + .getNetworkClient() + .fetch( + new FetchOptions.Builder( + String.join( + "", + this.networkSession.getBaseUrls().getBaseUrl(), + "/2.0/metadata_taxonomies/", + convertToString(namespace), + "/", + convertToString(taxonomyKey)), + "DELETE") + .headers(headersMap) + .responseFormat(ResponseFormat.NO_CONTENT) + .auth(this.auth) + .networkSession(this.networkSession) + .build()); + } + + /** + * Creates new metadata taxonomy levels. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param taxonomyKey The key of the metadata taxonomy. Example: "geography" + * @param requestBody Request body of createMetadataTaxonomyLevel method + */ + public MetadataTaxonomyLevels createMetadataTaxonomyLevel( + String namespace, String taxonomyKey, List requestBody) { + return createMetadataTaxonomyLevel( + namespace, taxonomyKey, requestBody, new CreateMetadataTaxonomyLevelHeaders()); + } + + /** + * Creates new metadata taxonomy levels. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param taxonomyKey The key of the metadata taxonomy. Example: "geography" + * @param requestBody Request body of createMetadataTaxonomyLevel method + * @param headers Headers of createMetadataTaxonomyLevel method + */ + public MetadataTaxonomyLevels createMetadataTaxonomyLevel( + String namespace, + String taxonomyKey, + List requestBody, + CreateMetadataTaxonomyLevelHeaders headers) { + Map headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders())); + FetchResponse response = + this.networkSession + .getNetworkClient() + .fetch( + new FetchOptions.Builder( + String.join( + "", + this.networkSession.getBaseUrls().getBaseUrl(), + "/2.0/metadata_taxonomies/", + convertToString(namespace), + "/", + convertToString(taxonomyKey), + "/levels"), + "POST") + .headers(headersMap) + .data(JsonManager.serialize(requestBody)) + .contentType("application/json") + .responseFormat(ResponseFormat.JSON) + .auth(this.auth) + .networkSession(this.networkSession) + .build()); + return JsonManager.deserialize(response.getData(), MetadataTaxonomyLevels.class); + } + + /** + * Updates an existing metadata taxonomy level. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param taxonomyKey The key of the metadata taxonomy. Example: "geography" + * @param levelIndex The index of the metadata taxonomy level. Example: 1 + * @param requestBody Request body of patchMetadataTaxonomiesIdIdLevelsId method + */ + public MetadataTaxonomyLevel patchMetadataTaxonomiesIdIdLevelsId( + String namespace, + String taxonomyKey, + long levelIndex, + PatchMetadataTaxonomiesIdIdLevelsIdRequestBody requestBody) { + return patchMetadataTaxonomiesIdIdLevelsId( + namespace, + taxonomyKey, + levelIndex, + requestBody, + new PatchMetadataTaxonomiesIdIdLevelsIdHeaders()); + } + + /** + * Updates an existing metadata taxonomy level. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param taxonomyKey The key of the metadata taxonomy. Example: "geography" + * @param levelIndex The index of the metadata taxonomy level. Example: 1 + * @param requestBody Request body of patchMetadataTaxonomiesIdIdLevelsId method + * @param headers Headers of patchMetadataTaxonomiesIdIdLevelsId method + */ + public MetadataTaxonomyLevel patchMetadataTaxonomiesIdIdLevelsId( + String namespace, + String taxonomyKey, + long levelIndex, + PatchMetadataTaxonomiesIdIdLevelsIdRequestBody requestBody, + PatchMetadataTaxonomiesIdIdLevelsIdHeaders headers) { + Map headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders())); + FetchResponse response = + this.networkSession + .getNetworkClient() + .fetch( + new FetchOptions.Builder( + String.join( + "", + this.networkSession.getBaseUrls().getBaseUrl(), + "/2.0/metadata_taxonomies/", + convertToString(namespace), + "/", + convertToString(taxonomyKey), + "/levels/", + convertToString(levelIndex)), + "PATCH") + .headers(headersMap) + .data(JsonManager.serialize(requestBody)) + .contentType("application/json") + .responseFormat(ResponseFormat.JSON) + .auth(this.auth) + .networkSession(this.networkSession) + .build()); + return JsonManager.deserialize(response.getData(), MetadataTaxonomyLevel.class); + } + + /** + * Creates a new metadata taxonomy level and appends it to the existing levels. If there are no + * levels defined yet, this will create the first level. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param taxonomyKey The key of the metadata taxonomy. Example: "geography" + * @param requestBody Request body of addMetadataTaxonomyLevel method + */ + public MetadataTaxonomyLevels addMetadataTaxonomyLevel( + String namespace, String taxonomyKey, AddMetadataTaxonomyLevelRequestBody requestBody) { + return addMetadataTaxonomyLevel( + namespace, taxonomyKey, requestBody, new AddMetadataTaxonomyLevelHeaders()); + } + + /** + * Creates a new metadata taxonomy level and appends it to the existing levels. If there are no + * levels defined yet, this will create the first level. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param taxonomyKey The key of the metadata taxonomy. Example: "geography" + * @param requestBody Request body of addMetadataTaxonomyLevel method + * @param headers Headers of addMetadataTaxonomyLevel method + */ + public MetadataTaxonomyLevels addMetadataTaxonomyLevel( + String namespace, + String taxonomyKey, + AddMetadataTaxonomyLevelRequestBody requestBody, + AddMetadataTaxonomyLevelHeaders headers) { + Map headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders())); + FetchResponse response = + this.networkSession + .getNetworkClient() + .fetch( + new FetchOptions.Builder( + String.join( + "", + this.networkSession.getBaseUrls().getBaseUrl(), + "/2.0/metadata_taxonomies/", + convertToString(namespace), + "/", + convertToString(taxonomyKey), + "/levels:append"), + "POST") + .headers(headersMap) + .data(JsonManager.serialize(requestBody)) + .contentType("application/json") + .responseFormat(ResponseFormat.JSON) + .auth(this.auth) + .networkSession(this.networkSession) + .build()); + return JsonManager.deserialize(response.getData(), MetadataTaxonomyLevels.class); + } + + /** + * Deletes the last level of the metadata taxonomy. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param taxonomyKey The key of the metadata taxonomy. Example: "geography" + */ + public MetadataTaxonomyLevels deleteMetadataTaxonomyLevel(String namespace, String taxonomyKey) { + return deleteMetadataTaxonomyLevel( + namespace, taxonomyKey, new DeleteMetadataTaxonomyLevelHeaders()); + } + + /** + * Deletes the last level of the metadata taxonomy. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param taxonomyKey The key of the metadata taxonomy. Example: "geography" + * @param headers Headers of deleteMetadataTaxonomyLevel method + */ + public MetadataTaxonomyLevels deleteMetadataTaxonomyLevel( + String namespace, String taxonomyKey, DeleteMetadataTaxonomyLevelHeaders headers) { + Map headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders())); + FetchResponse response = + this.networkSession + .getNetworkClient() + .fetch( + new FetchOptions.Builder( + String.join( + "", + this.networkSession.getBaseUrls().getBaseUrl(), + "/2.0/metadata_taxonomies/", + convertToString(namespace), + "/", + convertToString(taxonomyKey), + "/levels:trim"), + "POST") + .headers(headersMap) + .responseFormat(ResponseFormat.JSON) + .auth(this.auth) + .networkSession(this.networkSession) + .build()); + return JsonManager.deserialize(response.getData(), MetadataTaxonomyLevels.class); + } + + /** + * Used to retrieve metadata taxonomy nodes based on the parameters specified. Results are sorted + * in lexicographic order unless a `query` parameter is passed. With a `query` parameter + * specified, results are sorted in order of relevance. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param taxonomyKey The key of the metadata taxonomy. Example: "geography" + */ + public MetadataTaxonomyNodes getMetadataTaxonomyNodes(String namespace, String taxonomyKey) { + return getMetadataTaxonomyNodes( + namespace, + taxonomyKey, + new GetMetadataTaxonomyNodesQueryParams(), + new GetMetadataTaxonomyNodesHeaders()); + } + + /** + * Used to retrieve metadata taxonomy nodes based on the parameters specified. Results are sorted + * in lexicographic order unless a `query` parameter is passed. With a `query` parameter + * specified, results are sorted in order of relevance. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param taxonomyKey The key of the metadata taxonomy. Example: "geography" + * @param queryParams Query parameters of getMetadataTaxonomyNodes method + */ + public MetadataTaxonomyNodes getMetadataTaxonomyNodes( + String namespace, String taxonomyKey, GetMetadataTaxonomyNodesQueryParams queryParams) { + return getMetadataTaxonomyNodes( + namespace, taxonomyKey, queryParams, new GetMetadataTaxonomyNodesHeaders()); + } + + /** + * Used to retrieve metadata taxonomy nodes based on the parameters specified. Results are sorted + * in lexicographic order unless a `query` parameter is passed. With a `query` parameter + * specified, results are sorted in order of relevance. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param taxonomyKey The key of the metadata taxonomy. Example: "geography" + * @param headers Headers of getMetadataTaxonomyNodes method + */ + public MetadataTaxonomyNodes getMetadataTaxonomyNodes( + String namespace, String taxonomyKey, GetMetadataTaxonomyNodesHeaders headers) { + return getMetadataTaxonomyNodes( + namespace, taxonomyKey, new GetMetadataTaxonomyNodesQueryParams(), headers); + } + + /** + * Used to retrieve metadata taxonomy nodes based on the parameters specified. Results are sorted + * in lexicographic order unless a `query` parameter is passed. With a `query` parameter + * specified, results are sorted in order of relevance. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param taxonomyKey The key of the metadata taxonomy. Example: "geography" + * @param queryParams Query parameters of getMetadataTaxonomyNodes method + * @param headers Headers of getMetadataTaxonomyNodes method + */ + public MetadataTaxonomyNodes getMetadataTaxonomyNodes( + String namespace, + String taxonomyKey, + GetMetadataTaxonomyNodesQueryParams queryParams, + GetMetadataTaxonomyNodesHeaders headers) { + Map queryParamsMap = + prepareParams( + mapOf( + entryOf("level", convertToString(queryParams.getLevel())), + entryOf("parent", convertToString(queryParams.getParent())), + entryOf("ancestor", convertToString(queryParams.getAncestor())), + entryOf("query", convertToString(queryParams.getQuery())), + entryOf( + "include-total-result-count", + convertToString(queryParams.getIncludeTotalResultCount())), + entryOf("marker", convertToString(queryParams.getMarker())), + entryOf("limit", convertToString(queryParams.getLimit())))); + Map headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders())); + FetchResponse response = + this.networkSession + .getNetworkClient() + .fetch( + new FetchOptions.Builder( + String.join( + "", + this.networkSession.getBaseUrls().getBaseUrl(), + "/2.0/metadata_taxonomies/", + convertToString(namespace), + "/", + convertToString(taxonomyKey), + "/nodes"), + "GET") + .params(queryParamsMap) + .headers(headersMap) + .responseFormat(ResponseFormat.JSON) + .auth(this.auth) + .networkSession(this.networkSession) + .build()); + return JsonManager.deserialize(response.getData(), MetadataTaxonomyNodes.class); + } + + /** + * Creates a new metadata taxonomy node. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param taxonomyKey The key of the metadata taxonomy. Example: "geography" + * @param requestBody Request body of createMetadataTaxonomyNode method + */ + public MetadataTaxonomyNode createMetadataTaxonomyNode( + String namespace, String taxonomyKey, CreateMetadataTaxonomyNodeRequestBody requestBody) { + return createMetadataTaxonomyNode( + namespace, taxonomyKey, requestBody, new CreateMetadataTaxonomyNodeHeaders()); + } + + /** + * Creates a new metadata taxonomy node. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param taxonomyKey The key of the metadata taxonomy. Example: "geography" + * @param requestBody Request body of createMetadataTaxonomyNode method + * @param headers Headers of createMetadataTaxonomyNode method + */ + public MetadataTaxonomyNode createMetadataTaxonomyNode( + String namespace, + String taxonomyKey, + CreateMetadataTaxonomyNodeRequestBody requestBody, + CreateMetadataTaxonomyNodeHeaders headers) { + Map headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders())); + FetchResponse response = + this.networkSession + .getNetworkClient() + .fetch( + new FetchOptions.Builder( + String.join( + "", + this.networkSession.getBaseUrls().getBaseUrl(), + "/2.0/metadata_taxonomies/", + convertToString(namespace), + "/", + convertToString(taxonomyKey), + "/nodes"), + "POST") + .headers(headersMap) + .data(JsonManager.serialize(requestBody)) + .contentType("application/json") + .responseFormat(ResponseFormat.JSON) + .auth(this.auth) + .networkSession(this.networkSession) + .build()); + return JsonManager.deserialize(response.getData(), MetadataTaxonomyNode.class); + } + + /** + * Retrieves a metadata taxonomy node by its identifier. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param taxonomyKey The key of the metadata taxonomy. Example: "geography" + * @param nodeId The identifier of the metadata taxonomy node. Example: + * "14d3d433-c77f-49c5-b146-9dea370f6e32" + */ + public MetadataTaxonomyNode getMetadataTaxonomyNodeById( + String namespace, String taxonomyKey, String nodeId) { + return getMetadataTaxonomyNodeById( + namespace, taxonomyKey, nodeId, new GetMetadataTaxonomyNodeByIdHeaders()); + } + + /** + * Retrieves a metadata taxonomy node by its identifier. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param taxonomyKey The key of the metadata taxonomy. Example: "geography" + * @param nodeId The identifier of the metadata taxonomy node. Example: + * "14d3d433-c77f-49c5-b146-9dea370f6e32" + * @param headers Headers of getMetadataTaxonomyNodeById method + */ + public MetadataTaxonomyNode getMetadataTaxonomyNodeById( + String namespace, + String taxonomyKey, + String nodeId, + GetMetadataTaxonomyNodeByIdHeaders headers) { + Map headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders())); + FetchResponse response = + this.networkSession + .getNetworkClient() + .fetch( + new FetchOptions.Builder( + String.join( + "", + this.networkSession.getBaseUrls().getBaseUrl(), + "/2.0/metadata_taxonomies/", + convertToString(namespace), + "/", + convertToString(taxonomyKey), + "/nodes/", + convertToString(nodeId)), + "GET") + .headers(headersMap) + .responseFormat(ResponseFormat.JSON) + .auth(this.auth) + .networkSession(this.networkSession) + .build()); + return JsonManager.deserialize(response.getData(), MetadataTaxonomyNode.class); + } + + /** + * Updates an existing metadata taxonomy node. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param taxonomyKey The key of the metadata taxonomy. Example: "geography" + * @param nodeId The identifier of the metadata taxonomy node. Example: + * "14d3d433-c77f-49c5-b146-9dea370f6e32" + */ + public MetadataTaxonomyNode updateMetadataTaxonomyNode( + String namespace, String taxonomyKey, String nodeId) { + return updateMetadataTaxonomyNode( + namespace, + taxonomyKey, + nodeId, + new UpdateMetadataTaxonomyNodeRequestBody(), + new UpdateMetadataTaxonomyNodeHeaders()); + } + + /** + * Updates an existing metadata taxonomy node. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param taxonomyKey The key of the metadata taxonomy. Example: "geography" + * @param nodeId The identifier of the metadata taxonomy node. Example: + * "14d3d433-c77f-49c5-b146-9dea370f6e32" + * @param requestBody Request body of updateMetadataTaxonomyNode method + */ + public MetadataTaxonomyNode updateMetadataTaxonomyNode( + String namespace, + String taxonomyKey, + String nodeId, + UpdateMetadataTaxonomyNodeRequestBody requestBody) { + return updateMetadataTaxonomyNode( + namespace, taxonomyKey, nodeId, requestBody, new UpdateMetadataTaxonomyNodeHeaders()); + } + + /** + * Updates an existing metadata taxonomy node. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param taxonomyKey The key of the metadata taxonomy. Example: "geography" + * @param nodeId The identifier of the metadata taxonomy node. Example: + * "14d3d433-c77f-49c5-b146-9dea370f6e32" + * @param headers Headers of updateMetadataTaxonomyNode method + */ + public MetadataTaxonomyNode updateMetadataTaxonomyNode( + String namespace, + String taxonomyKey, + String nodeId, + UpdateMetadataTaxonomyNodeHeaders headers) { + return updateMetadataTaxonomyNode( + namespace, taxonomyKey, nodeId, new UpdateMetadataTaxonomyNodeRequestBody(), headers); + } + + /** + * Updates an existing metadata taxonomy node. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param taxonomyKey The key of the metadata taxonomy. Example: "geography" + * @param nodeId The identifier of the metadata taxonomy node. Example: + * "14d3d433-c77f-49c5-b146-9dea370f6e32" + * @param requestBody Request body of updateMetadataTaxonomyNode method + * @param headers Headers of updateMetadataTaxonomyNode method + */ + public MetadataTaxonomyNode updateMetadataTaxonomyNode( + String namespace, + String taxonomyKey, + String nodeId, + UpdateMetadataTaxonomyNodeRequestBody requestBody, + UpdateMetadataTaxonomyNodeHeaders headers) { + Map headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders())); + FetchResponse response = + this.networkSession + .getNetworkClient() + .fetch( + new FetchOptions.Builder( + String.join( + "", + this.networkSession.getBaseUrls().getBaseUrl(), + "/2.0/metadata_taxonomies/", + convertToString(namespace), + "/", + convertToString(taxonomyKey), + "/nodes/", + convertToString(nodeId)), + "PATCH") + .headers(headersMap) + .data(JsonManager.serialize(requestBody)) + .contentType("application/json") + .responseFormat(ResponseFormat.JSON) + .auth(this.auth) + .networkSession(this.networkSession) + .build()); + return JsonManager.deserialize(response.getData(), MetadataTaxonomyNode.class); + } + + /** + * Delete a metadata taxonomy node. This deletion is permanent and cannot be reverted. Only + * metadata taxonomy nodes without any children can be deleted. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param taxonomyKey The key of the metadata taxonomy. Example: "geography" + * @param nodeId The identifier of the metadata taxonomy node. Example: + * "14d3d433-c77f-49c5-b146-9dea370f6e32" + */ + public void deleteMetadataTaxonomyNode(String namespace, String taxonomyKey, String nodeId) { + deleteMetadataTaxonomyNode( + namespace, taxonomyKey, nodeId, new DeleteMetadataTaxonomyNodeHeaders()); + } + + /** + * Delete a metadata taxonomy node. This deletion is permanent and cannot be reverted. Only + * metadata taxonomy nodes without any children can be deleted. + * + * @param namespace The namespace of the metadata taxonomy. Example: "enterprise_123456" + * @param taxonomyKey The key of the metadata taxonomy. Example: "geography" + * @param nodeId The identifier of the metadata taxonomy node. Example: + * "14d3d433-c77f-49c5-b146-9dea370f6e32" + * @param headers Headers of deleteMetadataTaxonomyNode method + */ + public void deleteMetadataTaxonomyNode( + String namespace, + String taxonomyKey, + String nodeId, + DeleteMetadataTaxonomyNodeHeaders headers) { + Map headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders())); + FetchResponse response = + this.networkSession + .getNetworkClient() + .fetch( + new FetchOptions.Builder( + String.join( + "", + this.networkSession.getBaseUrls().getBaseUrl(), + "/2.0/metadata_taxonomies/", + convertToString(namespace), + "/", + convertToString(taxonomyKey), + "/nodes/", + convertToString(nodeId)), + "DELETE") + .headers(headersMap) + .responseFormat(ResponseFormat.NO_CONTENT) + .auth(this.auth) + .networkSession(this.networkSession) + .build()); + } + + /** + * Used to retrieve metadata taxonomy nodes which are available for the taxonomy field based on + * its configuration and the parameters specified. Results are sorted in lexicographic order + * unless a `query` parameter is passed. With a `query` parameter specified, results are sorted in + * order of relevance. + * + * @param scope The scope of the metadata template. Example: "global" + * @param templateKey The name of the metadata template. Example: "properties" + * @param fieldKey The key of the metadata taxonomy field in the template. Example: "geography" + */ + public MetadataTaxonomyNodes getMetadataTemplateFieldOptions( + GetMetadataTemplateFieldOptionsScope scope, String templateKey, String fieldKey) { + return getMetadataTemplateFieldOptions( + scope, + templateKey, + fieldKey, + new GetMetadataTemplateFieldOptionsQueryParams(), + new GetMetadataTemplateFieldOptionsHeaders()); + } + + /** + * Used to retrieve metadata taxonomy nodes which are available for the taxonomy field based on + * its configuration and the parameters specified. Results are sorted in lexicographic order + * unless a `query` parameter is passed. With a `query` parameter specified, results are sorted in + * order of relevance. + * + * @param scope The scope of the metadata template. Example: "global" + * @param templateKey The name of the metadata template. Example: "properties" + * @param fieldKey The key of the metadata taxonomy field in the template. Example: "geography" + * @param queryParams Query parameters of getMetadataTemplateFieldOptions method + */ + public MetadataTaxonomyNodes getMetadataTemplateFieldOptions( + GetMetadataTemplateFieldOptionsScope scope, + String templateKey, + String fieldKey, + GetMetadataTemplateFieldOptionsQueryParams queryParams) { + return getMetadataTemplateFieldOptions( + scope, templateKey, fieldKey, queryParams, new GetMetadataTemplateFieldOptionsHeaders()); + } + + /** + * Used to retrieve metadata taxonomy nodes which are available for the taxonomy field based on + * its configuration and the parameters specified. Results are sorted in lexicographic order + * unless a `query` parameter is passed. With a `query` parameter specified, results are sorted in + * order of relevance. + * + * @param scope The scope of the metadata template. Example: "global" + * @param templateKey The name of the metadata template. Example: "properties" + * @param fieldKey The key of the metadata taxonomy field in the template. Example: "geography" + * @param headers Headers of getMetadataTemplateFieldOptions method + */ + public MetadataTaxonomyNodes getMetadataTemplateFieldOptions( + GetMetadataTemplateFieldOptionsScope scope, + String templateKey, + String fieldKey, + GetMetadataTemplateFieldOptionsHeaders headers) { + return getMetadataTemplateFieldOptions( + scope, templateKey, fieldKey, new GetMetadataTemplateFieldOptionsQueryParams(), headers); + } + + /** + * Used to retrieve metadata taxonomy nodes which are available for the taxonomy field based on + * its configuration and the parameters specified. Results are sorted in lexicographic order + * unless a `query` parameter is passed. With a `query` parameter specified, results are sorted in + * order of relevance. + * + * @param scope The scope of the metadata template. Example: "global" + * @param templateKey The name of the metadata template. Example: "properties" + * @param fieldKey The key of the metadata taxonomy field in the template. Example: "geography" + * @param queryParams Query parameters of getMetadataTemplateFieldOptions method + * @param headers Headers of getMetadataTemplateFieldOptions method + */ + public MetadataTaxonomyNodes getMetadataTemplateFieldOptions( + GetMetadataTemplateFieldOptionsScope scope, + String templateKey, + String fieldKey, + GetMetadataTemplateFieldOptionsQueryParams queryParams, + GetMetadataTemplateFieldOptionsHeaders headers) { + Map queryParamsMap = + prepareParams( + mapOf( + entryOf("level", convertToString(queryParams.getLevel())), + entryOf("parent", convertToString(queryParams.getParent())), + entryOf("ancestor", convertToString(queryParams.getAncestor())), + entryOf("query", convertToString(queryParams.getQuery())), + entryOf( + "include-total-result-count", + convertToString(queryParams.getIncludeTotalResultCount())), + entryOf( + "only-selectable-options", + convertToString(queryParams.getOnlySelectableOptions())), + entryOf("marker", convertToString(queryParams.getMarker())), + entryOf("limit", convertToString(queryParams.getLimit())))); + Map headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders())); + FetchResponse response = + this.networkSession + .getNetworkClient() + .fetch( + new FetchOptions.Builder( + String.join( + "", + this.networkSession.getBaseUrls().getBaseUrl(), + "/2.0/metadata_templates/", + convertToString(scope), + "/", + convertToString(templateKey), + "/fields/", + convertToString(fieldKey), + "/options"), + "GET") + .params(queryParamsMap) + .headers(headersMap) + .responseFormat(ResponseFormat.JSON) + .auth(this.auth) + .networkSession(this.networkSession) + .build()); + return JsonManager.deserialize(response.getData(), MetadataTaxonomyNodes.class); + } + + public Authentication getAuth() { + return auth; + } + + public NetworkSession getNetworkSession() { + return networkSession; + } + + public static class Builder { + + protected Authentication auth; + + protected NetworkSession networkSession; + + public Builder() { + this.networkSession = new NetworkSession(); + } + + public Builder auth(Authentication auth) { + this.auth = auth; + return this; + } + + public Builder networkSession(NetworkSession networkSession) { + this.networkSession = networkSession; + return this; + } + + public MetadataTaxonomiesManager build() { + return new MetadataTaxonomiesManager(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/metadatataxonomies/PatchMetadataTaxonomiesIdIdLevelsIdHeaders.java b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/PatchMetadataTaxonomiesIdIdLevelsIdHeaders.java new file mode 100644 index 000000000..ec8f7eba3 --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/PatchMetadataTaxonomiesIdIdLevelsIdHeaders.java @@ -0,0 +1,41 @@ +package com.box.sdkgen.managers.metadatataxonomies; + +import static com.box.sdkgen.internal.utils.UtilsManager.mapOf; + +import java.util.Map; + +public class PatchMetadataTaxonomiesIdIdLevelsIdHeaders { + + /** Extra headers that will be included in the HTTP request. */ + public Map extraHeaders; + + public PatchMetadataTaxonomiesIdIdLevelsIdHeaders() { + this.extraHeaders = mapOf(); + } + + protected PatchMetadataTaxonomiesIdIdLevelsIdHeaders(Builder builder) { + this.extraHeaders = builder.extraHeaders; + } + + public Map getExtraHeaders() { + return extraHeaders; + } + + public static class Builder { + + protected Map extraHeaders; + + public Builder() { + this.extraHeaders = mapOf(); + } + + public Builder extraHeaders(Map extraHeaders) { + this.extraHeaders = extraHeaders; + return this; + } + + public PatchMetadataTaxonomiesIdIdLevelsIdHeaders build() { + return new PatchMetadataTaxonomiesIdIdLevelsIdHeaders(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/metadatataxonomies/PatchMetadataTaxonomiesIdIdLevelsIdRequestBody.java b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/PatchMetadataTaxonomiesIdIdLevelsIdRequestBody.java new file mode 100644 index 000000000..abea43114 --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/PatchMetadataTaxonomiesIdIdLevelsIdRequestBody.java @@ -0,0 +1,91 @@ +package com.box.sdkgen.managers.metadatataxonomies; + +import com.box.sdkgen.internal.NullableFieldTracker; +import com.box.sdkgen.internal.SerializableObject; +import com.fasterxml.jackson.annotation.JsonFilter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +@JsonFilter("nullablePropertyFilter") +public class PatchMetadataTaxonomiesIdIdLevelsIdRequestBody extends SerializableObject { + + /** The display name of the taxonomy level. */ + protected final String displayName; + + /** The description of the taxonomy level. */ + protected String description; + + public PatchMetadataTaxonomiesIdIdLevelsIdRequestBody( + @JsonProperty("displayName") String displayName) { + super(); + this.displayName = displayName; + } + + protected PatchMetadataTaxonomiesIdIdLevelsIdRequestBody(Builder builder) { + super(); + this.displayName = builder.displayName; + this.description = builder.description; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public String getDisplayName() { + return displayName; + } + + public String getDescription() { + return description; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchMetadataTaxonomiesIdIdLevelsIdRequestBody casted = + (PatchMetadataTaxonomiesIdIdLevelsIdRequestBody) o; + return Objects.equals(displayName, casted.displayName) + && Objects.equals(description, casted.description); + } + + @Override + public int hashCode() { + return Objects.hash(displayName, description); + } + + @Override + public String toString() { + return "PatchMetadataTaxonomiesIdIdLevelsIdRequestBody{" + + "displayName='" + + displayName + + '\'' + + ", " + + "description='" + + description + + '\'' + + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected final String displayName; + + protected String description; + + public Builder(String displayName) { + super(); + this.displayName = displayName; + } + + public Builder description(String description) { + this.description = description; + return this; + } + + public PatchMetadataTaxonomiesIdIdLevelsIdRequestBody build() { + return new PatchMetadataTaxonomiesIdIdLevelsIdRequestBody(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/metadatataxonomies/UpdateMetadataTaxonomyHeaders.java b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/UpdateMetadataTaxonomyHeaders.java new file mode 100644 index 000000000..3b007ed71 --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/UpdateMetadataTaxonomyHeaders.java @@ -0,0 +1,41 @@ +package com.box.sdkgen.managers.metadatataxonomies; + +import static com.box.sdkgen.internal.utils.UtilsManager.mapOf; + +import java.util.Map; + +public class UpdateMetadataTaxonomyHeaders { + + /** Extra headers that will be included in the HTTP request. */ + public Map extraHeaders; + + public UpdateMetadataTaxonomyHeaders() { + this.extraHeaders = mapOf(); + } + + protected UpdateMetadataTaxonomyHeaders(Builder builder) { + this.extraHeaders = builder.extraHeaders; + } + + public Map getExtraHeaders() { + return extraHeaders; + } + + public static class Builder { + + protected Map extraHeaders; + + public Builder() { + this.extraHeaders = mapOf(); + } + + public Builder extraHeaders(Map extraHeaders) { + this.extraHeaders = extraHeaders; + return this; + } + + public UpdateMetadataTaxonomyHeaders build() { + return new UpdateMetadataTaxonomyHeaders(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/metadatataxonomies/UpdateMetadataTaxonomyNodeHeaders.java b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/UpdateMetadataTaxonomyNodeHeaders.java new file mode 100644 index 000000000..a5bb0313c --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/UpdateMetadataTaxonomyNodeHeaders.java @@ -0,0 +1,41 @@ +package com.box.sdkgen.managers.metadatataxonomies; + +import static com.box.sdkgen.internal.utils.UtilsManager.mapOf; + +import java.util.Map; + +public class UpdateMetadataTaxonomyNodeHeaders { + + /** Extra headers that will be included in the HTTP request. */ + public Map extraHeaders; + + public UpdateMetadataTaxonomyNodeHeaders() { + this.extraHeaders = mapOf(); + } + + protected UpdateMetadataTaxonomyNodeHeaders(Builder builder) { + this.extraHeaders = builder.extraHeaders; + } + + public Map getExtraHeaders() { + return extraHeaders; + } + + public static class Builder { + + protected Map extraHeaders; + + public Builder() { + this.extraHeaders = mapOf(); + } + + public Builder extraHeaders(Map extraHeaders) { + this.extraHeaders = extraHeaders; + return this; + } + + public UpdateMetadataTaxonomyNodeHeaders build() { + return new UpdateMetadataTaxonomyNodeHeaders(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/metadatataxonomies/UpdateMetadataTaxonomyNodeRequestBody.java b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/UpdateMetadataTaxonomyNodeRequestBody.java new file mode 100644 index 000000000..d112544b4 --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/UpdateMetadataTaxonomyNodeRequestBody.java @@ -0,0 +1,63 @@ +package com.box.sdkgen.managers.metadatataxonomies; + +import com.box.sdkgen.internal.NullableFieldTracker; +import com.box.sdkgen.internal.SerializableObject; +import com.fasterxml.jackson.annotation.JsonFilter; +import java.util.Objects; + +@JsonFilter("nullablePropertyFilter") +public class UpdateMetadataTaxonomyNodeRequestBody extends SerializableObject { + + /** The display name of the taxonomy node. */ + protected String displayName; + + public UpdateMetadataTaxonomyNodeRequestBody() { + super(); + } + + protected UpdateMetadataTaxonomyNodeRequestBody(Builder builder) { + super(); + this.displayName = builder.displayName; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public String getDisplayName() { + return displayName; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateMetadataTaxonomyNodeRequestBody casted = (UpdateMetadataTaxonomyNodeRequestBody) o; + return Objects.equals(displayName, casted.displayName); + } + + @Override + public int hashCode() { + return Objects.hash(displayName); + } + + @Override + public String toString() { + return "UpdateMetadataTaxonomyNodeRequestBody{" + "displayName='" + displayName + '\'' + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected String displayName; + + public Builder displayName(String displayName) { + this.displayName = displayName; + return this; + } + + public UpdateMetadataTaxonomyNodeRequestBody build() { + return new UpdateMetadataTaxonomyNodeRequestBody(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/metadatataxonomies/UpdateMetadataTaxonomyRequestBody.java b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/UpdateMetadataTaxonomyRequestBody.java new file mode 100644 index 000000000..b40189c1c --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/metadatataxonomies/UpdateMetadataTaxonomyRequestBody.java @@ -0,0 +1,44 @@ +package com.box.sdkgen.managers.metadatataxonomies; + +import com.box.sdkgen.internal.SerializableObject; +import com.fasterxml.jackson.annotation.JsonFilter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +@JsonFilter("nullablePropertyFilter") +public class UpdateMetadataTaxonomyRequestBody extends SerializableObject { + + /** The display name of the taxonomy. */ + protected final String displayName; + + public UpdateMetadataTaxonomyRequestBody(@JsonProperty("displayName") String displayName) { + super(); + this.displayName = displayName; + } + + public String getDisplayName() { + return displayName; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateMetadataTaxonomyRequestBody casted = (UpdateMetadataTaxonomyRequestBody) o; + return Objects.equals(displayName, casted.displayName); + } + + @Override + public int hashCode() { + return Objects.hash(displayName); + } + + @Override + public String toString() { + return "UpdateMetadataTaxonomyRequestBody{" + "displayName='" + displayName + '\'' + "}"; + } +} diff --git a/src/main/java/com/box/sdkgen/managers/metadatatemplates/CreateMetadataTemplateRequestBodyFieldsField.java b/src/main/java/com/box/sdkgen/managers/metadatatemplates/CreateMetadataTemplateRequestBodyFieldsField.java index 985f90911..b72968c5e 100644 --- a/src/main/java/com/box/sdkgen/managers/metadatatemplates/CreateMetadataTemplateRequestBodyFieldsField.java +++ b/src/main/java/com/box/sdkgen/managers/metadatatemplates/CreateMetadataTemplateRequestBodyFieldsField.java @@ -15,10 +15,13 @@ public class CreateMetadataTemplateRequestBodyFieldsField extends SerializableOb /** * The type of field. The basic fields are a `string` field for text, a `float` field for numbers, - * and a `date` fields to present the user with a date-time picker. + * and a `date` field to present the user with a date-time picker. * *

Additionally, metadata templates support an `enum` field for a basic list of items, and ` * multiSelect` field for a similar list of items where the user can select more than one value. + * + *

Metadata taxonomies are also supported as a `taxonomy` field type with a specific set of + * additional properties, which describe its structure. */ @JsonDeserialize( using = @@ -54,6 +57,24 @@ public class CreateMetadataTemplateRequestBodyFieldsField extends SerializableOb */ protected List options; + /** + * The unique key of the metadata taxonomy to use for this taxonomy field. This property is + * required when the field `type` is set to `taxonomy`. + */ + protected String taxonomyKey; + + /** + * The namespace of the metadata taxonomy to use for this taxonomy field. This property is + * required when the field `type` is set to `taxonomy`. + */ + protected String namespace; + + /** + * An object defining additional rules for the options of the taxonomy field. This property is + * required when the field `type` is set to `taxonomy`. + */ + protected CreateMetadataTemplateRequestBodyFieldsOptionsRulesField optionsRules; + public CreateMetadataTemplateRequestBodyFieldsField( CreateMetadataTemplateRequestBodyFieldsTypeField type, String key, String displayName) { super(); @@ -80,6 +101,9 @@ protected CreateMetadataTemplateRequestBodyFieldsField(Builder builder) { this.description = builder.description; this.hidden = builder.hidden; this.options = builder.options; + this.taxonomyKey = builder.taxonomyKey; + this.namespace = builder.namespace; + this.optionsRules = builder.optionsRules; markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); } @@ -107,6 +131,18 @@ public List getOptions() { return options; } + public String getTaxonomyKey() { + return taxonomyKey; + } + + public String getNamespace() { + return namespace; + } + + public CreateMetadataTemplateRequestBodyFieldsOptionsRulesField getOptionsRules() { + return optionsRules; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -122,12 +158,16 @@ public boolean equals(Object o) { && Objects.equals(displayName, casted.displayName) && Objects.equals(description, casted.description) && Objects.equals(hidden, casted.hidden) - && Objects.equals(options, casted.options); + && Objects.equals(options, casted.options) + && Objects.equals(taxonomyKey, casted.taxonomyKey) + && Objects.equals(namespace, casted.namespace) + && Objects.equals(optionsRules, casted.optionsRules); } @Override public int hashCode() { - return Objects.hash(type, key, displayName, description, hidden, options); + return Objects.hash( + type, key, displayName, description, hidden, options, taxonomyKey, namespace, optionsRules); } @Override @@ -156,6 +196,18 @@ public String toString() { + "options='" + options + '\'' + + ", " + + "taxonomyKey='" + + taxonomyKey + + '\'' + + ", " + + "namespace='" + + namespace + + '\'' + + ", " + + "optionsRules='" + + optionsRules + + '\'' + "}"; } @@ -173,6 +225,12 @@ public static class Builder extends NullableFieldTracker { protected List options; + protected String taxonomyKey; + + protected String namespace; + + protected CreateMetadataTemplateRequestBodyFieldsOptionsRulesField optionsRules; + public Builder( CreateMetadataTemplateRequestBodyFieldsTypeField type, String key, String displayName) { super(); @@ -206,6 +264,22 @@ public Builder options(List return this; } + public Builder taxonomyKey(String taxonomyKey) { + this.taxonomyKey = taxonomyKey; + return this; + } + + public Builder namespace(String namespace) { + this.namespace = namespace; + return this; + } + + public Builder optionsRules( + CreateMetadataTemplateRequestBodyFieldsOptionsRulesField optionsRules) { + this.optionsRules = optionsRules; + return this; + } + public CreateMetadataTemplateRequestBodyFieldsField build() { return new CreateMetadataTemplateRequestBodyFieldsField(this); } diff --git a/src/main/java/com/box/sdkgen/managers/metadatatemplates/CreateMetadataTemplateRequestBodyFieldsOptionsRulesField.java b/src/main/java/com/box/sdkgen/managers/metadatatemplates/CreateMetadataTemplateRequestBodyFieldsOptionsRulesField.java new file mode 100644 index 000000000..2df9946a1 --- /dev/null +++ b/src/main/java/com/box/sdkgen/managers/metadatatemplates/CreateMetadataTemplateRequestBodyFieldsOptionsRulesField.java @@ -0,0 +1,89 @@ +package com.box.sdkgen.managers.metadatatemplates; + +import com.box.sdkgen.internal.NullableFieldTracker; +import com.box.sdkgen.internal.SerializableObject; +import com.fasterxml.jackson.annotation.JsonFilter; +import java.util.List; +import java.util.Objects; + +@JsonFilter("nullablePropertyFilter") +public class CreateMetadataTemplateRequestBodyFieldsOptionsRulesField extends SerializableObject { + + /** Whether to allow users to select multiple values. */ + protected Boolean multiSelect; + + /** An array of integers defining which levels of the taxonomy are selectable by users. */ + protected List selectableLevels; + + public CreateMetadataTemplateRequestBodyFieldsOptionsRulesField() { + super(); + } + + protected CreateMetadataTemplateRequestBodyFieldsOptionsRulesField(Builder builder) { + super(); + this.multiSelect = builder.multiSelect; + this.selectableLevels = builder.selectableLevels; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public Boolean getMultiSelect() { + return multiSelect; + } + + public List getSelectableLevels() { + return selectableLevels; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateMetadataTemplateRequestBodyFieldsOptionsRulesField casted = + (CreateMetadataTemplateRequestBodyFieldsOptionsRulesField) o; + return Objects.equals(multiSelect, casted.multiSelect) + && Objects.equals(selectableLevels, casted.selectableLevels); + } + + @Override + public int hashCode() { + return Objects.hash(multiSelect, selectableLevels); + } + + @Override + public String toString() { + return "CreateMetadataTemplateRequestBodyFieldsOptionsRulesField{" + + "multiSelect='" + + multiSelect + + '\'' + + ", " + + "selectableLevels='" + + selectableLevels + + '\'' + + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected Boolean multiSelect; + + protected List selectableLevels; + + public Builder multiSelect(Boolean multiSelect) { + this.multiSelect = multiSelect; + return this; + } + + public Builder selectableLevels(List selectableLevels) { + this.selectableLevels = selectableLevels; + return this; + } + + public CreateMetadataTemplateRequestBodyFieldsOptionsRulesField build() { + return new CreateMetadataTemplateRequestBodyFieldsOptionsRulesField(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/managers/metadatatemplates/CreateMetadataTemplateRequestBodyFieldsTypeField.java b/src/main/java/com/box/sdkgen/managers/metadatatemplates/CreateMetadataTemplateRequestBodyFieldsTypeField.java index b4d3bc111..851e8b110 100644 --- a/src/main/java/com/box/sdkgen/managers/metadatatemplates/CreateMetadataTemplateRequestBodyFieldsTypeField.java +++ b/src/main/java/com/box/sdkgen/managers/metadatatemplates/CreateMetadataTemplateRequestBodyFieldsTypeField.java @@ -16,7 +16,8 @@ public enum CreateMetadataTemplateRequestBodyFieldsTypeField implements Valuable FLOAT("float"), DATE("date"), ENUM("enum"), - MULTISELECT("multiSelect"); + MULTISELECT("multiSelect"), + TAXONOMY("taxonomy"); private final String value; diff --git a/src/main/java/com/box/sdkgen/schemas/metadatataxonomies/MetadataTaxonomies.java b/src/main/java/com/box/sdkgen/schemas/metadatataxonomies/MetadataTaxonomies.java new file mode 100644 index 000000000..1288dcd71 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/metadatataxonomies/MetadataTaxonomies.java @@ -0,0 +1,141 @@ +package com.box.sdkgen.schemas.metadatataxonomies; + +import com.box.sdkgen.internal.Nullable; +import com.box.sdkgen.internal.NullableFieldTracker; +import com.box.sdkgen.internal.SerializableObject; +import com.box.sdkgen.schemas.metadatataxonomy.MetadataTaxonomy; +import com.fasterxml.jackson.annotation.JsonFilter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Objects; + +/** A list of metadata taxonomies. */ +@JsonFilter("nullablePropertyFilter") +public class MetadataTaxonomies extends SerializableObject { + + /** + * The limit that was used for these entries. This will be the same as the `limit` query parameter + * unless that value exceeded the maximum value allowed. The maximum value varies by API. + */ + protected Long limit; + + /** The marker for the start of the next page of results. */ + @JsonProperty("next_marker") + @Nullable + protected String nextMarker; + + /** The marker for the start of the previous page of results. */ + @JsonProperty("prev_marker") + @Nullable + protected String prevMarker; + + /** A list of metadata taxonomies. */ + protected List entries; + + public MetadataTaxonomies() { + super(); + } + + protected MetadataTaxonomies(Builder builder) { + super(); + this.limit = builder.limit; + this.nextMarker = builder.nextMarker; + this.prevMarker = builder.prevMarker; + this.entries = builder.entries; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public Long getLimit() { + return limit; + } + + public String getNextMarker() { + return nextMarker; + } + + public String getPrevMarker() { + return prevMarker; + } + + public List getEntries() { + return entries; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MetadataTaxonomies casted = (MetadataTaxonomies) o; + return Objects.equals(limit, casted.limit) + && Objects.equals(nextMarker, casted.nextMarker) + && Objects.equals(prevMarker, casted.prevMarker) + && Objects.equals(entries, casted.entries); + } + + @Override + public int hashCode() { + return Objects.hash(limit, nextMarker, prevMarker, entries); + } + + @Override + public String toString() { + return "MetadataTaxonomies{" + + "limit='" + + limit + + '\'' + + ", " + + "nextMarker='" + + nextMarker + + '\'' + + ", " + + "prevMarker='" + + prevMarker + + '\'' + + ", " + + "entries='" + + entries + + '\'' + + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected Long limit; + + protected String nextMarker; + + protected String prevMarker; + + protected List entries; + + public Builder limit(Long limit) { + this.limit = limit; + return this; + } + + public Builder nextMarker(String nextMarker) { + this.nextMarker = nextMarker; + this.markNullableFieldAsSet("next_marker"); + return this; + } + + public Builder prevMarker(String prevMarker) { + this.prevMarker = prevMarker; + this.markNullableFieldAsSet("prev_marker"); + return this; + } + + public Builder entries(List entries) { + this.entries = entries; + return this; + } + + public MetadataTaxonomies build() { + return new MetadataTaxonomies(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/metadatataxonomy/MetadataTaxonomy.java b/src/main/java/com/box/sdkgen/schemas/metadatataxonomy/MetadataTaxonomy.java new file mode 100644 index 000000000..58cfad5cf --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/metadatataxonomy/MetadataTaxonomy.java @@ -0,0 +1,152 @@ +package com.box.sdkgen.schemas.metadatataxonomy; + +import com.box.sdkgen.internal.NullableFieldTracker; +import com.box.sdkgen.internal.SerializableObject; +import com.box.sdkgen.schemas.metadatataxonomylevel.MetadataTaxonomyLevel; +import com.fasterxml.jackson.annotation.JsonFilter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Objects; + +/** A taxonomy object for metadata that can be used in metadata templates. */ +@JsonFilter("nullablePropertyFilter") +public class MetadataTaxonomy extends SerializableObject { + + /** A unique identifier of the metadata taxonomy. */ + protected final String id; + + /** + * A unique identifier of the metadata taxonomy. The identifier must be unique within the + * namespace to which it belongs. + */ + protected String key; + + /** The display name of the metadata taxonomy. This can be seen in the Box web app. */ + protected final String displayName; + + /** A namespace that the metadata taxonomy is associated with. */ + protected final String namespace; + + /** Levels of the metadata taxonomy. */ + protected List levels; + + public MetadataTaxonomy( + @JsonProperty("id") String id, + @JsonProperty("displayName") String displayName, + @JsonProperty("namespace") String namespace) { + super(); + this.id = id; + this.displayName = displayName; + this.namespace = namespace; + } + + protected MetadataTaxonomy(Builder builder) { + super(); + this.id = builder.id; + this.key = builder.key; + this.displayName = builder.displayName; + this.namespace = builder.namespace; + this.levels = builder.levels; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public String getId() { + return id; + } + + public String getKey() { + return key; + } + + public String getDisplayName() { + return displayName; + } + + public String getNamespace() { + return namespace; + } + + public List getLevels() { + return levels; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MetadataTaxonomy casted = (MetadataTaxonomy) o; + return Objects.equals(id, casted.id) + && Objects.equals(key, casted.key) + && Objects.equals(displayName, casted.displayName) + && Objects.equals(namespace, casted.namespace) + && Objects.equals(levels, casted.levels); + } + + @Override + public int hashCode() { + return Objects.hash(id, key, displayName, namespace, levels); + } + + @Override + public String toString() { + return "MetadataTaxonomy{" + + "id='" + + id + + '\'' + + ", " + + "key='" + + key + + '\'' + + ", " + + "displayName='" + + displayName + + '\'' + + ", " + + "namespace='" + + namespace + + '\'' + + ", " + + "levels='" + + levels + + '\'' + + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected final String id; + + protected String key; + + protected final String displayName; + + protected final String namespace; + + protected List levels; + + public Builder(String id, String displayName, String namespace) { + super(); + this.id = id; + this.displayName = displayName; + this.namespace = namespace; + } + + public Builder key(String key) { + this.key = key; + return this; + } + + public Builder levels(List levels) { + this.levels = levels; + return this; + } + + public MetadataTaxonomy build() { + return new MetadataTaxonomy(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/metadatataxonomyancestor/MetadataTaxonomyAncestor.java b/src/main/java/com/box/sdkgen/schemas/metadatataxonomyancestor/MetadataTaxonomyAncestor.java new file mode 100644 index 000000000..429f3facb --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/metadatataxonomyancestor/MetadataTaxonomyAncestor.java @@ -0,0 +1,108 @@ +package com.box.sdkgen.schemas.metadatataxonomyancestor; + +import com.box.sdkgen.internal.NullableFieldTracker; +import com.box.sdkgen.internal.SerializableObject; +import com.fasterxml.jackson.annotation.JsonFilter; +import java.util.Objects; + +/** A node object in the metadata taxonomy that represents an ancestor. */ +@JsonFilter("nullablePropertyFilter") +public class MetadataTaxonomyAncestor extends SerializableObject { + + /** A unique identifier of the metadata taxonomy node. */ + protected String id; + + /** The display name of the metadata taxonomy node. */ + protected String displayName; + + /** An index of the level to which the node belongs. */ + protected Long level; + + public MetadataTaxonomyAncestor() { + super(); + } + + protected MetadataTaxonomyAncestor(Builder builder) { + super(); + this.id = builder.id; + this.displayName = builder.displayName; + this.level = builder.level; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public String getId() { + return id; + } + + public String getDisplayName() { + return displayName; + } + + public Long getLevel() { + return level; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MetadataTaxonomyAncestor casted = (MetadataTaxonomyAncestor) o; + return Objects.equals(id, casted.id) + && Objects.equals(displayName, casted.displayName) + && Objects.equals(level, casted.level); + } + + @Override + public int hashCode() { + return Objects.hash(id, displayName, level); + } + + @Override + public String toString() { + return "MetadataTaxonomyAncestor{" + + "id='" + + id + + '\'' + + ", " + + "displayName='" + + displayName + + '\'' + + ", " + + "level='" + + level + + '\'' + + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected String id; + + protected String displayName; + + protected Long level; + + public Builder id(String id) { + this.id = id; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = displayName; + return this; + } + + public Builder level(Long level) { + this.level = level; + return this; + } + + public MetadataTaxonomyAncestor build() { + return new MetadataTaxonomyAncestor(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/metadatataxonomylevel/MetadataTaxonomyLevel.java b/src/main/java/com/box/sdkgen/schemas/metadatataxonomylevel/MetadataTaxonomyLevel.java new file mode 100644 index 000000000..52fe23956 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/metadatataxonomylevel/MetadataTaxonomyLevel.java @@ -0,0 +1,111 @@ +package com.box.sdkgen.schemas.metadatataxonomylevel; + +import com.box.sdkgen.internal.NullableFieldTracker; +import com.box.sdkgen.internal.SerializableObject; +import com.fasterxml.jackson.annotation.JsonFilter; +import java.util.Objects; + +/** + * A level in the metadata taxonomy represents a hierarchical category within the taxonomy + * structure. + */ +@JsonFilter("nullablePropertyFilter") +public class MetadataTaxonomyLevel extends SerializableObject { + + /** The display name of the level as it is shown to the user. */ + protected String displayName; + + /** A description of the level. */ + protected String description; + + /** An index of the level within the taxonomy. Levels are indexed starting from 1. */ + protected Integer level; + + public MetadataTaxonomyLevel() { + super(); + } + + protected MetadataTaxonomyLevel(Builder builder) { + super(); + this.displayName = builder.displayName; + this.description = builder.description; + this.level = builder.level; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public String getDisplayName() { + return displayName; + } + + public String getDescription() { + return description; + } + + public Integer getLevel() { + return level; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MetadataTaxonomyLevel casted = (MetadataTaxonomyLevel) o; + return Objects.equals(displayName, casted.displayName) + && Objects.equals(description, casted.description) + && Objects.equals(level, casted.level); + } + + @Override + public int hashCode() { + return Objects.hash(displayName, description, level); + } + + @Override + public String toString() { + return "MetadataTaxonomyLevel{" + + "displayName='" + + displayName + + '\'' + + ", " + + "description='" + + description + + '\'' + + ", " + + "level='" + + level + + '\'' + + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected String displayName; + + protected String description; + + protected Integer level; + + public Builder displayName(String displayName) { + this.displayName = displayName; + return this; + } + + public Builder description(String description) { + this.description = description; + return this; + } + + public Builder level(Integer level) { + this.level = level; + return this; + } + + public MetadataTaxonomyLevel build() { + return new MetadataTaxonomyLevel(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/metadatataxonomylevels/MetadataTaxonomyLevels.java b/src/main/java/com/box/sdkgen/schemas/metadatataxonomylevels/MetadataTaxonomyLevels.java new file mode 100644 index 000000000..9cc982a8f --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/metadatataxonomylevels/MetadataTaxonomyLevels.java @@ -0,0 +1,68 @@ +package com.box.sdkgen.schemas.metadatataxonomylevels; + +import com.box.sdkgen.internal.NullableFieldTracker; +import com.box.sdkgen.internal.SerializableObject; +import com.box.sdkgen.schemas.metadatataxonomylevel.MetadataTaxonomyLevel; +import com.fasterxml.jackson.annotation.JsonFilter; +import java.util.List; +import java.util.Objects; + +/** + * Levels in the metadata taxonomy represent hierarchical categories within the taxonomy structure. + */ +@JsonFilter("nullablePropertyFilter") +public class MetadataTaxonomyLevels extends SerializableObject { + + /** An array of all taxonomy levels. */ + protected List entries; + + public MetadataTaxonomyLevels() { + super(); + } + + protected MetadataTaxonomyLevels(Builder builder) { + super(); + this.entries = builder.entries; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public List getEntries() { + return entries; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MetadataTaxonomyLevels casted = (MetadataTaxonomyLevels) o; + return Objects.equals(entries, casted.entries); + } + + @Override + public int hashCode() { + return Objects.hash(entries); + } + + @Override + public String toString() { + return "MetadataTaxonomyLevels{" + "entries='" + entries + '\'' + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected List entries; + + public Builder entries(List entries) { + this.entries = entries; + return this; + } + + public MetadataTaxonomyLevels build() { + return new MetadataTaxonomyLevels(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/metadatataxonomynode/MetadataTaxonomyNode.java b/src/main/java/com/box/sdkgen/schemas/metadatataxonomynode/MetadataTaxonomyNode.java new file mode 100644 index 000000000..dffaa3c91 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/metadatataxonomynode/MetadataTaxonomyNode.java @@ -0,0 +1,169 @@ +package com.box.sdkgen.schemas.metadatataxonomynode; + +import com.box.sdkgen.internal.NullableFieldTracker; +import com.box.sdkgen.internal.SerializableObject; +import com.box.sdkgen.schemas.metadatataxonomyancestor.MetadataTaxonomyAncestor; +import com.fasterxml.jackson.annotation.JsonFilter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Objects; + +/** A node object for metadata taxonomy that can be used in metadata templates. */ +@JsonFilter("nullablePropertyFilter") +public class MetadataTaxonomyNode extends SerializableObject { + + /** A unique identifier of the metadata taxonomy node. */ + protected final String id; + + /** The display name of the metadata taxonomy node. */ + protected final String displayName; + + /** An index of the level to which the node belongs. */ + protected final long level; + + /** The identifier of the parent node. */ + protected String parentId; + + /** An array of identifiers for all ancestor nodes. Not returned for root-level nodes. */ + protected List nodePath; + + /** An array of objects for all ancestor nodes. Not returned for root-level nodes. */ + protected List ancestors; + + public MetadataTaxonomyNode( + @JsonProperty("id") String id, + @JsonProperty("displayName") String displayName, + @JsonProperty("level") long level) { + super(); + this.id = id; + this.displayName = displayName; + this.level = level; + } + + protected MetadataTaxonomyNode(Builder builder) { + super(); + this.id = builder.id; + this.displayName = builder.displayName; + this.level = builder.level; + this.parentId = builder.parentId; + this.nodePath = builder.nodePath; + this.ancestors = builder.ancestors; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public String getId() { + return id; + } + + public String getDisplayName() { + return displayName; + } + + public long getLevel() { + return level; + } + + public String getParentId() { + return parentId; + } + + public List getNodePath() { + return nodePath; + } + + public List getAncestors() { + return ancestors; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MetadataTaxonomyNode casted = (MetadataTaxonomyNode) o; + return Objects.equals(id, casted.id) + && Objects.equals(displayName, casted.displayName) + && Objects.equals(level, casted.level) + && Objects.equals(parentId, casted.parentId) + && Objects.equals(nodePath, casted.nodePath) + && Objects.equals(ancestors, casted.ancestors); + } + + @Override + public int hashCode() { + return Objects.hash(id, displayName, level, parentId, nodePath, ancestors); + } + + @Override + public String toString() { + return "MetadataTaxonomyNode{" + + "id='" + + id + + '\'' + + ", " + + "displayName='" + + displayName + + '\'' + + ", " + + "level='" + + level + + '\'' + + ", " + + "parentId='" + + parentId + + '\'' + + ", " + + "nodePath='" + + nodePath + + '\'' + + ", " + + "ancestors='" + + ancestors + + '\'' + + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected final String id; + + protected final String displayName; + + protected final long level; + + protected String parentId; + + protected List nodePath; + + protected List ancestors; + + public Builder(String id, String displayName, long level) { + super(); + this.id = id; + this.displayName = displayName; + this.level = level; + } + + public Builder parentId(String parentId) { + this.parentId = parentId; + return this; + } + + public Builder nodePath(List nodePath) { + this.nodePath = nodePath; + return this; + } + + public Builder ancestors(List ancestors) { + this.ancestors = ancestors; + return this; + } + + public MetadataTaxonomyNode build() { + return new MetadataTaxonomyNode(this); + } + } +} diff --git a/src/main/java/com/box/sdkgen/schemas/metadatataxonomynodes/MetadataTaxonomyNodes.java b/src/main/java/com/box/sdkgen/schemas/metadatataxonomynodes/MetadataTaxonomyNodes.java new file mode 100644 index 000000000..c1f94ec15 --- /dev/null +++ b/src/main/java/com/box/sdkgen/schemas/metadatataxonomynodes/MetadataTaxonomyNodes.java @@ -0,0 +1,141 @@ +package com.box.sdkgen.schemas.metadatataxonomynodes; + +import com.box.sdkgen.internal.Nullable; +import com.box.sdkgen.internal.NullableFieldTracker; +import com.box.sdkgen.internal.SerializableObject; +import com.box.sdkgen.schemas.metadatataxonomynode.MetadataTaxonomyNode; +import com.fasterxml.jackson.annotation.JsonFilter; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Objects; + +/** A list of metadata taxonomy nodes. */ +@JsonFilter("nullablePropertyFilter") +public class MetadataTaxonomyNodes extends SerializableObject { + + /** + * The limit that was used for these entries. This will be the same as the `limit` query parameter + * unless that value exceeded the maximum value allowed. The maximum value varies by API. + */ + protected Long limit; + + /** The marker for the start of the next page of results. */ + @JsonProperty("next_marker") + @Nullable + protected String nextMarker; + + /** The marker for the start of the previous page of results. */ + @JsonProperty("prev_marker") + @Nullable + protected String prevMarker; + + /** A list of metadata taxonomy nodes. */ + protected List entries; + + public MetadataTaxonomyNodes() { + super(); + } + + protected MetadataTaxonomyNodes(Builder builder) { + super(); + this.limit = builder.limit; + this.nextMarker = builder.nextMarker; + this.prevMarker = builder.prevMarker; + this.entries = builder.entries; + markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); + } + + public Long getLimit() { + return limit; + } + + public String getNextMarker() { + return nextMarker; + } + + public String getPrevMarker() { + return prevMarker; + } + + public List getEntries() { + return entries; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MetadataTaxonomyNodes casted = (MetadataTaxonomyNodes) o; + return Objects.equals(limit, casted.limit) + && Objects.equals(nextMarker, casted.nextMarker) + && Objects.equals(prevMarker, casted.prevMarker) + && Objects.equals(entries, casted.entries); + } + + @Override + public int hashCode() { + return Objects.hash(limit, nextMarker, prevMarker, entries); + } + + @Override + public String toString() { + return "MetadataTaxonomyNodes{" + + "limit='" + + limit + + '\'' + + ", " + + "nextMarker='" + + nextMarker + + '\'' + + ", " + + "prevMarker='" + + prevMarker + + '\'' + + ", " + + "entries='" + + entries + + '\'' + + "}"; + } + + public static class Builder extends NullableFieldTracker { + + protected Long limit; + + protected String nextMarker; + + protected String prevMarker; + + protected List entries; + + public Builder limit(Long limit) { + this.limit = limit; + return this; + } + + public Builder nextMarker(String nextMarker) { + this.nextMarker = nextMarker; + this.markNullableFieldAsSet("next_marker"); + return this; + } + + public Builder prevMarker(String prevMarker) { + this.prevMarker = prevMarker; + this.markNullableFieldAsSet("prev_marker"); + return this; + } + + public Builder entries(List entries) { + this.entries = entries; + return this; + } + + public MetadataTaxonomyNodes build() { + return new MetadataTaxonomyNodes(this); + } + } +}