/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.reports;

/**
 * Service definition for Reports (reports_v1).
 *
 * <p>
 * Fetches reports for the administrators of G Suite customers about the usage, collaboration, security, and risk for their users.
 * </p>
 *
 * <p>
 * For more information about this service, see the
 * <a href="/admin-sdk/reports/" target="_blank">API Documentation</a>
 * </p>
 *
 * <p>
 * This service uses {@link ReportsRequestInitializer} to initialize global parameters via its
 * {@link Builder}.
 * </p>
 *
 * @since 1.3
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public class Reports extends com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient {

  // Note: Leave this static initializer at the top of the file.
  static {
    com.google.api.client.util.Preconditions.checkState(
        com.google.api.client.googleapis.GoogleUtils.MAJOR_VERSION == 1 &&
        com.google.api.client.googleapis.GoogleUtils.MINOR_VERSION >= 15,
        "You are currently running with version %s of google-api-client. " +
        "You need at least version 1.15 of google-api-client to run version " +
        "1.30.8 of the Admin Reports API library.", com.google.api.client.googleapis.GoogleUtils.VERSION);
  }

  /**
   * The default encoded root URL of the service. This is determined when the library is generated
   * and normally should not be changed.
   *
   * @since 1.7
   */
  public static final String DEFAULT_ROOT_URL = "https://www.googleapis.com/";

  /**
   * The default encoded service path of the service. This is determined when the library is
   * generated and normally should not be changed.
   *
   * @since 1.7
   */
  public static final String DEFAULT_SERVICE_PATH = "admin/reports/v1/";

  /**
   * The default encoded batch path of the service. This is determined when the library is
   * generated and normally should not be changed.
   *
   * @since 1.23
   */
  public static final String DEFAULT_BATCH_PATH = "batch/admin/reports_v1";

  /**
   * The default encoded base URL of the service. This is determined when the library is generated
   * and normally should not be changed.
   */
  public static final String DEFAULT_BASE_URL = DEFAULT_ROOT_URL + DEFAULT_SERVICE_PATH;

  /**
   * Constructor.
   *
   * <p>
   * Use {@link Builder} if you need to specify any of the optional parameters.
   * </p>
   *
   * @param transport HTTP transport, which should normally be:
   *        <ul>
   *        <li>Google App Engine:
   *        {@code com.google.api.client.extensions.appengine.http.UrlFetchTransport}</li>
   *        <li>Android: {@code newCompatibleTransport} from
   *        {@code com.google.api.client.extensions.android.http.AndroidHttp}</li>
   *        <li>Java: {@link com.google.api.client.googleapis.javanet.GoogleNetHttpTransport#newTrustedTransport()}
   *        </li>
   *        </ul>
   * @param jsonFactory JSON factory, which may be:
   *        <ul>
   *        <li>Jackson: {@code com.google.api.client.json.jackson2.JacksonFactory}</li>
   *        <li>Google GSON: {@code com.google.api.client.json.gson.GsonFactory}</li>
   *        <li>Android Honeycomb or higher:
   *        {@code com.google.api.client.extensions.android.json.AndroidJsonFactory}</li>
   *        </ul>
   * @param httpRequestInitializer HTTP request initializer or {@code null} for none
   * @since 1.7
   */
  public Reports(com.google.api.client.http.HttpTransport transport, com.google.api.client.json.JsonFactory jsonFactory,
      com.google.api.client.http.HttpRequestInitializer httpRequestInitializer) {
    this(new Builder(transport, jsonFactory, httpRequestInitializer));
  }

  /**
   * @param builder builder
   */
  Reports(Builder builder) {
    super(builder);
  }

  @Override
  protected void initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest<?> httpClientRequest) throws java.io.IOException {
    super.initialize(httpClientRequest);
  }

  /**
   * An accessor for creating requests from the Activities collection.
   *
   * <p>The typical use is:</p>
   * <pre>
   *   {@code Reports admin = new Reports(...);}
   *   {@code Reports.Activities.List request = admin.activities().list(parameters ...)}
   * </pre>
   *
   * @return the resource collection
   */
  public Activities activities() {
    return new Activities();
  }

  /**
   * The "activities" collection of methods.
   */
  public class Activities {

    /**
     * Retrieves a list of activities for a specific customer's account and application such as the
     * Admin console application or the Google Drive application. For more information, see the guides
     * for administrator and Google Drive activity reports. For more information about the activity
     * report's parameters, see the activity parameters reference guides.
     *
     * Create a request for the method "activities.list".
     *
     * This request holds the parameters needed by the admin server.  After setting any optional
     * parameters, call the {@link List#execute()} method to invoke the remote operation.
     *
     * @param userKey Represents the profile ID or the user email for which the data should be filtered. Can be all for
     *        all information, or userKey for a user's unique G Suite profile ID or their primary email
     *        address.
     * @param applicationName Application name for which the events are to be retrieved.
     * @return the request
     */
    public List list(java.lang.String userKey, java.lang.String applicationName) throws java.io.IOException {
      List result = new List(userKey, applicationName);
      initialize(result);
      return result;
    }

    public class List extends ReportsRequest<com.google.api.services.reports.model.Activities> {

      private static final String REST_PATH = "activity/users/{userKey}/applications/{applicationName}";

      private final java.util.regex.Pattern APPLICATION_NAME_PATTERN =
          java.util.regex.Pattern.compile("(admin)|(calendar)|(drive)|(login)|(mobile)|(token)|(groups)|(saml)|(chat)|(gplus)|(rules)|(jamboard)|(meet)|(user_accounts)|(access_transparency)|(groups_enterprise)|(gcp)");

      private final java.util.regex.Pattern CUSTOMER_ID_PATTERN =
          java.util.regex.Pattern.compile("C.+");

      private final java.util.regex.Pattern END_TIME_PATTERN =
          java.util.regex.Pattern.compile("(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.(\\d+))?(?:(Z)|([-+])(\\d\\d):(\\d\\d))");

      private final java.util.regex.Pattern FILTERS_PATTERN =
          java.util.regex.Pattern.compile("(.+[<,<=,==,>=,>,<>].+,)*(.+[<,<=,==,>=,>,<>].+)");

      private final java.util.regex.Pattern ORG_UNIT_ID_PATTERN =
          java.util.regex.Pattern.compile("(id:[a-z0-9]+)");

      private final java.util.regex.Pattern START_TIME_PATTERN =
          java.util.regex.Pattern.compile("(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.(\\d+))?(?:(Z)|([-+])(\\d\\d):(\\d\\d))");

      /**
       * Retrieves a list of activities for a specific customer's account and application such as the
       * Admin console application or the Google Drive application. For more information, see the guides
       * for administrator and Google Drive activity reports. For more information about the activity
       * report's parameters, see the activity parameters reference guides.
       *
       * Create a request for the method "activities.list".
       *
       * This request holds the parameters needed by the the admin server.  After setting any optional
       * parameters, call the {@link List#execute()} method to invoke the remote operation. <p> {@link
       * List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must be
       * called to initialize this instance immediately after invoking the constructor. </p>
       *
       * @param userKey Represents the profile ID or the user email for which the data should be filtered. Can be all for
     *        all information, or userKey for a user's unique G Suite profile ID or their primary email
     *        address.
       * @param applicationName Application name for which the events are to be retrieved.
       * @since 1.13
       */
      protected List(java.lang.String userKey, java.lang.String applicationName) {
        super(Reports.this, "GET", REST_PATH, null, com.google.api.services.reports.model.Activities.class);
        this.userKey = com.google.api.client.util.Preconditions.checkNotNull(userKey, "Required parameter userKey must be specified.");
        this.applicationName = com.google.api.client.util.Preconditions.checkNotNull(applicationName, "Required parameter applicationName must be specified.");
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(APPLICATION_NAME_PATTERN.matcher(applicationName).matches(),
              "Parameter applicationName must conform to the pattern " +
              "(admin)|(calendar)|(drive)|(login)|(mobile)|(token)|(groups)|(saml)|(chat)|(gplus)|(rules)|(jamboard)|(meet)|(user_accounts)|(access_transparency)|(groups_enterprise)|(gcp)");
        }
      }

      @Override
      public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
        return super.executeUsingHead();
      }

      @Override
      public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
        return super.buildHttpRequestUsingHead();
      }

      @Override
      public List setAlt(java.lang.String alt) {
        return (List) super.setAlt(alt);
      }

      @Override
      public List setFields(java.lang.String fields) {
        return (List) super.setFields(fields);
      }

      @Override
      public List setKey(java.lang.String key) {
        return (List) super.setKey(key);
      }

      @Override
      public List setOauthToken(java.lang.String oauthToken) {
        return (List) super.setOauthToken(oauthToken);
      }

      @Override
      public List setPrettyPrint(java.lang.Boolean prettyPrint) {
        return (List) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public List setQuotaUser(java.lang.String quotaUser) {
        return (List) super.setQuotaUser(quotaUser);
      }

      @Override
      public List setUserIp(java.lang.String userIp) {
        return (List) super.setUserIp(userIp);
      }

      /**
       * Represents the profile ID or the user email for which the data should be filtered. Can be
       * all for all information, or userKey for a user's unique G Suite profile ID or their primary
       * email address.
       */
      @com.google.api.client.util.Key
      private java.lang.String userKey;

      /** Represents the profile ID or the user email for which the data should be filtered. Can be all for
     all information, or userKey for a user's unique G Suite profile ID or their primary email address.
       */
      public java.lang.String getUserKey() {
        return userKey;
      }

      /**
       * Represents the profile ID or the user email for which the data should be filtered. Can be
       * all for all information, or userKey for a user's unique G Suite profile ID or their primary
       * email address.
       */
      public List setUserKey(java.lang.String userKey) {
        this.userKey = userKey;
        return this;
      }

      /** Application name for which the events are to be retrieved. */
      @com.google.api.client.util.Key
      private java.lang.String applicationName;

      /** Application name for which the events are to be retrieved.
       */
      public java.lang.String getApplicationName() {
        return applicationName;
      }

      /** Application name for which the events are to be retrieved. */
      public List setApplicationName(java.lang.String applicationName) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(APPLICATION_NAME_PATTERN.matcher(applicationName).matches(),
              "Parameter applicationName must conform to the pattern " +
              "(admin)|(calendar)|(drive)|(login)|(mobile)|(token)|(groups)|(saml)|(chat)|(gplus)|(rules)|(jamboard)|(meet)|(user_accounts)|(access_transparency)|(groups_enterprise)|(gcp)");
        }
        this.applicationName = applicationName;
        return this;
      }

      /**
       * The Internet Protocol (IP) Address of host where the event was performed. This is an
       * additional way to filter a report's summary using the IP address of the user whose activity
       * is being reported. This IP address may or may not reflect the user's physical location. For
       * example, the IP address can be the user's proxy server's address or a virtual private
       * network (VPN) address. This parameter supports both IPv4 and IPv6 address versions.
       */
      @com.google.api.client.util.Key
      private java.lang.String actorIpAddress;

      /** The Internet Protocol (IP) Address of host where the event was performed. This is an additional way
     to filter a report's summary using the IP address of the user whose activity is being reported.
     This IP address may or may not reflect the user's physical location. For example, the IP address
     can be the user's proxy server's address or a virtual private network (VPN) address. This parameter
     supports both IPv4 and IPv6 address versions.
       */
      public java.lang.String getActorIpAddress() {
        return actorIpAddress;
      }

      /**
       * The Internet Protocol (IP) Address of host where the event was performed. This is an
       * additional way to filter a report's summary using the IP address of the user whose activity
       * is being reported. This IP address may or may not reflect the user's physical location. For
       * example, the IP address can be the user's proxy server's address or a virtual private
       * network (VPN) address. This parameter supports both IPv4 and IPv6 address versions.
       */
      public List setActorIpAddress(java.lang.String actorIpAddress) {
        this.actorIpAddress = actorIpAddress;
        return this;
      }

      /** The unique ID of the customer to retrieve data for. */
      @com.google.api.client.util.Key
      private java.lang.String customerId;

      /** The unique ID of the customer to retrieve data for.
       */
      public java.lang.String getCustomerId() {
        return customerId;
      }

      /** The unique ID of the customer to retrieve data for. */
      public List setCustomerId(java.lang.String customerId) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(CUSTOMER_ID_PATTERN.matcher(customerId).matches(),
              "Parameter customerId must conform to the pattern " +
              "C.+");
        }
        this.customerId = customerId;
        return this;
      }

      /**
       * Sets the end of the range of time shown in the report. The date is in the RFC 3339 format,
       * for example 2010-10-28T10:26:35.000Z. The default value is the approximate time of the API
       * request. An API report has three basic time concepts: - Date of the API's request for a
       * report: When the API created and retrieved the report. - Report's start time: The beginning
       * of the timespan shown in the report. The startTime must be before the endTime (if
       * specified) and the current time when the request is made, or the API returns an error. -
       * Report's end time: The end of the timespan shown in the report. For example, the timespan
       * of events summarized in a report can start in April and end in May. The report itself can
       * be requested in August.  If the endTime is not specified, the report returns all activities
       * from the startTime until the current time or the most recent 180 days if the startTime is
       * more than 180 days in the past.
       */
      @com.google.api.client.util.Key
      private java.lang.String endTime;

      /** Sets the end of the range of time shown in the report. The date is in the RFC 3339 format, for
     example 2010-10-28T10:26:35.000Z. The default value is the approximate time of the API request. An
     API report has three basic time concepts: - Date of the API's request for a report: When the API
     created and retrieved the report. - Report's start time: The beginning of the timespan shown in the
     report. The startTime must be before the endTime (if specified) and the current time when the
     request is made, or the API returns an error. - Report's end time: The end of the timespan shown in
     the report. For example, the timespan of events summarized in a report can start in April and end
     in May. The report itself can be requested in August.  If the endTime is not specified, the report
     returns all activities from the startTime until the current time or the most recent 180 days if the
     startTime is more than 180 days in the past.
       */
      public java.lang.String getEndTime() {
        return endTime;
      }

      /**
       * Sets the end of the range of time shown in the report. The date is in the RFC 3339 format,
       * for example 2010-10-28T10:26:35.000Z. The default value is the approximate time of the API
       * request. An API report has three basic time concepts: - Date of the API's request for a
       * report: When the API created and retrieved the report. - Report's start time: The beginning
       * of the timespan shown in the report. The startTime must be before the endTime (if
       * specified) and the current time when the request is made, or the API returns an error. -
       * Report's end time: The end of the timespan shown in the report. For example, the timespan
       * of events summarized in a report can start in April and end in May. The report itself can
       * be requested in August.  If the endTime is not specified, the report returns all activities
       * from the startTime until the current time or the most recent 180 days if the startTime is
       * more than 180 days in the past.
       */
      public List setEndTime(java.lang.String endTime) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(END_TIME_PATTERN.matcher(endTime).matches(),
              "Parameter endTime must conform to the pattern " +
              "(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.(\\d+))?(?:(Z)|([-+])(\\d\\d):(\\d\\d))");
        }
        this.endTime = endTime;
        return this;
      }

      /**
       * The name of the event being queried by the API. Each eventName is related to a specific G
       * Suite service or feature which the API organizes into types of events. An example is the
       * Google Calendar events in the Admin console application's reports. The Calendar Settings
       * type structure has all of the Calendar eventName activities reported by the API. When an
       * administrator changes a Calendar setting, the API reports this activity in the Calendar
       * Settings type and eventName parameters. For more information about eventName query strings
       * and parameters, see the list of event names for various applications above in
       * applicationName.
       */
      @com.google.api.client.util.Key
      private java.lang.String eventName;

      /** The name of the event being queried by the API. Each eventName is related to a specific G Suite
     service or feature which the API organizes into types of events. An example is the Google Calendar
     events in the Admin console application's reports. The Calendar Settings type structure has all of
     the Calendar eventName activities reported by the API. When an administrator changes a Calendar
     setting, the API reports this activity in the Calendar Settings type and eventName parameters. For
     more information about eventName query strings and parameters, see the list of event names for
     various applications above in applicationName.
       */
      public java.lang.String getEventName() {
        return eventName;
      }

      /**
       * The name of the event being queried by the API. Each eventName is related to a specific G
       * Suite service or feature which the API organizes into types of events. An example is the
       * Google Calendar events in the Admin console application's reports. The Calendar Settings
       * type structure has all of the Calendar eventName activities reported by the API. When an
       * administrator changes a Calendar setting, the API reports this activity in the Calendar
       * Settings type and eventName parameters. For more information about eventName query strings
       * and parameters, see the list of event names for various applications above in
       * applicationName.
       */
      public List setEventName(java.lang.String eventName) {
        this.eventName = eventName;
        return this;
      }

      /**
       * The filters query string is a comma-separated list. The list is composed of event
       * parameters that are manipulated by relational operators. Event parameters are in the form
       * [parameter1 name][relational operator][parameter1 value],[parameter2 name][relational
       * operator][parameter2 value],... These event parameters are associated with a specific
       * eventName. An empty report is returned if the filtered request's parameter does not belong
       * to the eventName. For more information about eventName parameters, see the list of event
       * names for various applications above in applicationName.
       *
       * In the following Admin Activity example, the <> operator is URL-encoded in the request's
       * query string (%3C%3E): GET...=CHANGE_CALENDAR_SETTING =NEW_VALUE%3C%3EREAD_ONLY_ACCESS
       *
       * In the following Drive example, the list can be a view or edit event's doc_id parameter
       * with a value that is manipulated by an 'equal to' (==) or 'not equal to' (<>) relational
       * operator. In the first example, the report returns each edited document's doc_id. In the
       * second example, the report returns each viewed document's doc_id that equals the value
       * 12345 and does not return any viewed document's which have a doc_id value of 98765. The <>
       * operator is URL-encoded in the request's query string (%3C%3E):
       *
       * GET...=edit=doc_id GET...=view=doc_id==12345,doc_id%3C%3E98765
       *
       * The relational operators include: - == - 'equal to'. - <> - 'not equal to'. It is URL-
       * encoded (%3C%3E). - < - 'less than'. It is URL-encoded (%3C). - <= - 'less than or equal
       * to'. It is URL-encoded (%3C=). - > - 'greater than'. It is URL-encoded (%3E). - >= -
       * 'greater than or equal to'. It is URL-encoded (%3E=). Note: The API doesn't accept multiple
       * values of a parameter. If a particular parameter is supplied more than once in the API
       * request, the API only accepts the last value of that request parameter. In addition, if an
       * invalid request parameter is supplied in the API request, the API ignores that request
       * parameter and returns the response corresponding to the remaining valid request parameters.
       * If no parameters are requested, all parameters are returned.
       */
      @com.google.api.client.util.Key
      private java.lang.String filters;

      /** The filters query string is a comma-separated list. The list is composed of event parameters that
     are manipulated by relational operators. Event parameters are in the form [parameter1
     name][relational operator][parameter1 value],[parameter2 name][relational operator][parameter2
     value],... These event parameters are associated with a specific eventName. An empty report is
     returned if the filtered request's parameter does not belong to the eventName. For more information
     about eventName parameters, see the list of event names for various applications above in
     applicationName.

     In the following Admin Activity example, the <> operator is URL-encoded in the request's query
     string (%3C%3E): GET...=CHANGE_CALENDAR_SETTING =NEW_VALUE%3C%3EREAD_ONLY_ACCESS

     In the following Drive example, the list can be a view or edit event's doc_id parameter with a
     value that is manipulated by an 'equal to' (==) or 'not equal to' (<>) relational operator. In the
     first example, the report returns each edited document's doc_id. In the second example, the report
     returns each viewed document's doc_id that equals the value 12345 and does not return any viewed
     document's which have a doc_id value of 98765. The <> operator is URL-encoded in the request's
     query string (%3C%3E):

     GET...=edit=doc_id GET...=view=doc_id==12345,doc_id%3C%3E98765

     The relational operators include: - == - 'equal to'. - <> - 'not equal to'. It is URL-encoded
     (%3C%3E). - < - 'less than'. It is URL-encoded (%3C). - <= - 'less than or equal to'. It is URL-
     encoded (%3C=). - > - 'greater than'. It is URL-encoded (%3E). - >= - 'greater than or equal to'.
     It is URL-encoded (%3E=). Note: The API doesn't accept multiple values of a parameter. If a
     particular parameter is supplied more than once in the API request, the API only accepts the last
     value of that request parameter. In addition, if an invalid request parameter is supplied in the
     API request, the API ignores that request parameter and returns the response corresponding to the
     remaining valid request parameters. If no parameters are requested, all parameters are returned.
       */
      public java.lang.String getFilters() {
        return filters;
      }

      /**
       * The filters query string is a comma-separated list. The list is composed of event
       * parameters that are manipulated by relational operators. Event parameters are in the form
       * [parameter1 name][relational operator][parameter1 value],[parameter2 name][relational
       * operator][parameter2 value],... These event parameters are associated with a specific
       * eventName. An empty report is returned if the filtered request's parameter does not belong
       * to the eventName. For more information about eventName parameters, see the list of event
       * names for various applications above in applicationName.
       *
       * In the following Admin Activity example, the <> operator is URL-encoded in the request's
       * query string (%3C%3E): GET...=CHANGE_CALENDAR_SETTING =NEW_VALUE%3C%3EREAD_ONLY_ACCESS
       *
       * In the following Drive example, the list can be a view or edit event's doc_id parameter
       * with a value that is manipulated by an 'equal to' (==) or 'not equal to' (<>) relational
       * operator. In the first example, the report returns each edited document's doc_id. In the
       * second example, the report returns each viewed document's doc_id that equals the value
       * 12345 and does not return any viewed document's which have a doc_id value of 98765. The <>
       * operator is URL-encoded in the request's query string (%3C%3E):
       *
       * GET...=edit=doc_id GET...=view=doc_id==12345,doc_id%3C%3E98765
       *
       * The relational operators include: - == - 'equal to'. - <> - 'not equal to'. It is URL-
       * encoded (%3C%3E). - < - 'less than'. It is URL-encoded (%3C). - <= - 'less than or equal
       * to'. It is URL-encoded (%3C=). - > - 'greater than'. It is URL-encoded (%3E). - >= -
       * 'greater than or equal to'. It is URL-encoded (%3E=). Note: The API doesn't accept multiple
       * values of a parameter. If a particular parameter is supplied more than once in the API
       * request, the API only accepts the last value of that request parameter. In addition, if an
       * invalid request parameter is supplied in the API request, the API ignores that request
       * parameter and returns the response corresponding to the remaining valid request parameters.
       * If no parameters are requested, all parameters are returned.
       */
      public List setFilters(java.lang.String filters) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(FILTERS_PATTERN.matcher(filters).matches(),
              "Parameter filters must conform to the pattern " +
              "(.+[<,<=,==,>=,>,<>].+,)*(.+[<,<=,==,>=,>,<>].+)");
        }
        this.filters = filters;
        return this;
      }

      /**
       * Determines how many activity records are shown on each response page. For example, if the
       * request sets maxResults=1 and the report has two activities, the report has two pages. The
       * response's nextPageToken property has the token to the second page. The maxResults query
       * string is optional in the request. The default value is 1000.
       */
      @com.google.api.client.util.Key
      private java.lang.Integer maxResults;

      /** Determines how many activity records are shown on each response page. For example, if the request
     sets maxResults=1 and the report has two activities, the report has two pages. The response's
     nextPageToken property has the token to the second page. The maxResults query string is optional in
     the request. The default value is 1000. [default: 1000] [minimum: 1] [maximum: 1000]
       */
      public java.lang.Integer getMaxResults() {
        return maxResults;
      }

      /**
       * Determines how many activity records are shown on each response page. For example, if the
       * request sets maxResults=1 and the report has two activities, the report has two pages. The
       * response's nextPageToken property has the token to the second page. The maxResults query
       * string is optional in the request. The default value is 1000.
       */
      public List setMaxResults(java.lang.Integer maxResults) {
        this.maxResults = maxResults;
        return this;
      }

      /**
       * ID of the organizational unit to report on. Activity records will be shown only for users
       * who belong to the specified organizational unit. Data before Dec 17, 2018 doesn't appear in
       * the filtered results.
       */
      @com.google.api.client.util.Key
      private java.lang.String orgUnitID;

      /** ID of the organizational unit to report on. Activity records will be shown only for users who
     belong to the specified organizational unit. Data before Dec 17, 2018 doesn't appear in the
     filtered results.
       */
      public java.lang.String getOrgUnitID() {
        return orgUnitID;
      }

      /**
       * ID of the organizational unit to report on. Activity records will be shown only for users
       * who belong to the specified organizational unit. Data before Dec 17, 2018 doesn't appear in
       * the filtered results.
       */
      public List setOrgUnitID(java.lang.String orgUnitID) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(ORG_UNIT_ID_PATTERN.matcher(orgUnitID).matches(),
              "Parameter orgUnitID must conform to the pattern " +
              "(id:[a-z0-9]+)");
        }
        this.orgUnitID = orgUnitID;
        return this;
      }

      /**
       * The token to specify next page. A report with multiple pages has a nextPageToken property
       * in the response. In your follow-on request getting the next page of the report, enter the
       * nextPageToken value in the pageToken query string.
       */
      @com.google.api.client.util.Key
      private java.lang.String pageToken;

      /** The token to specify next page. A report with multiple pages has a nextPageToken property in the
     response. In your follow-on request getting the next page of the report, enter the nextPageToken
     value in the pageToken query string.
       */
      public java.lang.String getPageToken() {
        return pageToken;
      }

      /**
       * The token to specify next page. A report with multiple pages has a nextPageToken property
       * in the response. In your follow-on request getting the next page of the report, enter the
       * nextPageToken value in the pageToken query string.
       */
      public List setPageToken(java.lang.String pageToken) {
        this.pageToken = pageToken;
        return this;
      }

      /**
       * Sets the beginning of the range of time shown in the report. The date is in the RFC 3339
       * format, for example 2010-10-28T10:26:35.000Z. The report returns all activities from
       * startTime until endTime. The startTime must be before the endTime (if specified) and the
       * current time when the request is made, or the API returns an error.
       */
      @com.google.api.client.util.Key
      private java.lang.String startTime;

      /** Sets the beginning of the range of time shown in the report. The date is in the RFC 3339 format,
     for example 2010-10-28T10:26:35.000Z. The report returns all activities from startTime until
     endTime. The startTime must be before the endTime (if specified) and the current time when the
     request is made, or the API returns an error.
       */
      public java.lang.String getStartTime() {
        return startTime;
      }

      /**
       * Sets the beginning of the range of time shown in the report. The date is in the RFC 3339
       * format, for example 2010-10-28T10:26:35.000Z. The report returns all activities from
       * startTime until endTime. The startTime must be before the endTime (if specified) and the
       * current time when the request is made, or the API returns an error.
       */
      public List setStartTime(java.lang.String startTime) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(START_TIME_PATTERN.matcher(startTime).matches(),
              "Parameter startTime must conform to the pattern " +
              "(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.(\\d+))?(?:(Z)|([-+])(\\d\\d):(\\d\\d))");
        }
        this.startTime = startTime;
        return this;
      }

      @Override
      public List set(String parameterName, Object value) {
        return (List) super.set(parameterName, value);
      }
    }
    /**
     * Start receiving notifications for account activities. For more information, see Receiving Push
     * Notifications.
     *
     * Create a request for the method "activities.watch".
     *
     * This request holds the parameters needed by the admin server.  After setting any optional
     * parameters, call the {@link Watch#execute()} method to invoke the remote operation.
     *
     * @param userKey Represents the profile ID or the user email for which the data should be filtered. Can be all for
     *        all information, or userKey for a user's unique G Suite profile ID or their primary email
     *        address.
     * @param applicationName Application name for which the events are to be retrieved.
     * @param content the {@link com.google.api.services.reports.model.Channel}
     * @return the request
     */
    public Watch watch(java.lang.String userKey, java.lang.String applicationName, com.google.api.services.reports.model.Channel content) throws java.io.IOException {
      Watch result = new Watch(userKey, applicationName, content);
      initialize(result);
      return result;
    }

    public class Watch extends ReportsRequest<com.google.api.services.reports.model.Channel> {

      private static final String REST_PATH = "activity/users/{userKey}/applications/{applicationName}/watch";

      private final java.util.regex.Pattern APPLICATION_NAME_PATTERN =
          java.util.regex.Pattern.compile("(admin)|(calendar)|(drive)|(login)|(mobile)|(token)|(groups)|(saml)|(chat)|(gplus)|(rules)|(jamboard)|(meet)|(user_accounts)|(access_transparency)|(groups_enterprise)|(gcp)");

      private final java.util.regex.Pattern CUSTOMER_ID_PATTERN =
          java.util.regex.Pattern.compile("C.+");

      private final java.util.regex.Pattern END_TIME_PATTERN =
          java.util.regex.Pattern.compile("(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.(\\d+))?(?:(Z)|([-+])(\\d\\d):(\\d\\d))");

      private final java.util.regex.Pattern FILTERS_PATTERN =
          java.util.regex.Pattern.compile("(.+[<,<=,==,>=,>,<>].+,)*(.+[<,<=,==,>=,>,<>].+)");

      private final java.util.regex.Pattern ORG_UNIT_ID_PATTERN =
          java.util.regex.Pattern.compile("(id:[a-z0-9]+)");

      private final java.util.regex.Pattern START_TIME_PATTERN =
          java.util.regex.Pattern.compile("(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.(\\d+))?(?:(Z)|([-+])(\\d\\d):(\\d\\d))");

      /**
       * Start receiving notifications for account activities. For more information, see Receiving Push
       * Notifications.
       *
       * Create a request for the method "activities.watch".
       *
       * This request holds the parameters needed by the the admin server.  After setting any optional
       * parameters, call the {@link Watch#execute()} method to invoke the remote operation. <p> {@link
       * Watch#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
       * be called to initialize this instance immediately after invoking the constructor. </p>
       *
       * @param userKey Represents the profile ID or the user email for which the data should be filtered. Can be all for
     *        all information, or userKey for a user's unique G Suite profile ID or their primary email
     *        address.
       * @param applicationName Application name for which the events are to be retrieved.
       * @param content the {@link com.google.api.services.reports.model.Channel}
       * @since 1.13
       */
      protected Watch(java.lang.String userKey, java.lang.String applicationName, com.google.api.services.reports.model.Channel content) {
        super(Reports.this, "POST", REST_PATH, content, com.google.api.services.reports.model.Channel.class);
        this.userKey = com.google.api.client.util.Preconditions.checkNotNull(userKey, "Required parameter userKey must be specified.");
        this.applicationName = com.google.api.client.util.Preconditions.checkNotNull(applicationName, "Required parameter applicationName must be specified.");
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(APPLICATION_NAME_PATTERN.matcher(applicationName).matches(),
              "Parameter applicationName must conform to the pattern " +
              "(admin)|(calendar)|(drive)|(login)|(mobile)|(token)|(groups)|(saml)|(chat)|(gplus)|(rules)|(jamboard)|(meet)|(user_accounts)|(access_transparency)|(groups_enterprise)|(gcp)");
        }
      }

      @Override
      public Watch setAlt(java.lang.String alt) {
        return (Watch) super.setAlt(alt);
      }

      @Override
      public Watch setFields(java.lang.String fields) {
        return (Watch) super.setFields(fields);
      }

      @Override
      public Watch setKey(java.lang.String key) {
        return (Watch) super.setKey(key);
      }

      @Override
      public Watch setOauthToken(java.lang.String oauthToken) {
        return (Watch) super.setOauthToken(oauthToken);
      }

      @Override
      public Watch setPrettyPrint(java.lang.Boolean prettyPrint) {
        return (Watch) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Watch setQuotaUser(java.lang.String quotaUser) {
        return (Watch) super.setQuotaUser(quotaUser);
      }

      @Override
      public Watch setUserIp(java.lang.String userIp) {
        return (Watch) super.setUserIp(userIp);
      }

      /**
       * Represents the profile ID or the user email for which the data should be filtered. Can be
       * all for all information, or userKey for a user's unique G Suite profile ID or their primary
       * email address.
       */
      @com.google.api.client.util.Key
      private java.lang.String userKey;

      /** Represents the profile ID or the user email for which the data should be filtered. Can be all for
     all information, or userKey for a user's unique G Suite profile ID or their primary email address.
       */
      public java.lang.String getUserKey() {
        return userKey;
      }

      /**
       * Represents the profile ID or the user email for which the data should be filtered. Can be
       * all for all information, or userKey for a user's unique G Suite profile ID or their primary
       * email address.
       */
      public Watch setUserKey(java.lang.String userKey) {
        this.userKey = userKey;
        return this;
      }

      /** Application name for which the events are to be retrieved. */
      @com.google.api.client.util.Key
      private java.lang.String applicationName;

      /** Application name for which the events are to be retrieved.
       */
      public java.lang.String getApplicationName() {
        return applicationName;
      }

      /** Application name for which the events are to be retrieved. */
      public Watch setApplicationName(java.lang.String applicationName) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(APPLICATION_NAME_PATTERN.matcher(applicationName).matches(),
              "Parameter applicationName must conform to the pattern " +
              "(admin)|(calendar)|(drive)|(login)|(mobile)|(token)|(groups)|(saml)|(chat)|(gplus)|(rules)|(jamboard)|(meet)|(user_accounts)|(access_transparency)|(groups_enterprise)|(gcp)");
        }
        this.applicationName = applicationName;
        return this;
      }

      /**
       * The Internet Protocol (IP) Address of host where the event was performed. This is an
       * additional way to filter a report's summary using the IP address of the user whose activity
       * is being reported. This IP address may or may not reflect the user's physical location. For
       * example, the IP address can be the user's proxy server's address or a virtual private
       * network (VPN) address. This parameter supports both IPv4 and IPv6 address versions.
       */
      @com.google.api.client.util.Key
      private java.lang.String actorIpAddress;

      /** The Internet Protocol (IP) Address of host where the event was performed. This is an additional way
     to filter a report's summary using the IP address of the user whose activity is being reported.
     This IP address may or may not reflect the user's physical location. For example, the IP address
     can be the user's proxy server's address or a virtual private network (VPN) address. This parameter
     supports both IPv4 and IPv6 address versions.
       */
      public java.lang.String getActorIpAddress() {
        return actorIpAddress;
      }

      /**
       * The Internet Protocol (IP) Address of host where the event was performed. This is an
       * additional way to filter a report's summary using the IP address of the user whose activity
       * is being reported. This IP address may or may not reflect the user's physical location. For
       * example, the IP address can be the user's proxy server's address or a virtual private
       * network (VPN) address. This parameter supports both IPv4 and IPv6 address versions.
       */
      public Watch setActorIpAddress(java.lang.String actorIpAddress) {
        this.actorIpAddress = actorIpAddress;
        return this;
      }

      /** The unique ID of the customer to retrieve data for. */
      @com.google.api.client.util.Key
      private java.lang.String customerId;

      /** The unique ID of the customer to retrieve data for.
       */
      public java.lang.String getCustomerId() {
        return customerId;
      }

      /** The unique ID of the customer to retrieve data for. */
      public Watch setCustomerId(java.lang.String customerId) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(CUSTOMER_ID_PATTERN.matcher(customerId).matches(),
              "Parameter customerId must conform to the pattern " +
              "C.+");
        }
        this.customerId = customerId;
        return this;
      }

      /**
       * Sets the end of the range of time shown in the report. The date is in the RFC 3339 format,
       * for example 2010-10-28T10:26:35.000Z. The default value is the approximate time of the API
       * request. An API report has three basic time concepts: - Date of the API's request for a
       * report: When the API created and retrieved the report. - Report's start time: The beginning
       * of the timespan shown in the report. The startTime must be before the endTime (if
       * specified) and the current time when the request is made, or the API returns an error. -
       * Report's end time: The end of the timespan shown in the report. For example, the timespan
       * of events summarized in a report can start in April and end in May. The report itself can
       * be requested in August.  If the endTime is not specified, the report returns all activities
       * from the startTime until the current time or the most recent 180 days if the startTime is
       * more than 180 days in the past.
       */
      @com.google.api.client.util.Key
      private java.lang.String endTime;

      /** Sets the end of the range of time shown in the report. The date is in the RFC 3339 format, for
     example 2010-10-28T10:26:35.000Z. The default value is the approximate time of the API request. An
     API report has three basic time concepts: - Date of the API's request for a report: When the API
     created and retrieved the report. - Report's start time: The beginning of the timespan shown in the
     report. The startTime must be before the endTime (if specified) and the current time when the
     request is made, or the API returns an error. - Report's end time: The end of the timespan shown in
     the report. For example, the timespan of events summarized in a report can start in April and end
     in May. The report itself can be requested in August.  If the endTime is not specified, the report
     returns all activities from the startTime until the current time or the most recent 180 days if the
     startTime is more than 180 days in the past.
       */
      public java.lang.String getEndTime() {
        return endTime;
      }

      /**
       * Sets the end of the range of time shown in the report. The date is in the RFC 3339 format,
       * for example 2010-10-28T10:26:35.000Z. The default value is the approximate time of the API
       * request. An API report has three basic time concepts: - Date of the API's request for a
       * report: When the API created and retrieved the report. - Report's start time: The beginning
       * of the timespan shown in the report. The startTime must be before the endTime (if
       * specified) and the current time when the request is made, or the API returns an error. -
       * Report's end time: The end of the timespan shown in the report. For example, the timespan
       * of events summarized in a report can start in April and end in May. The report itself can
       * be requested in August.  If the endTime is not specified, the report returns all activities
       * from the startTime until the current time or the most recent 180 days if the startTime is
       * more than 180 days in the past.
       */
      public Watch setEndTime(java.lang.String endTime) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(END_TIME_PATTERN.matcher(endTime).matches(),
              "Parameter endTime must conform to the pattern " +
              "(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.(\\d+))?(?:(Z)|([-+])(\\d\\d):(\\d\\d))");
        }
        this.endTime = endTime;
        return this;
      }

      /**
       * The name of the event being queried by the API. Each eventName is related to a specific G
       * Suite service or feature which the API organizes into types of events. An example is the
       * Google Calendar events in the Admin console application's reports. The Calendar Settings
       * type structure has all of the Calendar eventName activities reported by the API. When an
       * administrator changes a Calendar setting, the API reports this activity in the Calendar
       * Settings type and eventName parameters. For more information about eventName query strings
       * and parameters, see the list of event names for various applications above in
       * applicationName.
       */
      @com.google.api.client.util.Key
      private java.lang.String eventName;

      /** The name of the event being queried by the API. Each eventName is related to a specific G Suite
     service or feature which the API organizes into types of events. An example is the Google Calendar
     events in the Admin console application's reports. The Calendar Settings type structure has all of
     the Calendar eventName activities reported by the API. When an administrator changes a Calendar
     setting, the API reports this activity in the Calendar Settings type and eventName parameters. For
     more information about eventName query strings and parameters, see the list of event names for
     various applications above in applicationName.
       */
      public java.lang.String getEventName() {
        return eventName;
      }

      /**
       * The name of the event being queried by the API. Each eventName is related to a specific G
       * Suite service or feature which the API organizes into types of events. An example is the
       * Google Calendar events in the Admin console application's reports. The Calendar Settings
       * type structure has all of the Calendar eventName activities reported by the API. When an
       * administrator changes a Calendar setting, the API reports this activity in the Calendar
       * Settings type and eventName parameters. For more information about eventName query strings
       * and parameters, see the list of event names for various applications above in
       * applicationName.
       */
      public Watch setEventName(java.lang.String eventName) {
        this.eventName = eventName;
        return this;
      }

      /**
       * The filters query string is a comma-separated list. The list is composed of event
       * parameters that are manipulated by relational operators. Event parameters are in the form
       * [parameter1 name][relational operator][parameter1 value],[parameter2 name][relational
       * operator][parameter2 value],... These event parameters are associated with a specific
       * eventName. An empty report is returned if the filtered request's parameter does not belong
       * to the eventName. For more information about eventName parameters, see the list of event
       * names for various applications above in applicationName.
       *
       * In the following Admin Activity example, the <> operator is URL-encoded in the request's
       * query string (%3C%3E): GET...=CHANGE_CALENDAR_SETTING =NEW_VALUE%3C%3EREAD_ONLY_ACCESS
       *
       * In the following Drive example, the list can be a view or edit event's doc_id parameter
       * with a value that is manipulated by an 'equal to' (==) or 'not equal to' (<>) relational
       * operator. In the first example, the report returns each edited document's doc_id. In the
       * second example, the report returns each viewed document's doc_id that equals the value
       * 12345 and does not return any viewed document's which have a doc_id value of 98765. The <>
       * operator is URL-encoded in the request's query string (%3C%3E):
       *
       * GET...=edit=doc_id GET...=view=doc_id==12345,doc_id%3C%3E98765
       *
       * The relational operators include: - == - 'equal to'. - <> - 'not equal to'. It is URL-
       * encoded (%3C%3E). - < - 'less than'. It is URL-encoded (%3C). - <= - 'less than or equal
       * to'. It is URL-encoded (%3C=). - > - 'greater than'. It is URL-encoded (%3E). - >= -
       * 'greater than or equal to'. It is URL-encoded (%3E=). Note: The API doesn't accept multiple
       * values of a parameter. If a particular parameter is supplied more than once in the API
       * request, the API only accepts the last value of that request parameter. In addition, if an
       * invalid request parameter is supplied in the API request, the API ignores that request
       * parameter and returns the response corresponding to the remaining valid request parameters.
       * If no parameters are requested, all parameters are returned.
       */
      @com.google.api.client.util.Key
      private java.lang.String filters;

      /** The filters query string is a comma-separated list. The list is composed of event parameters that
     are manipulated by relational operators. Event parameters are in the form [parameter1
     name][relational operator][parameter1 value],[parameter2 name][relational operator][parameter2
     value],... These event parameters are associated with a specific eventName. An empty report is
     returned if the filtered request's parameter does not belong to the eventName. For more information
     about eventName parameters, see the list of event names for various applications above in
     applicationName.

     In the following Admin Activity example, the <> operator is URL-encoded in the request's query
     string (%3C%3E): GET...=CHANGE_CALENDAR_SETTING =NEW_VALUE%3C%3EREAD_ONLY_ACCESS

     In the following Drive example, the list can be a view or edit event's doc_id parameter with a
     value that is manipulated by an 'equal to' (==) or 'not equal to' (<>) relational operator. In the
     first example, the report returns each edited document's doc_id. In the second example, the report
     returns each viewed document's doc_id that equals the value 12345 and does not return any viewed
     document's which have a doc_id value of 98765. The <> operator is URL-encoded in the request's
     query string (%3C%3E):

     GET...=edit=doc_id GET...=view=doc_id==12345,doc_id%3C%3E98765

     The relational operators include: - == - 'equal to'. - <> - 'not equal to'. It is URL-encoded
     (%3C%3E). - < - 'less than'. It is URL-encoded (%3C). - <= - 'less than or equal to'. It is URL-
     encoded (%3C=). - > - 'greater than'. It is URL-encoded (%3E). - >= - 'greater than or equal to'.
     It is URL-encoded (%3E=). Note: The API doesn't accept multiple values of a parameter. If a
     particular parameter is supplied more than once in the API request, the API only accepts the last
     value of that request parameter. In addition, if an invalid request parameter is supplied in the
     API request, the API ignores that request parameter and returns the response corresponding to the
     remaining valid request parameters. If no parameters are requested, all parameters are returned.
       */
      public java.lang.String getFilters() {
        return filters;
      }

      /**
       * The filters query string is a comma-separated list. The list is composed of event
       * parameters that are manipulated by relational operators. Event parameters are in the form
       * [parameter1 name][relational operator][parameter1 value],[parameter2 name][relational
       * operator][parameter2 value],... These event parameters are associated with a specific
       * eventName. An empty report is returned if the filtered request's parameter does not belong
       * to the eventName. For more information about eventName parameters, see the list of event
       * names for various applications above in applicationName.
       *
       * In the following Admin Activity example, the <> operator is URL-encoded in the request's
       * query string (%3C%3E): GET...=CHANGE_CALENDAR_SETTING =NEW_VALUE%3C%3EREAD_ONLY_ACCESS
       *
       * In the following Drive example, the list can be a view or edit event's doc_id parameter
       * with a value that is manipulated by an 'equal to' (==) or 'not equal to' (<>) relational
       * operator. In the first example, the report returns each edited document's doc_id. In the
       * second example, the report returns each viewed document's doc_id that equals the value
       * 12345 and does not return any viewed document's which have a doc_id value of 98765. The <>
       * operator is URL-encoded in the request's query string (%3C%3E):
       *
       * GET...=edit=doc_id GET...=view=doc_id==12345,doc_id%3C%3E98765
       *
       * The relational operators include: - == - 'equal to'. - <> - 'not equal to'. It is URL-
       * encoded (%3C%3E). - < - 'less than'. It is URL-encoded (%3C). - <= - 'less than or equal
       * to'. It is URL-encoded (%3C=). - > - 'greater than'. It is URL-encoded (%3E). - >= -
       * 'greater than or equal to'. It is URL-encoded (%3E=). Note: The API doesn't accept multiple
       * values of a parameter. If a particular parameter is supplied more than once in the API
       * request, the API only accepts the last value of that request parameter. In addition, if an
       * invalid request parameter is supplied in the API request, the API ignores that request
       * parameter and returns the response corresponding to the remaining valid request parameters.
       * If no parameters are requested, all parameters are returned.
       */
      public Watch setFilters(java.lang.String filters) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(FILTERS_PATTERN.matcher(filters).matches(),
              "Parameter filters must conform to the pattern " +
              "(.+[<,<=,==,>=,>,<>].+,)*(.+[<,<=,==,>=,>,<>].+)");
        }
        this.filters = filters;
        return this;
      }

      /**
       * Determines how many activity records are shown on each response page. For example, if the
       * request sets maxResults=1 and the report has two activities, the report has two pages. The
       * response's nextPageToken property has the token to the second page. The maxResults query
       * string is optional in the request. The default value is 1000.
       */
      @com.google.api.client.util.Key
      private java.lang.Integer maxResults;

      /** Determines how many activity records are shown on each response page. For example, if the request
     sets maxResults=1 and the report has two activities, the report has two pages. The response's
     nextPageToken property has the token to the second page. The maxResults query string is optional in
     the request. The default value is 1000. [default: 1000] [minimum: 1] [maximum: 1000]
       */
      public java.lang.Integer getMaxResults() {
        return maxResults;
      }

      /**
       * Determines how many activity records are shown on each response page. For example, if the
       * request sets maxResults=1 and the report has two activities, the report has two pages. The
       * response's nextPageToken property has the token to the second page. The maxResults query
       * string is optional in the request. The default value is 1000.
       */
      public Watch setMaxResults(java.lang.Integer maxResults) {
        this.maxResults = maxResults;
        return this;
      }

      /**
       * ID of the organizational unit to report on. Activity records will be shown only for users
       * who belong to the specified organizational unit. Data before Dec 17, 2018 doesn't appear in
       * the filtered results.
       */
      @com.google.api.client.util.Key
      private java.lang.String orgUnitID;

      /** ID of the organizational unit to report on. Activity records will be shown only for users who
     belong to the specified organizational unit. Data before Dec 17, 2018 doesn't appear in the
     filtered results.
       */
      public java.lang.String getOrgUnitID() {
        return orgUnitID;
      }

      /**
       * ID of the organizational unit to report on. Activity records will be shown only for users
       * who belong to the specified organizational unit. Data before Dec 17, 2018 doesn't appear in
       * the filtered results.
       */
      public Watch setOrgUnitID(java.lang.String orgUnitID) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(ORG_UNIT_ID_PATTERN.matcher(orgUnitID).matches(),
              "Parameter orgUnitID must conform to the pattern " +
              "(id:[a-z0-9]+)");
        }
        this.orgUnitID = orgUnitID;
        return this;
      }

      /**
       * The token to specify next page. A report with multiple pages has a nextPageToken property
       * in the response. In your follow-on request getting the next page of the report, enter the
       * nextPageToken value in the pageToken query string.
       */
      @com.google.api.client.util.Key
      private java.lang.String pageToken;

      /** The token to specify next page. A report with multiple pages has a nextPageToken property in the
     response. In your follow-on request getting the next page of the report, enter the nextPageToken
     value in the pageToken query string.
       */
      public java.lang.String getPageToken() {
        return pageToken;
      }

      /**
       * The token to specify next page. A report with multiple pages has a nextPageToken property
       * in the response. In your follow-on request getting the next page of the report, enter the
       * nextPageToken value in the pageToken query string.
       */
      public Watch setPageToken(java.lang.String pageToken) {
        this.pageToken = pageToken;
        return this;
      }

      /**
       * Sets the beginning of the range of time shown in the report. The date is in the RFC 3339
       * format, for example 2010-10-28T10:26:35.000Z. The report returns all activities from
       * startTime until endTime. The startTime must be before the endTime (if specified) and the
       * current time when the request is made, or the API returns an error.
       */
      @com.google.api.client.util.Key
      private java.lang.String startTime;

      /** Sets the beginning of the range of time shown in the report. The date is in the RFC 3339 format,
     for example 2010-10-28T10:26:35.000Z. The report returns all activities from startTime until
     endTime. The startTime must be before the endTime (if specified) and the current time when the
     request is made, or the API returns an error.
       */
      public java.lang.String getStartTime() {
        return startTime;
      }

      /**
       * Sets the beginning of the range of time shown in the report. The date is in the RFC 3339
       * format, for example 2010-10-28T10:26:35.000Z. The report returns all activities from
       * startTime until endTime. The startTime must be before the endTime (if specified) and the
       * current time when the request is made, or the API returns an error.
       */
      public Watch setStartTime(java.lang.String startTime) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(START_TIME_PATTERN.matcher(startTime).matches(),
              "Parameter startTime must conform to the pattern " +
              "(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)(?:\\.(\\d+))?(?:(Z)|([-+])(\\d\\d):(\\d\\d))");
        }
        this.startTime = startTime;
        return this;
      }

      @Override
      public Watch set(String parameterName, Object value) {
        return (Watch) super.set(parameterName, value);
      }
    }

  }

  /**
   * An accessor for creating requests from the Channels collection.
   *
   * <p>The typical use is:</p>
   * <pre>
   *   {@code Reports admin = new Reports(...);}
   *   {@code Reports.Channels.List request = admin.channels().list(parameters ...)}
   * </pre>
   *
   * @return the resource collection
   */
  public Channels channels() {
    return new Channels();
  }

  /**
   * The "channels" collection of methods.
   */
  public class Channels {

    /**
     * Stop watching resources through this channel
     *
     * Create a request for the method "channels.stop".
     *
     * This request holds the parameters needed by the admin server.  After setting any optional
     * parameters, call the {@link Stop#execute()} method to invoke the remote operation.
     *
     * @param content the {@link com.google.api.services.reports.model.Channel}
     * @return the request
     */
    public Stop stop(com.google.api.services.reports.model.Channel content) throws java.io.IOException {
      Stop result = new Stop(content);
      initialize(result);
      return result;
    }

    public class Stop extends ReportsRequest<Void> {

      private static final String REST_PATH = "/admin/reports_v1/channels/stop";

      /**
       * Stop watching resources through this channel
       *
       * Create a request for the method "channels.stop".
       *
       * This request holds the parameters needed by the the admin server.  After setting any optional
       * parameters, call the {@link Stop#execute()} method to invoke the remote operation. <p> {@link
       * Stop#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must be
       * called to initialize this instance immediately after invoking the constructor. </p>
       *
       * @param content the {@link com.google.api.services.reports.model.Channel}
       * @since 1.13
       */
      protected Stop(com.google.api.services.reports.model.Channel content) {
        super(Reports.this, "POST", REST_PATH, content, Void.class);
      }

      @Override
      public Stop setAlt(java.lang.String alt) {
        return (Stop) super.setAlt(alt);
      }

      @Override
      public Stop setFields(java.lang.String fields) {
        return (Stop) super.setFields(fields);
      }

      @Override
      public Stop setKey(java.lang.String key) {
        return (Stop) super.setKey(key);
      }

      @Override
      public Stop setOauthToken(java.lang.String oauthToken) {
        return (Stop) super.setOauthToken(oauthToken);
      }

      @Override
      public Stop setPrettyPrint(java.lang.Boolean prettyPrint) {
        return (Stop) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Stop setQuotaUser(java.lang.String quotaUser) {
        return (Stop) super.setQuotaUser(quotaUser);
      }

      @Override
      public Stop setUserIp(java.lang.String userIp) {
        return (Stop) super.setUserIp(userIp);
      }

      @Override
      public Stop set(String parameterName, Object value) {
        return (Stop) super.set(parameterName, value);
      }
    }

  }

  /**
   * An accessor for creating requests from the CustomerUsageReports collection.
   *
   * <p>The typical use is:</p>
   * <pre>
   *   {@code Reports admin = new Reports(...);}
   *   {@code Reports.CustomerUsageReports.List request = admin.customerUsageReports().list(parameters ...)}
   * </pre>
   *
   * @return the resource collection
   */
  public CustomerUsageReports customerUsageReports() {
    return new CustomerUsageReports();
  }

  /**
   * The "customerUsageReports" collection of methods.
   */
  public class CustomerUsageReports {

    /**
     * Retrieves a report which is a collection of properties and statistics for a specific customer's
     * account. For more information, see the Customers Usage Report guide. For more information about
     * the customer report's parameters, see the Customers Usage parameters reference guides.
     *
     * Create a request for the method "customerUsageReports.get".
     *
     * This request holds the parameters needed by the admin server.  After setting any optional
     * parameters, call the {@link Get#execute()} method to invoke the remote operation.
     *
     * @param date Represents the date the usage occurred. The timestamp is in the ISO 8601 format, yyyy-mm-dd. We
     *        recommend you use your account's time zone for this.
     * @return the request
     */
    public Get get(java.lang.String date) throws java.io.IOException {
      Get result = new Get(date);
      initialize(result);
      return result;
    }

    public class Get extends ReportsRequest<com.google.api.services.reports.model.UsageReports> {

      private static final String REST_PATH = "usage/dates/{date}";

      private final java.util.regex.Pattern DATE_PATTERN =
          java.util.regex.Pattern.compile("(\\d){4}-(\\d){2}-(\\d){2}");

      private final java.util.regex.Pattern CUSTOMER_ID_PATTERN =
          java.util.regex.Pattern.compile("C.+");

      private final java.util.regex.Pattern PARAMETERS_PATTERN =
          java.util.regex.Pattern.compile("(((accounts)|(app_maker)|(apps_scripts)|(classroom)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)|(drive)|(meet)):[^,]+,)*(((accounts)|(app_maker)|(apps_scripts)|(classroom)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)|(drive)|(meet)):[^,]+)");

      /**
       * Retrieves a report which is a collection of properties and statistics for a specific customer's
       * account. For more information, see the Customers Usage Report guide. For more information about
       * the customer report's parameters, see the Customers Usage parameters reference guides.
       *
       * Create a request for the method "customerUsageReports.get".
       *
       * This request holds the parameters needed by the the admin server.  After setting any optional
       * parameters, call the {@link Get#execute()} method to invoke the remote operation. <p> {@link
       * Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must be
       * called to initialize this instance immediately after invoking the constructor. </p>
       *
       * @param date Represents the date the usage occurred. The timestamp is in the ISO 8601 format, yyyy-mm-dd. We
     *        recommend you use your account's time zone for this.
       * @since 1.13
       */
      protected Get(java.lang.String date) {
        super(Reports.this, "GET", REST_PATH, null, com.google.api.services.reports.model.UsageReports.class);
        this.date = com.google.api.client.util.Preconditions.checkNotNull(date, "Required parameter date must be specified.");
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(DATE_PATTERN.matcher(date).matches(),
              "Parameter date must conform to the pattern " +
              "(\\d){4}-(\\d){2}-(\\d){2}");
        }
      }

      @Override
      public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
        return super.executeUsingHead();
      }

      @Override
      public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
        return super.buildHttpRequestUsingHead();
      }

      @Override
      public Get setAlt(java.lang.String alt) {
        return (Get) super.setAlt(alt);
      }

      @Override
      public Get setFields(java.lang.String fields) {
        return (Get) super.setFields(fields);
      }

      @Override
      public Get setKey(java.lang.String key) {
        return (Get) super.setKey(key);
      }

      @Override
      public Get setOauthToken(java.lang.String oauthToken) {
        return (Get) super.setOauthToken(oauthToken);
      }

      @Override
      public Get setPrettyPrint(java.lang.Boolean prettyPrint) {
        return (Get) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Get setQuotaUser(java.lang.String quotaUser) {
        return (Get) super.setQuotaUser(quotaUser);
      }

      @Override
      public Get setUserIp(java.lang.String userIp) {
        return (Get) super.setUserIp(userIp);
      }

      /**
       * Represents the date the usage occurred. The timestamp is in the ISO 8601 format, yyyy-mm-
       * dd. We recommend you use your account's time zone for this.
       */
      @com.google.api.client.util.Key
      private java.lang.String date;

      /** Represents the date the usage occurred. The timestamp is in the ISO 8601 format, yyyy-mm-dd. We
     recommend you use your account's time zone for this.
       */
      public java.lang.String getDate() {
        return date;
      }

      /**
       * Represents the date the usage occurred. The timestamp is in the ISO 8601 format, yyyy-mm-
       * dd. We recommend you use your account's time zone for this.
       */
      public Get setDate(java.lang.String date) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(DATE_PATTERN.matcher(date).matches(),
              "Parameter date must conform to the pattern " +
              "(\\d){4}-(\\d){2}-(\\d){2}");
        }
        this.date = date;
        return this;
      }

      /** The unique ID of the customer to retrieve data for. */
      @com.google.api.client.util.Key
      private java.lang.String customerId;

      /** The unique ID of the customer to retrieve data for.
       */
      public java.lang.String getCustomerId() {
        return customerId;
      }

      /** The unique ID of the customer to retrieve data for. */
      public Get setCustomerId(java.lang.String customerId) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(CUSTOMER_ID_PATTERN.matcher(customerId).matches(),
              "Parameter customerId must conform to the pattern " +
              "C.+");
        }
        this.customerId = customerId;
        return this;
      }

      /**
       * Token to specify next page. A report with multiple pages has a nextPageToken property in
       * the response. For your follow-on requests getting all of the report's pages, enter the
       * nextPageToken value in the pageToken query string.
       */
      @com.google.api.client.util.Key
      private java.lang.String pageToken;

      /** Token to specify next page. A report with multiple pages has a nextPageToken property in the
     response. For your follow-on requests getting all of the report's pages, enter the nextPageToken
     value in the pageToken query string.
       */
      public java.lang.String getPageToken() {
        return pageToken;
      }

      /**
       * Token to specify next page. A report with multiple pages has a nextPageToken property in
       * the response. For your follow-on requests getting all of the report's pages, enter the
       * nextPageToken value in the pageToken query string.
       */
      public Get setPageToken(java.lang.String pageToken) {
        this.pageToken = pageToken;
        return this;
      }

      /**
       * The parameters query string is a comma-separated list of event parameters that refine a
       * report's results. The parameter is associated with a specific application. The application
       * values for the Customers usage report include accounts, app_maker, apps_scripts, calendar,
       * classroom, cros, docs, gmail, gplus, device_management, meet, and sites. A parameters query
       * string is in the CSV form of app_name1:param_name1, app_name2:param_name2. Note: The API
       * doesn't accept multiple values of a parameter. If a particular parameter is supplied more
       * than once in the API request, the API only accepts the last value of that request
       * parameter. In addition, if an invalid request parameter is supplied in the API request, the
       * API ignores that request parameter and returns the response corresponding to the remaining
       * valid request parameters.
       *
       * An example of an invalid request parameter is one that does not belong to the application.
       * If no parameters are requested, all parameters are returned.
       */
      @com.google.api.client.util.Key
      private java.lang.String parameters;

      /** The parameters query string is a comma-separated list of event parameters that refine a report's
     results. The parameter is associated with a specific application. The application values for the
     Customers usage report include accounts, app_maker, apps_scripts, calendar, classroom, cros, docs,
     gmail, gplus, device_management, meet, and sites. A parameters query string is in the CSV form of
     app_name1:param_name1, app_name2:param_name2. Note: The API doesn't accept multiple values of a
     parameter. If a particular parameter is supplied more than once in the API request, the API only
     accepts the last value of that request parameter. In addition, if an invalid request parameter is
     supplied in the API request, the API ignores that request parameter and returns the response
     corresponding to the remaining valid request parameters.

     An example of an invalid request parameter is one that does not belong to the application. If no
     parameters are requested, all parameters are returned.
       */
      public java.lang.String getParameters() {
        return parameters;
      }

      /**
       * The parameters query string is a comma-separated list of event parameters that refine a
       * report's results. The parameter is associated with a specific application. The application
       * values for the Customers usage report include accounts, app_maker, apps_scripts, calendar,
       * classroom, cros, docs, gmail, gplus, device_management, meet, and sites. A parameters query
       * string is in the CSV form of app_name1:param_name1, app_name2:param_name2. Note: The API
       * doesn't accept multiple values of a parameter. If a particular parameter is supplied more
       * than once in the API request, the API only accepts the last value of that request
       * parameter. In addition, if an invalid request parameter is supplied in the API request, the
       * API ignores that request parameter and returns the response corresponding to the remaining
       * valid request parameters.
       *
       * An example of an invalid request parameter is one that does not belong to the application.
       * If no parameters are requested, all parameters are returned.
       */
      public Get setParameters(java.lang.String parameters) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(PARAMETERS_PATTERN.matcher(parameters).matches(),
              "Parameter parameters must conform to the pattern " +
              "(((accounts)|(app_maker)|(apps_scripts)|(classroom)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)|(drive)|(meet)):[^,]+,)*(((accounts)|(app_maker)|(apps_scripts)|(classroom)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)|(drive)|(meet)):[^,]+)");
        }
        this.parameters = parameters;
        return this;
      }

      @Override
      public Get set(String parameterName, Object value) {
        return (Get) super.set(parameterName, value);
      }
    }

  }

  /**
   * An accessor for creating requests from the EntityUsageReports collection.
   *
   * <p>The typical use is:</p>
   * <pre>
   *   {@code Reports admin = new Reports(...);}
   *   {@code Reports.EntityUsageReports.List request = admin.entityUsageReports().list(parameters ...)}
   * </pre>
   *
   * @return the resource collection
   */
  public EntityUsageReports entityUsageReports() {
    return new EntityUsageReports();
  }

  /**
   * The "entityUsageReports" collection of methods.
   */
  public class EntityUsageReports {

    /**
     * Retrieves a report which is a collection of properties and statistics for entities used by users
     * within the account. For more information, see the Entities Usage Report guide. For more
     * information about the entities report's parameters, see the Entities Usage parameters reference
     * guides.
     *
     * Create a request for the method "entityUsageReports.get".
     *
     * This request holds the parameters needed by the admin server.  After setting any optional
     * parameters, call the {@link Get#execute()} method to invoke the remote operation.
     *
     * @param entityType Represents the type of entity for the report.
     * @param entityKey Represents the key of the object to filter the data with.
     * @param date Represents the date the usage occurred. The timestamp is in the ISO 8601 format, yyyy-mm-dd. We
     *        recommend you use your account's time zone for this.
     * @return the request
     */
    public Get get(java.lang.String entityType, java.lang.String entityKey, java.lang.String date) throws java.io.IOException {
      Get result = new Get(entityType, entityKey, date);
      initialize(result);
      return result;
    }

    public class Get extends ReportsRequest<com.google.api.services.reports.model.UsageReports> {

      private static final String REST_PATH = "usage/{entityType}/{entityKey}/dates/{date}";

      private final java.util.regex.Pattern ENTITY_TYPE_PATTERN =
          java.util.regex.Pattern.compile("(gplus_communities)");

      private final java.util.regex.Pattern DATE_PATTERN =
          java.util.regex.Pattern.compile("(\\d){4}-(\\d){2}-(\\d){2}");

      private final java.util.regex.Pattern CUSTOMER_ID_PATTERN =
          java.util.regex.Pattern.compile("C.+");

      private final java.util.regex.Pattern FILTERS_PATTERN =
          java.util.regex.Pattern.compile("(((gplus)):[a-z0-9_]+[<,<=,==,>=,>,!=][^,]+,)*(((gplus)):[a-z0-9_]+[<,<=,==,>=,>,!=][^,]+)");

      private final java.util.regex.Pattern PARAMETERS_PATTERN =
          java.util.regex.Pattern.compile("(((gplus)):[^,]+,)*(((gplus)):[^,]+)");

      /**
       * Retrieves a report which is a collection of properties and statistics for entities used by
       * users within the account. For more information, see the Entities Usage Report guide. For more
       * information about the entities report's parameters, see the Entities Usage parameters reference
       * guides.
       *
       * Create a request for the method "entityUsageReports.get".
       *
       * This request holds the parameters needed by the the admin server.  After setting any optional
       * parameters, call the {@link Get#execute()} method to invoke the remote operation. <p> {@link
       * Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must be
       * called to initialize this instance immediately after invoking the constructor. </p>
       *
       * @param entityType Represents the type of entity for the report.
       * @param entityKey Represents the key of the object to filter the data with.
       * @param date Represents the date the usage occurred. The timestamp is in the ISO 8601 format, yyyy-mm-dd. We
     *        recommend you use your account's time zone for this.
       * @since 1.13
       */
      protected Get(java.lang.String entityType, java.lang.String entityKey, java.lang.String date) {
        super(Reports.this, "GET", REST_PATH, null, com.google.api.services.reports.model.UsageReports.class);
        this.entityType = com.google.api.client.util.Preconditions.checkNotNull(entityType, "Required parameter entityType must be specified.");
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(ENTITY_TYPE_PATTERN.matcher(entityType).matches(),
              "Parameter entityType must conform to the pattern " +
              "(gplus_communities)");
        }
        this.entityKey = com.google.api.client.util.Preconditions.checkNotNull(entityKey, "Required parameter entityKey must be specified.");
        this.date = com.google.api.client.util.Preconditions.checkNotNull(date, "Required parameter date must be specified.");
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(DATE_PATTERN.matcher(date).matches(),
              "Parameter date must conform to the pattern " +
              "(\\d){4}-(\\d){2}-(\\d){2}");
        }
      }

      @Override
      public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
        return super.executeUsingHead();
      }

      @Override
      public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
        return super.buildHttpRequestUsingHead();
      }

      @Override
      public Get setAlt(java.lang.String alt) {
        return (Get) super.setAlt(alt);
      }

      @Override
      public Get setFields(java.lang.String fields) {
        return (Get) super.setFields(fields);
      }

      @Override
      public Get setKey(java.lang.String key) {
        return (Get) super.setKey(key);
      }

      @Override
      public Get setOauthToken(java.lang.String oauthToken) {
        return (Get) super.setOauthToken(oauthToken);
      }

      @Override
      public Get setPrettyPrint(java.lang.Boolean prettyPrint) {
        return (Get) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Get setQuotaUser(java.lang.String quotaUser) {
        return (Get) super.setQuotaUser(quotaUser);
      }

      @Override
      public Get setUserIp(java.lang.String userIp) {
        return (Get) super.setUserIp(userIp);
      }

      /** Represents the type of entity for the report. */
      @com.google.api.client.util.Key
      private java.lang.String entityType;

      /** Represents the type of entity for the report.
       */
      public java.lang.String getEntityType() {
        return entityType;
      }

      /** Represents the type of entity for the report. */
      public Get setEntityType(java.lang.String entityType) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(ENTITY_TYPE_PATTERN.matcher(entityType).matches(),
              "Parameter entityType must conform to the pattern " +
              "(gplus_communities)");
        }
        this.entityType = entityType;
        return this;
      }

      /** Represents the key of the object to filter the data with. */
      @com.google.api.client.util.Key
      private java.lang.String entityKey;

      /** Represents the key of the object to filter the data with.
       */
      public java.lang.String getEntityKey() {
        return entityKey;
      }

      /** Represents the key of the object to filter the data with. */
      public Get setEntityKey(java.lang.String entityKey) {
        this.entityKey = entityKey;
        return this;
      }

      /**
       * Represents the date the usage occurred. The timestamp is in the ISO 8601 format, yyyy-mm-
       * dd. We recommend you use your account's time zone for this.
       */
      @com.google.api.client.util.Key
      private java.lang.String date;

      /** Represents the date the usage occurred. The timestamp is in the ISO 8601 format, yyyy-mm-dd. We
     recommend you use your account's time zone for this.
       */
      public java.lang.String getDate() {
        return date;
      }

      /**
       * Represents the date the usage occurred. The timestamp is in the ISO 8601 format, yyyy-mm-
       * dd. We recommend you use your account's time zone for this.
       */
      public Get setDate(java.lang.String date) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(DATE_PATTERN.matcher(date).matches(),
              "Parameter date must conform to the pattern " +
              "(\\d){4}-(\\d){2}-(\\d){2}");
        }
        this.date = date;
        return this;
      }

      /** The unique ID of the customer to retrieve data for. */
      @com.google.api.client.util.Key
      private java.lang.String customerId;

      /** The unique ID of the customer to retrieve data for.
       */
      public java.lang.String getCustomerId() {
        return customerId;
      }

      /** The unique ID of the customer to retrieve data for. */
      public Get setCustomerId(java.lang.String customerId) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(CUSTOMER_ID_PATTERN.matcher(customerId).matches(),
              "Parameter customerId must conform to the pattern " +
              "C.+");
        }
        this.customerId = customerId;
        return this;
      }

      /**
       * The filters query string is a comma-separated list of an application's event parameters
       * where the parameter's value is manipulated by a relational operator. The filters query
       * string includes the name of the application whose usage is returned in the report. The
       * application values for the Entities usage report include accounts, docs, and gmail. Filters
       * are in the form [application name]:[parameter name][relational operator][parameter
       * value],....
       *
       * In this example, the <> 'not equal to' operator is URL-encoded in the request's query
       * string (%3C%3E): GET
       * https://www.googleapis.com/admin/reports/v1/usage/gplus_communities/all/dates/2017-12-01
       * ?parameters=gplus:community_name,gplus:num_total_members =gplus:num_total_members>0
       *
       * The relational operators include: - == - 'equal to'. - <> - 'not equal to'. It is URL-
       * encoded (%3C%3E). - < - 'less than'. It is URL-encoded (%3C). - <= - 'less than or equal
       * to'. It is URL-encoded (%3C=). - > - 'greater than'. It is URL-encoded (%3E). - >= -
       * 'greater than or equal to'. It is URL-encoded (%3E=).  Filters can only be applied to
       * numeric parameters.
       */
      @com.google.api.client.util.Key
      private java.lang.String filters;

      /** The filters query string is a comma-separated list of an application's event parameters where the
     parameter's value is manipulated by a relational operator. The filters query string includes the
     name of the application whose usage is returned in the report. The application values for the
     Entities usage report include accounts, docs, and gmail. Filters are in the form [application
     name]:[parameter name][relational operator][parameter value],....

     In this example, the <> 'not equal to' operator is URL-encoded in the request's query string
     (%3C%3E): GET
     https://www.googleapis.com/admin/reports/v1/usage/gplus_communities/all/dates/2017-12-01
     ?parameters=gplus:community_name,gplus:num_total_members =gplus:num_total_members>0

     The relational operators include: - == - 'equal to'. - <> - 'not equal to'. It is URL-encoded
     (%3C%3E). - < - 'less than'. It is URL-encoded (%3C). - <= - 'less than or equal to'. It is URL-
     encoded (%3C=). - > - 'greater than'. It is URL-encoded (%3E). - >= - 'greater than or equal to'.
     It is URL-encoded (%3E=).  Filters can only be applied to numeric parameters.
       */
      public java.lang.String getFilters() {
        return filters;
      }

      /**
       * The filters query string is a comma-separated list of an application's event parameters
       * where the parameter's value is manipulated by a relational operator. The filters query
       * string includes the name of the application whose usage is returned in the report. The
       * application values for the Entities usage report include accounts, docs, and gmail. Filters
       * are in the form [application name]:[parameter name][relational operator][parameter
       * value],....
       *
       * In this example, the <> 'not equal to' operator is URL-encoded in the request's query
       * string (%3C%3E): GET
       * https://www.googleapis.com/admin/reports/v1/usage/gplus_communities/all/dates/2017-12-01
       * ?parameters=gplus:community_name,gplus:num_total_members =gplus:num_total_members>0
       *
       * The relational operators include: - == - 'equal to'. - <> - 'not equal to'. It is URL-
       * encoded (%3C%3E). - < - 'less than'. It is URL-encoded (%3C). - <= - 'less than or equal
       * to'. It is URL-encoded (%3C=). - > - 'greater than'. It is URL-encoded (%3E). - >= -
       * 'greater than or equal to'. It is URL-encoded (%3E=).  Filters can only be applied to
       * numeric parameters.
       */
      public Get setFilters(java.lang.String filters) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(FILTERS_PATTERN.matcher(filters).matches(),
              "Parameter filters must conform to the pattern " +
              "(((gplus)):[a-z0-9_]+[<,<=,==,>=,>,!=][^,]+,)*(((gplus)):[a-z0-9_]+[<,<=,==,>=,>,!=][^,]+)");
        }
        this.filters = filters;
        return this;
      }

      /**
       * Determines how many activity records are shown on each response page. For example, if the
       * request sets maxResults=1 and the report has two activities, the report has two pages. The
       * response's nextPageToken property has the token to the second page.
       */
      @com.google.api.client.util.Key
      private java.lang.Long maxResults;

      /** Determines how many activity records are shown on each response page. For example, if the request
     sets maxResults=1 and the report has two activities, the report has two pages. The response's
     nextPageToken property has the token to the second page. [default: 1000] [minimum: 1] [maximum:
     1000]
       */
      public java.lang.Long getMaxResults() {
        return maxResults;
      }

      /**
       * Determines how many activity records are shown on each response page. For example, if the
       * request sets maxResults=1 and the report has two activities, the report has two pages. The
       * response's nextPageToken property has the token to the second page.
       */
      public Get setMaxResults(java.lang.Long maxResults) {
        this.maxResults = maxResults;
        return this;
      }

      /**
       * Token to specify next page. A report with multiple pages has a nextPageToken property in
       * the response. In your follow-on request getting the next page of the report, enter the
       * nextPageToken value in the pageToken query string.
       */
      @com.google.api.client.util.Key
      private java.lang.String pageToken;

      /** Token to specify next page. A report with multiple pages has a nextPageToken property in the
     response. In your follow-on request getting the next page of the report, enter the nextPageToken
     value in the pageToken query string.
       */
      public java.lang.String getPageToken() {
        return pageToken;
      }

      /**
       * Token to specify next page. A report with multiple pages has a nextPageToken property in
       * the response. In your follow-on request getting the next page of the report, enter the
       * nextPageToken value in the pageToken query string.
       */
      public Get setPageToken(java.lang.String pageToken) {
        this.pageToken = pageToken;
        return this;
      }

      /**
       * The parameters query string is a comma-separated list of event parameters that refine a
       * report's results. The parameter is associated with a specific application. The application
       * values for the Entities usage report are only gplus. A parameter query string is in the CSV
       * form of [app_name1:param_name1], [app_name2:param_name2].... Note: The API doesn't accept
       * multiple values of a parameter. If a particular parameter is supplied more than once in the
       * API request, the API only accepts the last value of that request parameter. In addition, if
       * an invalid request parameter is supplied in the API request, the API ignores that request
       * parameter and returns the response corresponding to the remaining valid request parameters.
       *
       * An example of an invalid request parameter is one that does not belong to the application.
       * If no parameters are requested, all parameters are returned.
       */
      @com.google.api.client.util.Key
      private java.lang.String parameters;

      /** The parameters query string is a comma-separated list of event parameters that refine a report's
     results. The parameter is associated with a specific application. The application values for the
     Entities usage report are only gplus. A parameter query string is in the CSV form of
     [app_name1:param_name1], [app_name2:param_name2].... Note: The API doesn't accept multiple values
     of a parameter. If a particular parameter is supplied more than once in the API request, the API
     only accepts the last value of that request parameter. In addition, if an invalid request parameter
     is supplied in the API request, the API ignores that request parameter and returns the response
     corresponding to the remaining valid request parameters.

     An example of an invalid request parameter is one that does not belong to the application. If no
     parameters are requested, all parameters are returned.
       */
      public java.lang.String getParameters() {
        return parameters;
      }

      /**
       * The parameters query string is a comma-separated list of event parameters that refine a
       * report's results. The parameter is associated with a specific application. The application
       * values for the Entities usage report are only gplus. A parameter query string is in the CSV
       * form of [app_name1:param_name1], [app_name2:param_name2].... Note: The API doesn't accept
       * multiple values of a parameter. If a particular parameter is supplied more than once in the
       * API request, the API only accepts the last value of that request parameter. In addition, if
       * an invalid request parameter is supplied in the API request, the API ignores that request
       * parameter and returns the response corresponding to the remaining valid request parameters.
       *
       * An example of an invalid request parameter is one that does not belong to the application.
       * If no parameters are requested, all parameters are returned.
       */
      public Get setParameters(java.lang.String parameters) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(PARAMETERS_PATTERN.matcher(parameters).matches(),
              "Parameter parameters must conform to the pattern " +
              "(((gplus)):[^,]+,)*(((gplus)):[^,]+)");
        }
        this.parameters = parameters;
        return this;
      }

      @Override
      public Get set(String parameterName, Object value) {
        return (Get) super.set(parameterName, value);
      }
    }

  }

  /**
   * An accessor for creating requests from the UserUsageReport collection.
   *
   * <p>The typical use is:</p>
   * <pre>
   *   {@code Reports admin = new Reports(...);}
   *   {@code Reports.UserUsageReport.List request = admin.userUsageReport().list(parameters ...)}
   * </pre>
   *
   * @return the resource collection
   */
  public UserUsageReport userUsageReport() {
    return new UserUsageReport();
  }

  /**
   * The "userUsageReport" collection of methods.
   */
  public class UserUsageReport {

    /**
     * Retrieves a report which is a collection of properties and statistics for a set of users with the
     * account. For more information, see the User Usage Report guide. For more information about the
     * user report's parameters, see the Users Usage parameters reference guides.
     *
     * Create a request for the method "userUsageReport.get".
     *
     * This request holds the parameters needed by the admin server.  After setting any optional
     * parameters, call the {@link Get#execute()} method to invoke the remote operation.
     *
     * @param userKey Represents the profile ID or the user email for which the data should be filtered. Can be all for
     *        all information, or userKey for a user's unique G Suite profile ID or their primary email
     *        address.
     * @param date Represents the date the usage occurred. The timestamp is in the ISO 8601 format, yyyy-mm-dd. We
     *        recommend you use your account's time zone for this.
     * @return the request
     */
    public Get get(java.lang.String userKey, java.lang.String date) throws java.io.IOException {
      Get result = new Get(userKey, date);
      initialize(result);
      return result;
    }

    public class Get extends ReportsRequest<com.google.api.services.reports.model.UsageReports> {

      private static final String REST_PATH = "usage/users/{userKey}/dates/{date}";

      private final java.util.regex.Pattern DATE_PATTERN =
          java.util.regex.Pattern.compile("(\\d){4}-(\\d){2}-(\\d){2}");

      private final java.util.regex.Pattern CUSTOMER_ID_PATTERN =
          java.util.regex.Pattern.compile("C.+");

      private final java.util.regex.Pattern FILTERS_PATTERN =
          java.util.regex.Pattern.compile("(((accounts)|(classroom)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)|(drive)):[a-z0-9_]+[<,<=,==,>=,>,!=][^,]+,)*(((accounts)|(classroom)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)|(drive)):[a-z0-9_]+[<,<=,==,>=,>,!=][^,]+)");

      private final java.util.regex.Pattern ORG_UNIT_ID_PATTERN =
          java.util.regex.Pattern.compile("(id:[a-z0-9]+)");

      private final java.util.regex.Pattern PARAMETERS_PATTERN =
          java.util.regex.Pattern.compile("(((accounts)|(classroom)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)|(drive)):[^,]+,)*(((accounts)|(classroom)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)|(drive)):[^,]+)");

      /**
       * Retrieves a report which is a collection of properties and statistics for a set of users with
       * the account. For more information, see the User Usage Report guide. For more information about
       * the user report's parameters, see the Users Usage parameters reference guides.
       *
       * Create a request for the method "userUsageReport.get".
       *
       * This request holds the parameters needed by the the admin server.  After setting any optional
       * parameters, call the {@link Get#execute()} method to invoke the remote operation. <p> {@link
       * Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must be
       * called to initialize this instance immediately after invoking the constructor. </p>
       *
       * @param userKey Represents the profile ID or the user email for which the data should be filtered. Can be all for
     *        all information, or userKey for a user's unique G Suite profile ID or their primary email
     *        address.
       * @param date Represents the date the usage occurred. The timestamp is in the ISO 8601 format, yyyy-mm-dd. We
     *        recommend you use your account's time zone for this.
       * @since 1.13
       */
      protected Get(java.lang.String userKey, java.lang.String date) {
        super(Reports.this, "GET", REST_PATH, null, com.google.api.services.reports.model.UsageReports.class);
        this.userKey = com.google.api.client.util.Preconditions.checkNotNull(userKey, "Required parameter userKey must be specified.");
        this.date = com.google.api.client.util.Preconditions.checkNotNull(date, "Required parameter date must be specified.");
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(DATE_PATTERN.matcher(date).matches(),
              "Parameter date must conform to the pattern " +
              "(\\d){4}-(\\d){2}-(\\d){2}");
        }
      }

      @Override
      public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
        return super.executeUsingHead();
      }

      @Override
      public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
        return super.buildHttpRequestUsingHead();
      }

      @Override
      public Get setAlt(java.lang.String alt) {
        return (Get) super.setAlt(alt);
      }

      @Override
      public Get setFields(java.lang.String fields) {
        return (Get) super.setFields(fields);
      }

      @Override
      public Get setKey(java.lang.String key) {
        return (Get) super.setKey(key);
      }

      @Override
      public Get setOauthToken(java.lang.String oauthToken) {
        return (Get) super.setOauthToken(oauthToken);
      }

      @Override
      public Get setPrettyPrint(java.lang.Boolean prettyPrint) {
        return (Get) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Get setQuotaUser(java.lang.String quotaUser) {
        return (Get) super.setQuotaUser(quotaUser);
      }

      @Override
      public Get setUserIp(java.lang.String userIp) {
        return (Get) super.setUserIp(userIp);
      }

      /**
       * Represents the profile ID or the user email for which the data should be filtered. Can be
       * all for all information, or userKey for a user's unique G Suite profile ID or their primary
       * email address.
       */
      @com.google.api.client.util.Key
      private java.lang.String userKey;

      /** Represents the profile ID or the user email for which the data should be filtered. Can be all for
     all information, or userKey for a user's unique G Suite profile ID or their primary email address.
       */
      public java.lang.String getUserKey() {
        return userKey;
      }

      /**
       * Represents the profile ID or the user email for which the data should be filtered. Can be
       * all for all information, or userKey for a user's unique G Suite profile ID or their primary
       * email address.
       */
      public Get setUserKey(java.lang.String userKey) {
        this.userKey = userKey;
        return this;
      }

      /**
       * Represents the date the usage occurred. The timestamp is in the ISO 8601 format, yyyy-mm-
       * dd. We recommend you use your account's time zone for this.
       */
      @com.google.api.client.util.Key
      private java.lang.String date;

      /** Represents the date the usage occurred. The timestamp is in the ISO 8601 format, yyyy-mm-dd. We
     recommend you use your account's time zone for this.
       */
      public java.lang.String getDate() {
        return date;
      }

      /**
       * Represents the date the usage occurred. The timestamp is in the ISO 8601 format, yyyy-mm-
       * dd. We recommend you use your account's time zone for this.
       */
      public Get setDate(java.lang.String date) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(DATE_PATTERN.matcher(date).matches(),
              "Parameter date must conform to the pattern " +
              "(\\d){4}-(\\d){2}-(\\d){2}");
        }
        this.date = date;
        return this;
      }

      /** The unique ID of the customer to retrieve data for. */
      @com.google.api.client.util.Key
      private java.lang.String customerId;

      /** The unique ID of the customer to retrieve data for.
       */
      public java.lang.String getCustomerId() {
        return customerId;
      }

      /** The unique ID of the customer to retrieve data for. */
      public Get setCustomerId(java.lang.String customerId) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(CUSTOMER_ID_PATTERN.matcher(customerId).matches(),
              "Parameter customerId must conform to the pattern " +
              "C.+");
        }
        this.customerId = customerId;
        return this;
      }

      /**
       * The filters query string is a comma-separated list of an application's event parameters
       * where the parameter's value is manipulated by a relational operator. The filters query
       * string includes the name of the application whose usage is returned in the report. The
       * application values for the Users Usage Report include accounts, docs, and gmail. Filters
       * are in the form [application name]:[parameter name][relational operator][parameter
       * value],....
       *
       * In this example, the <> 'not equal to' operator is URL-encoded in the request's query
       * string (%3C%3E): GET
       * https://www.googleapis.com/admin/reports/v1/usage/users/all/dates/2013-03-03
       * ?parameters=accounts:last_login_time =accounts:last_login_time>2010-10-28T10:26:35.000Z
       *
       * The relational operators include: - == - 'equal to'. - <> - 'not equal to'. It is URL-
       * encoded (%3C%3E). - < - 'less than'. It is URL-encoded (%3C). - <= - 'less than or equal
       * to'. It is URL-encoded (%3C=). - > - 'greater than'. It is URL-encoded (%3E). - >= -
       * 'greater than or equal to'. It is URL-encoded (%3E=).
       */
      @com.google.api.client.util.Key
      private java.lang.String filters;

      /** The filters query string is a comma-separated list of an application's event parameters where the
     parameter's value is manipulated by a relational operator. The filters query string includes the
     name of the application whose usage is returned in the report. The application values for the Users
     Usage Report include accounts, docs, and gmail. Filters are in the form [application
     name]:[parameter name][relational operator][parameter value],....

     In this example, the <> 'not equal to' operator is URL-encoded in the request's query string
     (%3C%3E): GET https://www.googleapis.com/admin/reports/v1/usage/users/all/dates/2013-03-03
     ?parameters=accounts:last_login_time =accounts:last_login_time>2010-10-28T10:26:35.000Z

     The relational operators include: - == - 'equal to'. - <> - 'not equal to'. It is URL-encoded
     (%3C%3E). - < - 'less than'. It is URL-encoded (%3C). - <= - 'less than or equal to'. It is URL-
     encoded (%3C=). - > - 'greater than'. It is URL-encoded (%3E). - >= - 'greater than or equal to'.
     It is URL-encoded (%3E=).
       */
      public java.lang.String getFilters() {
        return filters;
      }

      /**
       * The filters query string is a comma-separated list of an application's event parameters
       * where the parameter's value is manipulated by a relational operator. The filters query
       * string includes the name of the application whose usage is returned in the report. The
       * application values for the Users Usage Report include accounts, docs, and gmail. Filters
       * are in the form [application name]:[parameter name][relational operator][parameter
       * value],....
       *
       * In this example, the <> 'not equal to' operator is URL-encoded in the request's query
       * string (%3C%3E): GET
       * https://www.googleapis.com/admin/reports/v1/usage/users/all/dates/2013-03-03
       * ?parameters=accounts:last_login_time =accounts:last_login_time>2010-10-28T10:26:35.000Z
       *
       * The relational operators include: - == - 'equal to'. - <> - 'not equal to'. It is URL-
       * encoded (%3C%3E). - < - 'less than'. It is URL-encoded (%3C). - <= - 'less than or equal
       * to'. It is URL-encoded (%3C=). - > - 'greater than'. It is URL-encoded (%3E). - >= -
       * 'greater than or equal to'. It is URL-encoded (%3E=).
       */
      public Get setFilters(java.lang.String filters) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(FILTERS_PATTERN.matcher(filters).matches(),
              "Parameter filters must conform to the pattern " +
              "(((accounts)|(classroom)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)|(drive)):[a-z0-9_]+[<,<=,==,>=,>,!=][^,]+,)*(((accounts)|(classroom)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)|(drive)):[a-z0-9_]+[<,<=,==,>=,>,!=][^,]+)");
        }
        this.filters = filters;
        return this;
      }

      /**
       * Determines how many activity records are shown on each response page. For example, if the
       * request sets maxResults=1 and the report has two activities, the report has two pages. The
       * response's nextPageToken property has the token to the second page. The maxResults query
       * string is optional.
       */
      @com.google.api.client.util.Key
      private java.lang.Long maxResults;

      /** Determines how many activity records are shown on each response page. For example, if the request
     sets maxResults=1 and the report has two activities, the report has two pages. The response's
     nextPageToken property has the token to the second page. The maxResults query string is optional.
     [default: 1000] [minimum: 1] [maximum: 1000]
       */
      public java.lang.Long getMaxResults() {
        return maxResults;
      }

      /**
       * Determines how many activity records are shown on each response page. For example, if the
       * request sets maxResults=1 and the report has two activities, the report has two pages. The
       * response's nextPageToken property has the token to the second page. The maxResults query
       * string is optional.
       */
      public Get setMaxResults(java.lang.Long maxResults) {
        this.maxResults = maxResults;
        return this;
      }

      /**
       * ID of the organizational unit to report on. User activity will be shown only for users who
       * belong to the specified organizational unit. Data before Dec 17, 2018 doesn't appear in the
       * filtered results.
       */
      @com.google.api.client.util.Key
      private java.lang.String orgUnitID;

      /** ID of the organizational unit to report on. User activity will be shown only for users who belong
     to the specified organizational unit. Data before Dec 17, 2018 doesn't appear in the filtered
     results.
       */
      public java.lang.String getOrgUnitID() {
        return orgUnitID;
      }

      /**
       * ID of the organizational unit to report on. User activity will be shown only for users who
       * belong to the specified organizational unit. Data before Dec 17, 2018 doesn't appear in the
       * filtered results.
       */
      public Get setOrgUnitID(java.lang.String orgUnitID) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(ORG_UNIT_ID_PATTERN.matcher(orgUnitID).matches(),
              "Parameter orgUnitID must conform to the pattern " +
              "(id:[a-z0-9]+)");
        }
        this.orgUnitID = orgUnitID;
        return this;
      }

      /**
       * Token to specify next page. A report with multiple pages has a nextPageToken property in
       * the response. In your follow-on request getting the next page of the report, enter the
       * nextPageToken value in the pageToken query string.
       */
      @com.google.api.client.util.Key
      private java.lang.String pageToken;

      /** Token to specify next page. A report with multiple pages has a nextPageToken property in the
     response. In your follow-on request getting the next page of the report, enter the nextPageToken
     value in the pageToken query string.
       */
      public java.lang.String getPageToken() {
        return pageToken;
      }

      /**
       * Token to specify next page. A report with multiple pages has a nextPageToken property in
       * the response. In your follow-on request getting the next page of the report, enter the
       * nextPageToken value in the pageToken query string.
       */
      public Get setPageToken(java.lang.String pageToken) {
        this.pageToken = pageToken;
        return this;
      }

      /**
       * The parameters query string is a comma-separated list of event parameters that refine a
       * report's results. The parameter is associated with a specific application. The application
       * values for the Customers usage report include accounts, app_maker, apps_scripts, calendar,
       * classroom, cros, docs, gmail, gplus, device_management, meet, and sites. A parameters query
       * string is in the CSV form of app_name1:param_name1, app_name2:param_name2. Note: The API
       * doesn't accept multiple values of a parameter. If a particular parameter is supplied more
       * than once in the API request, the API only accepts the last value of that request
       * parameter. In addition, if an invalid request parameter is supplied in the API request, the
       * API ignores that request parameter and returns the response corresponding to the remaining
       * valid request parameters.
       *
       * An example of an invalid request parameter is one that does not belong to the application.
       * If no parameters are requested, all parameters are returned.
       */
      @com.google.api.client.util.Key
      private java.lang.String parameters;

      /** The parameters query string is a comma-separated list of event parameters that refine a report's
     results. The parameter is associated with a specific application. The application values for the
     Customers usage report include accounts, app_maker, apps_scripts, calendar, classroom, cros, docs,
     gmail, gplus, device_management, meet, and sites. A parameters query string is in the CSV form of
     app_name1:param_name1, app_name2:param_name2. Note: The API doesn't accept multiple values of a
     parameter. If a particular parameter is supplied more than once in the API request, the API only
     accepts the last value of that request parameter. In addition, if an invalid request parameter is
     supplied in the API request, the API ignores that request parameter and returns the response
     corresponding to the remaining valid request parameters.

     An example of an invalid request parameter is one that does not belong to the application. If no
     parameters are requested, all parameters are returned.
       */
      public java.lang.String getParameters() {
        return parameters;
      }

      /**
       * The parameters query string is a comma-separated list of event parameters that refine a
       * report's results. The parameter is associated with a specific application. The application
       * values for the Customers usage report include accounts, app_maker, apps_scripts, calendar,
       * classroom, cros, docs, gmail, gplus, device_management, meet, and sites. A parameters query
       * string is in the CSV form of app_name1:param_name1, app_name2:param_name2. Note: The API
       * doesn't accept multiple values of a parameter. If a particular parameter is supplied more
       * than once in the API request, the API only accepts the last value of that request
       * parameter. In addition, if an invalid request parameter is supplied in the API request, the
       * API ignores that request parameter and returns the response corresponding to the remaining
       * valid request parameters.
       *
       * An example of an invalid request parameter is one that does not belong to the application.
       * If no parameters are requested, all parameters are returned.
       */
      public Get setParameters(java.lang.String parameters) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(PARAMETERS_PATTERN.matcher(parameters).matches(),
              "Parameter parameters must conform to the pattern " +
              "(((accounts)|(classroom)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)|(drive)):[^,]+,)*(((accounts)|(classroom)|(cros)|(gmail)|(calendar)|(docs)|(gplus)|(sites)|(device_management)|(drive)):[^,]+)");
        }
        this.parameters = parameters;
        return this;
      }

      @Override
      public Get set(String parameterName, Object value) {
        return (Get) super.set(parameterName, value);
      }
    }

  }

  /**
   * Builder for {@link Reports}.
   *
   * <p>
   * Implementation is not thread-safe.
   * </p>
   *
   * @since 1.3.0
   */
  public static final class Builder extends com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient.Builder {

    /**
     * Returns an instance of a new builder.
     *
     * @param transport HTTP transport, which should normally be:
     *        <ul>
     *        <li>Google App Engine:
     *        {@code com.google.api.client.extensions.appengine.http.UrlFetchTransport}</li>
     *        <li>Android: {@code newCompatibleTransport} from
     *        {@code com.google.api.client.extensions.android.http.AndroidHttp}</li>
     *        <li>Java: {@link com.google.api.client.googleapis.javanet.GoogleNetHttpTransport#newTrustedTransport()}
     *        </li>
     *        </ul>
     * @param jsonFactory JSON factory, which may be:
     *        <ul>
     *        <li>Jackson: {@code com.google.api.client.json.jackson2.JacksonFactory}</li>
     *        <li>Google GSON: {@code com.google.api.client.json.gson.GsonFactory}</li>
     *        <li>Android Honeycomb or higher:
     *        {@code com.google.api.client.extensions.android.json.AndroidJsonFactory}</li>
     *        </ul>
     * @param httpRequestInitializer HTTP request initializer or {@code null} for none
     * @since 1.7
     */
    public Builder(com.google.api.client.http.HttpTransport transport, com.google.api.client.json.JsonFactory jsonFactory,
        com.google.api.client.http.HttpRequestInitializer httpRequestInitializer) {
      super(
          transport,
          jsonFactory,
          DEFAULT_ROOT_URL,
          DEFAULT_SERVICE_PATH,
          httpRequestInitializer,
          false);
      setBatchPath(DEFAULT_BATCH_PATH);
    }

    /** Builds a new instance of {@link Reports}. */
    @Override
    public Reports build() {
      return new Reports(this);
    }

    @Override
    public Builder setRootUrl(String rootUrl) {
      return (Builder) super.setRootUrl(rootUrl);
    }

    @Override
    public Builder setServicePath(String servicePath) {
      return (Builder) super.setServicePath(servicePath);
    }

    @Override
    public Builder setBatchPath(String batchPath) {
      return (Builder) super.setBatchPath(batchPath);
    }

    @Override
    public Builder setHttpRequestInitializer(com.google.api.client.http.HttpRequestInitializer httpRequestInitializer) {
      return (Builder) super.setHttpRequestInitializer(httpRequestInitializer);
    }

    @Override
    public Builder setApplicationName(String applicationName) {
      return (Builder) super.setApplicationName(applicationName);
    }

    @Override
    public Builder setSuppressPatternChecks(boolean suppressPatternChecks) {
      return (Builder) super.setSuppressPatternChecks(suppressPatternChecks);
    }

    @Override
    public Builder setSuppressRequiredParameterChecks(boolean suppressRequiredParameterChecks) {
      return (Builder) super.setSuppressRequiredParameterChecks(suppressRequiredParameterChecks);
    }

    @Override
    public Builder setSuppressAllChecks(boolean suppressAllChecks) {
      return (Builder) super.setSuppressAllChecks(suppressAllChecks);
    }

    /**
     * Set the {@link ReportsRequestInitializer}.
     *
     * @since 1.12
     */
    public Builder setReportsRequestInitializer(
        ReportsRequestInitializer reportsRequestInitializer) {
      return (Builder) super.setGoogleClientRequestInitializer(reportsRequestInitializer);
    }

    @Override
    public Builder setGoogleClientRequestInitializer(
        com.google.api.client.googleapis.services.GoogleClientRequestInitializer googleClientRequestInitializer) {
      return (Builder) super.setGoogleClientRequestInitializer(googleClientRequestInitializer);
    }
  }
}
