Class Project.Builder
- java.lang.Object
-
- com.google.cloud.resourcemanager.ProjectInfo.Builder
-
- com.google.cloud.resourcemanager.Project.Builder
-
- Enclosing class:
- Project
public static class Project.Builder extends ProjectInfo.Builder
Builder forProject.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Project.BuilderaddLabel(String key, String value)Add a label associated with this project.Projectbuild()Project.BuilderclearLabels()Clear the labels associated with this project.Project.BuilderremoveLabel(String key)Remove a label associated with this project.Project.BuildersetLabels(Map<String,String> labels)Set the labels associated with this project.Project.BuildersetName(String name)Set the user-assigned name of the project.Project.BuildersetParent(ProjectInfo.ResourceId parent)Project.BuildersetProjectId(String projectId)Set the unique, user-assigned ID of the project.
-
-
-
Method Detail
-
setName
public Project.Builder setName(String name)
Description copied from class:ProjectInfo.BuilderSet 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. This field can be changed after project creation.
- Specified by:
setNamein classProjectInfo.Builder
-
setProjectId
public Project.Builder setProjectId(String projectId)
Description copied from class:ProjectInfo.BuilderSet the unique, user-assigned ID of the project.The ID must be 6 to 30 lowercase letters, digits, or hyphens. It must start with a letter. Trailing hyphens are prohibited. This field cannot be changed after the server creates the project.
- Specified by:
setProjectIdin classProjectInfo.Builder
-
addLabel
public Project.Builder addLabel(String key, String value)
Description copied from class:ProjectInfo.BuilderAdd a label associated with this project.See
ProjectInfo.labelsfor label restrictions.- Specified by:
addLabelin classProjectInfo.Builder
-
removeLabel
public Project.Builder removeLabel(String key)
Description copied from class:ProjectInfo.BuilderRemove a label associated with this project.- Specified by:
removeLabelin classProjectInfo.Builder
-
clearLabels
public Project.Builder clearLabels()
Description copied from class:ProjectInfo.BuilderClear the labels associated with this project.- Specified by:
clearLabelsin classProjectInfo.Builder
-
setLabels
public Project.Builder setLabels(Map<String,String> labels)
Description copied from class:ProjectInfo.BuilderSet 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. This field can be changed after project creation.
- Specified by:
setLabelsin classProjectInfo.Builder
-
setParent
public Project.Builder setParent(ProjectInfo.ResourceId parent)
- Specified by:
setParentin classProjectInfo.Builder
-
build
public Project build()
- Specified by:
buildin classProjectInfo.Builder
-
-