You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -194,7 +194,6 @@ Google Cloud Resource Manager
194
194
Here is a code snippet showing a simple usage example. Note that you must supply Google SDK credentials forthis service, not other forms of authentication listedin the [Authentication section](#authentication).
Copy file name to clipboardExpand all lines: gcloud-java-resourcemanager/README.md
+10-18Lines changed: 10 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@ with the Cloud Resource Manager using this client Library.
50
50
Getting Started
51
51
---------------
52
52
#### Prerequisites
53
-
You will also need to set up the local development environment by [installing the Google Cloud SDK](https://cloud.google.com/sdk/) and running the following commands in command line: `gcloud auth login`.
53
+
You will need to set up the local development environment by [installing the Google Cloud SDK](https://cloud.google.com/sdk/) and running the following command in command line: `gcloud auth login`.
54
54
55
55
> Note: You don't need a project ID to use this service. If you have a project ID set in the Google Cloud SDK, you can unset it by typing `gcloud config unset project` in command line.
All you need to create a project is a globally unique project ID. You can also optionally attach a non-unique name and labels to your project. Read more about naming guidelines for project IDs, names, and labels [here](https://cloud.google.com/resource-manager/reference/rest/v1beta1/projects). To create a project, add the following imports at the top of your file:
71
+
All you need to create a project is a globally unique project ID. You can also optionally attach a non-unique name and labels to your project. Read more about naming guidelines for project IDs, names, and labels [here](https://cloud.google.com/resource-manager/reference/rest/v1beta1/projects). To create a project, add the following import at the top of your file:
Note that the return value from `create` is a `ProjectInfo` that includes additional read-only information, like creation time, project number, and lifecycle state. Read more about these fields on the [Projects page](https://cloud.google.com/resource-manager/reference/rest/v1beta1/projects).
85
85
86
86
#### Getting a specific project
87
-
You can load a project if you know it's project ID and have read permissions to the project. For example, say we wanted to get the project we just created. We can do the following:
87
+
You can load a project if you know it's project ID and have read permissions to the project. For example, to get the project we just created we can do the following:
Note that the values of the project you pass in to `replace` overwrite the server's values for non-read-only fields, namely `projectName` and `labels`. For example, if you create a project with `projectName` "some-project-name" and subsequently call replace using a `ProjectInfo` object that didn't set the `projectName`, then the server will unset the project's name. The server ignores any attempted changes to the read-only fields `projectNumber`, `lifecycleState`, and `createTime`. The `projectId` cannot change.
110
104
111
105
#### Listing all projects
112
-
Suppose that we want list of all projects for which we have read permissions. Add the following import:
106
+
Suppose that we want a list of all projects for which we have read permissions. Add the following import:
113
107
114
108
```java
115
109
importjava.util.Iterator;
@@ -130,7 +124,6 @@ while (projectIterator.hasNext()) {
130
124
Here we put together all the code shown above into one program. This program assumes that you are running from your own desktop.
0 commit comments