@VisibleForTesting
 RefreshingOAuth2CredentialsInterceptor(
     ExecutorService scheduler,
     OAuth2Credentials credentials,
     RetryOptions retryOptions,
     Logger logger) {
   this.executor = Preconditions.checkNotNull(scheduler);
   this.credentials = Preconditions.checkNotNull(credentials);
   this.retryOptions = Preconditions.checkNotNull(retryOptions);
   this.logger = Preconditions.checkNotNull(logger);
 }
 /**
  * Create a request for the method "getNewsClassification".
  *
  * <p>This request holds the parameters needed by the the extractApi server. After setting any
  * optional parameters, call the {@link GetNewsClassification#execute()} method to invoke the
  * remote operation.
  *
  * <p>{@link GetNewsClassification#initialize(com.google.api.client.googleapis.
  * services.AbstractGoogleClientRequest)} must be called to initialize this instance immediately
  * after invoking the constructor.
  *
  * @param content
  * @param title
  * @since 1.13
  */
 protected GetNewsClassification(java.lang.String content, java.lang.String title) {
   super(
       ExtractApi.this,
       "GET",
       REST_PATH,
       null,
       com.example.backend.extractApi.model.NewsClassification.class);
   this.content =
       com.google.api.client.util.Preconditions.checkNotNull(
           content, "Required parameter content must be specified.");
   this.title =
       com.google.api.client.util.Preconditions.checkNotNull(
           title, "Required parameter title must be specified.");
 }
Beispiel #3
0
 public Smartcanvas(
     HttpTransport httpTransport,
     JsonFactory jsonFactory,
     String clientId,
     String clientSecret,
     boolean useSandbox)
     throws JoseException {
   super();
   this.transport =
       Preconditions.checkNotNull(
           httpTransport, "Required parameter httpTransport must be specified.");
   this.jsonFactory =
       Preconditions.checkNotNull(
           jsonFactory, "Required parameter jsonFactory must be specified.");
   this.authInitializer = new SmartcanvasAuthentication(clientId, clientSecret, null);
   this.useSandbox = useSandbox;
 }
 /**
  * Create a request for the method "getOferta".
  *
  * <p>This request holds the parameters needed by the the ofertaendpoint server. After setting
  * any optional parameters, call the {@link GetOferta#execute()} method to invoke the remote
  * operation.
  *
  * <p>{@link
  * GetOferta#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
  * must be called to initialize this instance immediately after invoking the constructor.
  *
  * @param id
  * @since 1.13
  */
 protected GetOferta(java.lang.Long id) {
   super(
       Ofertaendpoint.this,
       "GET",
       REST_PATH,
       null,
       com.jtristan.reservarestaurantev2.entidades.ofertaendpoint.model.Oferta.class);
   this.id =
       com.google.api.client.util.Preconditions.checkNotNull(
           id, "Required parameter id must be specified.");
 }
 /**
  * Create a request for the method "greetings.getGreeting".
  *
  * <p>This request holds the parameters needed by the the gear server. After setting any
  * optional parameters, call the {@link GetGreeting#execute()} method to invoke the remote
  * operation.
  *
  * <p>{@link
  * GetGreeting#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
  * must be called to initialize this instance immediately after invoking the constructor.
  *
  * @param id
  * @since 1.13
  */
 protected GetGreeting(java.lang.Integer id) {
   super(
       Gear.this,
       "GET",
       REST_PATH,
       null,
       com.appspot.backendgear_1121.gear.model.GearBackendGreeting.class);
   this.id =
       com.google.api.client.util.Preconditions.checkNotNull(
           id, "Required parameter id must be specified.");
 }
Beispiel #6
0
 /**
  * Create a request for the method "grabJoke".
  *
  * <p>This request holds the parameters needed by the the jokeApi server. After setting any
  * optional parameters, call the {@link GrabJoke#execute()} method to invoke the remote
  * operation.
  *
  * <p>{@link
  * GrabJoke#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
  * must be called to initialize this instance immediately after invoking the constructor.
  *
  * @param joke
  * @since 1.13
  */
 protected GrabJoke(java.lang.String joke) {
   super(
       JokeApi.this,
       "POST",
       REST_PATH,
       null,
       com.udacity.gradle.builditbigger.backend.jokeApi.model.Joke.class);
   this.joke =
       com.google.api.client.util.Preconditions.checkNotNull(
           joke, "Required parameter joke must be specified.");
 }
 /**
  * Create a request for the method "getLunchDate".
  *
  * <p>This request holds the parameters needed by the the lunchdateendpoint server. After
  * setting any optional parameters, call the {@link GetLunchDate#execute()} method to invoke the
  * remote operation.
  *
  * <p>{@link
  * GetLunchDate#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
  * must be called to initialize this instance immediately after invoking the constructor.
  *
  * @param id
  * @since 1.13
  */
 protected GetLunchDate(java.lang.Long id) {
   super(
       Lunchdateendpoint.this,
       "GET",
       REST_PATH,
       null,
       com.linkedlunchbuddy.lunchdateendpoint.model.LunchDate.class);
   this.id =
       com.google.api.client.util.Preconditions.checkNotNull(
           id, "Required parameter id must be specified.");
 }
 /**
  * Create a request for the method "get".
  *
  * <p>This request holds the parameters needed by the the litterTypeApi server. After setting
  * any optional parameters, call the {@link Get#execute()} method to invoke the remote
  * operation.
  *
  * <p>{@link
  * Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
  * be called to initialize this instance immediately after invoking the constructor.
  *
  * @param id
  * @since 1.13
  */
 protected Get(java.lang.Long id) {
   super(
       LitterTypeApi.this,
       "GET",
       REST_PATH,
       null,
       uk.ac.bristol.littermappingtool.backend.litterTypeApi.model.LitterType.class);
   this.id =
       com.google.api.client.util.Preconditions.checkNotNull(
           id, "Required parameter id must be specified.");
 }
