Reference documentation and code samples for the google-cloud-resource_manager class Google::Cloud::ResourceManager::Resource.
Resource
A container to reference an id for any resource type. A resource
in
Google Cloud Platform is a generic term for something a developer may
want to interact with through an API. Some examples are an App Engine
app, a Compute Engine instance, a Cloud SQL database, and so on. (See
Manager#resource.)
Inherits
- Object
Example
require "google/cloud/resource_manager" resource_manager = Google::Cloud::ResourceManager.new project = resource_manager.project "tokyo-rain-123" folder = Google::Cloud::ResourceManager::Resource.new "folder", "1234" project.parent = folder
Methods
.folder
def self.folder(id) -> Resource
Create a Resource object with type folder
.
- id (String) — The type-specific id. This should correspond to the id used in the type-specific API's.
- (Resource)
.organization
def self.organization(id) -> Resource
Create a Resource object with type organization
.
- id (String) — The type-specific id. This should correspond to the id used in the type-specific API's.
- (Resource)
#folder?
def folder?() -> Boolean
Checks if the type is folder
.
- (Boolean)
#id
def id() -> String
Required field for the type-specific id. This should correspond to the id used in the type-specific API's.
- (String)
#id=
def id=(value) -> String
Required field for the type-specific id. This should correspond to the id used in the type-specific API's.
- value (String)
- (String)
#initialize
def initialize(type, id) -> Resource
Create a Resource object.
- type (String) — The resource type this id is for. At present, the valid types are: "organization" and "folder".
- id (String) — The type-specific id. This should correspond to the id used in the type-specific API's.
- (Resource) — a new instance of Resource
- (ArgumentError)
#organization?
def organization?() -> Boolean
Checks if the type is organization
.
- (Boolean)
#type
def type() -> String
Required field representing the resource type this id is for. At present, the valid types are: "organization" and "folder".
- (String)
#type=
def type=(value) -> String
Required field representing the resource type this id is for. At present, the valid types are: "organization" and "folder".
- value (String)
- (String)