Reference documentation and code samples for the Cloud Asset V1 API class Google::Cloud::Asset::V1::VersionedResource.
Resource representation as defined by the corresponding service providing the
resource for a given API version.
Inherits
Object
Extended By
Google::Protobuf::MessageExts::ClassMethods
Includes
Google::Protobuf::MessageExts
Methods
#resource
defresource()->::Google::Protobuf::Struct
Returns
(::Google::Protobuf::Struct) — JSON representation of the resource as defined by the corresponding
service providing this resource.
Example:
If the resource is an instance provided by Compute Engine, this field will
contain the JSON representation of the instance as defined by Compute
Engine:
https://cloud.google.com/compute/docs/reference/rest/v1/instances.
You can find the resource definition for each supported resource type in
this table:
https://cloud.google.com/asset-inventory/docs/supported-asset-types
#resource=
defresource=(value)->::Google::Protobuf::Struct
Parameter
value (::Google::Protobuf::Struct) — JSON representation of the resource as defined by the corresponding
service providing this resource.
Example:
If the resource is an instance provided by Compute Engine, this field will
contain the JSON representation of the instance as defined by Compute
Engine:
https://cloud.google.com/compute/docs/reference/rest/v1/instances.
You can find the resource definition for each supported resource type in
this table:
https://cloud.google.com/asset-inventory/docs/supported-asset-types
Returns
(::Google::Protobuf::Struct) — JSON representation of the resource as defined by the corresponding
service providing this resource.
Example:
If the resource is an instance provided by Compute Engine, this field will
contain the JSON representation of the instance as defined by Compute
Engine:
https://cloud.google.com/compute/docs/reference/rest/v1/instances.
You can find the resource definition for each supported resource type in
this table:
https://cloud.google.com/asset-inventory/docs/supported-asset-types
#version
defversion()->::String
Returns
(::String) — API version of the resource.
Example:
If the resource is an instance provided by Compute Engine v1 API as defined
in https://cloud.google.com/compute/docs/reference/rest/v1/instances,
version will be "v1".
#version=
defversion=(value)->::String
Parameter
value (::String) — API version of the resource.
Example:
If the resource is an instance provided by Compute Engine v1 API as defined
in https://cloud.google.com/compute/docs/reference/rest/v1/instances,
version will be "v1".
Returns
(::String) — API version of the resource.
Example:
If the resource is an instance provided by Compute Engine v1 API as defined
in https://cloud.google.com/compute/docs/reference/rest/v1/instances,
version will be "v1".
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-09 UTC."],[],[],null,["# Cloud Asset V1 API - Class Google::Cloud::Asset::V1::VersionedResource (v1.4.1)\n\nVersion latestkeyboard_arrow_down\n\n- [1.4.1 (latest)](/ruby/docs/reference/google-cloud-asset-v1/latest/Google-Cloud-Asset-V1-VersionedResource)\n- [1.4.0](/ruby/docs/reference/google-cloud-asset-v1/1.4.0/Google-Cloud-Asset-V1-VersionedResource)\n- [1.3.1](/ruby/docs/reference/google-cloud-asset-v1/1.3.1/Google-Cloud-Asset-V1-VersionedResource)\n- [1.2.0](/ruby/docs/reference/google-cloud-asset-v1/1.2.0/Google-Cloud-Asset-V1-VersionedResource)\n- [1.1.0](/ruby/docs/reference/google-cloud-asset-v1/1.1.0/Google-Cloud-Asset-V1-VersionedResource)\n- [1.0.2](/ruby/docs/reference/google-cloud-asset-v1/1.0.2/Google-Cloud-Asset-V1-VersionedResource)\n- [0.32.0](/ruby/docs/reference/google-cloud-asset-v1/0.32.0/Google-Cloud-Asset-V1-VersionedResource)\n- [0.31.0](/ruby/docs/reference/google-cloud-asset-v1/0.31.0/Google-Cloud-Asset-V1-VersionedResource)\n- [0.30.0](/ruby/docs/reference/google-cloud-asset-v1/0.30.0/Google-Cloud-Asset-V1-VersionedResource)\n- [0.29.3](/ruby/docs/reference/google-cloud-asset-v1/0.29.3/Google-Cloud-Asset-V1-VersionedResource)\n- [0.28.1](/ruby/docs/reference/google-cloud-asset-v1/0.28.1/Google-Cloud-Asset-V1-VersionedResource)\n- [0.27.0](/ruby/docs/reference/google-cloud-asset-v1/0.27.0/Google-Cloud-Asset-V1-VersionedResource)\n- [0.26.1](/ruby/docs/reference/google-cloud-asset-v1/0.26.1/Google-Cloud-Asset-V1-VersionedResource)\n- [0.25.0](/ruby/docs/reference/google-cloud-asset-v1/0.25.0/Google-Cloud-Asset-V1-VersionedResource)\n- [0.24.0](/ruby/docs/reference/google-cloud-asset-v1/0.24.0/Google-Cloud-Asset-V1-VersionedResource)\n- [0.23.0](/ruby/docs/reference/google-cloud-asset-v1/0.23.0/Google-Cloud-Asset-V1-VersionedResource)\n- [0.22.0](/ruby/docs/reference/google-cloud-asset-v1/0.22.0/Google-Cloud-Asset-V1-VersionedResource)\n- [0.21.1](/ruby/docs/reference/google-cloud-asset-v1/0.21.1/Google-Cloud-Asset-V1-VersionedResource)\n- [0.20.1](/ruby/docs/reference/google-cloud-asset-v1/0.20.1/Google-Cloud-Asset-V1-VersionedResource)\n- [0.19.0](/ruby/docs/reference/google-cloud-asset-v1/0.19.0/Google-Cloud-Asset-V1-VersionedResource)\n- [0.18.0](/ruby/docs/reference/google-cloud-asset-v1/0.18.0/Google-Cloud-Asset-V1-VersionedResource)\n- [0.17.3](/ruby/docs/reference/google-cloud-asset-v1/0.17.3/Google-Cloud-Asset-V1-VersionedResource) \nReference documentation and code samples for the Cloud Asset V1 API class Google::Cloud::Asset::V1::VersionedResource.\n\nResource representation as defined by the corresponding service providing the\nresource for a given API version. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #resource\n\n def resource() -\u003e ::Google::Protobuf::Struct\n\n**Returns**\n\n- ([::Google::Protobuf::Struct](./Google-Protobuf-Struct)) --- JSON representation of the resource as defined by the corresponding service providing this resource.\n\n\n Example:\n If the resource is an instance provided by Compute Engine, this field will\n contain the JSON representation of the instance as defined by Compute\n Engine:\n `https://cloud.google.com/compute/docs/reference/rest/v1/instances`.\n\n You can find the resource definition for each supported resource type in\n this table:\n `https://cloud.google.com/asset-inventory/docs/supported-asset-types`\n\n### #resource=\n\n def resource=(value) -\u003e ::Google::Protobuf::Struct\n\n**Parameter**\n\n- **value** ([::Google::Protobuf::Struct](./Google-Protobuf-Struct)) --- JSON representation of the resource as defined by the corresponding service providing this resource.\n\n\n Example:\n If the resource is an instance provided by Compute Engine, this field will\n contain the JSON representation of the instance as defined by Compute\n Engine:\n `https://cloud.google.com/compute/docs/reference/rest/v1/instances`.\n\n You can find the resource definition for each supported resource type in\n this table:\n`https://cloud.google.com/asset-inventory/docs/supported-asset-types` \n**Returns**\n\n- ([::Google::Protobuf::Struct](./Google-Protobuf-Struct)) --- JSON representation of the resource as defined by the corresponding service providing this resource.\n\n\n Example:\n If the resource is an instance provided by Compute Engine, this field will\n contain the JSON representation of the instance as defined by Compute\n Engine:\n `https://cloud.google.com/compute/docs/reference/rest/v1/instances`.\n\n You can find the resource definition for each supported resource type in\n this table:\n `https://cloud.google.com/asset-inventory/docs/supported-asset-types`\n\n### #version\n\n def version() -\u003e ::String\n\n**Returns**\n\n- (::String) --- API version of the resource.\n\n Example:\n If the resource is an instance provided by Compute Engine v1 API as defined\n in `https://cloud.google.com/compute/docs/reference/rest/v1/instances`,\n version will be \"v1\".\n\n### #version=\n\n def version=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- API version of the resource.\n\n\n Example:\n If the resource is an instance provided by Compute Engine v1 API as defined\n in `https://cloud.google.com/compute/docs/reference/rest/v1/instances`,\nversion will be \"v1\". \n**Returns**\n\n- (::String) --- API version of the resource.\n\n Example:\n If the resource is an instance provided by Compute Engine v1 API as defined\n in `https://cloud.google.com/compute/docs/reference/rest/v1/instances`,\n version will be \"v1\"."]]