congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
CloudResourceManager$Projects.getIamPolicy
Code IndexAdd Tabnine to your IDE (free)

How to use
getIamPolicy
method
in
com.google.api.services.cloudresourcemanager.CloudResourceManager$Projects

Best Java code snippets using com.google.api.services.cloudresourcemanager.CloudResourceManager$Projects.getIamPolicy (Showing top 4 results out of 315)

origin: spotify/styx

private Optional<com.google.api.services.cloudresourcemanager.model.Policy> getProjectPolicy(String projectId) {
 try {
  return retry(() -> Optional.of(crm.projects()
    .getIamPolicy(projectId, new GetIamPolicyRequest())
    .execute()));
 } catch (ExecutionException e) {
  final Throwable cause = e.getCause();
  if (cause instanceof GoogleJsonResponseException
    && ((GoogleJsonResponseException) cause).getStatusCode() == 404) {
   return Optional.empty();
  }
  throw new RuntimeException(e);
 } catch (RetryException e) {
  throw new RuntimeException(e);
 }
}
origin: GoogleCloudPlatform/google-cloud-intellij

private void setupMockResourceManagerClient() throws IOException {
 when(resourceManager.projects()).thenReturn(resourceManagerProjects);
 when(resourceManagerProjects.getIamPolicy(anyString(), any())).thenReturn(getIamPolicy);
 when(getIamPolicy.execute()).thenReturn(policy);
 when(resourceManagerProjects.setIamPolicy(anyString(), any())).thenReturn(setIamPolicy);
}
origin: GoogleCloudPlatform/google-cloud-intellij

  resourceManager
    .projects()
    .getIamPolicy(cloudProject.projectId(), new GetIamPolicyRequest())
    .execute();
List<Binding> bindings = Lists.newArrayList(existingPolicy.getBindings());
origin: googleapis/google-cloud-java

@Override
public Policy getPolicy(String projectId) throws ResourceManagerException {
 try {
  return resourceManager
    .projects()
    .getIamPolicy(projectId, new GetIamPolicyRequest())
    .execute();
 } catch (IOException ex) {
  ResourceManagerException translated = translate(ex);
  if (translated.getCode() == HTTP_FORBIDDEN) {
   // Service returns permission denied if policy doesn't exist.
   return null;
  } else {
   throw translated;
  }
 }
}
com.google.api.services.cloudresourcemanagerCloudResourceManager$ProjectsgetIamPolicy

Popular methods of CloudResourceManager$Projects

  • list
  • get
  • setIamPolicy
  • delete
  • create
  • getAncestry
  • testIamPermissions
  • undelete
  • update

Popular in Java

  • Start an intent from android
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getExternalFilesDir (Context)
  • putExtra (Intent)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now