001package com.box.sdkgen.managers.users;
002
003import com.box.sdkgen.serialization.json.EnumWrapper;
004import java.util.List;
005
006public class GetUsersQueryParams {
007
008  /**
009   * Limits the results to only users who's `name` or `login` start with the search term.
010   *
011   * <p>For externally managed users, the search term needs to completely match the in order to find
012   * the user, and it will only return one user at a time.
013   */
014  public String filterTerm;
015
016  /**
017   * Limits the results to the kind of user specified.
018   *
019   * <p>* `all` returns every kind of user for whom the `login` or `name` partially matches the
020   * `filter_term`. It will only return an external user if the login matches the `filter_term`
021   * completely, and in that case it will only return that user. * `managed` returns all managed and
022   * app users for whom the `login` or `name` partially matches the `filter_term`. * `external`
023   * returns all external users for whom the `login` matches the `filter_term` exactly.
024   */
025  public EnumWrapper<GetUsersQueryParamsUserTypeField> userType;
026
027  /**
028   * Limits the results to app users with the given `external_app_user_id` value.
029   *
030   * <p>When creating an app user, an `external_app_user_id` value can be set. This value can then
031   * be used in this endpoint to find any users that match that `external_app_user_id` value.
032   */
033  public String externalAppUserId;
034
035  /**
036   * A comma-separated list of attributes to include in the response. This can be used to request
037   * fields that are not normally returned in a standard response.
038   *
039   * <p>Be aware that specifying this parameter will have the effect that none of the standard
040   * fields are returned in the response unless explicitly specified, instead only fields for the
041   * mini representation are returned, additional to the fields requested.
042   */
043  public List<String> fields;
044
045  /**
046   * The offset of the item at which to begin the response.
047   *
048   * <p>Queries with offset parameter value exceeding 10000 will be rejected with a 400 response.
049   */
050  public Long offset;
051
052  /** The maximum number of items to return per page. */
053  public Long limit;
054
055  /**
056   * Specifies whether to use marker-based pagination instead of offset-based pagination. Only one
057   * pagination method can be used at a time.
058   *
059   * <p>By setting this value to true, the API will return a `marker` field that can be passed as a
060   * parameter to this endpoint to get the next page of the response.
061   */
062  public Boolean usemarker;
063
064  /**
065   * Defines the position marker at which to begin returning results. This is used when paginating
066   * using marker-based pagination.
067   *
068   * <p>This requires `usemarker` to be set to `true`.
069   */
070  public String marker;
071
072  public GetUsersQueryParams() {}
073
074  protected GetUsersQueryParams(Builder builder) {
075    this.filterTerm = builder.filterTerm;
076    this.userType = builder.userType;
077    this.externalAppUserId = builder.externalAppUserId;
078    this.fields = builder.fields;
079    this.offset = builder.offset;
080    this.limit = builder.limit;
081    this.usemarker = builder.usemarker;
082    this.marker = builder.marker;
083  }
084
085  public String getFilterTerm() {
086    return filterTerm;
087  }
088
089  public EnumWrapper<GetUsersQueryParamsUserTypeField> getUserType() {
090    return userType;
091  }
092
093  public String getExternalAppUserId() {
094    return externalAppUserId;
095  }
096
097  public List<String> getFields() {
098    return fields;
099  }
100
101  public Long getOffset() {
102    return offset;
103  }
104
105  public Long getLimit() {
106    return limit;
107  }
108
109  public Boolean getUsemarker() {
110    return usemarker;
111  }
112
113  public String getMarker() {
114    return marker;
115  }
116
117  public static class Builder {
118
119    protected String filterTerm;
120
121    protected EnumWrapper<GetUsersQueryParamsUserTypeField> userType;
122
123    protected String externalAppUserId;
124
125    protected List<String> fields;
126
127    protected Long offset;
128
129    protected Long limit;
130
131    protected Boolean usemarker;
132
133    protected String marker;
134
135    public Builder filterTerm(String filterTerm) {
136      this.filterTerm = filterTerm;
137      return this;
138    }
139
140    public Builder userType(GetUsersQueryParamsUserTypeField userType) {
141      this.userType = new EnumWrapper<GetUsersQueryParamsUserTypeField>(userType);
142      return this;
143    }
144
145    public Builder userType(EnumWrapper<GetUsersQueryParamsUserTypeField> userType) {
146      this.userType = userType;
147      return this;
148    }
149
150    public Builder externalAppUserId(String externalAppUserId) {
151      this.externalAppUserId = externalAppUserId;
152      return this;
153    }
154
155    public Builder fields(List<String> fields) {
156      this.fields = fields;
157      return this;
158    }
159
160    public Builder offset(Long offset) {
161      this.offset = offset;
162      return this;
163    }
164
165    public Builder limit(Long limit) {
166      this.limit = limit;
167      return this;
168    }
169
170    public Builder usemarker(Boolean usemarker) {
171      this.usemarker = usemarker;
172      return this;
173    }
174
175    public Builder marker(String marker) {
176      this.marker = marker;
177      return this;
178    }
179
180    public GetUsersQueryParams build() {
181      return new GetUsersQueryParams(this);
182    }
183  }
184}