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

/**
 * Connection represents an instance of connector.
 *
 * <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 Connectors 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 Connection extends com.google.api.client.json.GenericJson {

  /**
   * Optional. Configuration for establishing the connection's authentication with an external
   * system.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private AuthConfig authConfig;

  /**
   * Optional. Configuration for configuring the connection with an external system.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<ConfigVariable> configVariables;

  static {
    // hack to force ProGuard to consider ConfigVariable 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(ConfigVariable.class);
  }

  /**
   * Output only. Connection revision. This field is only updated when the connection is created or
   * updated by User.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key @com.google.api.client.json.JsonString
  private java.lang.Long connectionRevision;

  /**
   * Required. Connector version on which the connection is created. The format is:
   * projects/locations/providers/connectors/versions Only global location is supported for
   * ConnectorVersion resource.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String connectorVersion;

  /**
   * Output only. Infra configs supported by Connector Version.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private ConnectorVersionInfraConfig connectorVersionInfraConfig;

  /**
   * Output only. Flag to mark the version indicating the launch stage.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String connectorVersionLaunchStage;

  /**
   * Output only. Created time.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private String createTime;

  /**
   * Optional. Description of the resource.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String description;

  /**
   * Optional. Configuration of the Connector's destination. Only accepted for Connectors that
   * accepts user defined destination(s).
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<DestinationConfig> destinationConfigs;

  /**
   * Output only. GCR location where the envoy image is stored. formatted like:
   * gcr.io/{bucketName}/{imageName}
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String envoyImageLocation;

  /**
   * Optional. Eventing config of a connection
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private EventingConfig eventingConfig;

  /**
   * Optional. Eventing enablement type. Will be nil if eventing is not enabled.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String eventingEnablementType;

  /**
   * Output only. Eventing Runtime Data.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private EventingRuntimeData eventingRuntimeData;

  /**
   * Output only. GCR location where the runtime image is stored. formatted like:
   * gcr.io/{bucketName}/{imageName}
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String imageLocation;

  /**
   * Optional. Resource labels to represent user-provided metadata. Refer to cloud documentation on
   * labels for more details. https://cloud.google.com/compute/docs/labeling-resources
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.Map<String, java.lang.String> labels;

  /**
   * Optional. Configuration that indicates whether or not the Connection can be edited.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private LockConfig lockConfig;

  /**
   * Optional. Log configuration for the connection.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private ConnectorsLogConfig logConfig;

  /**
   * Output only. Resource name of the Connection. Format:
   * projects/{project}/locations/{location}/connections/{connection}
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String name;

  /**
   * Optional. Node configuration for the connection.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private NodeConfig nodeConfig;

  /**
   * Optional. Service account needed for runtime plane to access Google Cloud resources.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String serviceAccount;

  /**
   * Output only. The name of the Service Directory service name. Used for Private Harpoon to
   * resolve the ILB address. e.g. "projects/cloud-connectors-e2e-testing/locations/us-
   * central1/namespaces/istio-system/services/istio-ingressgateway-connectors"
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String serviceDirectory;

  /**
   * Optional. Ssl config of a connection
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private SslConfig sslConfig;

  /**
   * Output only. Current status of the connection.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private ConnectionStatus status;

  /**
   * Output only. This subscription type enum states the subscription type of the project.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String subscriptionType;

  /**
   * Optional. Suspended indicates if a user has suspended a connection or not.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Boolean suspended;

  /**
   * Output only. Updated time.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private String updateTime;

  /**
   * Optional. Configuration for establishing the connection's authentication with an external
   * system.
   * @return value or {@code null} for none
   */
  public AuthConfig getAuthConfig() {
    return authConfig;
  }

  /**
   * Optional. Configuration for establishing the connection's authentication with an external
   * system.
   * @param authConfig authConfig or {@code null} for none
   */
  public Connection setAuthConfig(AuthConfig authConfig) {
    this.authConfig = authConfig;
    return this;
  }

  /**
   * Optional. Configuration for configuring the connection with an external system.
   * @return value or {@code null} for none
   */
  public java.util.List<ConfigVariable> getConfigVariables() {
    return configVariables;
  }

  /**
   * Optional. Configuration for configuring the connection with an external system.
   * @param configVariables configVariables or {@code null} for none
   */
  public Connection setConfigVariables(java.util.List<ConfigVariable> configVariables) {
    this.configVariables = configVariables;
    return this;
  }

  /**
   * Output only. Connection revision. This field is only updated when the connection is created or
   * updated by User.
   * @return value or {@code null} for none
   */
  public java.lang.Long getConnectionRevision() {
    return connectionRevision;
  }

  /**
   * Output only. Connection revision. This field is only updated when the connection is created or
   * updated by User.
   * @param connectionRevision connectionRevision or {@code null} for none
   */
  public Connection setConnectionRevision(java.lang.Long connectionRevision) {
    this.connectionRevision = connectionRevision;
    return this;
  }

  /**
   * Required. Connector version on which the connection is created. The format is:
   * projects/locations/providers/connectors/versions Only global location is supported for
   * ConnectorVersion resource.
   * @return value or {@code null} for none
   */
  public java.lang.String getConnectorVersion() {
    return connectorVersion;
  }

  /**
   * Required. Connector version on which the connection is created. The format is:
   * projects/locations/providers/connectors/versions Only global location is supported for
   * ConnectorVersion resource.
   * @param connectorVersion connectorVersion or {@code null} for none
   */
  public Connection setConnectorVersion(java.lang.String connectorVersion) {
    this.connectorVersion = connectorVersion;
    return this;
  }

  /**
   * Output only. Infra configs supported by Connector Version.
   * @return value or {@code null} for none
   */
  public ConnectorVersionInfraConfig getConnectorVersionInfraConfig() {
    return connectorVersionInfraConfig;
  }

  /**
   * Output only. Infra configs supported by Connector Version.
   * @param connectorVersionInfraConfig connectorVersionInfraConfig or {@code null} for none
   */
  public Connection setConnectorVersionInfraConfig(ConnectorVersionInfraConfig connectorVersionInfraConfig) {
    this.connectorVersionInfraConfig = connectorVersionInfraConfig;
    return this;
  }

  /**
   * Output only. Flag to mark the version indicating the launch stage.
   * @return value or {@code null} for none
   */
  public java.lang.String getConnectorVersionLaunchStage() {
    return connectorVersionLaunchStage;
  }

  /**
   * Output only. Flag to mark the version indicating the launch stage.
   * @param connectorVersionLaunchStage connectorVersionLaunchStage or {@code null} for none
   */
  public Connection setConnectorVersionLaunchStage(java.lang.String connectorVersionLaunchStage) {
    this.connectorVersionLaunchStage = connectorVersionLaunchStage;
    return this;
  }

  /**
   * Output only. Created time.
   * @return value or {@code null} for none
   */
  public String getCreateTime() {
    return createTime;
  }

  /**
   * Output only. Created time.
   * @param createTime createTime or {@code null} for none
   */
  public Connection setCreateTime(String createTime) {
    this.createTime = createTime;
    return this;
  }

  /**
   * Optional. Description of the resource.
   * @return value or {@code null} for none
   */
  public java.lang.String getDescription() {
    return description;
  }

  /**
   * Optional. Description of the resource.
   * @param description description or {@code null} for none
   */
  public Connection setDescription(java.lang.String description) {
    this.description = description;
    return this;
  }

  /**
   * Optional. Configuration of the Connector's destination. Only accepted for Connectors that
   * accepts user defined destination(s).
   * @return value or {@code null} for none
   */
  public java.util.List<DestinationConfig> getDestinationConfigs() {
    return destinationConfigs;
  }

  /**
   * Optional. Configuration of the Connector's destination. Only accepted for Connectors that
   * accepts user defined destination(s).
   * @param destinationConfigs destinationConfigs or {@code null} for none
   */
  public Connection setDestinationConfigs(java.util.List<DestinationConfig> destinationConfigs) {
    this.destinationConfigs = destinationConfigs;
    return this;
  }

  /**
   * Output only. GCR location where the envoy image is stored. formatted like:
   * gcr.io/{bucketName}/{imageName}
   * @return value or {@code null} for none
   */
  public java.lang.String getEnvoyImageLocation() {
    return envoyImageLocation;
  }

  /**
   * Output only. GCR location where the envoy image is stored. formatted like:
   * gcr.io/{bucketName}/{imageName}
   * @param envoyImageLocation envoyImageLocation or {@code null} for none
   */
  public Connection setEnvoyImageLocation(java.lang.String envoyImageLocation) {
    this.envoyImageLocation = envoyImageLocation;
    return this;
  }

  /**
   * Optional. Eventing config of a connection
   * @return value or {@code null} for none
   */
  public EventingConfig getEventingConfig() {
    return eventingConfig;
  }

  /**
   * Optional. Eventing config of a connection
   * @param eventingConfig eventingConfig or {@code null} for none
   */
  public Connection setEventingConfig(EventingConfig eventingConfig) {
    this.eventingConfig = eventingConfig;
    return this;
  }

  /**
   * Optional. Eventing enablement type. Will be nil if eventing is not enabled.
   * @return value or {@code null} for none
   */
  public java.lang.String getEventingEnablementType() {
    return eventingEnablementType;
  }

  /**
   * Optional. Eventing enablement type. Will be nil if eventing is not enabled.
   * @param eventingEnablementType eventingEnablementType or {@code null} for none
   */
  public Connection setEventingEnablementType(java.lang.String eventingEnablementType) {
    this.eventingEnablementType = eventingEnablementType;
    return this;
  }

  /**
   * Output only. Eventing Runtime Data.
   * @return value or {@code null} for none
   */
  public EventingRuntimeData getEventingRuntimeData() {
    return eventingRuntimeData;
  }

  /**
   * Output only. Eventing Runtime Data.
   * @param eventingRuntimeData eventingRuntimeData or {@code null} for none
   */
  public Connection setEventingRuntimeData(EventingRuntimeData eventingRuntimeData) {
    this.eventingRuntimeData = eventingRuntimeData;
    return this;
  }

  /**
   * Output only. GCR location where the runtime image is stored. formatted like:
   * gcr.io/{bucketName}/{imageName}
   * @return value or {@code null} for none
   */
  public java.lang.String getImageLocation() {
    return imageLocation;
  }

  /**
   * Output only. GCR location where the runtime image is stored. formatted like:
   * gcr.io/{bucketName}/{imageName}
   * @param imageLocation imageLocation or {@code null} for none
   */
  public Connection setImageLocation(java.lang.String imageLocation) {
    this.imageLocation = imageLocation;
    return this;
  }

  /**
   * Optional. Resource labels to represent user-provided metadata. Refer to cloud documentation on
   * labels for more details. https://cloud.google.com/compute/docs/labeling-resources
   * @return value or {@code null} for none
   */
  public java.util.Map<String, java.lang.String> getLabels() {
    return labels;
  }

  /**
   * Optional. Resource labels to represent user-provided metadata. Refer to cloud documentation on
   * labels for more details. https://cloud.google.com/compute/docs/labeling-resources
   * @param labels labels or {@code null} for none
   */
  public Connection setLabels(java.util.Map<String, java.lang.String> labels) {
    this.labels = labels;
    return this;
  }

  /**
   * Optional. Configuration that indicates whether or not the Connection can be edited.
   * @return value or {@code null} for none
   */
  public LockConfig getLockConfig() {
    return lockConfig;
  }

  /**
   * Optional. Configuration that indicates whether or not the Connection can be edited.
   * @param lockConfig lockConfig or {@code null} for none
   */
  public Connection setLockConfig(LockConfig lockConfig) {
    this.lockConfig = lockConfig;
    return this;
  }

  /**
   * Optional. Log configuration for the connection.
   * @return value or {@code null} for none
   */
  public ConnectorsLogConfig getLogConfig() {
    return logConfig;
  }

  /**
   * Optional. Log configuration for the connection.
   * @param logConfig logConfig or {@code null} for none
   */
  public Connection setLogConfig(ConnectorsLogConfig logConfig) {
    this.logConfig = logConfig;
    return this;
  }

  /**
   * Output only. Resource name of the Connection. Format:
   * projects/{project}/locations/{location}/connections/{connection}
   * @return value or {@code null} for none
   */
  public java.lang.String getName() {
    return name;
  }

  /**
   * Output only. Resource name of the Connection. Format:
   * projects/{project}/locations/{location}/connections/{connection}
   * @param name name or {@code null} for none
   */
  public Connection setName(java.lang.String name) {
    this.name = name;
    return this;
  }

  /**
   * Optional. Node configuration for the connection.
   * @return value or {@code null} for none
   */
  public NodeConfig getNodeConfig() {
    return nodeConfig;
  }

  /**
   * Optional. Node configuration for the connection.
   * @param nodeConfig nodeConfig or {@code null} for none
   */
  public Connection setNodeConfig(NodeConfig nodeConfig) {
    this.nodeConfig = nodeConfig;
    return this;
  }

  /**
   * Optional. Service account needed for runtime plane to access Google Cloud resources.
   * @return value or {@code null} for none
   */
  public java.lang.String getServiceAccount() {
    return serviceAccount;
  }

  /**
   * Optional. Service account needed for runtime plane to access Google Cloud resources.
   * @param serviceAccount serviceAccount or {@code null} for none
   */
  public Connection setServiceAccount(java.lang.String serviceAccount) {
    this.serviceAccount = serviceAccount;
    return this;
  }

  /**
   * Output only. The name of the Service Directory service name. Used for Private Harpoon to
   * resolve the ILB address. e.g. "projects/cloud-connectors-e2e-testing/locations/us-
   * central1/namespaces/istio-system/services/istio-ingressgateway-connectors"
   * @return value or {@code null} for none
   */
  public java.lang.String getServiceDirectory() {
    return serviceDirectory;
  }

  /**
   * Output only. The name of the Service Directory service name. Used for Private Harpoon to
   * resolve the ILB address. e.g. "projects/cloud-connectors-e2e-testing/locations/us-
   * central1/namespaces/istio-system/services/istio-ingressgateway-connectors"
   * @param serviceDirectory serviceDirectory or {@code null} for none
   */
  public Connection setServiceDirectory(java.lang.String serviceDirectory) {
    this.serviceDirectory = serviceDirectory;
    return this;
  }

  /**
   * Optional. Ssl config of a connection
   * @return value or {@code null} for none
   */
  public SslConfig getSslConfig() {
    return sslConfig;
  }

  /**
   * Optional. Ssl config of a connection
   * @param sslConfig sslConfig or {@code null} for none
   */
  public Connection setSslConfig(SslConfig sslConfig) {
    this.sslConfig = sslConfig;
    return this;
  }

  /**
   * Output only. Current status of the connection.
   * @return value or {@code null} for none
   */
  public ConnectionStatus getStatus() {
    return status;
  }

  /**
   * Output only. Current status of the connection.
   * @param status status or {@code null} for none
   */
  public Connection setStatus(ConnectionStatus status) {
    this.status = status;
    return this;
  }

  /**
   * Output only. This subscription type enum states the subscription type of the project.
   * @return value or {@code null} for none
   */
  public java.lang.String getSubscriptionType() {
    return subscriptionType;
  }

  /**
   * Output only. This subscription type enum states the subscription type of the project.
   * @param subscriptionType subscriptionType or {@code null} for none
   */
  public Connection setSubscriptionType(java.lang.String subscriptionType) {
    this.subscriptionType = subscriptionType;
    return this;
  }

  /**
   * Optional. Suspended indicates if a user has suspended a connection or not.
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getSuspended() {
    return suspended;
  }

  /**
   * Optional. Suspended indicates if a user has suspended a connection or not.
   * @param suspended suspended or {@code null} for none
   */
  public Connection setSuspended(java.lang.Boolean suspended) {
    this.suspended = suspended;
    return this;
  }

  /**
   * Output only. Updated time.
   * @return value or {@code null} for none
   */
  public String getUpdateTime() {
    return updateTime;
  }

  /**
   * Output only. Updated time.
   * @param updateTime updateTime or {@code null} for none
   */
  public Connection setUpdateTime(String updateTime) {
    this.updateTime = updateTime;
    return this;
  }

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

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

}
