google-cloud-resource_manager - Class Google::Cloud::ResourceManager::Resource (v0.37.0)

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.

Parameter
  • id (String) — The type-specific id. This should correspond to the id used in the type-specific API's.
Returns

.organization

def self.organization(id) -> Resource

Create a Resource object with type organization.

Parameter
  • id (String) — The type-specific id. This should correspond to the id used in the type-specific API's.
Returns

#folder?

def folder?() -> Boolean

Checks if the type is folder.

Returns
  • (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.

Returns
  • (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.

Parameter
  • value (String)
Returns
  • (String)

#initialize

def initialize(type, id) -> Resource

Create a Resource object.

Parameters
  • 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.
Returns
  • (Resource) — a new instance of Resource
Raises
  • (ArgumentError)

#organization?

def organization?() -> Boolean

Checks if the type is organization.

Returns
  • (Boolean)

#type

def type() -> String

Required field representing the resource type this id is for. At present, the valid types are: "organization" and "folder".

Returns
  • (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".

Parameter
  • value (String)
Returns
  • (String)