@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);
 }
コード例 #2
0
 /**
  * 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.");
 }
コード例 #3
0
ファイル: Smartcanvas.java プロジェクト: smartcanvas/java-sdk
 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;
 }
コード例 #4
0
 /**
  * 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.");
 }
コード例 #5
0
 /**
  * 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.");
 }
コード例 #6
0
ファイル: JokeApi.java プロジェクト: ngaruko/BuildItBigger
 /**
  * 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.");
 }
コード例 #7
0
 /**
  * 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.");
 }
コード例 #8
0
 /**
  * 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.");
 }
コード例 #9
0
ファイル: Nodeendpoint.java プロジェクト: ufoe/gpsTracker-3
 /**
  * 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.");
 }
コード例 #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.");
 }
コード例 #11
0
ファイル: JokeApi.java プロジェクト: ngaruko/BuildItBigger
 /**
  * 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.");
 }
コード例 #12
0
 /**
  * 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.");
 }
コード例 #13
0
 /**
  * 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.");
 }
コード例 #14
0
 /**
  * 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.");
 }
コード例 #15
0
 /**
  * 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.");
 }
コード例 #16
0
 /**
  * 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.");
 }
コード例 #17
0
    @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);
 }
コード例 #19
0
 /**
  * @param methodName request method name
  * @param uri URI
  */
 public HttpExtensionMethod(String methodName, String uri) {
   this.methodName = Preconditions.checkNotNull(methodName);
   setURI(URI.create(uri));
 }
コード例 #20
0
 /**
  * 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.");
 }
コード例 #21
0
 /**
  * Sets the sleeper.
  *
  * <p>The default value is {@link Sleeper#DEFAULT}.
  */
 @VisibleForTesting
 final void setSleeper(@Nonnull Sleeper sleeper) {
   mSleeper = Preconditions.checkNotNull(sleeper);
 }
コード例 #22
0
 /**
  * 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.");
 }
コード例 #23
0
 /**
  * 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;
 }
コード例 #24
0
 /**
  * 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.");
 }
コード例 #25
0
 /**
  * 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);
 }
コード例 #26
0
ファイル: JsonObjectParser.java プロジェクト: amithbm/cbskeep
 public Builder(JsonFactory paramJsonFactory) {
   jsonFactory = ((JsonFactory) Preconditions.checkNotNull(paramJsonFactory));
 }
コード例 #27
0
 /**
  * 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;
 }