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

/**
 * A Connectivity Test for a network reachability analysis.
 *
 * <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 Network Management 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 ConnectivityTest extends com.google.api.client.json.GenericJson {

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

  /**
   * The user-supplied description of the Connectivity Test. Maximum of 512 characters.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String description;

  /**
   * Required. Destination specification of the Connectivity Test. You can use a combination of
   * destination IP address, Compute Engine VM instance, or VPC network to uniquely identify the
   * destination location. Even if the destination IP address is not unique, the source IP location
   * is unique. Usually, the analysis can infer the destination endpoint from route information. If
   * the destination you specify is a VM instance and the instance has multiple network interfaces,
   * then you must also specify either a destination IP address or VPC network to identify the
   * destination interface. A reachability analysis proceeds even if the destination location is
   * ambiguous. However, the result can include endpoints that you don't intend to test.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private Endpoint destination;

  /**
   * Output only. The display name of a Connectivity Test.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String displayName;

  /**
   * Resource labels to represent user-provided metadata.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.Map<String, java.lang.String> labels;

  /**
   * Required. Unique name of the resource using the form:
   * `projects/{project_id}/locations/global/connectivityTests/{test_id}`
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String name;

  /**
   * IP Protocol of the test. When not provided, "TCP" is assumed.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String protocol;

  /**
   * Output only. The reachability details of this test from the latest run. The details are updated
   * when creating a new test, updating an existing test, or triggering a one-time rerun of an
   * existing test.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private ReachabilityDetails reachabilityDetails;

  /**
   * Other projects that may be relevant for reachability analysis. This is applicable to scenarios
   * where a test can cross project boundaries.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<java.lang.String> relatedProjects;

  /**
   * Required. Source specification of the Connectivity Test. You can use a combination of source IP
   * address, virtual machine (VM) instance, or Compute Engine network to uniquely identify the
   * source location. Examples: If the source IP address is an internal IP address within a Google
   * Cloud Virtual Private Cloud (VPC) network, then you must also specify the VPC network.
   * Otherwise, specify the VM instance, which already contains its internal IP address and VPC
   * network information. If the source of the test is within an on-premises network, then you must
   * provide the destination VPC network. If the source endpoint is a Compute Engine VM instance
   * with multiple network interfaces, the instance itself is not sufficient to identify the
   * endpoint. So, you must also specify the source IP address or VPC network. A reachability
   * analysis proceeds even if the source location is ambiguous. However, the test result may
   * include endpoints that you don't intend to test.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private Endpoint source;

  /**
   * Output only. The time the test's configuration was updated.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private String updateTime;

  /**
   * Output only. The time the test was created.
   * @return value or {@code null} for none
   */
  public String getCreateTime() {
    return createTime;
  }

  /**
   * Output only. The time the test was created.
   * @param createTime createTime or {@code null} for none
   */
  public ConnectivityTest setCreateTime(String createTime) {
    this.createTime = createTime;
    return this;
  }

  /**
   * The user-supplied description of the Connectivity Test. Maximum of 512 characters.
   * @return value or {@code null} for none
   */
  public java.lang.String getDescription() {
    return description;
  }

  /**
   * The user-supplied description of the Connectivity Test. Maximum of 512 characters.
   * @param description description or {@code null} for none
   */
  public ConnectivityTest setDescription(java.lang.String description) {
    this.description = description;
    return this;
  }

  /**
   * Required. Destination specification of the Connectivity Test. You can use a combination of
   * destination IP address, Compute Engine VM instance, or VPC network to uniquely identify the
   * destination location. Even if the destination IP address is not unique, the source IP location
   * is unique. Usually, the analysis can infer the destination endpoint from route information. If
   * the destination you specify is a VM instance and the instance has multiple network interfaces,
   * then you must also specify either a destination IP address or VPC network to identify the
   * destination interface. A reachability analysis proceeds even if the destination location is
   * ambiguous. However, the result can include endpoints that you don't intend to test.
   * @return value or {@code null} for none
   */
  public Endpoint getDestination() {
    return destination;
  }

  /**
   * Required. Destination specification of the Connectivity Test. You can use a combination of
   * destination IP address, Compute Engine VM instance, or VPC network to uniquely identify the
   * destination location. Even if the destination IP address is not unique, the source IP location
   * is unique. Usually, the analysis can infer the destination endpoint from route information. If
   * the destination you specify is a VM instance and the instance has multiple network interfaces,
   * then you must also specify either a destination IP address or VPC network to identify the
   * destination interface. A reachability analysis proceeds even if the destination location is
   * ambiguous. However, the result can include endpoints that you don't intend to test.
   * @param destination destination or {@code null} for none
   */
  public ConnectivityTest setDestination(Endpoint destination) {
    this.destination = destination;
    return this;
  }

  /**
   * Output only. The display name of a Connectivity Test.
   * @return value or {@code null} for none
   */
  public java.lang.String getDisplayName() {
    return displayName;
  }

  /**
   * Output only. The display name of a Connectivity Test.
   * @param displayName displayName or {@code null} for none
   */
  public ConnectivityTest setDisplayName(java.lang.String displayName) {
    this.displayName = displayName;
    return this;
  }

  /**
   * Resource labels to represent user-provided metadata.
   * @return value or {@code null} for none
   */
  public java.util.Map<String, java.lang.String> getLabels() {
    return labels;
  }

  /**
   * Resource labels to represent user-provided metadata.
   * @param labels labels or {@code null} for none
   */
  public ConnectivityTest setLabels(java.util.Map<String, java.lang.String> labels) {
    this.labels = labels;
    return this;
  }

  /**
   * Required. Unique name of the resource using the form:
   * `projects/{project_id}/locations/global/connectivityTests/{test_id}`
   * @return value or {@code null} for none
   */
  public java.lang.String getName() {
    return name;
  }

  /**
   * Required. Unique name of the resource using the form:
   * `projects/{project_id}/locations/global/connectivityTests/{test_id}`
   * @param name name or {@code null} for none
   */
  public ConnectivityTest setName(java.lang.String name) {
    this.name = name;
    return this;
  }

  /**
   * IP Protocol of the test. When not provided, "TCP" is assumed.
   * @return value or {@code null} for none
   */
  public java.lang.String getProtocol() {
    return protocol;
  }

  /**
   * IP Protocol of the test. When not provided, "TCP" is assumed.
   * @param protocol protocol or {@code null} for none
   */
  public ConnectivityTest setProtocol(java.lang.String protocol) {
    this.protocol = protocol;
    return this;
  }

  /**
   * Output only. The reachability details of this test from the latest run. The details are updated
   * when creating a new test, updating an existing test, or triggering a one-time rerun of an
   * existing test.
   * @return value or {@code null} for none
   */
  public ReachabilityDetails getReachabilityDetails() {
    return reachabilityDetails;
  }

  /**
   * Output only. The reachability details of this test from the latest run. The details are updated
   * when creating a new test, updating an existing test, or triggering a one-time rerun of an
   * existing test.
   * @param reachabilityDetails reachabilityDetails or {@code null} for none
   */
  public ConnectivityTest setReachabilityDetails(ReachabilityDetails reachabilityDetails) {
    this.reachabilityDetails = reachabilityDetails;
    return this;
  }

  /**
   * Other projects that may be relevant for reachability analysis. This is applicable to scenarios
   * where a test can cross project boundaries.
   * @return value or {@code null} for none
   */
  public java.util.List<java.lang.String> getRelatedProjects() {
    return relatedProjects;
  }

  /**
   * Other projects that may be relevant for reachability analysis. This is applicable to scenarios
   * where a test can cross project boundaries.
   * @param relatedProjects relatedProjects or {@code null} for none
   */
  public ConnectivityTest setRelatedProjects(java.util.List<java.lang.String> relatedProjects) {
    this.relatedProjects = relatedProjects;
    return this;
  }

  /**
   * Required. Source specification of the Connectivity Test. You can use a combination of source IP
   * address, virtual machine (VM) instance, or Compute Engine network to uniquely identify the
   * source location. Examples: If the source IP address is an internal IP address within a Google
   * Cloud Virtual Private Cloud (VPC) network, then you must also specify the VPC network.
   * Otherwise, specify the VM instance, which already contains its internal IP address and VPC
   * network information. If the source of the test is within an on-premises network, then you must
   * provide the destination VPC network. If the source endpoint is a Compute Engine VM instance
   * with multiple network interfaces, the instance itself is not sufficient to identify the
   * endpoint. So, you must also specify the source IP address or VPC network. A reachability
   * analysis proceeds even if the source location is ambiguous. However, the test result may
   * include endpoints that you don't intend to test.
   * @return value or {@code null} for none
   */
  public Endpoint getSource() {
    return source;
  }

  /**
   * Required. Source specification of the Connectivity Test. You can use a combination of source IP
   * address, virtual machine (VM) instance, or Compute Engine network to uniquely identify the
   * source location. Examples: If the source IP address is an internal IP address within a Google
   * Cloud Virtual Private Cloud (VPC) network, then you must also specify the VPC network.
   * Otherwise, specify the VM instance, which already contains its internal IP address and VPC
   * network information. If the source of the test is within an on-premises network, then you must
   * provide the destination VPC network. If the source endpoint is a Compute Engine VM instance
   * with multiple network interfaces, the instance itself is not sufficient to identify the
   * endpoint. So, you must also specify the source IP address or VPC network. A reachability
   * analysis proceeds even if the source location is ambiguous. However, the test result may
   * include endpoints that you don't intend to test.
   * @param source source or {@code null} for none
   */
  public ConnectivityTest setSource(Endpoint source) {
    this.source = source;
    return this;
  }

  /**
   * Output only. The time the test's configuration was updated.
   * @return value or {@code null} for none
   */
  public String getUpdateTime() {
    return updateTime;
  }

  /**
   * Output only. The time the test's configuration was updated.
   * @param updateTime updateTime or {@code null} for none
   */
  public ConnectivityTest setUpdateTime(String updateTime) {
    this.updateTime = updateTime;
    return this;
  }

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

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

}
