The typical use is:
+ *
+ * {@code CloudRun run = new CloudRun(...);}
+ * {@code CloudRun.SourceUploads.List request = run.sourceUploads().list(parameters ...)}
+ *
+ *
+ * @return the resource collection
+ */
+ public SourceUploads sourceUploads() {
+ return new SourceUploads();
+ }
+
+ /**
+ * The "sourceUploads" collection of methods.
+ */
+ public class SourceUploads {
+
+ /**
+ * Uploads a source archive to a Google Cloud Storage bucket through Cloud Run. The uploaded source
+ * object should be used for Cloud Run resource deployments. User is responsible for managing the
+ * lifecycle of the uploaded object. If uploading through the Cloud Run API to Cloud Storage is not
+ * desired, you can use the IAM Deny Policy to deny the `run.locations.uploadSource` permission for
+ * all principals.
+ *
+ * Create a request for the method "sourceUploads.upload".
+ *
+ * This request holds the parameters needed by the run server. After setting any optional
+ * parameters, call the {@link Upload#execute()} method to invoke the remote operation.
+ *
+ * @param parent Required. The project and location in which the source archive should be uploaded to, specified in
+ * the format `projects/locations`.
+ * @param content the {@link com.google.api.services.run.v2.model.GoogleCloudRunV2UploadSourceRequest}
+ * @return the request
+ */
+ public Upload upload(java.lang.String parent, com.google.api.services.run.v2.model.GoogleCloudRunV2UploadSourceRequest content) throws java.io.IOException {
+ Upload result = new Upload(parent, content);
+ initialize(result);
+ return result;
+ }
+
+ /**
+ * Uploads a source archive to a Google Cloud Storage bucket through Cloud Run. The uploaded source
+ * object should be used for Cloud Run resource deployments. User is responsible for managing the
+ * lifecycle of the uploaded object. If uploading through the Cloud Run API to Cloud Storage is not
+ * desired, you can use the IAM Deny Policy to deny the `run.locations.uploadSource` permission for
+ * all principals.
+ *
+ * Create a request for the method "sourceUploads.upload".
+ *
+ * This request holds the parameters needed by the the run server. After setting any optional
+ * parameters, call the {@link Upload#execute()} method to invoke the remote operation.
+ *
+ * + * This method should be used for uploading media content. + *
+ * + * @param parent Required. The project and location in which the source archive should be uploaded to, specified in + * the format `projects/locations`. + * @param content the {@link com.google.api.services.run.v2.model.GoogleCloudRunV2UploadSourceRequest} media metadata or {@code null} if none + * @param mediaContent The media HTTP content. + * @return the request + * @throws java.io.IOException if the initialization of the request fails + */ + public Upload upload(java.lang.String parent, com.google.api.services.run.v2.model.GoogleCloudRunV2UploadSourceRequest content, com.google.api.client.http.AbstractInputStreamContent mediaContent) throws java.io.IOException { + Upload result = new Upload(parent, content, mediaContent); + initialize(result); + return result; + } + + public class Upload extends CloudRunRequest{@link + * Upload#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must + * be called to initialize this instance immediately after invoking the constructor.
+ * + * @param parent Required. The project and location in which the source archive should be uploaded to, specified in + * the format `projects/locations`. + * @param content the {@link com.google.api.services.run.v2.model.GoogleCloudRunV2UploadSourceRequest} + * @since 1.13 + */ + protected Upload(java.lang.String parent, com.google.api.services.run.v2.model.GoogleCloudRunV2UploadSourceRequest content) { + super(CloudRun.this, "POST", REST_PATH, content, com.google.api.services.run.v2.model.GoogleCloudRunV2UploadSourceResponse.class); + this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified."); + if (!getSuppressPatternChecks()) { + com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(), + "Parameter parent must conform to the pattern " + + "^projects/[^/]+/locations/[^/]+$"); + } + } + + /** + * Uploads a source archive to a Google Cloud Storage bucket through Cloud Run. The uploaded + * source object should be used for Cloud Run resource deployments. User is responsible for + * managing the lifecycle of the uploaded object. If uploading through the Cloud Run API to Cloud + * Storage is not desired, you can use the IAM Deny Policy to deny the + * `run.locations.uploadSource` permission for all principals. + * + * Create a request for the method "sourceUploads.upload". + * + * This request holds the parameters needed by the the run server. After setting any optional + * parameters, call the {@link Upload#execute()} method to invoke the remote operation.{@link + * Upload#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must + * be called to initialize this instance immediately after invoking the constructor.
+ * + *+ * This constructor should be used for uploading media content. + *
+ * + * @param parent Required. The project and location in which the source archive should be uploaded to, specified in + * the format `projects/locations`. + * @param content the {@link com.google.api.services.run.v2.model.GoogleCloudRunV2UploadSourceRequest} media metadata or {@code null} if none + * @param mediaContent The media HTTP content. + * @since 1.13 + */ + protected Upload(java.lang.String parent, com.google.api.services.run.v2.model.GoogleCloudRunV2UploadSourceRequest content, com.google.api.client.http.AbstractInputStreamContent mediaContent) { + super(CloudRun.this, "POST", "/upload/" + getServicePath() + REST_PATH, content, com.google.api.services.run.v2.model.GoogleCloudRunV2UploadSourceResponse.class); + this.parent = com.google.api.client.util.Preconditions.checkNotNull(parent, "Required parameter parent must be specified."); + com.google.api.client.util.Preconditions.checkNotNull(mediaContent, "Required parameter mediaContent must be specified."); + initializeMediaUpload(mediaContent); + } + + @Override + public Upload set$Xgafv(java.lang.String $Xgafv) { + return (Upload) super.set$Xgafv($Xgafv); + } + + @Override + public Upload setAccessToken(java.lang.String accessToken) { + return (Upload) super.setAccessToken(accessToken); + } + + @Override + public Upload setAlt(java.lang.String alt) { + return (Upload) super.setAlt(alt); + } + + @Override + public Upload setCallback(java.lang.String callback) { + return (Upload) super.setCallback(callback); + } + + @Override + public Upload setFields(java.lang.String fields) { + return (Upload) super.setFields(fields); + } + + @Override + public Upload setKey(java.lang.String key) { + return (Upload) super.setKey(key); + } + + @Override + public Upload setOauthToken(java.lang.String oauthToken) { + return (Upload) super.setOauthToken(oauthToken); + } + + @Override + public Upload setPrettyPrint(java.lang.Boolean prettyPrint) { + return (Upload) super.setPrettyPrint(prettyPrint); + } + + @Override + public Upload setQuotaUser(java.lang.String quotaUser) { + return (Upload) super.setQuotaUser(quotaUser); + } + + @Override + public Upload setUploadType(java.lang.String uploadType) { + return (Upload) super.setUploadType(uploadType); + } + + @Override + public Upload setUploadProtocol(java.lang.String uploadProtocol) { + return (Upload) super.setUploadProtocol(uploadProtocol); + } + + /** + * Required. The project and location in which the source archive should be uploaded to, + * specified in the format `projects/locations`. + */ + @com.google.api.client.util.Key + private java.lang.String parent; + + /** Required. The project and location in which the source archive should be uploaded to, specified in + the format `projects/locations`. + */ + public java.lang.String getParent() { + return parent; + } + + /** + * Required. The project and location in which the source archive should be uploaded to, + * specified in the format `projects/locations`. + */ + public Upload setParent(java.lang.String parent) { + if (!getSuppressPatternChecks()) { + com.google.api.client.util.Preconditions.checkArgument(PARENT_PATTERN.matcher(parent).matches(), + "Parameter parent must conform to the pattern " + + "^projects/[^/]+/locations/[^/]+$"); + } + this.parent = parent; + return this; + } + + @Override + public Upload set(String parameterName, Object value) { + return (Upload) super.set(parameterName, value); + } + } + + } /** * An accessor for creating requests from the WorkerPools collection. * diff --git a/clients/google-api-services-run/v2/2.0.0/com/google/api/services/run/v2/model/GoogleCloudRunV2UploadSourceRequest.java b/clients/google-api-services-run/v2/2.0.0/com/google/api/services/run/v2/model/GoogleCloudRunV2UploadSourceRequest.java new file mode 100644 index 00000000000..db5b44758e1 --- /dev/null +++ b/clients/google-api-services-run/v2/2.0.0/com/google/api/services/run/v2/model/GoogleCloudRunV2UploadSourceRequest.java @@ -0,0 +1,66 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +/* + * This code was generated by https://github.com/googleapis/google-api-java-client-services/ + * Modify at your own risk. + */ + +package com.google.api.services.run.v2.model; + +/** + * The request message for the UploadSource method. + * + *This is the Java data model class that specifies how to parse/serialize into the JSON that is + * transmitted over HTTP when working with the Cloud Run Admin API. For a detailed explanation see: + * https://developers.google.com/api-client-library/java/google-http-java-client/json + *
+ * + * @author Google, Inc. + */ +@SuppressWarnings("javadoc") +public final class GoogleCloudRunV2UploadSourceRequest extends com.google.api.client.json.GenericJson { + + /** + * The name of Cloud Run Service upload source archive will be used for. + * The value may be {@code null}. + */ + @com.google.api.client.util.Key + private java.lang.String service; + + /** + * The name of Cloud Run Service upload source archive will be used for. + * @return value or {@code null} for none + */ + public java.lang.String getService() { + return service; + } + + /** + * The name of Cloud Run Service upload source archive will be used for. + * @param service service or {@code null} for none + */ + public GoogleCloudRunV2UploadSourceRequest setService(java.lang.String service) { + this.service = service; + return this; + } + + @Override + public GoogleCloudRunV2UploadSourceRequest set(String fieldName, Object value) { + return (GoogleCloudRunV2UploadSourceRequest) super.set(fieldName, value); + } + + @Override + public GoogleCloudRunV2UploadSourceRequest clone() { + return (GoogleCloudRunV2UploadSourceRequest) super.clone(); + } + +} diff --git a/clients/google-api-services-run/v2/2.0.0/com/google/api/services/run/v2/model/GoogleCloudRunV2UploadSourceResponse.java b/clients/google-api-services-run/v2/2.0.0/com/google/api/services/run/v2/model/GoogleCloudRunV2UploadSourceResponse.java new file mode 100644 index 00000000000..54db394f7a2 --- /dev/null +++ b/clients/google-api-services-run/v2/2.0.0/com/google/api/services/run/v2/model/GoogleCloudRunV2UploadSourceResponse.java @@ -0,0 +1,66 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +/* + * This code was generated by https://github.com/googleapis/google-api-java-client-services/ + * Modify at your own risk. + */ + +package com.google.api.services.run.v2.model; + +/** + * The response message for the UploadSource method. + * + *This is the Java data model class that specifies how to parse/serialize into the JSON that is + * transmitted over HTTP when working with the Cloud Run Admin API. For a detailed explanation see: + * https://developers.google.com/api-client-library/java/google-http-java-client/json + *
+ * + * @author Google, Inc. + */ +@SuppressWarnings("javadoc") +public final class GoogleCloudRunV2UploadSourceResponse extends com.google.api.client.json.GenericJson { + + /** + * The Cloud Storage object path the source archive is uploaded to. + * The value may be {@code null}. + */ + @com.google.api.client.util.Key + private GoogleCloudRunV2CloudStorageSource cloudStorageSource; + + /** + * The Cloud Storage object path the source archive is uploaded to. + * @return value or {@code null} for none + */ + public GoogleCloudRunV2CloudStorageSource getCloudStorageSource() { + return cloudStorageSource; + } + + /** + * The Cloud Storage object path the source archive is uploaded to. + * @param cloudStorageSource cloudStorageSource or {@code null} for none + */ + public GoogleCloudRunV2UploadSourceResponse setCloudStorageSource(GoogleCloudRunV2CloudStorageSource cloudStorageSource) { + this.cloudStorageSource = cloudStorageSource; + return this; + } + + @Override + public GoogleCloudRunV2UploadSourceResponse set(String fieldName, Object value) { + return (GoogleCloudRunV2UploadSourceResponse) super.set(fieldName, value); + } + + @Override + public GoogleCloudRunV2UploadSourceResponse clone() { + return (GoogleCloudRunV2UploadSourceResponse) super.clone(); + } + +} diff --git a/clients/google-api-services-run/v2/2.0.0/pom.xml b/clients/google-api-services-run/v2/2.0.0/pom.xml index c849579a781..ac2ddefc209 100644 --- a/clients/google-api-services-run/v2/2.0.0/pom.xml +++ b/clients/google-api-services-run/v2/2.0.0/pom.xml @@ -8,8 +8,8 @@