Tabnine Logo
com.google.cloud
Code IndexAdd Tabnine to your IDE (free)

How to use com.google.cloud

Best Java code snippets using com.google.cloud (Showing top 20 results out of 315)

origin: googleapis/google-cloud-java

public static ExceptionData from(
  int code, String message, String reason, boolean retryable, Throwable cause) {
 return newBuilder()
   .setCode(code)
   .setMessage(message)
   .setReason(reason)
   .setRetryable(retryable)
   .setCause(cause)
   .build();
}
origin: googleapis/google-cloud-java

public static ExceptionHandler build() {
 return ExceptionHandler.newBuilder()
   .abortOn(RuntimeException.class)
   .addInterceptors(
     DatastoreImpl.EXCEPTION_HANDLER_INTERCEPTOR, TRANSACTION_EXCEPTION_HANDLER_INTERCEPTOR)
   .build();
}
origin: googleapis/google-cloud-java

/** Creates a {@code MonitoredResource} object given the resource's type and labels. */
public static MonitoredResource of(String type, Map<String, String> labels) {
 return newBuilder(type).setLabels(labels).build();
}
origin: googleapis/google-cloud-java

static Policy convertFromApiPolicy(com.google.api.services.storage.model.Policy apiPolicy) {
 Policy.Builder policyBuilder = Policy.newBuilder();
 for (Bindings binding : apiPolicy.getBindings()) {
  for (String member : binding.getMembers()) {
   policyBuilder.addIdentity(Role.of(binding.getRole()), Identity.valueOf(member));
  }
 }
 return policyBuilder.setEtag(apiPolicy.getEtag()).build();
}
origin: googleapis/google-cloud-java

public CustomServiceException(int code, String message, String reason, boolean idempotent) {
 super(
   ExceptionData.from(
     code,
     message,
     reason,
     BaseServiceException.isRetryable(code, reason, idempotent, RETRYABLE_ERRORS)));
}
origin: googleapis/google-cloud-java

@Test
public void testToAndFromPb() {
 compareResourceDescriptor(
   RESOURCE_DESCRIPTOR, MonitoredResourceDescriptor.fromPb(RESOURCE_DESCRIPTOR.toPb()));
 MonitoredResourceDescriptor resourceDescriptor =
   MonitoredResourceDescriptor.newBuilder(TYPE).build();
 compareResourceDescriptor(
   resourceDescriptor, MonitoredResourceDescriptor.fromPb(resourceDescriptor.toPb()));
}
origin: googleapis/google-cloud-java

 /** Return the known values for LegacySQLTypeName. */
 public static LegacySQLTypeName[] values() {
  return type.values();
 }
}
origin: googleapis/google-cloud-java

/**
 * Get the Type for the given String constant, and throw an exception if the constant is not
 * recognized.
 */
public static Type valueOfStrict(String constant) {
 return type.valueOfStrict(constant);
}
origin: googleapis/google-cloud-java

@Override
public void close() throws IOException {
 synchronized (this) {
  channel.close();
 }
}
origin: googleapis/google-cloud-java

/**
 * Returns the editor role. Encapsulates all viewer's permissions and permissions for actions that
 * modify the state of a resource.
 *
 * @see <a href="https://cloud.google.com/iam/docs/understanding-roles">Understanding Roles</a>
 */
public static Role editor() {
 return of("editor");
}
origin: googleapis/google-cloud-java

@Override
public void close() throws IOException {
 synchronized (this) {
  channel.close();
 }
}
origin: googleapis/google-cloud-java

/** Sets a result and status as completed. Notifies all callbacks. */
protected void success(T result) {
 this.result = result;
 this.completed = true;
 for (Callback<T, E> callback : toBeNotified) {
  callback.success(result);
 }
}
origin: googleapis/google-cloud-java

 @Override
 public Identity apply(String identityPb) {
  return Identity.valueOf(identityPb);
 }
};
origin: googleapis/google-cloud-java

 @Override
 public LabelDescriptor apply(com.google.api.LabelDescriptor descriptorPb) {
  return fromPb(descriptorPb);
 }
};
origin: googleapis/google-cloud-java

/**
 * Sets the project ID. If no project ID is set, {@link #getDefaultProjectId()} will be used to
 * attempt getting the project ID from the environment.
 *
 * @return the builder
 */
public B setProjectId(String projectId) {
 this.projectId = projectId;
 return self();
}
origin: googleapis/google-cloud-java

 @Override
 public Letter apply(String constant) {
  return new Letter(constant);
 }
};
origin: googleapis/google-cloud-java

 /** Return the known values for Operator. */
 static Operator[] values() {
  return type.values();
 }
}
origin: googleapis/google-cloud-java

/**
 * Get the Operator for the given String constant, and throw an exception if the constant is
 * not recognized.
 */
static Operator valueOfStrict(String constant) {
 return type.valueOfStrict(constant);
}
origin: googleapis/google-cloud-java

/**
 * Returns the owner role. Encapsulates all editor's permissions and permissions to manage access
 * control for a resource or manage the billing options for a project.
 *
 * @see <a href="https://cloud.google.com/iam/docs/understanding-roles">Understanding Roles</a>
 */
public static Role owner() {
 return of("owner");
}
origin: googleapis/google-cloud-java

/**
 * Sets configuration parameters for request retries.
 *
 * @return the builder
 */
public B setRetrySettings(RetrySettings retrySettings) {
 this.retrySettings = retrySettings;
 return self();
}
com.google.cloud

Most used classes

  • ServiceOptions
    Abstract class representing service options.
  • Storage
    An interface for Google Cloud Storage.
  • StorageOptions
  • BaseServiceException
    Base class for all service exceptions.
  • RetryHelper$RetryHelperException
  • StorageOptions$Builder,
  • BlobInfo,
  • Bucket,
  • Blob,
  • BlobInfo$Builder,
  • NoCredentials,
  • Datastore,
  • Entity,
  • RetryHelper,
  • BigtableConfiguration,
  • HttpTransportOptions,
  • IntegratedGoogleLoginService,
  • PageImpl,
  • BigQuery
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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