|
25 | 25 | import com.google.api.gax.paging.AbstractPagedListResponse;
|
26 | 26 | import com.google.api.gax.rpc.PageContext;
|
27 | 27 | import com.google.api.gax.rpc.UnaryCallable;
|
| 28 | +import com.google.api.resourcenames.ResourceName; |
28 | 29 | import com.google.cloud.datacatalog.v1.stub.DataCatalogStub;
|
29 | 30 | import com.google.cloud.datacatalog.v1.stub.DataCatalogStubSettings;
|
30 | 31 | import com.google.common.util.concurrent.MoreExecutors;
|
@@ -3108,6 +3109,77 @@ public final UnaryCallable<ListTagsRequest, ListTagsResponse> listTagsCallable()
|
3108 | 3109 | return stub.listTagsCallable();
|
3109 | 3110 | }
|
3110 | 3111 |
|
| 3112 | + // AUTO-GENERATED DOCUMENTATION AND METHOD |
| 3113 | + /** |
| 3114 | + * Sets the access control policy for a resource. Replaces any existing policy. Supported |
| 3115 | + * resources are: - Tag templates. - Entries. - Entry groups. Note, this method cannot be used to |
| 3116 | + * manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform resources synced |
| 3117 | + * to Data Catalog. |
| 3118 | + * |
| 3119 | + * <p>Callers must have following Google IAM permission - `datacatalog.tagTemplates.setIamPolicy` |
| 3120 | + * to set policies on tag templates. - `datacatalog.entries.setIamPolicy` to set policies on |
| 3121 | + * entries. - `datacatalog.entryGroups.setIamPolicy` to set policies on entry groups. |
| 3122 | + * |
| 3123 | + * <p>Sample code: |
| 3124 | + * |
| 3125 | + * <pre><code> |
| 3126 | + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { |
| 3127 | + * ResourceName resource = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]"); |
| 3128 | + * Policy policy = Policy.newBuilder().build(); |
| 3129 | + * Policy response = dataCatalogClient.setIamPolicy(resource, policy); |
| 3130 | + * } |
| 3131 | + * </code></pre> |
| 3132 | + * |
| 3133 | + * @param resource REQUIRED: The resource for which the policy is being specified. See the |
| 3134 | + * operation documentation for the appropriate value for this field. |
| 3135 | + * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the |
| 3136 | + * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud |
| 3137 | + * Platform services (such as Projects) might reject them. |
| 3138 | + * @throws com.google.api.gax.rpc.ApiException if the remote call fails |
| 3139 | + */ |
| 3140 | + public final Policy setIamPolicy(ResourceName resource, Policy policy) { |
| 3141 | + SetIamPolicyRequest request = |
| 3142 | + SetIamPolicyRequest.newBuilder() |
| 3143 | + .setResource(resource == null ? null : resource.toString()) |
| 3144 | + .setPolicy(policy) |
| 3145 | + .build(); |
| 3146 | + return setIamPolicy(request); |
| 3147 | + } |
| 3148 | + |
| 3149 | + // AUTO-GENERATED DOCUMENTATION AND METHOD |
| 3150 | + /** |
| 3151 | + * Sets the access control policy for a resource. Replaces any existing policy. Supported |
| 3152 | + * resources are: - Tag templates. - Entries. - Entry groups. Note, this method cannot be used to |
| 3153 | + * manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform resources synced |
| 3154 | + * to Data Catalog. |
| 3155 | + * |
| 3156 | + * <p>Callers must have following Google IAM permission - `datacatalog.tagTemplates.setIamPolicy` |
| 3157 | + * to set policies on tag templates. - `datacatalog.entries.setIamPolicy` to set policies on |
| 3158 | + * entries. - `datacatalog.entryGroups.setIamPolicy` to set policies on entry groups. |
| 3159 | + * |
| 3160 | + * <p>Sample code: |
| 3161 | + * |
| 3162 | + * <pre><code> |
| 3163 | + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { |
| 3164 | + * ResourceName resource = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]"); |
| 3165 | + * Policy policy = Policy.newBuilder().build(); |
| 3166 | + * Policy response = dataCatalogClient.setIamPolicy(resource.toString(), policy); |
| 3167 | + * } |
| 3168 | + * </code></pre> |
| 3169 | + * |
| 3170 | + * @param resource REQUIRED: The resource for which the policy is being specified. See the |
| 3171 | + * operation documentation for the appropriate value for this field. |
| 3172 | + * @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the |
| 3173 | + * policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud |
| 3174 | + * Platform services (such as Projects) might reject them. |
| 3175 | + * @throws com.google.api.gax.rpc.ApiException if the remote call fails |
| 3176 | + */ |
| 3177 | + public final Policy setIamPolicy(String resource, Policy policy) { |
| 3178 | + SetIamPolicyRequest request = |
| 3179 | + SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); |
| 3180 | + return setIamPolicy(request); |
| 3181 | + } |
| 3182 | + |
3111 | 3183 | // AUTO-GENERATED DOCUMENTATION AND METHOD
|
3112 | 3184 | /**
|
3113 | 3185 | * Sets the access control policy for a resource. Replaces any existing policy. Supported
|
@@ -3171,6 +3243,73 @@ public final UnaryCallable<SetIamPolicyRequest, Policy> setIamPolicyCallable() {
|
3171 | 3243 | return stub.setIamPolicyCallable();
|
3172 | 3244 | }
|
3173 | 3245 |
|
| 3246 | + // AUTO-GENERATED DOCUMENTATION AND METHOD |
| 3247 | + /** |
| 3248 | + * Gets the access control policy for a resource. A `NOT_FOUND` error is returned if the resource |
| 3249 | + * does not exist. An empty policy is returned if the resource exists but does not have a policy |
| 3250 | + * set on it. |
| 3251 | + * |
| 3252 | + * <p>Supported resources are: - Tag templates. - Entries. - Entry groups. Note, this method |
| 3253 | + * cannot be used to manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform |
| 3254 | + * resources synced to Data Catalog. |
| 3255 | + * |
| 3256 | + * <p>Callers must have following Google IAM permission - `datacatalog.tagTemplates.getIamPolicy` |
| 3257 | + * to get policies on tag templates. - `datacatalog.entries.getIamPolicy` to get policies on |
| 3258 | + * entries. - `datacatalog.entryGroups.getIamPolicy` to get policies on entry groups. |
| 3259 | + * |
| 3260 | + * <p>Sample code: |
| 3261 | + * |
| 3262 | + * <pre><code> |
| 3263 | + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { |
| 3264 | + * ResourceName resource = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]"); |
| 3265 | + * Policy response = dataCatalogClient.getIamPolicy(resource); |
| 3266 | + * } |
| 3267 | + * </code></pre> |
| 3268 | + * |
| 3269 | + * @param resource REQUIRED: The resource for which the policy is being requested. See the |
| 3270 | + * operation documentation for the appropriate value for this field. |
| 3271 | + * @throws com.google.api.gax.rpc.ApiException if the remote call fails |
| 3272 | + */ |
| 3273 | + public final Policy getIamPolicy(ResourceName resource) { |
| 3274 | + GetIamPolicyRequest request = |
| 3275 | + GetIamPolicyRequest.newBuilder() |
| 3276 | + .setResource(resource == null ? null : resource.toString()) |
| 3277 | + .build(); |
| 3278 | + return getIamPolicy(request); |
| 3279 | + } |
| 3280 | + |
| 3281 | + // AUTO-GENERATED DOCUMENTATION AND METHOD |
| 3282 | + /** |
| 3283 | + * Gets the access control policy for a resource. A `NOT_FOUND` error is returned if the resource |
| 3284 | + * does not exist. An empty policy is returned if the resource exists but does not have a policy |
| 3285 | + * set on it. |
| 3286 | + * |
| 3287 | + * <p>Supported resources are: - Tag templates. - Entries. - Entry groups. Note, this method |
| 3288 | + * cannot be used to manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform |
| 3289 | + * resources synced to Data Catalog. |
| 3290 | + * |
| 3291 | + * <p>Callers must have following Google IAM permission - `datacatalog.tagTemplates.getIamPolicy` |
| 3292 | + * to get policies on tag templates. - `datacatalog.entries.getIamPolicy` to get policies on |
| 3293 | + * entries. - `datacatalog.entryGroups.getIamPolicy` to get policies on entry groups. |
| 3294 | + * |
| 3295 | + * <p>Sample code: |
| 3296 | + * |
| 3297 | + * <pre><code> |
| 3298 | + * try (DataCatalogClient dataCatalogClient = DataCatalogClient.create()) { |
| 3299 | + * ResourceName resource = EntryName.of("[PROJECT]", "[LOCATION]", "[ENTRY_GROUP]", "[ENTRY]"); |
| 3300 | + * Policy response = dataCatalogClient.getIamPolicy(resource.toString()); |
| 3301 | + * } |
| 3302 | + * </code></pre> |
| 3303 | + * |
| 3304 | + * @param resource REQUIRED: The resource for which the policy is being requested. See the |
| 3305 | + * operation documentation for the appropriate value for this field. |
| 3306 | + * @throws com.google.api.gax.rpc.ApiException if the remote call fails |
| 3307 | + */ |
| 3308 | + public final Policy getIamPolicy(String resource) { |
| 3309 | + GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); |
| 3310 | + return getIamPolicy(request); |
| 3311 | + } |
| 3312 | + |
3174 | 3313 | // AUTO-GENERATED DOCUMENTATION AND METHOD
|
3175 | 3314 | /**
|
3176 | 3315 | * Gets the access control policy for a resource. A `NOT_FOUND` error is returned if the resource
|
|
0 commit comments