001package com.box.sdkgen.managers.folders; 002 003import com.box.sdkgen.serialization.json.EnumWrapper; 004import java.util.List; 005 006public class GetFolderItemsQueryParams { 007 008 /** 009 * A comma-separated list of attributes to include in the response. This can be used to request 010 * fields that are not normally returned in a standard response. 011 * 012 * <p>Be aware that specifying this parameter will have the effect that none of the standard 013 * fields are returned in the response unless explicitly specified, instead only fields for the 014 * mini representation are returned, additional to the fields requested. 015 * 016 * <p>Additionally this field can be used to query any metadata applied to the file by specifying 017 * the `metadata` field as well as the scope and key of the template to retrieve, for example 018 * `?fields=metadata.enterprise_12345.contractTemplate`. 019 */ 020 public List<String> fields; 021 022 /** 023 * Specifies whether to use marker-based pagination instead of offset-based pagination. Only one 024 * pagination method can be used at a time. 025 * 026 * <p>By setting this value to true, the API will return a `marker` field that can be passed as a 027 * parameter to this endpoint to get the next page of the response. 028 */ 029 public Boolean usemarker; 030 031 /** 032 * Defines the position marker at which to begin returning results. This is used when paginating 033 * using marker-based pagination. 034 * 035 * <p>This requires `usemarker` to be set to `true`. 036 */ 037 public String marker; 038 039 /** 040 * The offset of the item at which to begin the response. 041 * 042 * <p>Offset-based pagination is not guaranteed to work reliably for high offset values and may 043 * fail for large datasets. In those cases, use marker-based pagination by setting `usemarker` to 044 * `true`. 045 */ 046 public Long offset; 047 048 /** The maximum number of items to return per page. */ 049 public Long limit; 050 051 /** 052 * Defines the **second** attribute by which items are sorted. 053 * 054 * <p>The folder type affects the way the items are sorted: 055 * 056 * <p>* **Standard folder**: Items are always sorted by their `type` first, with folders listed 057 * before files, and files listed before web links. 058 * 059 * <p>* **Root folder**: This parameter is not supported for marker-based pagination on the root 060 * folder 061 * 062 * <p>(the folder with an `id` of `0`). 063 * 064 * <p>* **Shared folder with parent path to the associated folder visible to the collaborator**: 065 * Items are always sorted by their `type` first, with folders listed before files, and files 066 * listed before web links. 067 */ 068 public EnumWrapper<GetFolderItemsQueryParamsSortField> sort; 069 070 /** 071 * The direction to sort results in. This can be either in alphabetical ascending (`ASC`) or 072 * descending (`DESC`) order. 073 */ 074 public EnumWrapper<GetFolderItemsQueryParamsDirectionField> direction; 075 076 public GetFolderItemsQueryParams() {} 077 078 protected GetFolderItemsQueryParams(Builder builder) { 079 this.fields = builder.fields; 080 this.usemarker = builder.usemarker; 081 this.marker = builder.marker; 082 this.offset = builder.offset; 083 this.limit = builder.limit; 084 this.sort = builder.sort; 085 this.direction = builder.direction; 086 } 087 088 public List<String> getFields() { 089 return fields; 090 } 091 092 public Boolean getUsemarker() { 093 return usemarker; 094 } 095 096 public String getMarker() { 097 return marker; 098 } 099 100 public Long getOffset() { 101 return offset; 102 } 103 104 public Long getLimit() { 105 return limit; 106 } 107 108 public EnumWrapper<GetFolderItemsQueryParamsSortField> getSort() { 109 return sort; 110 } 111 112 public EnumWrapper<GetFolderItemsQueryParamsDirectionField> getDirection() { 113 return direction; 114 } 115 116 public static class Builder { 117 118 protected List<String> fields; 119 120 protected Boolean usemarker; 121 122 protected String marker; 123 124 protected Long offset; 125 126 protected Long limit; 127 128 protected EnumWrapper<GetFolderItemsQueryParamsSortField> sort; 129 130 protected EnumWrapper<GetFolderItemsQueryParamsDirectionField> direction; 131 132 public Builder fields(List<String> fields) { 133 this.fields = fields; 134 return this; 135 } 136 137 public Builder usemarker(Boolean usemarker) { 138 this.usemarker = usemarker; 139 return this; 140 } 141 142 public Builder marker(String marker) { 143 this.marker = marker; 144 return this; 145 } 146 147 public Builder offset(Long offset) { 148 this.offset = offset; 149 return this; 150 } 151 152 public Builder limit(Long limit) { 153 this.limit = limit; 154 return this; 155 } 156 157 public Builder sort(GetFolderItemsQueryParamsSortField sort) { 158 this.sort = new EnumWrapper<GetFolderItemsQueryParamsSortField>(sort); 159 return this; 160 } 161 162 public Builder sort(EnumWrapper<GetFolderItemsQueryParamsSortField> sort) { 163 this.sort = sort; 164 return this; 165 } 166 167 public Builder direction(GetFolderItemsQueryParamsDirectionField direction) { 168 this.direction = new EnumWrapper<GetFolderItemsQueryParamsDirectionField>(direction); 169 return this; 170 } 171 172 public Builder direction(EnumWrapper<GetFolderItemsQueryParamsDirectionField> direction) { 173 this.direction = direction; 174 return this; 175 } 176 177 public GetFolderItemsQueryParams build() { 178 return new GetFolderItemsQueryParams(this); 179 } 180 } 181}