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

/**
 * Binds the resources in a proxy or remote service with the GraphQL operation and its associated
 * quota enforcement.
 *
 * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Apigee API. For a detailed explanation see:
 * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
 * </p>
 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class GoogleCloudApigeeV1GraphQLOperationConfig extends com.google.api.client.json.GenericJson {

  /**
   * Required. Name of the API proxy endpoint or remote service with which the GraphQL operation and
   * quota are associated.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String apiSource;

  /**
   * Custom attributes associated with the operation.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<GoogleCloudApigeeV1Attribute> attributes;

  static {
    // hack to force ProGuard to consider GoogleCloudApigeeV1Attribute used, since otherwise it would be stripped out
    // see https://github.com/google/google-api-java-client/issues/543
    com.google.api.client.util.Data.nullOf(GoogleCloudApigeeV1Attribute.class);
  }

  /**
   * Required. List of GraphQL name/operation type pairs for the proxy or remote service to which
   * quota will be applied. If only operation types are specified, the quota will be applied to all
   * GraphQL requests irrespective of the GraphQL name. **Note**: Currently, you can specify only a
   * single GraphQLOperation. Specifying more than one will cause the operation to fail.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<GoogleCloudApigeeV1GraphQLOperation> operations;

  static {
    // hack to force ProGuard to consider GoogleCloudApigeeV1GraphQLOperation used, since otherwise it would be stripped out
    // see https://github.com/google/google-api-java-client/issues/543
    com.google.api.client.util.Data.nullOf(GoogleCloudApigeeV1GraphQLOperation.class);
  }

  /**
   * Quota parameters to be enforced for the resources, methods, and API source combination. If none
   * are specified, quota enforcement will not be done.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleCloudApigeeV1Quota quota;

  /**
   * Required. Name of the API proxy endpoint or remote service with which the GraphQL operation and
   * quota are associated.
   * @return value or {@code null} for none
   */
  public java.lang.String getApiSource() {
    return apiSource;
  }

  /**
   * Required. Name of the API proxy endpoint or remote service with which the GraphQL operation and
   * quota are associated.
   * @param apiSource apiSource or {@code null} for none
   */
  public GoogleCloudApigeeV1GraphQLOperationConfig setApiSource(java.lang.String apiSource) {
    this.apiSource = apiSource;
    return this;
  }

  /**
   * Custom attributes associated with the operation.
   * @return value or {@code null} for none
   */
  public java.util.List<GoogleCloudApigeeV1Attribute> getAttributes() {
    return attributes;
  }

  /**
   * Custom attributes associated with the operation.
   * @param attributes attributes or {@code null} for none
   */
  public GoogleCloudApigeeV1GraphQLOperationConfig setAttributes(java.util.List<GoogleCloudApigeeV1Attribute> attributes) {
    this.attributes = attributes;
    return this;
  }

  /**
   * Required. List of GraphQL name/operation type pairs for the proxy or remote service to which
   * quota will be applied. If only operation types are specified, the quota will be applied to all
   * GraphQL requests irrespective of the GraphQL name. **Note**: Currently, you can specify only a
   * single GraphQLOperation. Specifying more than one will cause the operation to fail.
   * @return value or {@code null} for none
   */
  public java.util.List<GoogleCloudApigeeV1GraphQLOperation> getOperations() {
    return operations;
  }

  /**
   * Required. List of GraphQL name/operation type pairs for the proxy or remote service to which
   * quota will be applied. If only operation types are specified, the quota will be applied to all
   * GraphQL requests irrespective of the GraphQL name. **Note**: Currently, you can specify only a
   * single GraphQLOperation. Specifying more than one will cause the operation to fail.
   * @param operations operations or {@code null} for none
   */
  public GoogleCloudApigeeV1GraphQLOperationConfig setOperations(java.util.List<GoogleCloudApigeeV1GraphQLOperation> operations) {
    this.operations = operations;
    return this;
  }

  /**
   * Quota parameters to be enforced for the resources, methods, and API source combination. If none
   * are specified, quota enforcement will not be done.
   * @return value or {@code null} for none
   */
  public GoogleCloudApigeeV1Quota getQuota() {
    return quota;
  }

  /**
   * Quota parameters to be enforced for the resources, methods, and API source combination. If none
   * are specified, quota enforcement will not be done.
   * @param quota quota or {@code null} for none
   */
  public GoogleCloudApigeeV1GraphQLOperationConfig setQuota(GoogleCloudApigeeV1Quota quota) {
    this.quota = quota;
    return this;
  }

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

  @Override
  public GoogleCloudApigeeV1GraphQLOperationConfig clone() {
    return (GoogleCloudApigeeV1GraphQLOperationConfig) super.clone();
  }

}
