/*
 * 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.policysimulator.v1beta1.model;

/**
 * The result of replaying a single access tuple against a simulated state.
 *
 * <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 Policy Simulator 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 GoogleCloudPolicysimulatorV1beta1ReplayResult extends com.google.api.client.json.GenericJson {

  /**
   * The access tuple that was replayed. This field includes information about the member, resource,
   * and permission that were involved in the access attempt.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleCloudPolicysimulatorV1beta1AccessTuple accessTuple;

  /**
   * The difference between the member's access under the current (baseline) policies and the
   * member's access under the proposed (simulated) policies. This field is only included for access
   * tuples that were successfully replayed and had different results under the current policies and
   * the proposed policies.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleCloudPolicysimulatorV1beta1ReplayDiff diff;

  /**
   * The error that caused the access tuple replay to fail. This field is only included for access
   * tuples that were not replayed successfully.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleRpcStatus error;

  /**
   * The latest date this access tuple was seen in the logs.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleTypeDate lastSeenDate;

  /**
   * The resource name of the `ReplayResult`, in the following format:
   * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}/results
   * /{replay-result-id}`, where `{resource-id}` is the ID of the project, folder, or organization
   * that owns the Replay. Example: `projects/my-example-project/locations/global/replays/506a5f7f-
   * 38ce-4d7d-8e03-479ce1833c36/results/1234`
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String name;

  /**
   * The Replay that the access tuple was included in.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String parent;

  /**
   * The access tuple that was replayed. This field includes information about the member, resource,
   * and permission that were involved in the access attempt.
   * @return value or {@code null} for none
   */
  public GoogleCloudPolicysimulatorV1beta1AccessTuple getAccessTuple() {
    return accessTuple;
  }

  /**
   * The access tuple that was replayed. This field includes information about the member, resource,
   * and permission that were involved in the access attempt.
   * @param accessTuple accessTuple or {@code null} for none
   */
  public GoogleCloudPolicysimulatorV1beta1ReplayResult setAccessTuple(GoogleCloudPolicysimulatorV1beta1AccessTuple accessTuple) {
    this.accessTuple = accessTuple;
    return this;
  }

  /**
   * The difference between the member's access under the current (baseline) policies and the
   * member's access under the proposed (simulated) policies. This field is only included for access
   * tuples that were successfully replayed and had different results under the current policies and
   * the proposed policies.
   * @return value or {@code null} for none
   */
  public GoogleCloudPolicysimulatorV1beta1ReplayDiff getDiff() {
    return diff;
  }

  /**
   * The difference between the member's access under the current (baseline) policies and the
   * member's access under the proposed (simulated) policies. This field is only included for access
   * tuples that were successfully replayed and had different results under the current policies and
   * the proposed policies.
   * @param diff diff or {@code null} for none
   */
  public GoogleCloudPolicysimulatorV1beta1ReplayResult setDiff(GoogleCloudPolicysimulatorV1beta1ReplayDiff diff) {
    this.diff = diff;
    return this;
  }

  /**
   * The error that caused the access tuple replay to fail. This field is only included for access
   * tuples that were not replayed successfully.
   * @return value or {@code null} for none
   */
  public GoogleRpcStatus getError() {
    return error;
  }

  /**
   * The error that caused the access tuple replay to fail. This field is only included for access
   * tuples that were not replayed successfully.
   * @param error error or {@code null} for none
   */
  public GoogleCloudPolicysimulatorV1beta1ReplayResult setError(GoogleRpcStatus error) {
    this.error = error;
    return this;
  }

  /**
   * The latest date this access tuple was seen in the logs.
   * @return value or {@code null} for none
   */
  public GoogleTypeDate getLastSeenDate() {
    return lastSeenDate;
  }

  /**
   * The latest date this access tuple was seen in the logs.
   * @param lastSeenDate lastSeenDate or {@code null} for none
   */
  public GoogleCloudPolicysimulatorV1beta1ReplayResult setLastSeenDate(GoogleTypeDate lastSeenDate) {
    this.lastSeenDate = lastSeenDate;
    return this;
  }

  /**
   * The resource name of the `ReplayResult`, in the following format:
   * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}/results
   * /{replay-result-id}`, where `{resource-id}` is the ID of the project, folder, or organization
   * that owns the Replay. Example: `projects/my-example-project/locations/global/replays/506a5f7f-
   * 38ce-4d7d-8e03-479ce1833c36/results/1234`
   * @return value or {@code null} for none
   */
  public java.lang.String getName() {
    return name;
  }

  /**
   * The resource name of the `ReplayResult`, in the following format:
   * `{projects|folders|organizations}/{resource-id}/locations/global/replays/{replay-id}/results
   * /{replay-result-id}`, where `{resource-id}` is the ID of the project, folder, or organization
   * that owns the Replay. Example: `projects/my-example-project/locations/global/replays/506a5f7f-
   * 38ce-4d7d-8e03-479ce1833c36/results/1234`
   * @param name name or {@code null} for none
   */
  public GoogleCloudPolicysimulatorV1beta1ReplayResult setName(java.lang.String name) {
    this.name = name;
    return this;
  }

  /**
   * The Replay that the access tuple was included in.
   * @return value or {@code null} for none
   */
  public java.lang.String getParent() {
    return parent;
  }

  /**
   * The Replay that the access tuple was included in.
   * @param parent parent or {@code null} for none
   */
  public GoogleCloudPolicysimulatorV1beta1ReplayResult setParent(java.lang.String parent) {
    this.parent = parent;
    return this;
  }

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

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

}
