Skip to content

Commit d67a3ce

Browse files
1 parent a15708f commit d67a3ce

11 files changed

Lines changed: 1013 additions & 32 deletions

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Device Run API Client Library for Java
2+
3+
The Device Run API allows management, scheduling, and execution of automated sessions and workloads across device catalogs.
4+
5+
This page contains information about getting started with the Device Run API
6+
using the Google API Client Library for Java. In addition, you may be interested
7+
in the following documentation:
8+
9+
* Browse the [Javadoc reference for the Device Run API][javadoc]
10+
* Read the [Developer's Guide for the Google API Client Library for Java][google-api-client].
11+
* Interact with this API in your browser using the [APIs Explorer for the Device Run API][api-explorer]
12+
13+
## Installation
14+
15+
### Maven
16+
17+
Add the following lines to your `pom.xml` file:
18+
19+
```xml
20+
<project>
21+
<dependencies>
22+
<dependency>
23+
<groupId>com.google.apis</groupId>
24+
<artifactId>google-api-services-devicerun</artifactId>
25+
<version>v1-rev20261019-2.9.2</version>
26+
</dependency>
27+
</dependencies>
28+
</project>
29+
```
30+
31+
### Gradle
32+
33+
```gradle
34+
repositories {
35+
mavenCentral()
36+
}
37+
dependencies {
38+
implementation 'com.google.apis:google-api-services-devicerun:v1-rev20261019-2.9.2'
39+
}
40+
```
41+
42+
[javadoc]: https://googleapis.dev/java/google-api-services-devicerun/latest/index.html
43+
[google-api-client]: https://github.com/googleapis/google-api-java-client/
44+
[api-explorer]: https://developers.google.com/apis-explorer/#p/devicerun/v1/
Lines changed: 259 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,259 @@
1+
/*
2+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
3+
* in compliance with the License. You may obtain a copy of the License at
4+
*
5+
* http://www.apache.org/licenses/LICENSE-2.0
6+
*
7+
* Unless required by applicable law or agreed to in writing, software distributed under the License
8+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
9+
* or implied. See the License for the specific language governing permissions and limitations under
10+
* the License.
11+
*/
12+
/*
13+
* This code was generated by https://github.com/googleapis/google-api-java-client-services/
14+
* Modify at your own risk.
15+
*/
16+
17+
package com.google.api.services.devicerun.v1;
18+
19+
/**
20+
* Service definition for DeviceRun (v1).
21+
*
22+
* <p>
23+
* The Device Run API allows management, scheduling, and execution of automated sessions and workloads across device catalogs.
24+
* </p>
25+
*
26+
* <p>
27+
* For more information about this service, see the
28+
* <a href="https://docs.cloud.google.com/developer-device-platform/device-run" target="_blank">API Documentation</a>
29+
* </p>
30+
*
31+
* <p>
32+
* This service uses {@link DeviceRunRequestInitializer} to initialize global parameters via its
33+
* {@link Builder}.
34+
* </p>
35+
*
36+
* @since 1.3
37+
* @author Google, Inc.
38+
*/
39+
@SuppressWarnings("javadoc")
40+
public class DeviceRun extends com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient {
41+
42+
// Note: Leave this static initializer at the top of the file.
43+
static {
44+
com.google.api.client.util.Preconditions.checkState(
45+
(com.google.api.client.googleapis.GoogleUtils.MAJOR_VERSION == 1 &&
46+
(com.google.api.client.googleapis.GoogleUtils.MINOR_VERSION >= 32 ||
47+
(com.google.api.client.googleapis.GoogleUtils.MINOR_VERSION == 31 &&
48+
com.google.api.client.googleapis.GoogleUtils.BUGFIX_VERSION >= 1))) ||
49+
com.google.api.client.googleapis.GoogleUtils.MAJOR_VERSION >= 2,
50+
"You are currently running with version %s of google-api-client. " +
51+
"You need at least version 1.31.1 of google-api-client to run version " +
52+
"2.9.2 of the Device Run API library.", com.google.api.client.googleapis.GoogleUtils.VERSION);
53+
}
54+
55+
/**
56+
* The default encoded root URL of the service. This is determined when the library is generated
57+
* and normally should not be changed.
58+
*
59+
* @since 1.7
60+
*/
61+
public static final String DEFAULT_ROOT_URL = "https://devicerun.googleapis.com/";
62+
63+
/**
64+
* The default encoded mTLS root URL of the service. This is determined when the library is generated
65+
* and normally should not be changed.
66+
*
67+
* @since 1.31
68+
*/
69+
public static final String DEFAULT_MTLS_ROOT_URL = "https://devicerun.mtls.googleapis.com/";
70+
71+
/**
72+
* The default encoded service path of the service. This is determined when the library is
73+
* generated and normally should not be changed.
74+
*
75+
* @since 1.7
76+
*/
77+
public static final String DEFAULT_SERVICE_PATH = "";
78+
79+
/**
80+
* The default encoded batch path of the service. This is determined when the library is
81+
* generated and normally should not be changed.
82+
*
83+
* @since 1.23
84+
*/
85+
public static final String DEFAULT_BATCH_PATH = "batch";
86+
87+
/**
88+
* The default encoded base URL of the service. This is determined when the library is generated
89+
* and normally should not be changed.
90+
*/
91+
public static final String DEFAULT_BASE_URL = DEFAULT_ROOT_URL + DEFAULT_SERVICE_PATH;
92+
93+
/**
94+
* Constructor.
95+
*
96+
* <p>
97+
* Use {@link Builder} if you need to specify any of the optional parameters.
98+
* </p>
99+
*
100+
* @param transport HTTP transport, which should normally be:
101+
* <ul>
102+
* <li>Google App Engine:
103+
* {@code com.google.api.client.extensions.appengine.http.UrlFetchTransport}</li>
104+
* <li>Android: {@code newCompatibleTransport} from
105+
* {@code com.google.api.client.extensions.android.http.AndroidHttp}</li>
106+
* <li>Java: {@code com.google.api.client.http.javanet.NetHttpTransport}</li>
107+
* </li>
108+
* </ul>
109+
* @param jsonFactory JSON factory, which may be:
110+
* <ul>
111+
* <li>Jackson: {@code com.google.api.client.json.jackson2.JacksonFactory}</li>
112+
* <li>Google GSON: {@code com.google.api.client.json.gson.GsonFactory}</li>
113+
* <li>Android Honeycomb or higher:
114+
* {@code com.google.api.client.extensions.android.json.AndroidJsonFactory}</li>
115+
* </ul>
116+
* @param httpRequestInitializer HTTP request initializer or {@code null} for none
117+
* @since 1.7
118+
*/
119+
public DeviceRun(com.google.api.client.http.HttpTransport transport, com.google.api.client.json.JsonFactory jsonFactory,
120+
com.google.api.client.http.HttpRequestInitializer httpRequestInitializer) {
121+
this(new Builder(transport, jsonFactory, httpRequestInitializer));
122+
}
123+
124+
/**
125+
* @param builder builder
126+
*/
127+
DeviceRun(Builder builder) {
128+
super(builder);
129+
}
130+
131+
@Override
132+
protected void initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest<?> httpClientRequest) throws java.io.IOException {
133+
super.initialize(httpClientRequest);
134+
}
135+
136+
/**
137+
* Builder for {@link DeviceRun}.
138+
*
139+
* <p>
140+
* Implementation is not thread-safe.
141+
* </p>
142+
*
143+
* @since 1.3.0
144+
*/
145+
public static final class Builder extends com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient.Builder {
146+
147+
private static String chooseEndpoint(com.google.api.client.http.HttpTransport transport) {
148+
// If the GOOGLE_API_USE_MTLS_ENDPOINT environment variable value is "always", use mTLS endpoint.
149+
// If the env variable is "auto", use mTLS endpoint if and only if the transport is mTLS.
150+
// Use the regular endpoint for all other cases.
151+
String useMtlsEndpoint = System.getenv("GOOGLE_API_USE_MTLS_ENDPOINT");
152+
useMtlsEndpoint = useMtlsEndpoint == null ? "auto" : useMtlsEndpoint;
153+
if ("always".equals(useMtlsEndpoint) || ("auto".equals(useMtlsEndpoint) && transport != null && transport.isMtls())) {
154+
return DEFAULT_MTLS_ROOT_URL;
155+
}
156+
return DEFAULT_ROOT_URL;
157+
}
158+
159+
/**
160+
* Returns an instance of a new builder.
161+
*
162+
* @param transport HTTP transport, which should normally be:
163+
* <ul>
164+
* <li>Google App Engine:
165+
* {@code com.google.api.client.extensions.appengine.http.UrlFetchTransport}</li>
166+
* <li>Android: {@code newCompatibleTransport} from
167+
* {@code com.google.api.client.extensions.android.http.AndroidHttp}</li>
168+
* <li>Java: {@code com.google.api.client.http.javanet.NetHttpTransport}</li>
169+
* </ul>
170+
* @param jsonFactory JSON factory, which may be:
171+
* <ul>
172+
* <li>Jackson: {@code com.google.api.client.json.jackson2.JacksonFactory}</li>
173+
* <li>Google GSON: {@code com.google.api.client.json.gson.GsonFactory}</li>
174+
* <li>Android Honeycomb or higher:
175+
* {@code com.google.api.client.extensions.android.json.AndroidJsonFactory}</li>
176+
* </ul>
177+
* @param httpRequestInitializer HTTP request initializer or {@code null} for none
178+
* @since 1.7
179+
*/
180+
public Builder(com.google.api.client.http.HttpTransport transport, com.google.api.client.json.JsonFactory jsonFactory,
181+
com.google.api.client.http.HttpRequestInitializer httpRequestInitializer) {
182+
super(
183+
transport,
184+
jsonFactory,
185+
Builder.chooseEndpoint(transport),
186+
DEFAULT_SERVICE_PATH,
187+
httpRequestInitializer,
188+
false);
189+
setBatchPath(DEFAULT_BATCH_PATH);
190+
}
191+
192+
/** Builds a new instance of {@link DeviceRun}. */
193+
@Override
194+
public DeviceRun build() {
195+
return new DeviceRun(this);
196+
}
197+
198+
@Override
199+
public Builder setRootUrl(String rootUrl) {
200+
return (Builder) super.setRootUrl(rootUrl);
201+
}
202+
203+
@Override
204+
public Builder setServicePath(String servicePath) {
205+
return (Builder) super.setServicePath(servicePath);
206+
}
207+
208+
@Override
209+
public Builder setBatchPath(String batchPath) {
210+
return (Builder) super.setBatchPath(batchPath);
211+
}
212+
213+
@Override
214+
public Builder setHttpRequestInitializer(com.google.api.client.http.HttpRequestInitializer httpRequestInitializer) {
215+
return (Builder) super.setHttpRequestInitializer(httpRequestInitializer);
216+
}
217+
218+
@Override
219+
public Builder setApplicationName(String applicationName) {
220+
return (Builder) super.setApplicationName(applicationName);
221+
}
222+
223+
@Override
224+
public Builder setSuppressPatternChecks(boolean suppressPatternChecks) {
225+
return (Builder) super.setSuppressPatternChecks(suppressPatternChecks);
226+
}
227+
228+
@Override
229+
public Builder setSuppressRequiredParameterChecks(boolean suppressRequiredParameterChecks) {
230+
return (Builder) super.setSuppressRequiredParameterChecks(suppressRequiredParameterChecks);
231+
}
232+
233+
@Override
234+
public Builder setSuppressAllChecks(boolean suppressAllChecks) {
235+
return (Builder) super.setSuppressAllChecks(suppressAllChecks);
236+
}
237+
238+
/**
239+
* Set the {@link DeviceRunRequestInitializer}.
240+
*
241+
* @since 1.12
242+
*/
243+
public Builder setDeviceRunRequestInitializer(
244+
DeviceRunRequestInitializer devicerunRequestInitializer) {
245+
return (Builder) super.setGoogleClientRequestInitializer(devicerunRequestInitializer);
246+
}
247+
248+
@Override
249+
public Builder setGoogleClientRequestInitializer(
250+
com.google.api.client.googleapis.services.GoogleClientRequestInitializer googleClientRequestInitializer) {
251+
return (Builder) super.setGoogleClientRequestInitializer(googleClientRequestInitializer);
252+
}
253+
254+
@Override
255+
public Builder setUniverseDomain(String universeDomain) {
256+
return (Builder) super.setUniverseDomain(universeDomain);
257+
}
258+
}
259+
}

0 commit comments

Comments
 (0)