Class: Google::Cloud::ResourceManager::Project::Updater
- Inherits:
-
Google::Cloud::ResourceManager::Project
- Object
- Google::Cloud::ResourceManager::Project
- Google::Cloud::ResourceManager::Project::Updater
- Defined in:
- lib/google/cloud/resource_manager/project/updater.rb
Overview
Project Updater
This object is used by Project#update when passed a block. These methods are used to update the project data in a single API call.
Instance Method Summary collapse
-
#labels ⇒ Object
The labels associated with this project.
-
#labels=(new_labels) ⇒ Object
Updates the labels associated with this project.
-
#name=(new_name) ⇒ Object
Updates the user-assigned name of the project.
-
#parent=(new_parent) ⇒ Object
Updates the reference to a parent with a new Resource.
Methods inherited from Google::Cloud::ResourceManager::Project
#active?, #created_at, #delete, #delete_in_progress?, #delete_requested?, #name, #parent, #policy, #project_id, #project_number, #reload!, #state, #test_permissions, #undelete, #unspecified?, #update, #update_policy
Instance Method Details
#labels ⇒ Object
The labels associated with this project.
Label keys must be between 1 and 63 characters long and must conform
to the following regular expression:
[a-z]([-a-z0-9]*[a-z0-9])?
.
Label values must be between 0 and 63 characters long and must
conform to the regular expression
([a-z]([-a-z0-9]*[a-z0-9])?)?
.
No more than 256 labels can be associated with a given resource.
(Hash
)
83 84 85 |
# File 'lib/google/cloud/resource_manager/project/updater.rb', line 83 def labels gapi.labels end |
#labels=(new_labels) ⇒ Object
Updates the labels associated with this project.
Label keys must be between 1 and 63 characters long and must conform
to the following regular expression:
[a-z]([-a-z0-9]*[a-z0-9])?
.
Label values must be between 0 and 63 characters long and must
conform to the regular expression
([a-z]([-a-z0-9]*[a-z0-9])?)?
.
No more than 256 labels can be associated with a given resource.
(Hash
)
110 111 112 |
# File 'lib/google/cloud/resource_manager/project/updater.rb', line 110 def labels= new_labels gapi.labels = new_labels end |
#name=(new_name) ⇒ Object
Updates the user-assigned name of the project. This field is optional and can remain unset.
Allowed characters are: lowercase and uppercase letters, numbers, hyphen, single-quote, double-quote, space, and exclamation point.
56 57 58 |
# File 'lib/google/cloud/resource_manager/project/updater.rb', line 56 def name= new_name gapi.name = new_name end |
#parent=(new_parent) ⇒ Object
Updates the reference to a parent with a new Resource.
Supported parent types include "organization" and "folder". Once set, the parent can be updated but cannot be cleared.
The end user must have the resourcemanager.projects.create
permission on the parent.
(See Resource and Manager#resource.)
135 136 137 138 |
# File 'lib/google/cloud/resource_manager/project/updater.rb', line 135 def parent= new_parent raise ArgumentError, "new_parent is required" if new_parent.nil? gapi.parent = new_parent.to_gapi end |