<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: deviceapis/device/v1/deviceapis_device_encryption_profile_v1.proto

namespace Deviceapis\Device\V1\EncryptionProfile;

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

/**
 * Ошибка удаления
 *
 * Generated from protobuf message <code>deviceapis.device.v1.EncryptionProfile.DeletingError</code>
 */
class DeletingError extends \Google\Protobuf\Internal\Message
{
    /**
     * Идентификатор профиля шифрования, к которому относится ошибка.
     * Тип: Guid
     *
     * Generated from protobuf field <code>string id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $id = '';
    protected $reason;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $id
     *           Идентификатор профиля шифрования, к которому относится ошибка.
     *           Тип: Guid
     *     @type \Deviceapis\Device\V1\EncryptionProfile\DeletingError\EncryptionProfileInUse $encryption_profile_in_use
     *           Профиль используется на устройстве
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Deviceapis\Device\V1\DeviceapisDeviceEncryptionProfileV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Идентификатор профиля шифрования, к которому относится ошибка.
     * Тип: Guid
     *
     * Generated from protobuf field <code>string id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Идентификатор профиля шифрования, к которому относится ошибка.
     * Тип: Guid
     *
     * Generated from protobuf field <code>string id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->id = $var;

        return $this;
    }

    /**
     * Профиль используется на устройстве
     *
     * Generated from protobuf field <code>.deviceapis.device.v1.EncryptionProfile.DeletingError.EncryptionProfileInUse encryption_profile_in_use = 2;</code>
     * @return \Deviceapis\Device\V1\EncryptionProfile\DeletingError\EncryptionProfileInUse|null
     */
    public function getEncryptionProfileInUse()
    {
        return $this->readOneof(2);
    }

    public function hasEncryptionProfileInUse()
    {
        return $this->hasOneof(2);
    }

    /**
     * Профиль используется на устройстве
     *
     * Generated from protobuf field <code>.deviceapis.device.v1.EncryptionProfile.DeletingError.EncryptionProfileInUse encryption_profile_in_use = 2;</code>
     * @param \Deviceapis\Device\V1\EncryptionProfile\DeletingError\EncryptionProfileInUse $var
     * @return $this
     */
    public function setEncryptionProfileInUse($var)
    {
        GPBUtil::checkMessage($var, \Deviceapis\Device\V1\EncryptionProfile\DeletingError\EncryptionProfileInUse::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getReason()
    {
        return $this->whichOneof("reason");
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(DeletingError::class, \Deviceapis\Device\V1\EncryptionProfile_DeletingError::class);