Beispiel #9
0
 /**
  * Create a request for the method "getNode".
  *
  * <p>This request holds the parameters needed by the the nodeendpoint server. After setting any
  * optional parameters, call the {@link GetNode#execute()} method to invoke the remote
  * operation.
  *
  * <p>{@link
  * GetNode#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
  * must be called to initialize this instance immediately after invoking the constructor.
  *
  * @param id
  * @since 1.13
  */
 protected GetNode(java.lang.Long id) {
   super(
       Nodeendpoint.this,
       "GET",
       REST_PATH,
       null,
       edu.vt.bmac.gpstracker.nodeendpoint.model.Node.class);
   this.id =
       com.google.api.client.util.Preconditions.checkNotNull(
           id, "Required parameter id must be specified.");
 }
Beispiel #10
0
 /**
  * Create a request for the method "getQuote".
  *
  * <p>This request holds the parameters needed by the the quoteendpoint server. After setting
  * any optional parameters, call the {@link GetQuote#execute()} method to invoke the remote
  * operation.
  *
  * <p>{@link
  * GetQuote#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
  * must be called to initialize this instance immediately after invoking the constructor.
  *
  * @param id
  * @since 1.13
  */
 protected GetQuote(java.lang.Long id) {
   super(
       Quoteendpoint.this,
       "GET",
       REST_PATH,
       null,
       com.protips6.entity.quoteendpoint.model.Quote.class);
   this.id =
       com.google.api.client.util.Preconditions.checkNotNull(
           id, "Required parameter id must be specified.");
 }
