<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/audit/audit_log.proto

namespace Google\Cloud\Audit;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Provides information about the Policy violation info for this request.
 *
 * Generated from protobuf message <code>google.cloud.audit.ViolationInfo</code>
 */
class ViolationInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. Constraint name
     *
     * Generated from protobuf field <code>string constraint = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $constraint = '';
    /**
     * Optional. Error message that policy is indicating.
     *
     * Generated from protobuf field <code>string error_message = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $error_message = '';
    /**
     * Optional. Value that is being checked for the policy.
     * This could be in encrypted form (if pii sensitive).
     * This field will only be emitted in LIST_POLICY types
     *
     * Generated from protobuf field <code>string checked_value = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $checked_value = '';
    /**
     * Optional. Indicates the type of the policy.
     *
     * Generated from protobuf field <code>.google.cloud.audit.ViolationInfo.PolicyType policy_type = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $policy_type = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $constraint
     *           Optional. Constraint name
     *     @type string $error_message
     *           Optional. Error message that policy is indicating.
     *     @type string $checked_value
     *           Optional. Value that is being checked for the policy.
     *           This could be in encrypted form (if pii sensitive).
     *           This field will only be emitted in LIST_POLICY types
     *     @type int $policy_type
     *           Optional. Indicates the type of the policy.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Audit\AuditLog::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. Constraint name
     *
     * Generated from protobuf field <code>string constraint = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getConstraint()
    {
        return $this->constraint;
    }

    /**
     * Optional. Constraint name
     *
     * Generated from protobuf field <code>string constraint = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setConstraint($var)
    {
        GPBUtil::checkString($var, True);
        $this->constraint = $var;

        return $this;
    }

    /**
     * Optional. Error message that policy is indicating.
     *
     * Generated from protobuf field <code>string error_message = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getErrorMessage()
    {
        return $this->error_message;
    }

    /**
     * Optional. Error message that policy is indicating.
     *
     * Generated from protobuf field <code>string error_message = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setErrorMessage($var)
    {
        GPBUtil::checkString($var, True);
        $this->error_message = $var;

        return $this;
    }

    /**
     * Optional. Value that is being checked for the policy.
     * This could be in encrypted form (if pii sensitive).
     * This field will only be emitted in LIST_POLICY types
     *
     * Generated from protobuf field <code>string checked_value = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getCheckedValue()
    {
        return $this->checked_value;
    }

    /**
     * Optional. Value that is being checked for the policy.
     * This could be in encrypted form (if pii sensitive).
     * This field will only be emitted in LIST_POLICY types
     *
     * Generated from protobuf field <code>string checked_value = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setCheckedValue($var)
    {
        GPBUtil::checkString($var, True);
        $this->checked_value = $var;

        return $this;
    }

    /**
     * Optional. Indicates the type of the policy.
     *
     * Generated from protobuf field <code>.google.cloud.audit.ViolationInfo.PolicyType policy_type = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return int
     */
    public function getPolicyType()
    {
        return $this->policy_type;
    }

    /**
     * Optional. Indicates the type of the policy.
     *
     * Generated from protobuf field <code>.google.cloud.audit.ViolationInfo.PolicyType policy_type = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param int $var
     * @return $this
     */
    public function setPolicyType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Audit\ViolationInfo\PolicyType::class);
        $this->policy_type = $var;

        return $this;
    }

}

