/*
 * 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.monitoring.v1;

/**
 * Service definition for Monitoring (v1).
 *
 * <p>
 * Manages your Cloud Monitoring data and configurations.
 * </p>
 *
 * <p>
 * For more information about this service, see the
 * <a href="https://cloud.google.com/monitoring/api/" target="_blank">API Documentation</a>
 * </p>
 *
 * <p>
 * This service uses {@link MonitoringRequestInitializer} to initialize global parameters via its
 * {@link Builder}.
 * </p>
 *
 * @since 1.3
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public class Monitoring 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 >= 32 ||
        (com.google.api.client.googleapis.GoogleUtils.MINOR_VERSION == 31 &&
        com.google.api.client.googleapis.GoogleUtils.BUGFIX_VERSION >= 1))) ||
        com.google.api.client.googleapis.GoogleUtils.MAJOR_VERSION >= 2,
        "You are currently running with version %s of google-api-client. " +
        "You need at least version 1.31.1 of google-api-client to run version " +
        "2.0.0 of the Cloud Monitoring 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://monitoring.googleapis.com/";

  /**
   * The default encoded mTLS root URL of the service. This is determined when the library is generated
   * and normally should not be changed.
   *
   * @since 1.31
   */
  public static final String DEFAULT_MTLS_ROOT_URL = "https://monitoring.mtls.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 = "";

  /**
   * 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";

  /**
   * 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 Monitoring(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
   */
  Monitoring(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 Locations collection.
   *
   * <p>The typical use is:</p>
   * <pre>
   *   {@code Monitoring monitoring = new Monitoring(...);}
   *   {@code Monitoring.Locations.List request = monitoring.locations().list(parameters ...)}
   * </pre>
   *
   * @return the resource collection
   */
  public Locations locations() {
    return new Locations();
  }

  /**
   * The "locations" collection of methods.
   */
  public class Locations {

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

    /**
     * The "global" collection of methods.
     */
    public class Global {

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

      /**
       * The "metricsScopes" collection of methods.
       */
      public class MetricsScopes {

        /**
         * Returns a specific Metrics Scope, including the list of projects monitored by the specified
         * Metrics Scope.
         *
         * Create a request for the method "metricsScopes.get".
         *
         * This request holds the parameters needed by the monitoring server.  After setting any optional
         * parameters, call the {@link Get#execute()} method to invoke the remote operation.
         *
         * @param name Required. The resource name of the Metrics Scope. Example:
         *        locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}
         * @return the request
         */
        public Get get(java.lang.String name) throws java.io.IOException {
          Get result = new Get(name);
          initialize(result);
          return result;
        }

        public class Get extends MonitoringRequest<com.google.api.services.monitoring.v1.model.MetricsScope> {

          private static final String REST_PATH = "v1/{+name}";

          private final java.util.regex.Pattern NAME_PATTERN =
              java.util.regex.Pattern.compile("^locations/global/metricsScopes/[^/]+$");

          /**
           * Returns a specific Metrics Scope, including the list of projects monitored by the specified
           * Metrics Scope.
           *
           * Create a request for the method "metricsScopes.get".
           *
           * This request holds the parameters needed by the the monitoring 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 name Required. The resource name of the Metrics Scope. Example:
         *        locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}
           * @since 1.13
           */
          protected Get(java.lang.String name) {
            super(Monitoring.this, "GET", REST_PATH, null, com.google.api.services.monitoring.v1.model.MetricsScope.class);
            this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                  "Parameter name must conform to the pattern " +
                  "^locations/global/metricsScopes/[^/]+$");
            }
          }

          @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 set$Xgafv(java.lang.String $Xgafv) {
            return (Get) super.set$Xgafv($Xgafv);
          }

          @Override
          public Get setAccessToken(java.lang.String accessToken) {
            return (Get) super.setAccessToken(accessToken);
          }

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

          @Override
          public Get setCallback(java.lang.String callback) {
            return (Get) super.setCallback(callback);
          }

          @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 setUploadType(java.lang.String uploadType) {
            return (Get) super.setUploadType(uploadType);
          }

          @Override
          public Get setUploadProtocol(java.lang.String uploadProtocol) {
            return (Get) super.setUploadProtocol(uploadProtocol);
          }

          /**
           * Required. The resource name of the Metrics Scope. Example:
           * locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}
           */
          @com.google.api.client.util.Key
          private java.lang.String name;

          /** Required. The resource name of the Metrics Scope. Example:
         locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}
           */
          public java.lang.String getName() {
            return name;
          }

          /**
           * Required. The resource name of the Metrics Scope. Example:
           * locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}
           */
          public Get setName(java.lang.String name) {
            if (!getSuppressPatternChecks()) {
              com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                  "Parameter name must conform to the pattern " +
                  "^locations/global/metricsScopes/[^/]+$");
            }
            this.name = name;
            return this;
          }

          @Override
          public Get set(String parameterName, Object value) {
            return (Get) super.set(parameterName, value);
          }
        }
        /**
         * Returns a list of every Metrics Scope that a specific MonitoredProject has been added to. The
         * metrics scope representing the specified monitored project will always be the first entry in the
         * response.
         *
         * Create a request for the method "metricsScopes.listMetricsScopesByMonitoredProject".
         *
         * This request holds the parameters needed by the monitoring server.  After setting any optional
         * parameters, call the {@link ListMetricsScopesByMonitoredProject#execute()} method to invoke the
         * remote operation.
         *
         * @return the request
         */
        public ListMetricsScopesByMonitoredProject listMetricsScopesByMonitoredProject() throws java.io.IOException {
          ListMetricsScopesByMonitoredProject result = new ListMetricsScopesByMonitoredProject();
          initialize(result);
          return result;
        }

        public class ListMetricsScopesByMonitoredProject extends MonitoringRequest<com.google.api.services.monitoring.v1.model.ListMetricsScopesByMonitoredProjectResponse> {

          private static final String REST_PATH = "v1/locations/global/metricsScopes:listMetricsScopesByMonitoredProject";

          /**
           * Returns a list of every Metrics Scope that a specific MonitoredProject has been added to. The
           * metrics scope representing the specified monitored project will always be the first entry in
           * the response.
           *
           * Create a request for the method "metricsScopes.listMetricsScopesByMonitoredProject".
           *
           * This request holds the parameters needed by the the monitoring server.  After setting any
           * optional parameters, call the {@link ListMetricsScopesByMonitoredProject#execute()} method to
           * invoke the remote operation. <p> {@link ListMetricsScopesByMonitoredProject#initialize(com.goog
           * le.api.client.googleapis.services.AbstractGoogleClientRequest)} must be called to initialize
           * this instance immediately after invoking the constructor. </p>
           *
           * @since 1.13
           */
          protected ListMetricsScopesByMonitoredProject() {
            super(Monitoring.this, "GET", REST_PATH, null, com.google.api.services.monitoring.v1.model.ListMetricsScopesByMonitoredProjectResponse.class);
          }

          @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 ListMetricsScopesByMonitoredProject set$Xgafv(java.lang.String $Xgafv) {
            return (ListMetricsScopesByMonitoredProject) super.set$Xgafv($Xgafv);
          }

          @Override
          public ListMetricsScopesByMonitoredProject setAccessToken(java.lang.String accessToken) {
            return (ListMetricsScopesByMonitoredProject) super.setAccessToken(accessToken);
          }

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

          @Override
          public ListMetricsScopesByMonitoredProject setCallback(java.lang.String callback) {
            return (ListMetricsScopesByMonitoredProject) super.setCallback(callback);
          }

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

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

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

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

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

          @Override
          public ListMetricsScopesByMonitoredProject setUploadType(java.lang.String uploadType) {
            return (ListMetricsScopesByMonitoredProject) super.setUploadType(uploadType);
          }

          @Override
          public ListMetricsScopesByMonitoredProject setUploadProtocol(java.lang.String uploadProtocol) {
            return (ListMetricsScopesByMonitoredProject) super.setUploadProtocol(uploadProtocol);
          }

          /**
           * Required. The resource name of the Monitored Project being requested. Example:
           * projects/{MONITORED_PROJECT_ID_OR_NUMBER}
           */
          @com.google.api.client.util.Key
          private java.lang.String monitoredResourceContainer;

          /** Required. The resource name of the Monitored Project being requested. Example:
         projects/{MONITORED_PROJECT_ID_OR_NUMBER}
           */
          public java.lang.String getMonitoredResourceContainer() {
            return monitoredResourceContainer;
          }

          /**
           * Required. The resource name of the Monitored Project being requested. Example:
           * projects/{MONITORED_PROJECT_ID_OR_NUMBER}
           */
          public ListMetricsScopesByMonitoredProject setMonitoredResourceContainer(java.lang.String monitoredResourceContainer) {
            this.monitoredResourceContainer = monitoredResourceContainer;
            return this;
          }

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

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

        /**
         * The "projects" collection of methods.
         */
        public class Projects {

          /**
           * Adds a MonitoredProject with the given project ID to the specified Metrics Scope.
           *
           * Create a request for the method "projects.create".
           *
           * This request holds the parameters needed by the monitoring server.  After setting any optional
           * parameters, call the {@link Create#execute()} method to invoke the remote operation.
           *
           * @param parent Required. The resource name of the existing Metrics Scope that will monitor this project. Example:
           *        locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}
           * @param content the {@link com.google.api.services.monitoring.v1.model.MonitoredProject}
           * @return the request
           */
          public Create create(java.lang.String parent, com.google.api.services.monitoring.v1.model.MonitoredProject content) throws java.io.IOException {
            Create result = new Create(parent, content);
            initialize(result);
            return result;
          }

          public class Create extends MonitoringRequest<com.google.api.services.monitoring.v1.model.Operation> {

            private static final String REST_PATH = "v1/{+parent}/projects";

            private final java.util.regex.Pattern PARENT_PATTERN =
                java.util.regex.Pattern.compile("^locations/global/metricsScopes/[^/]+$");

            /**
             * Adds a MonitoredProject with the given project ID to the specified Metrics Scope.
             *
             * Create a request for the method "projects.create".
             *
             * This request holds the parameters needed by the the monitoring server.  After setting any
             * optional parameters, call the {@link Create#execute()} method to invoke the remote operation.
             * <p> {@link
             * Create#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
             * be called to initialize this instance immediately after invoking the constructor. </p>
             *
             * @param parent Required. The resource name of the existing Metrics Scope that will monitor this project. Example:
           *        locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}
             * @param content the {@link com.google.api.services.monitoring.v1.model.MonitoredProject}
             * @since 1.13
             */
            protected Create(java.lang.String parent, com.google.api.services.monitoring.v1.model.MonitoredProject content) {
              super(Monitoring.this, "POST", REST_PATH, content, com.google.api.services.monitoring.v1.model.Operation.class);
              this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                    "Parameter parent must conform to the pattern " +
                    "^locations/global/metricsScopes/[^/]+$");
              }
            }

            @Override
            public Create set$Xgafv(java.lang.String $Xgafv) {
              return (Create) super.set$Xgafv($Xgafv);
            }

            @Override
            public Create setAccessToken(java.lang.String accessToken) {
              return (Create) super.setAccessToken(accessToken);
            }

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

            @Override
            public Create setCallback(java.lang.String callback) {
              return (Create) super.setCallback(callback);
            }

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

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

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

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

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

            @Override
            public Create setUploadType(java.lang.String uploadType) {
              return (Create) super.setUploadType(uploadType);
            }

            @Override
            public Create setUploadProtocol(java.lang.String uploadProtocol) {
              return (Create) super.setUploadProtocol(uploadProtocol);
            }

            /**
             * Required. The resource name of the existing Metrics Scope that will monitor this
             * project. Example: locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}
             */
            @com.google.api.client.util.Key
            private java.lang.String parent;

            /** Required. The resource name of the existing Metrics Scope that will monitor this project. Example:
           locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}
             */
            public java.lang.String getParent() {
              return parent;
            }

            /**
             * Required. The resource name of the existing Metrics Scope that will monitor this
             * project. Example: locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}
             */
            public Create setParent(java.lang.String parent) {
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                    "Parameter parent must conform to the pattern " +
                    "^locations/global/metricsScopes/[^/]+$");
              }
              this.parent = parent;
              return this;
            }

            @Override
            public Create set(String parameterName, Object value) {
              return (Create) super.set(parameterName, value);
            }
          }
          /**
           * Deletes a MonitoredProject from the specified Metrics Scope.
           *
           * Create a request for the method "projects.delete".
           *
           * This request holds the parameters needed by the monitoring server.  After setting any optional
           * parameters, call the {@link Delete#execute()} method to invoke the remote operation.
           *
           * @param name Required. The resource name of the MonitoredProject. Example: locations/global/metricsScopes/{SCOPIN
           *        G_PROJECT_ID_OR_NUMBER}/projects/{MONITORED_PROJECT_ID_OR_NUMBER}Authorization requires
           *        the following Google IAM (https://cloud.google.com/iam) permissions on both the Metrics
           *        Scope and on the MonitoredProject: monitoring.metricsScopes.link
           * @return the request
           */
          public Delete delete(java.lang.String name) throws java.io.IOException {
            Delete result = new Delete(name);
            initialize(result);
            return result;
          }

          public class Delete extends MonitoringRequest<com.google.api.services.monitoring.v1.model.Operation> {

            private static final String REST_PATH = "v1/{+name}";

            private final java.util.regex.Pattern NAME_PATTERN =
                java.util.regex.Pattern.compile("^locations/global/metricsScopes/[^/]+/projects/[^/]+$");

            /**
             * Deletes a MonitoredProject from the specified Metrics Scope.
             *
             * Create a request for the method "projects.delete".
             *
             * This request holds the parameters needed by the the monitoring server.  After setting any
             * optional parameters, call the {@link Delete#execute()} method to invoke the remote operation.
             * <p> {@link
             * Delete#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
             * be called to initialize this instance immediately after invoking the constructor. </p>
             *
             * @param name Required. The resource name of the MonitoredProject. Example: locations/global/metricsScopes/{SCOPIN
           *        G_PROJECT_ID_OR_NUMBER}/projects/{MONITORED_PROJECT_ID_OR_NUMBER}Authorization requires
           *        the following Google IAM (https://cloud.google.com/iam) permissions on both the Metrics
           *        Scope and on the MonitoredProject: monitoring.metricsScopes.link
             * @since 1.13
             */
            protected Delete(java.lang.String name) {
              super(Monitoring.this, "DELETE", REST_PATH, null, com.google.api.services.monitoring.v1.model.Operation.class);
              this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                    "Parameter name must conform to the pattern " +
                    "^locations/global/metricsScopes/[^/]+/projects/[^/]+$");
              }
            }

            @Override
            public Delete set$Xgafv(java.lang.String $Xgafv) {
              return (Delete) super.set$Xgafv($Xgafv);
            }

            @Override
            public Delete setAccessToken(java.lang.String accessToken) {
              return (Delete) super.setAccessToken(accessToken);
            }

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

            @Override
            public Delete setCallback(java.lang.String callback) {
              return (Delete) super.setCallback(callback);
            }

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

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

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

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

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

            @Override
            public Delete setUploadType(java.lang.String uploadType) {
              return (Delete) super.setUploadType(uploadType);
            }

            @Override
            public Delete setUploadProtocol(java.lang.String uploadProtocol) {
              return (Delete) super.setUploadProtocol(uploadProtocol);
            }

            /**
             * Required. The resource name of the MonitoredProject. Example: locations/global/metric
             * sScopes/{SCOPING_PROJECT_ID_OR_NUMBER}/projects/{MONITORED_PROJECT_ID_OR_NUMBER}Autho
             * rization requires the following Google IAM (https://cloud.google.com/iam) permissions
             * on both the Metrics Scope and on the MonitoredProject: monitoring.metricsScopes.link
             */
            @com.google.api.client.util.Key
            private java.lang.String name;

            /** Required. The resource name of the MonitoredProject. Example: locations/global/metricsScopes/{SCOPI
           NG_PROJECT_ID_OR_NUMBER}/projects/{MONITORED_PROJECT_ID_OR_NUMBER}Authorization requires the
           following Google IAM (https://cloud.google.com/iam) permissions on both the Metrics Scope and on
           the MonitoredProject: monitoring.metricsScopes.link
             */
            public java.lang.String getName() {
              return name;
            }

            /**
             * Required. The resource name of the MonitoredProject. Example: locations/global/metric
             * sScopes/{SCOPING_PROJECT_ID_OR_NUMBER}/projects/{MONITORED_PROJECT_ID_OR_NUMBER}Autho
             * rization requires the following Google IAM (https://cloud.google.com/iam) permissions
             * on both the Metrics Scope and on the MonitoredProject: monitoring.metricsScopes.link
             */
            public Delete setName(java.lang.String name) {
              if (!getSuppressPatternChecks()) {
                com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                    "Parameter name must conform to the pattern " +
                    "^locations/global/metricsScopes/[^/]+/projects/[^/]+$");
              }
              this.name = name;
              return this;
            }

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

        }
      }
    }
  }

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

  /**
   * The "operations" collection of methods.
   */
  public class Operations {

    /**
     * Gets the latest state of a long-running operation. Clients can use this method to poll the
     * operation result at intervals as recommended by the API service.
     *
     * Create a request for the method "operations.get".
     *
     * This request holds the parameters needed by the monitoring server.  After setting any optional
     * parameters, call the {@link Get#execute()} method to invoke the remote operation.
     *
     * @param name The name of the operation resource.
     * @return the request
     */
    public Get get(java.lang.String name) throws java.io.IOException {
      Get result = new Get(name);
      initialize(result);
      return result;
    }

    public class Get extends MonitoringRequest<com.google.api.services.monitoring.v1.model.Operation> {

      private static final String REST_PATH = "v1/{+name}";

      private final java.util.regex.Pattern NAME_PATTERN =
          java.util.regex.Pattern.compile("^operations/.*$");

      /**
       * Gets the latest state of a long-running operation. Clients can use this method to poll the
       * operation result at intervals as recommended by the API service.
       *
       * Create a request for the method "operations.get".
       *
       * This request holds the parameters needed by the the monitoring 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 name The name of the operation resource.
       * @since 1.13
       */
      protected Get(java.lang.String name) {
        super(Monitoring.this, "GET", REST_PATH, null, com.google.api.services.monitoring.v1.model.Operation.class);
        this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
              "Parameter name must conform to the pattern " +
              "^operations/.*$");
        }
      }

      @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 set$Xgafv(java.lang.String $Xgafv) {
        return (Get) super.set$Xgafv($Xgafv);
      }

      @Override
      public Get setAccessToken(java.lang.String accessToken) {
        return (Get) super.setAccessToken(accessToken);
      }

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

      @Override
      public Get setCallback(java.lang.String callback) {
        return (Get) super.setCallback(callback);
      }

      @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 setUploadType(java.lang.String uploadType) {
        return (Get) super.setUploadType(uploadType);
      }

      @Override
      public Get setUploadProtocol(java.lang.String uploadProtocol) {
        return (Get) super.setUploadProtocol(uploadProtocol);
      }

      /** The name of the operation resource. */
      @com.google.api.client.util.Key
      private java.lang.String name;

      /** The name of the operation resource.
       */
      public java.lang.String getName() {
        return name;
      }

      /** The name of the operation resource. */
      public Get setName(java.lang.String name) {
        if (!getSuppressPatternChecks()) {
          com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
              "Parameter name must conform to the pattern " +
              "^operations/.*$");
        }
        this.name = name;
        return this;
      }

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

  }

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

  /**
   * The "projects" collection of methods.
   */
  public class Projects {

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

    /**
     * The "dashboards" collection of methods.
     */
    public class Dashboards {

      /**
       * Creates a new custom dashboard. For examples on how you can use this API to create dashboards,
       * see Managing dashboards by API (https://cloud.google.com/monitoring/dashboards/api-dashboard).
       * This method requires the monitoring.dashboards.create permission on the specified project. For
       * more information about permissions, see Cloud Identity and Access Management
       * (https://cloud.google.com/iam).
       *
       * Create a request for the method "dashboards.create".
       *
       * This request holds the parameters needed by the monitoring server.  After setting any optional
       * parameters, call the {@link Create#execute()} method to invoke the remote operation.
       *
       * @param parent Required. The project on which to execute the request. The format is:
       *        projects/[PROJECT_ID_OR_NUMBER] The [PROJECT_ID_OR_NUMBER] must match the dashboard
       *        resource name.
       * @param content the {@link com.google.api.services.monitoring.v1.model.Dashboard}
       * @return the request
       */
      public Create create(java.lang.String parent, com.google.api.services.monitoring.v1.model.Dashboard content) throws java.io.IOException {
        Create result = new Create(parent, content);
        initialize(result);
        return result;
      }

      public class Create extends MonitoringRequest<com.google.api.services.monitoring.v1.model.Dashboard> {

        private static final String REST_PATH = "v1/{+parent}/dashboards";

        private final java.util.regex.Pattern PARENT_PATTERN =
            java.util.regex.Pattern.compile("^projects/[^/]+$");

        /**
         * Creates a new custom dashboard. For examples on how you can use this API to create dashboards,
         * see Managing dashboards by API (https://cloud.google.com/monitoring/dashboards/api-dashboard).
         * This method requires the monitoring.dashboards.create permission on the specified project. For
         * more information about permissions, see Cloud Identity and Access Management
         * (https://cloud.google.com/iam).
         *
         * Create a request for the method "dashboards.create".
         *
         * This request holds the parameters needed by the the monitoring server.  After setting any
         * optional parameters, call the {@link Create#execute()} method to invoke the remote operation.
         * <p> {@link
         * Create#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
         * be called to initialize this instance immediately after invoking the constructor. </p>
         *
         * @param parent Required. The project on which to execute the request. The format is:
       *        projects/[PROJECT_ID_OR_NUMBER] The [PROJECT_ID_OR_NUMBER] must match the dashboard
       *        resource name.
         * @param content the {@link com.google.api.services.monitoring.v1.model.Dashboard}
         * @since 1.13
         */
        protected Create(java.lang.String parent, com.google.api.services.monitoring.v1.model.Dashboard content) {
          super(Monitoring.this, "POST", REST_PATH, content, com.google.api.services.monitoring.v1.model.Dashboard.class);
          this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                "Parameter parent must conform to the pattern " +
                "^projects/[^/]+$");
          }
        }

        @Override
        public Create set$Xgafv(java.lang.String $Xgafv) {
          return (Create) super.set$Xgafv($Xgafv);
        }

        @Override
        public Create setAccessToken(java.lang.String accessToken) {
          return (Create) super.setAccessToken(accessToken);
        }

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

        @Override
        public Create setCallback(java.lang.String callback) {
          return (Create) super.setCallback(callback);
        }

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

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

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

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

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

        @Override
        public Create setUploadType(java.lang.String uploadType) {
          return (Create) super.setUploadType(uploadType);
        }

        @Override
        public Create setUploadProtocol(java.lang.String uploadProtocol) {
          return (Create) super.setUploadProtocol(uploadProtocol);
        }

        /**
         * Required. The project on which to execute the request. The format is:
         * projects/[PROJECT_ID_OR_NUMBER] The [PROJECT_ID_OR_NUMBER] must match the dashboard
         * resource name.
         */
        @com.google.api.client.util.Key
        private java.lang.String parent;

        /** Required. The project on which to execute the request. The format is:
       projects/[PROJECT_ID_OR_NUMBER] The [PROJECT_ID_OR_NUMBER] must match the dashboard resource name.
         */
        public java.lang.String getParent() {
          return parent;
        }

        /**
         * Required. The project on which to execute the request. The format is:
         * projects/[PROJECT_ID_OR_NUMBER] The [PROJECT_ID_OR_NUMBER] must match the dashboard
         * resource name.
         */
        public Create setParent(java.lang.String parent) {
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                "Parameter parent must conform to the pattern " +
                "^projects/[^/]+$");
          }
          this.parent = parent;
          return this;
        }

        /** If set, validate the request and preview the review, but do not actually save it. */
        @com.google.api.client.util.Key
        private java.lang.Boolean validateOnly;

        /** If set, validate the request and preview the review, but do not actually save it.
         */
        public java.lang.Boolean getValidateOnly() {
          return validateOnly;
        }

        /** If set, validate the request and preview the review, but do not actually save it. */
        public Create setValidateOnly(java.lang.Boolean validateOnly) {
          this.validateOnly = validateOnly;
          return this;
        }

        @Override
        public Create set(String parameterName, Object value) {
          return (Create) super.set(parameterName, value);
        }
      }
      /**
       * Deletes an existing custom dashboard.This method requires the monitoring.dashboards.delete
       * permission on the specified dashboard. For more information, see Cloud Identity and Access
       * Management (https://cloud.google.com/iam).
       *
       * Create a request for the method "dashboards.delete".
       *
       * This request holds the parameters needed by the monitoring server.  After setting any optional
       * parameters, call the {@link Delete#execute()} method to invoke the remote operation.
       *
       * @param name Required. The resource name of the Dashboard. The format is:
       *        projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID]
       * @return the request
       */
      public Delete delete(java.lang.String name) throws java.io.IOException {
        Delete result = new Delete(name);
        initialize(result);
        return result;
      }

      public class Delete extends MonitoringRequest<com.google.api.services.monitoring.v1.model.Empty> {

        private static final String REST_PATH = "v1/{+name}";

        private final java.util.regex.Pattern NAME_PATTERN =
            java.util.regex.Pattern.compile("^projects/[^/]+/dashboards/[^/]+$");

        /**
         * Deletes an existing custom dashboard.This method requires the monitoring.dashboards.delete
         * permission on the specified dashboard. For more information, see Cloud Identity and Access
         * Management (https://cloud.google.com/iam).
         *
         * Create a request for the method "dashboards.delete".
         *
         * This request holds the parameters needed by the the monitoring server.  After setting any
         * optional parameters, call the {@link Delete#execute()} method to invoke the remote operation.
         * <p> {@link
         * Delete#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
         * be called to initialize this instance immediately after invoking the constructor. </p>
         *
         * @param name Required. The resource name of the Dashboard. The format is:
       *        projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID]
         * @since 1.13
         */
        protected Delete(java.lang.String name) {
          super(Monitoring.this, "DELETE", REST_PATH, null, com.google.api.services.monitoring.v1.model.Empty.class);
          this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                "Parameter name must conform to the pattern " +
                "^projects/[^/]+/dashboards/[^/]+$");
          }
        }

        @Override
        public Delete set$Xgafv(java.lang.String $Xgafv) {
          return (Delete) super.set$Xgafv($Xgafv);
        }

        @Override
        public Delete setAccessToken(java.lang.String accessToken) {
          return (Delete) super.setAccessToken(accessToken);
        }

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

        @Override
        public Delete setCallback(java.lang.String callback) {
          return (Delete) super.setCallback(callback);
        }

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

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

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

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

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

        @Override
        public Delete setUploadType(java.lang.String uploadType) {
          return (Delete) super.setUploadType(uploadType);
        }

        @Override
        public Delete setUploadProtocol(java.lang.String uploadProtocol) {
          return (Delete) super.setUploadProtocol(uploadProtocol);
        }

        /**
         * Required. The resource name of the Dashboard. The format is:
         * projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID]
         */
        @com.google.api.client.util.Key
        private java.lang.String name;

        /** Required. The resource name of the Dashboard. The format is:
       projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID]
         */
        public java.lang.String getName() {
          return name;
        }

        /**
         * Required. The resource name of the Dashboard. The format is:
         * projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID]
         */
        public Delete setName(java.lang.String name) {
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                "Parameter name must conform to the pattern " +
                "^projects/[^/]+/dashboards/[^/]+$");
          }
          this.name = name;
          return this;
        }

        @Override
        public Delete set(String parameterName, Object value) {
          return (Delete) super.set(parameterName, value);
        }
      }
      /**
       * Fetches a specific dashboard.This method requires the monitoring.dashboards.get permission on the
       * specified dashboard. For more information, see Cloud Identity and Access Management
       * (https://cloud.google.com/iam).
       *
       * Create a request for the method "dashboards.get".
       *
       * This request holds the parameters needed by the monitoring server.  After setting any optional
       * parameters, call the {@link Get#execute()} method to invoke the remote operation.
       *
       * @param name Required. The resource name of the Dashboard. The format is one of: dashboards/[DASHBOARD_ID] (for
       *        system dashboards) projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID] (for custom
       *        dashboards).
       * @return the request
       */
      public Get get(java.lang.String name) throws java.io.IOException {
        Get result = new Get(name);
        initialize(result);
        return result;
      }

      public class Get extends MonitoringRequest<com.google.api.services.monitoring.v1.model.Dashboard> {

        private static final String REST_PATH = "v1/{+name}";

        private final java.util.regex.Pattern NAME_PATTERN =
            java.util.regex.Pattern.compile("^projects/[^/]+/dashboards/[^/]+$");

        /**
         * Fetches a specific dashboard.This method requires the monitoring.dashboards.get permission on
         * the specified dashboard. For more information, see Cloud Identity and Access Management
         * (https://cloud.google.com/iam).
         *
         * Create a request for the method "dashboards.get".
         *
         * This request holds the parameters needed by the the monitoring 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 name Required. The resource name of the Dashboard. The format is one of: dashboards/[DASHBOARD_ID] (for
       *        system dashboards) projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID] (for custom
       *        dashboards).
         * @since 1.13
         */
        protected Get(java.lang.String name) {
          super(Monitoring.this, "GET", REST_PATH, null, com.google.api.services.monitoring.v1.model.Dashboard.class);
          this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                "Parameter name must conform to the pattern " +
                "^projects/[^/]+/dashboards/[^/]+$");
          }
        }

        @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 set$Xgafv(java.lang.String $Xgafv) {
          return (Get) super.set$Xgafv($Xgafv);
        }

        @Override
        public Get setAccessToken(java.lang.String accessToken) {
          return (Get) super.setAccessToken(accessToken);
        }

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

        @Override
        public Get setCallback(java.lang.String callback) {
          return (Get) super.setCallback(callback);
        }

        @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 setUploadType(java.lang.String uploadType) {
          return (Get) super.setUploadType(uploadType);
        }

        @Override
        public Get setUploadProtocol(java.lang.String uploadProtocol) {
          return (Get) super.setUploadProtocol(uploadProtocol);
        }

        /**
         * Required. The resource name of the Dashboard. The format is one of:
         * dashboards/[DASHBOARD_ID] (for system dashboards)
         * projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID] (for custom dashboards).
         */
        @com.google.api.client.util.Key
        private java.lang.String name;

        /** Required. The resource name of the Dashboard. The format is one of: dashboards/[DASHBOARD_ID] (for
       system dashboards) projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID] (for custom
       dashboards).
         */
        public java.lang.String getName() {
          return name;
        }

        /**
         * Required. The resource name of the Dashboard. The format is one of:
         * dashboards/[DASHBOARD_ID] (for system dashboards)
         * projects/[PROJECT_ID_OR_NUMBER]/dashboards/[DASHBOARD_ID] (for custom dashboards).
         */
        public Get setName(java.lang.String name) {
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                "Parameter name must conform to the pattern " +
                "^projects/[^/]+/dashboards/[^/]+$");
          }
          this.name = name;
          return this;
        }

        @Override
        public Get set(String parameterName, Object value) {
          return (Get) super.set(parameterName, value);
        }
      }
      /**
       * Lists the existing dashboards.This method requires the monitoring.dashboards.list permission on
       * the specified project. For more information, see Cloud Identity and Access Management
       * (https://cloud.google.com/iam).
       *
       * Create a request for the method "dashboards.list".
       *
       * This request holds the parameters needed by the monitoring server.  After setting any optional
       * parameters, call the {@link List#execute()} method to invoke the remote operation.
       *
       * @param parent Required. The scope of the dashboards to list. The format is: projects/[PROJECT_ID_OR_NUMBER]
       * @return the request
       */
      public List list(java.lang.String parent) throws java.io.IOException {
        List result = new List(parent);
        initialize(result);
        return result;
      }

      public class List extends MonitoringRequest<com.google.api.services.monitoring.v1.model.ListDashboardsResponse> {

        private static final String REST_PATH = "v1/{+parent}/dashboards";

        private final java.util.regex.Pattern PARENT_PATTERN =
            java.util.regex.Pattern.compile("^projects/[^/]+$");

        /**
         * Lists the existing dashboards.This method requires the monitoring.dashboards.list permission on
         * the specified project. For more information, see Cloud Identity and Access Management
         * (https://cloud.google.com/iam).
         *
         * Create a request for the method "dashboards.list".
         *
         * This request holds the parameters needed by the the monitoring 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 parent Required. The scope of the dashboards to list. The format is: projects/[PROJECT_ID_OR_NUMBER]
         * @since 1.13
         */
        protected List(java.lang.String parent) {
          super(Monitoring.this, "GET", REST_PATH, null, com.google.api.services.monitoring.v1.model.ListDashboardsResponse.class);
          this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified.");
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                "Parameter parent must conform to the pattern " +
                "^projects/[^/]+$");
          }
        }

        @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 set$Xgafv(java.lang.String $Xgafv) {
          return (List) super.set$Xgafv($Xgafv);
        }

        @Override
        public List setAccessToken(java.lang.String accessToken) {
          return (List) super.setAccessToken(accessToken);
        }

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

        @Override
        public List setCallback(java.lang.String callback) {
          return (List) super.setCallback(callback);
        }

        @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 setUploadType(java.lang.String uploadType) {
          return (List) super.setUploadType(uploadType);
        }

        @Override
        public List setUploadProtocol(java.lang.String uploadProtocol) {
          return (List) super.setUploadProtocol(uploadProtocol);
        }

        /**
         * Required. The scope of the dashboards to list. The format is:
         * projects/[PROJECT_ID_OR_NUMBER]
         */
        @com.google.api.client.util.Key
        private java.lang.String parent;

        /** Required. The scope of the dashboards to list. The format is: projects/[PROJECT_ID_OR_NUMBER]
         */
        public java.lang.String getParent() {
          return parent;
        }

        /**
         * Required. The scope of the dashboards to list. The format is:
         * projects/[PROJECT_ID_OR_NUMBER]
         */
        public List setParent(java.lang.String parent) {
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(),
                "Parameter parent must conform to the pattern " +
                "^projects/[^/]+$");
          }
          this.parent = parent;
          return this;
        }

        /**
         * A positive number that is the maximum number of results to return. If unspecified, a
         * default of 1000 is used.
         */
        @com.google.api.client.util.Key
        private java.lang.Integer pageSize;

        /** A positive number that is the maximum number of results to return. If unspecified, a default of
       1000 is used.
         */
        public java.lang.Integer getPageSize() {
          return pageSize;
        }

        /**
         * A positive number that is the maximum number of results to return. If unspecified, a
         * default of 1000 is used.
         */
        public List setPageSize(java.lang.Integer pageSize) {
          this.pageSize = pageSize;
          return this;
        }

        /**
         * If this field is not empty then it must contain the nextPageToken value returned by a
         * previous call to this method. Using this field causes the method to return additional
         * results from the previous method call.
         */
        @com.google.api.client.util.Key
        private java.lang.String pageToken;

        /** If this field is not empty then it must contain the nextPageToken value returned by a previous call
       to this method. Using this field causes the method to return additional results from the previous
       method call.
         */
        public java.lang.String getPageToken() {
          return pageToken;
        }

        /**
         * If this field is not empty then it must contain the nextPageToken value returned by a
         * previous call to this method. Using this field causes the method to return additional
         * results from the previous method call.
         */
        public List setPageToken(java.lang.String pageToken) {
          this.pageToken = pageToken;
          return this;
        }

        @Override
        public List set(String parameterName, Object value) {
          return (List) super.set(parameterName, value);
        }
      }
      /**
       * Replaces an existing custom dashboard with a new definition.This method requires the
       * monitoring.dashboards.update permission on the specified dashboard. For more information, see
       * Cloud Identity and Access Management (https://cloud.google.com/iam).
       *
       * Create a request for the method "dashboards.patch".
       *
       * This request holds the parameters needed by the monitoring server.  After setting any optional
       * parameters, call the {@link Patch#execute()} method to invoke the remote operation.
       *
       * @param name Immutable. The resource name of the dashboard.
       * @param content the {@link com.google.api.services.monitoring.v1.model.Dashboard}
       * @return the request
       */
      public Patch patch(java.lang.String name, com.google.api.services.monitoring.v1.model.Dashboard content) throws java.io.IOException {
        Patch result = new Patch(name, content);
        initialize(result);
        return result;
      }

      public class Patch extends MonitoringRequest<com.google.api.services.monitoring.v1.model.Dashboard> {

        private static final String REST_PATH = "v1/{+name}";

        private final java.util.regex.Pattern NAME_PATTERN =
            java.util.regex.Pattern.compile("^projects/[^/]+/dashboards/[^/]+$");

        /**
         * Replaces an existing custom dashboard with a new definition.This method requires the
         * monitoring.dashboards.update permission on the specified dashboard. For more information, see
         * Cloud Identity and Access Management (https://cloud.google.com/iam).
         *
         * Create a request for the method "dashboards.patch".
         *
         * This request holds the parameters needed by the the monitoring server.  After setting any
         * optional parameters, call the {@link Patch#execute()} method to invoke the remote operation.
         * <p> {@link
         * Patch#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
         * be called to initialize this instance immediately after invoking the constructor. </p>
         *
         * @param name Immutable. The resource name of the dashboard.
         * @param content the {@link com.google.api.services.monitoring.v1.model.Dashboard}
         * @since 1.13
         */
        protected Patch(java.lang.String name, com.google.api.services.monitoring.v1.model.Dashboard content) {
          super(Monitoring.this, "PATCH", REST_PATH, content, com.google.api.services.monitoring.v1.model.Dashboard.class);
          this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                "Parameter name must conform to the pattern " +
                "^projects/[^/]+/dashboards/[^/]+$");
          }
        }

        @Override
        public Patch set$Xgafv(java.lang.String $Xgafv) {
          return (Patch) super.set$Xgafv($Xgafv);
        }

        @Override
        public Patch setAccessToken(java.lang.String accessToken) {
          return (Patch) super.setAccessToken(accessToken);
        }

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

        @Override
        public Patch setCallback(java.lang.String callback) {
          return (Patch) super.setCallback(callback);
        }

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

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

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

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

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

        @Override
        public Patch setUploadType(java.lang.String uploadType) {
          return (Patch) super.setUploadType(uploadType);
        }

        @Override
        public Patch setUploadProtocol(java.lang.String uploadProtocol) {
          return (Patch) super.setUploadProtocol(uploadProtocol);
        }

        /** Immutable. The resource name of the dashboard. */
        @com.google.api.client.util.Key
        private java.lang.String name;

        /** Immutable. The resource name of the dashboard.
         */
        public java.lang.String getName() {
          return name;
        }

        /** Immutable. The resource name of the dashboard. */
        public Patch setName(java.lang.String name) {
          if (!getSuppressPatternChecks()) {
            com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                "Parameter name must conform to the pattern " +
                "^projects/[^/]+/dashboards/[^/]+$");
          }
          this.name = name;
          return this;
        }

        /** If set, validate the request and preview the review, but do not actually save it. */
        @com.google.api.client.util.Key
        private java.lang.Boolean validateOnly;

        /** If set, validate the request and preview the review, but do not actually save it.
         */
        public java.lang.Boolean getValidateOnly() {
          return validateOnly;
        }

        /** If set, validate the request and preview the review, but do not actually save it. */
        public Patch setValidateOnly(java.lang.Boolean validateOnly) {
          this.validateOnly = validateOnly;
          return this;
        }

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

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

    /**
     * The "location" collection of methods.
     */
    public class Location {

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

      /**
       * The "prometheus" collection of methods.
       */
      public class Prometheus {

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

        /**
         * The "api" collection of methods.
         */
        public class Api {

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

          /**
           * The "v1" collection of methods.
           */
          public class V1 {

            /**
             * Lists labels for metrics.
             *
             * Create a request for the method "v1.labels".
             *
             * This request holds the parameters needed by the monitoring server.  After setting any optional
             * parameters, call the {@link Labels#execute()} method to invoke the remote operation.
             *
             * @param name The workspace on which to execute the request. It is not part of the open source API but used as a
             *        request path prefix to distinguish different virtual Prometheus instances of Google
             *        Prometheus Engine. The format is: projects/PROJECT_ID_OR_NUMBER.
             * @param location Location of the resource information. Has to be "global" now.
             * @param content the {@link com.google.api.services.monitoring.v1.model.QueryLabelsRequest}
             * @return the request
             */
            public Labels labels(java.lang.String name, java.lang.String location, com.google.api.services.monitoring.v1.model.QueryLabelsRequest content) throws java.io.IOException {
              Labels result = new Labels(name, location, content);
              initialize(result);
              return result;
            }

            public class Labels extends MonitoringRequest<com.google.api.services.monitoring.v1.model.HttpBody> {

              private static final String REST_PATH = "v1/{+name}/location/{location}/prometheus/api/v1/labels";

              private final java.util.regex.Pattern NAME_PATTERN =
                  java.util.regex.Pattern.compile("^projects/[^/]+$");

              /**
               * Lists labels for metrics.
               *
               * Create a request for the method "v1.labels".
               *
               * This request holds the parameters needed by the the monitoring server.  After setting any
               * optional parameters, call the {@link Labels#execute()} method to invoke the remote operation.
               * <p> {@link
               * Labels#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
               * be called to initialize this instance immediately after invoking the constructor. </p>
               *
               * @param name The workspace on which to execute the request. It is not part of the open source API but used as a
             *        request path prefix to distinguish different virtual Prometheus instances of Google
             *        Prometheus Engine. The format is: projects/PROJECT_ID_OR_NUMBER.
               * @param location Location of the resource information. Has to be "global" now.
               * @param content the {@link com.google.api.services.monitoring.v1.model.QueryLabelsRequest}
               * @since 1.13
               */
              protected Labels(java.lang.String name, java.lang.String location, com.google.api.services.monitoring.v1.model.QueryLabelsRequest content) {
                super(Monitoring.this, "POST", REST_PATH, content, com.google.api.services.monitoring.v1.model.HttpBody.class);
                this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
                if (!getSuppressPatternChecks()) {
                  com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                      "Parameter name must conform to the pattern " +
                      "^projects/[^/]+$");
                }
                this.location = com.google.api.client.util.Preconditions.checkNotNull(location, "Required parameter location must be specified.");
              }

              @Override
              public Labels set$Xgafv(java.lang.String $Xgafv) {
                return (Labels) super.set$Xgafv($Xgafv);
              }

              @Override
              public Labels setAccessToken(java.lang.String accessToken) {
                return (Labels) super.setAccessToken(accessToken);
              }

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

              @Override
              public Labels setCallback(java.lang.String callback) {
                return (Labels) super.setCallback(callback);
              }

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

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

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

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

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

              @Override
              public Labels setUploadType(java.lang.String uploadType) {
                return (Labels) super.setUploadType(uploadType);
              }

              @Override
              public Labels setUploadProtocol(java.lang.String uploadProtocol) {
                return (Labels) super.setUploadProtocol(uploadProtocol);
              }

              /**
               * The workspace on which to execute the request. It is not part of the open source
               * API but used as a request path prefix to distinguish different virtual Prometheus
               * instances of Google Prometheus Engine. The format is:
               * projects/PROJECT_ID_OR_NUMBER.
               */
              @com.google.api.client.util.Key
              private java.lang.String name;

              /** The workspace on which to execute the request. It is not part of the open source API but used as a
             request path prefix to distinguish different virtual Prometheus instances of Google Prometheus
             Engine. The format is: projects/PROJECT_ID_OR_NUMBER.
               */
              public java.lang.String getName() {
                return name;
              }

              /**
               * The workspace on which to execute the request. It is not part of the open source
               * API but used as a request path prefix to distinguish different virtual Prometheus
               * instances of Google Prometheus Engine. The format is:
               * projects/PROJECT_ID_OR_NUMBER.
               */
              public Labels setName(java.lang.String name) {
                if (!getSuppressPatternChecks()) {
                  com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                      "Parameter name must conform to the pattern " +
                      "^projects/[^/]+$");
                }
                this.name = name;
                return this;
              }

              /** Location of the resource information. Has to be "global" now. */
              @com.google.api.client.util.Key
              private java.lang.String location;

              /** Location of the resource information. Has to be "global" now.
               */
              public java.lang.String getLocation() {
                return location;
              }

              /** Location of the resource information. Has to be "global" now. */
              public Labels setLocation(java.lang.String location) {
                this.location = location;
                return this;
              }

              @Override
              public Labels set(String parameterName, Object value) {
                return (Labels) super.set(parameterName, value);
              }
            }
            /**
             * Evaluate a PromQL query at a single point in time.
             *
             * Create a request for the method "v1.query".
             *
             * This request holds the parameters needed by the monitoring server.  After setting any optional
             * parameters, call the {@link Query#execute()} method to invoke the remote operation.
             *
             * @param name The project on which to execute the request. Data associcated with the project's workspace stored
             *        under the The format is: projects/PROJECT_ID_OR_NUMBER. Open source API but used as a
             *        request path prefix to distinguish different virtual Prometheus instances of Google
             *        Prometheus Engine.
             * @param location Location of the resource information. Has to be "global" now.
             * @param content the {@link com.google.api.services.monitoring.v1.model.QueryInstantRequest}
             * @return the request
             */
            public Query query(java.lang.String name, java.lang.String location, com.google.api.services.monitoring.v1.model.QueryInstantRequest content) throws java.io.IOException {
              Query result = new Query(name, location, content);
              initialize(result);
              return result;
            }

            public class Query extends MonitoringRequest<com.google.api.services.monitoring.v1.model.HttpBody> {

              private static final String REST_PATH = "v1/{+name}/location/{location}/prometheus/api/v1/query";

              private final java.util.regex.Pattern NAME_PATTERN =
                  java.util.regex.Pattern.compile("^projects/[^/]+$");

              /**
               * Evaluate a PromQL query at a single point in time.
               *
               * Create a request for the method "v1.query".
               *
               * This request holds the parameters needed by the the monitoring server.  After setting any
               * optional parameters, call the {@link Query#execute()} method to invoke the remote operation.
               * <p> {@link
               * Query#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
               * be called to initialize this instance immediately after invoking the constructor. </p>
               *
               * @param name The project on which to execute the request. Data associcated with the project's workspace stored
             *        under the The format is: projects/PROJECT_ID_OR_NUMBER. Open source API but used as a
             *        request path prefix to distinguish different virtual Prometheus instances of Google
             *        Prometheus Engine.
               * @param location Location of the resource information. Has to be "global" now.
               * @param content the {@link com.google.api.services.monitoring.v1.model.QueryInstantRequest}
               * @since 1.13
               */
              protected Query(java.lang.String name, java.lang.String location, com.google.api.services.monitoring.v1.model.QueryInstantRequest content) {
                super(Monitoring.this, "POST", REST_PATH, content, com.google.api.services.monitoring.v1.model.HttpBody.class);
                this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
                if (!getSuppressPatternChecks()) {
                  com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                      "Parameter name must conform to the pattern " +
                      "^projects/[^/]+$");
                }
                this.location = com.google.api.client.util.Preconditions.checkNotNull(location, "Required parameter location must be specified.");
              }

              @Override
              public Query set$Xgafv(java.lang.String $Xgafv) {
                return (Query) super.set$Xgafv($Xgafv);
              }

              @Override
              public Query setAccessToken(java.lang.String accessToken) {
                return (Query) super.setAccessToken(accessToken);
              }

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

              @Override
              public Query setCallback(java.lang.String callback) {
                return (Query) super.setCallback(callback);
              }

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

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

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

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

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

              @Override
              public Query setUploadType(java.lang.String uploadType) {
                return (Query) super.setUploadType(uploadType);
              }

              @Override
              public Query setUploadProtocol(java.lang.String uploadProtocol) {
                return (Query) super.setUploadProtocol(uploadProtocol);
              }

              /**
               * The project on which to execute the request. Data associcated with the project's
               * workspace stored under the The format is: projects/PROJECT_ID_OR_NUMBER. Open
               * source API but used as a request path prefix to distinguish different virtual
               * Prometheus instances of Google Prometheus Engine.
               */
              @com.google.api.client.util.Key
              private java.lang.String name;

              /** The project on which to execute the request. Data associcated with the project's workspace stored
             under the The format is: projects/PROJECT_ID_OR_NUMBER. Open source API but used as a request path
             prefix to distinguish different virtual Prometheus instances of Google Prometheus Engine.
               */
              public java.lang.String getName() {
                return name;
              }

              /**
               * The project on which to execute the request. Data associcated with the project's
               * workspace stored under the The format is: projects/PROJECT_ID_OR_NUMBER. Open
               * source API but used as a request path prefix to distinguish different virtual
               * Prometheus instances of Google Prometheus Engine.
               */
              public Query setName(java.lang.String name) {
                if (!getSuppressPatternChecks()) {
                  com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                      "Parameter name must conform to the pattern " +
                      "^projects/[^/]+$");
                }
                this.name = name;
                return this;
              }

              /** Location of the resource information. Has to be "global" now. */
              @com.google.api.client.util.Key
              private java.lang.String location;

              /** Location of the resource information. Has to be "global" now.
               */
              public java.lang.String getLocation() {
                return location;
              }

              /** Location of the resource information. Has to be "global" now. */
              public Query setLocation(java.lang.String location) {
                this.location = location;
                return this;
              }

              @Override
              public Query set(String parameterName, Object value) {
                return (Query) super.set(parameterName, value);
              }
            }
            /**
             * Lists exemplars relevant to a given PromQL query,
             *
             * Create a request for the method "v1.query_exemplars".
             *
             * This request holds the parameters needed by the monitoring server.  After setting any optional
             * parameters, call the {@link QueryExemplars#execute()} method to invoke the remote operation.
             *
             * @param name The project on which to execute the request. Data associcated with the project's workspace stored
             *        under the The format is: projects/PROJECT_ID_OR_NUMBER. Open source API but used as a
             *        request path prefix to distinguish different virtual Prometheus instances of Google
             *        Prometheus Engine.
             * @param location Location of the resource information. Has to be "global" now.
             * @param content the {@link com.google.api.services.monitoring.v1.model.QueryExemplarsRequest}
             * @return the request
             */
            public QueryExemplars queryExemplars(java.lang.String name, java.lang.String location, com.google.api.services.monitoring.v1.model.QueryExemplarsRequest content) throws java.io.IOException {
              QueryExemplars result = new QueryExemplars(name, location, content);
              initialize(result);
              return result;
            }

            public class QueryExemplars extends MonitoringRequest<com.google.api.services.monitoring.v1.model.HttpBody> {

              private static final String REST_PATH = "v1/{+name}/location/{location}/prometheus/api/v1/query_exemplars";

              private final java.util.regex.Pattern NAME_PATTERN =
                  java.util.regex.Pattern.compile("^projects/[^/]+$");

              /**
               * Lists exemplars relevant to a given PromQL query,
               *
               * Create a request for the method "v1.query_exemplars".
               *
               * This request holds the parameters needed by the the monitoring server.  After setting any
               * optional parameters, call the {@link QueryExemplars#execute()} method to invoke the remote
               * operation. <p> {@link QueryExemplars#initialize(com.google.api.client.googleapis.services.Abstr
               * actGoogleClientRequest)} must be called to initialize this instance immediately after invoking
               * the constructor. </p>
               *
               * @param name The project on which to execute the request. Data associcated with the project's workspace stored
             *        under the The format is: projects/PROJECT_ID_OR_NUMBER. Open source API but used as a
             *        request path prefix to distinguish different virtual Prometheus instances of Google
             *        Prometheus Engine.
               * @param location Location of the resource information. Has to be "global" now.
               * @param content the {@link com.google.api.services.monitoring.v1.model.QueryExemplarsRequest}
               * @since 1.13
               */
              protected QueryExemplars(java.lang.String name, java.lang.String location, com.google.api.services.monitoring.v1.model.QueryExemplarsRequest content) {
                super(Monitoring.this, "POST", REST_PATH, content, com.google.api.services.monitoring.v1.model.HttpBody.class);
                this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
                if (!getSuppressPatternChecks()) {
                  com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                      "Parameter name must conform to the pattern " +
                      "^projects/[^/]+$");
                }
                this.location = com.google.api.client.util.Preconditions.checkNotNull(location, "Required parameter location must be specified.");
              }

              @Override
              public QueryExemplars set$Xgafv(java.lang.String $Xgafv) {
                return (QueryExemplars) super.set$Xgafv($Xgafv);
              }

              @Override
              public QueryExemplars setAccessToken(java.lang.String accessToken) {
                return (QueryExemplars) super.setAccessToken(accessToken);
              }

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

              @Override
              public QueryExemplars setCallback(java.lang.String callback) {
                return (QueryExemplars) super.setCallback(callback);
              }

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

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

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

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

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

              @Override
              public QueryExemplars setUploadType(java.lang.String uploadType) {
                return (QueryExemplars) super.setUploadType(uploadType);
              }

              @Override
              public QueryExemplars setUploadProtocol(java.lang.String uploadProtocol) {
                return (QueryExemplars) super.setUploadProtocol(uploadProtocol);
              }

              /**
               * The project on which to execute the request. Data associcated with the project's
               * workspace stored under the The format is: projects/PROJECT_ID_OR_NUMBER. Open
               * source API but used as a request path prefix to distinguish different virtual
               * Prometheus instances of Google Prometheus Engine.
               */
              @com.google.api.client.util.Key
              private java.lang.String name;

              /** The project on which to execute the request. Data associcated with the project's workspace stored
             under the The format is: projects/PROJECT_ID_OR_NUMBER. Open source API but used as a request path
             prefix to distinguish different virtual Prometheus instances of Google Prometheus Engine.
               */
              public java.lang.String getName() {
                return name;
              }

              /**
               * The project on which to execute the request. Data associcated with the project's
               * workspace stored under the The format is: projects/PROJECT_ID_OR_NUMBER. Open
               * source API but used as a request path prefix to distinguish different virtual
               * Prometheus instances of Google Prometheus Engine.
               */
              public QueryExemplars setName(java.lang.String name) {
                if (!getSuppressPatternChecks()) {
                  com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                      "Parameter name must conform to the pattern " +
                      "^projects/[^/]+$");
                }
                this.name = name;
                return this;
              }

              /** Location of the resource information. Has to be "global" now. */
              @com.google.api.client.util.Key
              private java.lang.String location;

              /** Location of the resource information. Has to be "global" now.
               */
              public java.lang.String getLocation() {
                return location;
              }

              /** Location of the resource information. Has to be "global" now. */
              public QueryExemplars setLocation(java.lang.String location) {
                this.location = location;
                return this;
              }

              @Override
              public QueryExemplars set(String parameterName, Object value) {
                return (QueryExemplars) super.set(parameterName, value);
              }
            }
            /**
             * Evaluate a PromQL query with start, end time range.
             *
             * Create a request for the method "v1.query_range".
             *
             * This request holds the parameters needed by the monitoring server.  After setting any optional
             * parameters, call the {@link QueryRange#execute()} method to invoke the remote operation.
             *
             * @param name The project on which to execute the request. Data associcated with the project's workspace stored
             *        under the The format is: projects/PROJECT_ID_OR_NUMBER. Open source API but used as a
             *        request path prefix to distinguish different virtual Prometheus instances of Google
             *        Prometheus Engine.
             * @param location Location of the resource information. Has to be "global" now.
             * @param content the {@link com.google.api.services.monitoring.v1.model.QueryRangeRequest}
             * @return the request
             */
            public QueryRange queryRange(java.lang.String name, java.lang.String location, com.google.api.services.monitoring.v1.model.QueryRangeRequest content) throws java.io.IOException {
              QueryRange result = new QueryRange(name, location, content);
              initialize(result);
              return result;
            }

            public class QueryRange extends MonitoringRequest<com.google.api.services.monitoring.v1.model.HttpBody> {

              private static final String REST_PATH = "v1/{+name}/location/{location}/prometheus/api/v1/query_range";

              private final java.util.regex.Pattern NAME_PATTERN =
                  java.util.regex.Pattern.compile("^projects/[^/]+$");

              /**
               * Evaluate a PromQL query with start, end time range.
               *
               * Create a request for the method "v1.query_range".
               *
               * This request holds the parameters needed by the the monitoring server.  After setting any
               * optional parameters, call the {@link QueryRange#execute()} method to invoke the remote
               * operation. <p> {@link
               * QueryRange#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
               * must be called to initialize this instance immediately after invoking the constructor. </p>
               *
               * @param name The project on which to execute the request. Data associcated with the project's workspace stored
             *        under the The format is: projects/PROJECT_ID_OR_NUMBER. Open source API but used as a
             *        request path prefix to distinguish different virtual Prometheus instances of Google
             *        Prometheus Engine.
               * @param location Location of the resource information. Has to be "global" now.
               * @param content the {@link com.google.api.services.monitoring.v1.model.QueryRangeRequest}
               * @since 1.13
               */
              protected QueryRange(java.lang.String name, java.lang.String location, com.google.api.services.monitoring.v1.model.QueryRangeRequest content) {
                super(Monitoring.this, "POST", REST_PATH, content, com.google.api.services.monitoring.v1.model.HttpBody.class);
                this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
                if (!getSuppressPatternChecks()) {
                  com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                      "Parameter name must conform to the pattern " +
                      "^projects/[^/]+$");
                }
                this.location = com.google.api.client.util.Preconditions.checkNotNull(location, "Required parameter location must be specified.");
              }

              @Override
              public QueryRange set$Xgafv(java.lang.String $Xgafv) {
                return (QueryRange) super.set$Xgafv($Xgafv);
              }

              @Override
              public QueryRange setAccessToken(java.lang.String accessToken) {
                return (QueryRange) super.setAccessToken(accessToken);
              }

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

              @Override
              public QueryRange setCallback(java.lang.String callback) {
                return (QueryRange) super.setCallback(callback);
              }

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

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

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

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

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

              @Override
              public QueryRange setUploadType(java.lang.String uploadType) {
                return (QueryRange) super.setUploadType(uploadType);
              }

              @Override
              public QueryRange setUploadProtocol(java.lang.String uploadProtocol) {
                return (QueryRange) super.setUploadProtocol(uploadProtocol);
              }

              /**
               * The project on which to execute the request. Data associcated with the project's
               * workspace stored under the The format is: projects/PROJECT_ID_OR_NUMBER. Open
               * source API but used as a request path prefix to distinguish different virtual
               * Prometheus instances of Google Prometheus Engine.
               */
              @com.google.api.client.util.Key
              private java.lang.String name;

              /** The project on which to execute the request. Data associcated with the project's workspace stored
             under the The format is: projects/PROJECT_ID_OR_NUMBER. Open source API but used as a request path
             prefix to distinguish different virtual Prometheus instances of Google Prometheus Engine.
               */
              public java.lang.String getName() {
                return name;
              }

              /**
               * The project on which to execute the request. Data associcated with the project's
               * workspace stored under the The format is: projects/PROJECT_ID_OR_NUMBER. Open
               * source API but used as a request path prefix to distinguish different virtual
               * Prometheus instances of Google Prometheus Engine.
               */
              public QueryRange setName(java.lang.String name) {
                if (!getSuppressPatternChecks()) {
                  com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                      "Parameter name must conform to the pattern " +
                      "^projects/[^/]+$");
                }
                this.name = name;
                return this;
              }

              /** Location of the resource information. Has to be "global" now. */
              @com.google.api.client.util.Key
              private java.lang.String location;

              /** Location of the resource information. Has to be "global" now.
               */
              public java.lang.String getLocation() {
                return location;
              }

              /** Location of the resource information. Has to be "global" now. */
              public QueryRange setLocation(java.lang.String location) {
                this.location = location;
                return this;
              }

              @Override
              public QueryRange set(String parameterName, Object value) {
                return (QueryRange) super.set(parameterName, value);
              }
            }
            /**
             * Lists metadata for metrics.
             *
             * Create a request for the method "v1.series".
             *
             * This request holds the parameters needed by the monitoring server.  After setting any optional
             * parameters, call the {@link Series#execute()} method to invoke the remote operation.
             *
             * @param name Required. The workspace on which to execute the request. It is not part of the open source API but
             *        used as a request path prefix to distinguish different virtual Prometheus instances of
             *        Google Prometheus Engine. The format is: projects/PROJECT_ID_OR_NUMBER.
             * @param location Location of the resource information. Has to be "global" for now.
             * @param content the {@link com.google.api.services.monitoring.v1.model.QuerySeriesRequest}
             * @return the request
             */
            public Series series(java.lang.String name, java.lang.String location, com.google.api.services.monitoring.v1.model.QuerySeriesRequest content) throws java.io.IOException {
              Series result = new Series(name, location, content);
              initialize(result);
              return result;
            }

            public class Series extends MonitoringRequest<com.google.api.services.monitoring.v1.model.HttpBody> {

              private static final String REST_PATH = "v1/{+name}/location/{location}/prometheus/api/v1/series";

              private final java.util.regex.Pattern NAME_PATTERN =
                  java.util.regex.Pattern.compile("^projects/[^/]+$");

              /**
               * Lists metadata for metrics.
               *
               * Create a request for the method "v1.series".
               *
               * This request holds the parameters needed by the the monitoring server.  After setting any
               * optional parameters, call the {@link Series#execute()} method to invoke the remote operation.
               * <p> {@link
               * Series#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
               * be called to initialize this instance immediately after invoking the constructor. </p>
               *
               * @param name Required. The workspace on which to execute the request. It is not part of the open source API but
             *        used as a request path prefix to distinguish different virtual Prometheus instances of
             *        Google Prometheus Engine. The format is: projects/PROJECT_ID_OR_NUMBER.
               * @param location Location of the resource information. Has to be "global" for now.
               * @param content the {@link com.google.api.services.monitoring.v1.model.QuerySeriesRequest}
               * @since 1.13
               */
              protected Series(java.lang.String name, java.lang.String location, com.google.api.services.monitoring.v1.model.QuerySeriesRequest content) {
                super(Monitoring.this, "POST", REST_PATH, content, com.google.api.services.monitoring.v1.model.HttpBody.class);
                this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
                if (!getSuppressPatternChecks()) {
                  com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                      "Parameter name must conform to the pattern " +
                      "^projects/[^/]+$");
                }
                this.location = com.google.api.client.util.Preconditions.checkNotNull(location, "Required parameter location must be specified.");
              }

              @Override
              public Series set$Xgafv(java.lang.String $Xgafv) {
                return (Series) super.set$Xgafv($Xgafv);
              }

              @Override
              public Series setAccessToken(java.lang.String accessToken) {
                return (Series) super.setAccessToken(accessToken);
              }

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

              @Override
              public Series setCallback(java.lang.String callback) {
                return (Series) super.setCallback(callback);
              }

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

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

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

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

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

              @Override
              public Series setUploadType(java.lang.String uploadType) {
                return (Series) super.setUploadType(uploadType);
              }

              @Override
              public Series setUploadProtocol(java.lang.String uploadProtocol) {
                return (Series) super.setUploadProtocol(uploadProtocol);
              }

              /**
               * Required. The workspace on which to execute the request. It is not part of the open
               * source API but used as a request path prefix to distinguish different virtual
               * Prometheus instances of Google Prometheus Engine. The format is:
               * projects/PROJECT_ID_OR_NUMBER.
               */
              @com.google.api.client.util.Key
              private java.lang.String name;

              /** Required. The workspace on which to execute the request. It is not part of the open source API but
             used as a request path prefix to distinguish different virtual Prometheus instances of Google
             Prometheus Engine. The format is: projects/PROJECT_ID_OR_NUMBER.
               */
              public java.lang.String getName() {
                return name;
              }

              /**
               * Required. The workspace on which to execute the request. It is not part of the open
               * source API but used as a request path prefix to distinguish different virtual
               * Prometheus instances of Google Prometheus Engine. The format is:
               * projects/PROJECT_ID_OR_NUMBER.
               */
              public Series setName(java.lang.String name) {
                if (!getSuppressPatternChecks()) {
                  com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                      "Parameter name must conform to the pattern " +
                      "^projects/[^/]+$");
                }
                this.name = name;
                return this;
              }

              /** Location of the resource information. Has to be "global" for now. */
              @com.google.api.client.util.Key
              private java.lang.String location;

              /** Location of the resource information. Has to be "global" for now.
               */
              public java.lang.String getLocation() {
                return location;
              }

              /** Location of the resource information. Has to be "global" for now. */
              public Series setLocation(java.lang.String location) {
                this.location = location;
                return this;
              }

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

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

            /**
             * The "label" collection of methods.
             */
            public class Label {

              /**
               * Lists possible values for a given label name.
               *
               * Create a request for the method "label.values".
               *
               * This request holds the parameters needed by the monitoring server.  After setting any optional
               * parameters, call the {@link Values#execute()} method to invoke the remote operation.
               *
               * @param name The workspace on which to execute the request. It is not part of the open source API but used as a
               *        request path prefix to distinguish different virtual Prometheus instances of Google
               *        Prometheus Engine. The format is: projects/PROJECT_ID_OR_NUMBER.
               * @param location Location of the resource information. Has to be "global" now.
               * @param label The label name for which values are queried.
               * @return the request
               */
              public Values values(java.lang.String name, java.lang.String location, java.lang.String label) throws java.io.IOException {
                Values result = new Values(name, location, label);
                initialize(result);
                return result;
              }

              public class Values extends MonitoringRequest<com.google.api.services.monitoring.v1.model.HttpBody> {

                private static final String REST_PATH = "v1/{+name}/location/{location}/prometheus/api/v1/label/{label}/values";

                private final java.util.regex.Pattern NAME_PATTERN =
                    java.util.regex.Pattern.compile("^projects/[^/]+$");

                /**
                 * Lists possible values for a given label name.
                 *
                 * Create a request for the method "label.values".
                 *
                 * This request holds the parameters needed by the the monitoring server.  After setting any
                 * optional parameters, call the {@link Values#execute()} method to invoke the remote operation.
                 * <p> {@link
                 * Values#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
                 * be called to initialize this instance immediately after invoking the constructor. </p>
                 *
                 * @param name The workspace on which to execute the request. It is not part of the open source API but used as a
               *        request path prefix to distinguish different virtual Prometheus instances of Google
               *        Prometheus Engine. The format is: projects/PROJECT_ID_OR_NUMBER.
                 * @param location Location of the resource information. Has to be "global" now.
                 * @param label The label name for which values are queried.
                 * @since 1.13
                 */
                protected Values(java.lang.String name, java.lang.String location, java.lang.String label) {
                  super(Monitoring.this, "GET", REST_PATH, null, com.google.api.services.monitoring.v1.model.HttpBody.class);
                  this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
                  if (!getSuppressPatternChecks()) {
                    com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                        "Parameter name must conform to the pattern " +
                        "^projects/[^/]+$");
                  }
                  this.location = com.google.api.client.util.Preconditions.checkNotNull(location, "Required parameter location must be specified.");
                  this.label = com.google.api.client.util.Preconditions.checkNotNull(label, "Required parameter label must be specified.");
                }

                @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 Values set$Xgafv(java.lang.String $Xgafv) {
                  return (Values) super.set$Xgafv($Xgafv);
                }

                @Override
                public Values setAccessToken(java.lang.String accessToken) {
                  return (Values) super.setAccessToken(accessToken);
                }

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

                @Override
                public Values setCallback(java.lang.String callback) {
                  return (Values) super.setCallback(callback);
                }

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

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

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

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

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

                @Override
                public Values setUploadType(java.lang.String uploadType) {
                  return (Values) super.setUploadType(uploadType);
                }

                @Override
                public Values setUploadProtocol(java.lang.String uploadProtocol) {
                  return (Values) super.setUploadProtocol(uploadProtocol);
                }

                /**
                 * The workspace on which to execute the request. It is not part of the open source
                 * API but used as a request path prefix to distinguish different virtual Prometheus
                 * instances of Google Prometheus Engine. The format is:
                 * projects/PROJECT_ID_OR_NUMBER.
                 */
                @com.google.api.client.util.Key
                private java.lang.String name;

                /** The workspace on which to execute the request. It is not part of the open source API but used as a
               request path prefix to distinguish different virtual Prometheus instances of Google Prometheus
               Engine. The format is: projects/PROJECT_ID_OR_NUMBER.
                 */
                public java.lang.String getName() {
                  return name;
                }

                /**
                 * The workspace on which to execute the request. It is not part of the open source
                 * API but used as a request path prefix to distinguish different virtual Prometheus
                 * instances of Google Prometheus Engine. The format is:
                 * projects/PROJECT_ID_OR_NUMBER.
                 */
                public Values setName(java.lang.String name) {
                  if (!getSuppressPatternChecks()) {
                    com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                        "Parameter name must conform to the pattern " +
                        "^projects/[^/]+$");
                  }
                  this.name = name;
                  return this;
                }

                /** Location of the resource information. Has to be "global" now. */
                @com.google.api.client.util.Key
                private java.lang.String location;

                /** Location of the resource information. Has to be "global" now.
                 */
                public java.lang.String getLocation() {
                  return location;
                }

                /** Location of the resource information. Has to be "global" now. */
                public Values setLocation(java.lang.String location) {
                  this.location = location;
                  return this;
                }

                /** The label name for which values are queried. */
                @com.google.api.client.util.Key
                private java.lang.String label;

                /** The label name for which values are queried.
                 */
                public java.lang.String getLabel() {
                  return label;
                }

                /** The label name for which values are queried. */
                public Values setLabel(java.lang.String label) {
                  this.label = label;
                  return this;
                }

                /**
                 * The end time to evaluate the query for. Either floating point UNIX seconds or
                 * RFC3339 formatted timestamp.
                 */
                @com.google.api.client.util.Key
                private java.lang.String end;

                /** The end time to evaluate the query for. Either floating point UNIX seconds or RFC3339 formatted
               timestamp.
                 */
                public java.lang.String getEnd() {
                  return end;
                }

                /**
                 * The end time to evaluate the query for. Either floating point UNIX seconds or
                 * RFC3339 formatted timestamp.
                 */
                public Values setEnd(java.lang.String end) {
                  this.end = end;
                  return this;
                }

                /**
                 * A list of matchers encoded in the Prometheus label matcher format to constrain
                 * the values to series that satisfy them.
                 */
                @com.google.api.client.util.Key
                private java.lang.String match;

                /** A list of matchers encoded in the Prometheus label matcher format to constrain the values to series
               that satisfy them.
                 */
                public java.lang.String getMatch() {
                  return match;
                }

                /**
                 * A list of matchers encoded in the Prometheus label matcher format to constrain
                 * the values to series that satisfy them.
                 */
                public Values setMatch(java.lang.String match) {
                  this.match = match;
                  return this;
                }

                /**
                 * The start time to evaluate the query for. Either floating point UNIX seconds or
                 * RFC3339 formatted timestamp.
                 */
                @com.google.api.client.util.Key
                private java.lang.String start;

                /** The start time to evaluate the query for. Either floating point UNIX seconds or RFC3339 formatted
               timestamp.
                 */
                public java.lang.String getStart() {
                  return start;
                }

                /**
                 * The start time to evaluate the query for. Either floating point UNIX seconds or
                 * RFC3339 formatted timestamp.
                 */
                public Values setStart(java.lang.String start) {
                  this.start = start;
                  return this;
                }

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

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

            /**
             * The "metadata" collection of methods.
             */
            public class Metadata {

              /**
               * Lists metadata for metrics.
               *
               * Create a request for the method "metadata.list".
               *
               * This request holds the parameters needed by the monitoring server.  After setting any optional
               * parameters, call the {@link List#execute()} method to invoke the remote operation.
               *
               * @param name Required. The workspace on which to execute the request. It is not part of the open source API but
               *        used as a request path prefix to distinguish different virtual Prometheus instances of
               *        Google Prometheus Engine. The format is: projects/PROJECT_ID_OR_NUMBER.
               * @param location Location of the resource information. Has to be "global" for now.
               * @return the request
               */
              public List list(java.lang.String name, java.lang.String location) throws java.io.IOException {
                List result = new List(name, location);
                initialize(result);
                return result;
              }

              public class List extends MonitoringRequest<com.google.api.services.monitoring.v1.model.HttpBody> {

                private static final String REST_PATH = "v1/{+name}/location/{location}/prometheus/api/v1/metadata";

                private final java.util.regex.Pattern NAME_PATTERN =
                    java.util.regex.Pattern.compile("^projects/[^/]+$");

                /**
                 * Lists metadata for metrics.
                 *
                 * Create a request for the method "metadata.list".
                 *
                 * This request holds the parameters needed by the the monitoring 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 name Required. The workspace on which to execute the request. It is not part of the open source API but
               *        used as a request path prefix to distinguish different virtual Prometheus instances of
               *        Google Prometheus Engine. The format is: projects/PROJECT_ID_OR_NUMBER.
                 * @param location Location of the resource information. Has to be "global" for now.
                 * @since 1.13
                 */
                protected List(java.lang.String name, java.lang.String location) {
                  super(Monitoring.this, "GET", REST_PATH, null, com.google.api.services.monitoring.v1.model.HttpBody.class);
                  this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
                  if (!getSuppressPatternChecks()) {
                    com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                        "Parameter name must conform to the pattern " +
                        "^projects/[^/]+$");
                  }
                  this.location = com.google.api.client.util.Preconditions.checkNotNull(location, "Required parameter location must be specified.");
                }

                @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 set$Xgafv(java.lang.String $Xgafv) {
                  return (List) super.set$Xgafv($Xgafv);
                }

                @Override
                public List setAccessToken(java.lang.String accessToken) {
                  return (List) super.setAccessToken(accessToken);
                }

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

                @Override
                public List setCallback(java.lang.String callback) {
                  return (List) super.setCallback(callback);
                }

                @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 setUploadType(java.lang.String uploadType) {
                  return (List) super.setUploadType(uploadType);
                }

                @Override
                public List setUploadProtocol(java.lang.String uploadProtocol) {
                  return (List) super.setUploadProtocol(uploadProtocol);
                }

                /**
                 * Required. The workspace on which to execute the request. It is not part of the
                 * open source API but used as a request path prefix to distinguish different
                 * virtual Prometheus instances of Google Prometheus Engine. The format is:
                 * projects/PROJECT_ID_OR_NUMBER.
                 */
                @com.google.api.client.util.Key
                private java.lang.String name;

                /** Required. The workspace on which to execute the request. It is not part of the open source API but
               used as a request path prefix to distinguish different virtual Prometheus instances of Google
               Prometheus Engine. The format is: projects/PROJECT_ID_OR_NUMBER.
                 */
                public java.lang.String getName() {
                  return name;
                }

                /**
                 * Required. The workspace on which to execute the request. It is not part of the
                 * open source API but used as a request path prefix to distinguish different
                 * virtual Prometheus instances of Google Prometheus Engine. The format is:
                 * projects/PROJECT_ID_OR_NUMBER.
                 */
                public List setName(java.lang.String name) {
                  if (!getSuppressPatternChecks()) {
                    com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
                        "Parameter name must conform to the pattern " +
                        "^projects/[^/]+$");
                  }
                  this.name = name;
                  return this;
                }

                /** Location of the resource information. Has to be "global" for now. */
                @com.google.api.client.util.Key
                private java.lang.String location;

                /** Location of the resource information. Has to be "global" for now.
                 */
                public java.lang.String getLocation() {
                  return location;
                }

                /** Location of the resource information. Has to be "global" for now. */
                public List setLocation(java.lang.String location) {
                  this.location = location;
                  return this;
                }

                /** Maximum number of metrics to return. */
                @com.google.api.client.util.Key
                private java.lang.Long limit;

                /** Maximum number of metrics to return.
                 */
                public java.lang.Long getLimit() {
                  return limit;
                }

                /** Maximum number of metrics to return. */
                public List setLimit(java.lang.Long limit) {
                  this.limit = limit;
                  return this;
                }

                /**
                 * The metric name for which to query metadata. If unset, all metric metadata is
                 * returned.
                 */
                @com.google.api.client.util.Key
                private java.lang.String metric;

                /** The metric name for which to query metadata. If unset, all metric metadata is returned.
                 */
                public java.lang.String getMetric() {
                  return metric;
                }

                /**
                 * The metric name for which to query metadata. If unset, all metric metadata is
                 * returned.
                 */
                public List setMetric(java.lang.String metric) {
                  this.metric = metric;
                  return this;
                }

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

            }
          }
        }
      }
    }
  }

  /**
   * Builder for {@link Monitoring}.
   *
   * <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 {

    private static String chooseEndpoint(com.google.api.client.http.HttpTransport transport) {
      // If the GOOGLE_API_USE_MTLS_ENDPOINT environment variable value is "always", use mTLS endpoint.
      // If the env variable is "auto", use mTLS endpoint if and only if the transport is mTLS.
      // Use the regular endpoint for all other cases.
      String useMtlsEndpoint = System.getenv("GOOGLE_API_USE_MTLS_ENDPOINT");
      useMtlsEndpoint = useMtlsEndpoint == null ? "auto" : useMtlsEndpoint;
      if ("always".equals(useMtlsEndpoint) || ("auto".equals(useMtlsEndpoint) && transport != null && transport.isMtls())) {
        return DEFAULT_MTLS_ROOT_URL;
      }
      return DEFAULT_ROOT_URL;
    }

    /**
     * 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,
          Builder.chooseEndpoint(transport),
          DEFAULT_SERVICE_PATH,
          httpRequestInitializer,
          false);
      setBatchPath(DEFAULT_BATCH_PATH);
    }

    /** Builds a new instance of {@link Monitoring}. */
    @Override
    public Monitoring build() {
      return new Monitoring(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 MonitoringRequestInitializer}.
     *
     * @since 1.12
     */
    public Builder setMonitoringRequestInitializer(
        MonitoringRequestInitializer monitoringRequestInitializer) {
      return (Builder) super.setGoogleClientRequestInitializer(monitoringRequestInitializer);
    }

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