Beispiel #11
0
 /**
  * Create a request for the method "getJoke".
  *
  * <p>This request holds the parameters needed by the the jokeApi server. After setting any
  * optional parameters, call the {@link GetJoke#execute()} method to invoke the remote
  * operation.
  *
  * <p>{@link
  * GetJoke#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
  * must be called to initialize this instance immediately after invoking the constructor.
  *
  * @param id
  * @since 1.13
  */
 protected GetJoke(java.lang.Long id) {
   super(
       JokeApi.this,
       "GET",
       REST_PATH,
       null,
       com.udacity.gradle.builditbigger.backend.jokeApi.model.Joke.class);
   this.id =
       com.google.api.client.util.Preconditions.checkNotNull(
           id, "Required parameter id must be specified.");
 }
 /**
  * Create a request for the method "getGossipMessage".
  *
  * <p>This request holds the parameters needed by the the gossipmessageendpoint server. After
  * setting any optional parameters, call the {@link GetGossipMessage#execute()} method to invoke
  * the remote operation.
  *
  * <p>{@link GetGossipMessage#initialize(com.google.api.client.googleapis.s
  * ervices.AbstractGoogleClientRequest)} must be called to initialize this instance immediately
  * after invoking the constructor.
  *
  * @param id
  * @since 1.13
  */
 protected GetGossipMessage(java.lang.Long id) {
   super(
       Gossipmessageendpoint.this,
       "GET",
       REST_PATH,
       null,
       com.horsepowerx.gossip.gossipmessageendpoint.model.GossipMessage.class);
   this.id =
       com.google.api.client.util.Preconditions.checkNotNull(
           id, "Required parameter id must be specified.");
 }
 /**
  * Create a request for the method "getEmployee".
  *
  * <p>This request holds the parameters needed by the the employeeendpoint server. After setting
  * any optional parameters, call the {@link GetEmployee#execute()} method to invoke the remote
  * operation.
  *
  * <p>{@link
  * GetEmployee#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
  * must be called to initialize this instance immediately after invoking the constructor.
  *
  * @param email
  * @since 1.13
  */
 protected GetEmployee(java.lang.String email) {
   super(
       Employeeendpoint.this,
       "GET",
       REST_PATH,
       null,
       com.blw.employeeendpoint.model.Employee.class);
   this.email =
       com.google.api.client.util.Preconditions.checkNotNull(
           email, "Required parameter email must be specified.");
 }
 /**
  * Create a request for the method "extractUrl".
  *
  * <p>This request holds the parameters needed by the the extractApi server. After setting any
  * optional parameters, call the {@link ExtractUrl#execute()} method to invoke the remote
  * operation.
  *
  * <p>{@link
  * ExtractUrl#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
  * must be called to initialize this instance immediately after invoking the constructor.
  *
  * @param url
  * @since 1.13
  */
 protected ExtractUrl(java.lang.String url) {
   super(
       ExtractApi.this,
       "GET",
       REST_PATH,
       null,
       com.example.backend.extractApi.model.ExtractedNewsObject.class);
   this.url =
       com.google.api.client.util.Preconditions.checkNotNull(
           url, "Required parameter url must be specified.");
 }
 /**
  * Create a request for the method "greetings.multiply".
  *
  * <p>This request holds the parameters needed by the the gear server. After setting any
  * optional parameters, call the {@link Multiply#execute()} method to invoke the remote
  * operation.
  *
  * <p>{@link
  * Multiply#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
  * must be called to initialize this instance immediately after invoking the constructor.
  *
  * @param times
  * @param content the {@link com.appspot.backendgear_1121.gear.model.GearBackendGreeting}
  * @since 1.13
  */
 protected Multiply(
     java.lang.Integer times,
     com.appspot.backendgear_1121.gear.model.GearBackendGreeting content) {
   super(
       Gear.this,
       "POST",
       REST_PATH,
       content,
       com.appspot.backendgear_1121.gear.model.GearBackendGreeting.class);
   this.times =
       com.google.api.client.util.Preconditions.checkNotNull(
           times, "Required parameter times must be specified.");
 }
 /**
  * Create a request for the method "updateEmployee".
  *
  * <p>This request holds the parameters needed by the the employeeendpoint server. After setting
  * any optional parameters, call the {@link UpdateEmployee#execute()} method to invoke the
  * remote operation.
  *
  * <p>{@link UpdateEmployee#initialize(com.google.api.client.googleapis.services.Abstr
  * actGoogleClientRequest)} must be called to initialize this instance immediately after
  * invoking the constructor.
  *
  * @param firstName
  * @param lastName
  * @param phoneNumber
  * @param cellNumber
  * @param email
  * @param idNumber
  * @param country
  * @param city
  * @since 1.13
  */
 protected UpdateEmployee(
     java.lang.String firstName,
     java.lang.String lastName,
     java.lang.String phoneNumber,
     java.lang.String cellNumber,
     java.lang.String email,
     java.lang.String idNumber,
     java.lang.String country,
     java.lang.String city) {
   super(
       Employeeendpoint.this,
       "PUT",
       REST_PATH,
       null,
       com.blw.employeeendpoint.model.Employee.class);
   this.firstName =
       com.google.api.client.util.Preconditions.checkNotNull(
           firstName, "Required parameter firstName must be specified.");
   this.lastName =
       com.google.api.client.util.Preconditions.checkNotNull(
           lastName, "Required parameter lastName must be specified.");
   this.phoneNumber =
       com.google.api.client.util.Preconditions.checkNotNull(
           phoneNumber, "Required parameter phoneNumber must be specified.");
   this.cellNumber =
       com.google.api.client.util.Preconditions.checkNotNull(
           cellNumber, "Required parameter cellNumber must be specified.");
   this.email =
       com.google.api.client.util.Preconditions.checkNotNull(
           email, "Required parameter email must be specified.");
   this.idNumber =
       com.google.api.client.util.Preconditions.checkNotNull(
           idNumber, "Required parameter idNumber must be specified.");
   this.country =
       com.google.api.client.util.Preconditions.checkNotNull(
           country, "Required parameter country must be specified.");
   this.city =
       com.google.api.client.util.Preconditions.checkNotNull(
           city, "Required parameter city must be specified.");
 }
    @Override
    public DynamicSplitResult requestDynamicSplit(DynamicSplitRequest splitRequest) {
      checkNotNull(splitRequest);

      com.google.api.services.dataflow.model.Position splitPosition =
          splitRequestToApproximateSplitRequest(splitRequest).getPosition();
      if (splitPosition == null) {
        LOG.warn("InMemoryReader only supports split at a Position. Requested: {}", splitRequest);
        return null;
      }

      Long splitIndex = splitPosition.getRecordIndex();
      if (splitIndex == null) {
        LOG.warn(
            "InMemoryReader only supports split at a record index. Requested: {}", splitPosition);
        return null;
      }

      if (!tracker.trySplitAtPosition(splitIndex)) {
        return null;
      }
      return new DynamicSplitResultWithPosition(cloudPositionToReaderPosition(splitPosition));
    }
 /**
  * @param content streaming content
  * @param encoding HTTP encoding
  */
 public HttpEncodingStreamingContent(StreamingContent content, HttpEncoding encoding) {
   this.content = Preconditions.checkNotNull(content);
   this.encoding = Preconditions.checkNotNull(encoding);
 }
 /**
  * @param methodName request method name
  * @param uri URI
  */
 public HttpExtensionMethod(String methodName, String uri) {
   this.methodName = Preconditions.checkNotNull(methodName);
   setURI(URI.create(uri));
 }
 /**
  * Create a request for the method "removeEmployee".
  *
  * <p>This request holds the parameters needed by the the employeeendpoint server. After setting
  * any optional parameters, call the {@link RemoveEmployee#execute()} method to invoke the
  * remote operation.
  *
  * <p>{@link RemoveEmployee#initialize(com.google.api.client.googleapis.services.Abstr
  * actGoogleClientRequest)} must be called to initialize this instance immediately after
  * invoking the constructor.
  *
  * @param email
  * @since 1.13
  */
 protected RemoveEmployee(java.lang.String email) {
   super(Employeeendpoint.this, "DELETE", REST_PATH, null, Void.class);
   this.email =
       com.google.api.client.util.Preconditions.checkNotNull(
           email, "Required parameter email must be specified.");
 }
 /**
  * Sets the sleeper.
  *
  * <p>The default value is {@link Sleeper#DEFAULT}.
  */
 @VisibleForTesting
 final void setSleeper(@Nonnull Sleeper sleeper) {
   mSleeper = Preconditions.checkNotNull(sleeper);
 }
 /**
  * Create a request for the method "removeGossipMessage".
  *
  * <p>This request holds the parameters needed by the the gossipmessageendpoint server. After
  * setting any optional parameters, call the {@link RemoveGossipMessage#execute()} method to
  * invoke the remote operation.
  *
  * <p>{@link RemoveGossipMessage#initialize(com.google.api.client.go
  * ogleapis.services.AbstractGoogleClientRequest)} must be called to initialize this instance
  * immediately after invoking the constructor.
  *
  * @param id
  * @since 1.13
  */
 protected RemoveGossipMessage(java.lang.Long id) {
   super(Gossipmessageendpoint.this, "DELETE", REST_PATH, null, Void.class);
   this.id =
       com.google.api.client.util.Preconditions.checkNotNull(
           id, "Required parameter id must be specified.");
 }
 /**
  * Sets the HTTP content.
  *
  * <p>Default value is an empty byte array.
  *
  * @since 1.5
  */
 public MockHttpContent setContent(byte[] content) {
   this.content = Preconditions.checkNotNull(content);
   return this;
 }
 /**
  * Create a request for the method "messagingEndpoint.sendMessage".
  *
  * <p>This request holds the parameters needed by the the messaging server. After setting any
  * optional parameters, call the {@link SendMessage#execute()} method to invoke the remote
  * operation.
  *
  * <p>{@link
  * SendMessage#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
  * must be called to initialize this instance immediately after invoking the constructor.
  *
  * @param message
  * @since 1.13
  */
 protected SendMessage(java.lang.String message) {
   super(Messaging.this, "POST", REST_PATH, null, Void.class);
   this.message =
       com.google.api.client.util.Preconditions.checkNotNull(
           message, "Required parameter message must be specified.");
 }
 /**
  * Constructs a new instance from a {@link BackOffRequired} and a {@link BackOff}.
  *
  * <p>When using this constructor, be aware that {@link BackOff} should be used for only one
  * request as the Google library doesn't reset it anymore. The only exception is when either
  * {@link BackOff} and {@link BackOffRequired} are stateless.
  *
  * @param backOffRequired The {@link BackOffRequired}
  * @param backOff back-off policy
  */
 public DefaultBackOffUnsuccessfulResponseHandler(
     @Nonnull BackOffRequired backOffRequired, @Nonnull BackOff backOff) {
   mBackOffRequired = Preconditions.checkNotNull(backOffRequired);
   mBackOff = Preconditions.checkNotNull(backOff);
 }
Beispiel #26
0
 public Builder(JsonFactory paramJsonFactory) {
   jsonFactory = ((JsonFactory) Preconditions.checkNotNull(paramJsonFactory));
 }
 /**
  * Sets the clock.
  *
  * <p>Overriding is only supported for the purpose of calling the super implementation and
  * changing the return type, but nothing else.
  */
 public Builder setClock(Clock clock) {
   this.clock = Preconditions.checkNotNull(clock);
   return this;
 }