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

namespace Google\Cloud\Asset\V1;

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

/**
 * DEPRECATED. This message only presents for the purpose of
 * backward-compatibility. The server will never populate this message in
 * responses.
 * The detailed related assets with the `relationship_type`.
 *
 * Generated from protobuf message <code>google.cloud.asset.v1.RelatedAssets</code>
 */
class RelatedAssets extends \Google\Protobuf\Internal\Message
{
    /**
     * The detailed relationship attributes.
     *
     * Generated from protobuf field <code>.google.cloud.asset.v1.RelationshipAttributes relationship_attributes = 1;</code>
     */
    private $relationship_attributes = null;
    /**
     * The peer resources of the relationship.
     *
     * Generated from protobuf field <code>repeated .google.cloud.asset.v1.RelatedAsset assets = 2;</code>
     */
    private $assets;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Asset\V1\RelationshipAttributes $relationship_attributes
     *           The detailed relationship attributes.
     *     @type array<\Google\Cloud\Asset\V1\RelatedAsset>|\Google\Protobuf\Internal\RepeatedField $assets
     *           The peer resources of the relationship.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Asset\V1\Assets::initOnce();
        parent::__construct($data);
    }

    /**
     * The detailed relationship attributes.
     *
     * Generated from protobuf field <code>.google.cloud.asset.v1.RelationshipAttributes relationship_attributes = 1;</code>
     * @return \Google\Cloud\Asset\V1\RelationshipAttributes|null
     */
    public function getRelationshipAttributes()
    {
        return $this->relationship_attributes;
    }

    public function hasRelationshipAttributes()
    {
        return isset($this->relationship_attributes);
    }

    public function clearRelationshipAttributes()
    {
        unset($this->relationship_attributes);
    }

    /**
     * The detailed relationship attributes.
     *
     * Generated from protobuf field <code>.google.cloud.asset.v1.RelationshipAttributes relationship_attributes = 1;</code>
     * @param \Google\Cloud\Asset\V1\RelationshipAttributes $var
     * @return $this
     */
    public function setRelationshipAttributes($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Asset\V1\RelationshipAttributes::class);
        $this->relationship_attributes = $var;

        return $this;
    }

    /**
     * The peer resources of the relationship.
     *
     * Generated from protobuf field <code>repeated .google.cloud.asset.v1.RelatedAsset assets = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getAssets()
    {
        return $this->assets;
    }

    /**
     * The peer resources of the relationship.
     *
     * Generated from protobuf field <code>repeated .google.cloud.asset.v1.RelatedAsset assets = 2;</code>
     * @param array<\Google\Cloud\Asset\V1\RelatedAsset>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setAssets($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\RelatedAsset::class);
        $this->assets = $arr;

        return $this;
    }

}

