<?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\GPBUtil;
use Google\Protobuf\RepeatedField;

/**
 * Attached resource representation, which is defined by the corresponding
 * service provider. It represents an attached resource's payload.
 *
 * Generated from protobuf message <code>google.cloud.asset.v1.AttachedResource</code>
 */
class AttachedResource extends \Google\Protobuf\Internal\Message
{
    /**
     * The type of this attached resource.
     * Example: `osconfig.googleapis.com/Inventory`
     * You can find the supported attached asset types of each resource in this
     * table:
     * `https://cloud.google.com/asset-inventory/docs/supported-asset-types`
     *
     * Generated from protobuf field <code>string asset_type = 1;</code>
     */
    protected $asset_type = '';
    /**
     * Versioned resource representations of this attached resource. This is
     * repeated because there could be multiple versions of the attached resource
     * representations during version migration.
     *
     * Generated from protobuf field <code>repeated .google.cloud.asset.v1.VersionedResource versioned_resources = 3;</code>
     */
    private $versioned_resources;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $asset_type
     *           The type of this attached resource.
     *           Example: `osconfig.googleapis.com/Inventory`
     *           You can find the supported attached asset types of each resource in this
     *           table:
     *           `https://cloud.google.com/asset-inventory/docs/supported-asset-types`
     *     @type \Google\Cloud\Asset\V1\VersionedResource[] $versioned_resources
     *           Versioned resource representations of this attached resource. This is
     *           repeated because there could be multiple versions of the attached resource
     *           representations during version migration.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Asset\V1\Assets::initOnce();
        parent::__construct($data);
    }

    /**
     * The type of this attached resource.
     * Example: `osconfig.googleapis.com/Inventory`
     * You can find the supported attached asset types of each resource in this
     * table:
     * `https://cloud.google.com/asset-inventory/docs/supported-asset-types`
     *
     * Generated from protobuf field <code>string asset_type = 1;</code>
     * @return string
     */
    public function getAssetType()
    {
        return $this->asset_type;
    }

    /**
     * The type of this attached resource.
     * Example: `osconfig.googleapis.com/Inventory`
     * You can find the supported attached asset types of each resource in this
     * table:
     * `https://cloud.google.com/asset-inventory/docs/supported-asset-types`
     *
     * Generated from protobuf field <code>string asset_type = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setAssetType($var)
    {
        GPBUtil::checkString($var, True);
        $this->asset_type = $var;

        return $this;
    }

    /**
     * Versioned resource representations of this attached resource. This is
     * repeated because there could be multiple versions of the attached resource
     * representations during version migration.
     *
     * Generated from protobuf field <code>repeated .google.cloud.asset.v1.VersionedResource versioned_resources = 3;</code>
     * @return RepeatedField<\Google\Cloud\Asset\V1\VersionedResource>
     */
    public function getVersionedResources()
    {
        return $this->versioned_resources;
    }

    /**
     * Versioned resource representations of this attached resource. This is
     * repeated because there could be multiple versions of the attached resource
     * representations during version migration.
     *
     * Generated from protobuf field <code>repeated .google.cloud.asset.v1.VersionedResource versioned_resources = 3;</code>
     * @param \Google\Cloud\Asset\V1\VersionedResource[] $var
     * @return $this
     */
    public function setVersionedResources($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Asset\V1\VersionedResource::class);
        $this->versioned_resources = $arr;

        return $this;
    }

}

