
com.google.api.services.cloudfunctions.v2.CloudFunctions Maven / Gradle / Ivy
/*
* 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.cloudfunctions.v2;
/**
* Service definition for CloudFunctions (v2).
*
*
* Manages lightweight user-provided functions executed in response to events.
*
*
*
* For more information about this service, see the
* API Documentation
*
*
*
* This service uses {@link CloudFunctionsRequestInitializer} to initialize global parameters via its
* {@link Builder}.
*
*
* @since 1.3
* @author Google, Inc.
*/
@SuppressWarnings("javadoc")
public class CloudFunctions extends com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient {
// Note: Leave this static initializer at the top of the file.
static {
com.google.api.client.util.Preconditions.checkState(
(com.google.api.client.googleapis.GoogleUtils.MAJOR_VERSION == 1 &&
(com.google.api.client.googleapis.GoogleUtils.MINOR_VERSION >= 32 ||
(com.google.api.client.googleapis.GoogleUtils.MINOR_VERSION == 31 &&
com.google.api.client.googleapis.GoogleUtils.BUGFIX_VERSION >= 1))) ||
com.google.api.client.googleapis.GoogleUtils.MAJOR_VERSION >= 2,
"You are currently running with version %s of google-api-client. " +
"You need at least version 1.31.1 of google-api-client to run version " +
"2.0.0 of the Cloud Functions API library.", com.google.api.client.googleapis.GoogleUtils.VERSION);
}
/**
* The default encoded root URL of the service. This is determined when the library is generated
* and normally should not be changed.
*
* @since 1.7
*/
public static final String DEFAULT_ROOT_URL = "https://cloudfunctions.googleapis.com/";
/**
* The default encoded mTLS root URL of the service. This is determined when the library is generated
* and normally should not be changed.
*
* @since 1.31
*/
public static final String DEFAULT_MTLS_ROOT_URL = "https://cloudfunctions.mtls.googleapis.com/";
/**
* The default encoded service path of the service. This is determined when the library is
* generated and normally should not be changed.
*
* @since 1.7
*/
public static final String DEFAULT_SERVICE_PATH = "";
/**
* The default encoded batch path of the service. This is determined when the library is
* generated and normally should not be changed.
*
* @since 1.23
*/
public static final String DEFAULT_BATCH_PATH = "batch";
/**
* The default encoded base URL of the service. This is determined when the library is generated
* and normally should not be changed.
*/
public static final String DEFAULT_BASE_URL = DEFAULT_ROOT_URL + DEFAULT_SERVICE_PATH;
/**
* Constructor.
*
*
* Use {@link Builder} if you need to specify any of the optional parameters.
*
*
* @param transport HTTP transport, which should normally be:
*
* - Google App Engine:
* {@code com.google.api.client.extensions.appengine.http.UrlFetchTransport}
* - Android: {@code newCompatibleTransport} from
* {@code com.google.api.client.extensions.android.http.AndroidHttp}
* - Java: {@link com.google.api.client.googleapis.javanet.GoogleNetHttpTransport#newTrustedTransport()}
*
*
* @param jsonFactory JSON factory, which may be:
*
* - Jackson: {@code com.google.api.client.json.jackson2.JacksonFactory}
* - Google GSON: {@code com.google.api.client.json.gson.GsonFactory}
* - Android Honeycomb or higher:
* {@code com.google.api.client.extensions.android.json.AndroidJsonFactory}
*
* @param httpRequestInitializer HTTP request initializer or {@code null} for none
* @since 1.7
*/
public CloudFunctions(com.google.api.client.http.HttpTransport transport, com.google.api.client.json.JsonFactory jsonFactory,
com.google.api.client.http.HttpRequestInitializer httpRequestInitializer) {
this(new Builder(transport, jsonFactory, httpRequestInitializer));
}
/**
* @param builder builder
*/
CloudFunctions(Builder builder) {
super(builder);
}
@Override
protected void initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest> httpClientRequest) throws java.io.IOException {
super.initialize(httpClientRequest);
}
/**
* An accessor for creating requests from the Projects collection.
*
* The typical use is:
*
* {@code CloudFunctions cloudfunctions = new CloudFunctions(...);}
* {@code CloudFunctions.Projects.List request = cloudfunctions.projects().list(parameters ...)}
*
*
* @return the resource collection
*/
public Projects projects() {
return new Projects();
}
/**
* The "projects" collection of methods.
*/
public class Projects {
/**
* An accessor for creating requests from the Locations collection.
*
* The typical use is:
*
* {@code CloudFunctions cloudfunctions = new CloudFunctions(...);}
* {@code CloudFunctions.Locations.List request = cloudfunctions.locations().list(parameters ...)}
*
*
* @return the resource collection
*/
public Locations locations() {
return new Locations();
}
/**
* The "locations" collection of methods.
*/
public class Locations {
/**
* Lists information about the supported locations for this service.
*
* Create a request for the method "locations.list".
*
* This request holds the parameters needed by the cloudfunctions server. After setting any
* optional parameters, call the {@link List#execute()} method to invoke the remote operation.
*
* @param name The resource that owns the locations collection, if applicable.
* @return the request
*/
public List list(java.lang.String name) throws java.io.IOException {
List result = new List(name);
initialize(result);
return result;
}
public class List extends CloudFunctionsRequest {
private static final String REST_PATH = "v2/{+name}/locations";
private final java.util.regex.Pattern NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+$");
/**
* Lists information about the supported locations for this service.
*
* Create a request for the method "locations.list".
*
* This request holds the parameters needed by the the cloudfunctions server. After setting any
* optional parameters, call the {@link List#execute()} method to invoke the remote operation.
* {@link List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
* must be called to initialize this instance immediately after invoking the constructor.
*
* @param name The resource that owns the locations collection, if applicable.
* @since 1.13
*/
protected List(java.lang.String name) {
super(CloudFunctions.this, "GET", REST_PATH, null, com.google.api.services.cloudfunctions.v2.model.ListLocationsResponse.class);
this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+$");
}
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public List set$Xgafv(java.lang.String $Xgafv) {
return (List) super.set$Xgafv($Xgafv);
}
@Override
public List setAccessToken(java.lang.String accessToken) {
return (List) super.setAccessToken(accessToken);
}
@Override
public List setAlt(java.lang.String alt) {
return (List) super.setAlt(alt);
}
@Override
public List setCallback(java.lang.String callback) {
return (List) super.setCallback(callback);
}
@Override
public List setFields(java.lang.String fields) {
return (List) super.setFields(fields);
}
@Override
public List setKey(java.lang.String key) {
return (List) super.setKey(key);
}
@Override
public List setOauthToken(java.lang.String oauthToken) {
return (List) super.setOauthToken(oauthToken);
}
@Override
public List setPrettyPrint(java.lang.Boolean prettyPrint) {
return (List) super.setPrettyPrint(prettyPrint);
}
@Override
public List setQuotaUser(java.lang.String quotaUser) {
return (List) super.setQuotaUser(quotaUser);
}
@Override
public List setUploadType(java.lang.String uploadType) {
return (List) super.setUploadType(uploadType);
}
@Override
public List setUploadProtocol(java.lang.String uploadProtocol) {
return (List) super.setUploadProtocol(uploadProtocol);
}
/** The resource that owns the locations collection, if applicable. */
@com.google.api.client.util.Key
private java.lang.String name;
/** The resource that owns the locations collection, if applicable.
*/
public java.lang.String getName() {
return name;
}
/** The resource that owns the locations collection, if applicable. */
public List setName(java.lang.String name) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+$");
}
this.name = name;
return this;
}
/**
* A filter to narrow down results to a preferred subset. The filtering language accepts
* strings like `"displayName=tokyo"`, and is documented in more detail in
* [AIP-160](https://google.aip.dev/160).
*/
@com.google.api.client.util.Key
private java.lang.String filter;
/** A filter to narrow down results to a preferred subset. The filtering language accepts strings like
`"displayName=tokyo"`, and is documented in more detail in [AIP-160](https://google.aip.dev/160).
*/
public java.lang.String getFilter() {
return filter;
}
/**
* A filter to narrow down results to a preferred subset. The filtering language accepts
* strings like `"displayName=tokyo"`, and is documented in more detail in
* [AIP-160](https://google.aip.dev/160).
*/
public List setFilter(java.lang.String filter) {
this.filter = filter;
return this;
}
/** The maximum number of results to return. If not set, the service selects a default. */
@com.google.api.client.util.Key
private java.lang.Integer pageSize;
/** The maximum number of results to return. If not set, the service selects a default.
*/
public java.lang.Integer getPageSize() {
return pageSize;
}
/** The maximum number of results to return. If not set, the service selects a default. */
public List setPageSize(java.lang.Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* A page token received from the `next_page_token` field in the response. Send that page
* token to receive the subsequent page.
*/
@com.google.api.client.util.Key
private java.lang.String pageToken;
/** A page token received from the `next_page_token` field in the response. Send that page token to
receive the subsequent page.
*/
public java.lang.String getPageToken() {
return pageToken;
}
/**
* A page token received from the `next_page_token` field in the response. Send that page
* token to receive the subsequent page.
*/
public List setPageToken(java.lang.String pageToken) {
this.pageToken = pageToken;
return this;
}
@Override
public List set(String parameterName, Object value) {
return (List) super.set(parameterName, value);
}
}
/**
* An accessor for creating requests from the Functions collection.
*
* The typical use is:
*
* {@code CloudFunctions cloudfunctions = new CloudFunctions(...);}
* {@code CloudFunctions.Functions.List request = cloudfunctions.functions().list(parameters ...)}
*
*
* @return the resource collection
*/
public Functions functions() {
return new Functions();
}
/**
* The "functions" collection of methods.
*/
public class Functions {
/**
* Creates a new function. If a function with the given name already exists in the specified
* project, the long running operation will return `ALREADY_EXISTS` error.
*
* Create a request for the method "functions.create".
*
* This request holds the parameters needed by the cloudfunctions server. After setting any
* optional parameters, call the {@link Create#execute()} method to invoke the remote operation.
*
* @param parent Required. The project and location in which the function should be created, specified in the format
* `projects/locations`
* @param content the {@link com.google.api.services.cloudfunctions.v2.model.Function}
* @return the request
*/
public Create create(java.lang.String parent, com.google.api.services.cloudfunctions.v2.model.Function content) throws java.io.IOException {
Create result = new Create(parent, content);
initialize(result);
return result;
}
public class Create extends CloudFunctionsRequest {
private static final String REST_PATH = "v2/{+parent}/functions";
private final java.util.regex.Pattern PARENT_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+$");
/**
* Creates a new function. If a function with the given name already exists in the specified
* project, the long running operation will return `ALREADY_EXISTS` error.
*
* Create a request for the method "functions.create".
*
* This request holds the parameters needed by the the cloudfunctions server. After setting any
* optional parameters, call the {@link Create#execute()} method to invoke the remote operation.
* {@link
* Create#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 function should be created, specified in the format
* `projects/locations`
* @param content the {@link com.google.api.services.cloudfunctions.v2.model.Function}
* @since 1.13
*/
protected Create(java.lang.String parent, com.google.api.services.cloudfunctions.v2.model.Function content) {
super(CloudFunctions.this, "POST", REST_PATH, content, com.google.api.services.cloudfunctions.v2.model.Operation.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/[^/]+$");
}
}
@Override
public Create set$Xgafv(java.lang.String $Xgafv) {
return (Create) super.set$Xgafv($Xgafv);
}
@Override
public Create setAccessToken(java.lang.String accessToken) {
return (Create) super.setAccessToken(accessToken);
}
@Override
public Create setAlt(java.lang.String alt) {
return (Create) super.setAlt(alt);
}
@Override
public Create setCallback(java.lang.String callback) {
return (Create) super.setCallback(callback);
}
@Override
public Create setFields(java.lang.String fields) {
return (Create) super.setFields(fields);
}
@Override
public Create setKey(java.lang.String key) {
return (Create) super.setKey(key);
}
@Override
public Create setOauthToken(java.lang.String oauthToken) {
return (Create) super.setOauthToken(oauthToken);
}
@Override
public Create setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Create) super.setPrettyPrint(prettyPrint);
}
@Override
public Create setQuotaUser(java.lang.String quotaUser) {
return (Create) super.setQuotaUser(quotaUser);
}
@Override
public Create setUploadType(java.lang.String uploadType) {
return (Create) super.setUploadType(uploadType);
}
@Override
public Create setUploadProtocol(java.lang.String uploadProtocol) {
return (Create) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. The project and location in which the function should be created, 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 function should be created, specified in the format
`projects/locations`
*/
public java.lang.String getParent() {
return parent;
}
/**
* Required. The project and location in which the function should be created, specified
* in the format `projects/locations`
*/
public Create 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;
}
/**
* The ID to use for the function, which will become the final component of the function's
* resource name. This value should be 4-63 characters, and valid characters are /a-z-/.
*/
@com.google.api.client.util.Key
private java.lang.String functionId;
/** The ID to use for the function, which will become the final component of the function's resource
name. This value should be 4-63 characters, and valid characters are /a-z-/.
*/
public java.lang.String getFunctionId() {
return functionId;
}
/**
* The ID to use for the function, which will become the final component of the function's
* resource name. This value should be 4-63 characters, and valid characters are /a-z-/.
*/
public Create setFunctionId(java.lang.String functionId) {
this.functionId = functionId;
return this;
}
@Override
public Create set(String parameterName, Object value) {
return (Create) super.set(parameterName, value);
}
}
/**
* Deletes a function with the given name from the specified project. If the given function is used
* by some trigger, the trigger will be updated to remove this function.
*
* Create a request for the method "functions.delete".
*
* This request holds the parameters needed by the cloudfunctions server. After setting any
* optional parameters, call the {@link Delete#execute()} method to invoke the remote operation.
*
* @param name Required. The name of the function which should be deleted.
* @return the request
*/
public Delete delete(java.lang.String name) throws java.io.IOException {
Delete result = new Delete(name);
initialize(result);
return result;
}
public class Delete extends CloudFunctionsRequest {
private static final String REST_PATH = "v2/{+name}";
private final java.util.regex.Pattern NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+/functions/[^/]+$");
/**
* Deletes a function with the given name from the specified project. If the given function is
* used by some trigger, the trigger will be updated to remove this function.
*
* Create a request for the method "functions.delete".
*
* This request holds the parameters needed by the the cloudfunctions server. After setting any
* optional parameters, call the {@link Delete#execute()} method to invoke the remote operation.
* {@link
* Delete#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
* be called to initialize this instance immediately after invoking the constructor.
*
* @param name Required. The name of the function which should be deleted.
* @since 1.13
*/
protected Delete(java.lang.String name) {
super(CloudFunctions.this, "DELETE", REST_PATH, null, com.google.api.services.cloudfunctions.v2.model.Operation.class);
this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/functions/[^/]+$");
}
}
@Override
public Delete set$Xgafv(java.lang.String $Xgafv) {
return (Delete) super.set$Xgafv($Xgafv);
}
@Override
public Delete setAccessToken(java.lang.String accessToken) {
return (Delete) super.setAccessToken(accessToken);
}
@Override
public Delete setAlt(java.lang.String alt) {
return (Delete) super.setAlt(alt);
}
@Override
public Delete setCallback(java.lang.String callback) {
return (Delete) super.setCallback(callback);
}
@Override
public Delete setFields(java.lang.String fields) {
return (Delete) super.setFields(fields);
}
@Override
public Delete setKey(java.lang.String key) {
return (Delete) super.setKey(key);
}
@Override
public Delete setOauthToken(java.lang.String oauthToken) {
return (Delete) super.setOauthToken(oauthToken);
}
@Override
public Delete setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Delete) super.setPrettyPrint(prettyPrint);
}
@Override
public Delete setQuotaUser(java.lang.String quotaUser) {
return (Delete) super.setQuotaUser(quotaUser);
}
@Override
public Delete setUploadType(java.lang.String uploadType) {
return (Delete) super.setUploadType(uploadType);
}
@Override
public Delete setUploadProtocol(java.lang.String uploadProtocol) {
return (Delete) super.setUploadProtocol(uploadProtocol);
}
/** Required. The name of the function which should be deleted. */
@com.google.api.client.util.Key
private java.lang.String name;
/** Required. The name of the function which should be deleted.
*/
public java.lang.String getName() {
return name;
}
/** Required. The name of the function which should be deleted. */
public Delete setName(java.lang.String name) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/functions/[^/]+$");
}
this.name = name;
return this;
}
@Override
public Delete set(String parameterName, Object value) {
return (Delete) super.set(parameterName, value);
}
}
/**
* Returns a signed URL for downloading deployed function source code. The URL is only valid for a
* limited period and should be used within 30 minutes of generation. For more information about the
* signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls
*
* Create a request for the method "functions.generateDownloadUrl".
*
* This request holds the parameters needed by the cloudfunctions server. After setting any
* optional parameters, call the {@link GenerateDownloadUrl#execute()} method to invoke the remote
* operation.
*
* @param name Required. The name of function for which source code Google Cloud Storage signed URL should be
* generated.
* @param content the {@link com.google.api.services.cloudfunctions.v2.model.GenerateDownloadUrlRequest}
* @return the request
*/
public GenerateDownloadUrl generateDownloadUrl(java.lang.String name, com.google.api.services.cloudfunctions.v2.model.GenerateDownloadUrlRequest content) throws java.io.IOException {
GenerateDownloadUrl result = new GenerateDownloadUrl(name, content);
initialize(result);
return result;
}
public class GenerateDownloadUrl extends CloudFunctionsRequest {
private static final String REST_PATH = "v2/{+name}:generateDownloadUrl";
private final java.util.regex.Pattern NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+/functions/[^/]+$");
/**
* Returns a signed URL for downloading deployed function source code. The URL is only valid for a
* limited period and should be used within 30 minutes of generation. For more information about
* the signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls
*
* Create a request for the method "functions.generateDownloadUrl".
*
* This request holds the parameters needed by the the cloudfunctions server. After setting any
* optional parameters, call the {@link GenerateDownloadUrl#execute()} method to invoke the remote
* operation. {@link GenerateDownloadUrl#initialize(com.google.api.client.googleapis.services.
* AbstractGoogleClientRequest)} must be called to initialize this instance immediately after
* invoking the constructor.
*
* @param name Required. The name of function for which source code Google Cloud Storage signed URL should be
* generated.
* @param content the {@link com.google.api.services.cloudfunctions.v2.model.GenerateDownloadUrlRequest}
* @since 1.13
*/
protected GenerateDownloadUrl(java.lang.String name, com.google.api.services.cloudfunctions.v2.model.GenerateDownloadUrlRequest content) {
super(CloudFunctions.this, "POST", REST_PATH, content, com.google.api.services.cloudfunctions.v2.model.GenerateDownloadUrlResponse.class);
this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/functions/[^/]+$");
}
}
@Override
public GenerateDownloadUrl set$Xgafv(java.lang.String $Xgafv) {
return (GenerateDownloadUrl) super.set$Xgafv($Xgafv);
}
@Override
public GenerateDownloadUrl setAccessToken(java.lang.String accessToken) {
return (GenerateDownloadUrl) super.setAccessToken(accessToken);
}
@Override
public GenerateDownloadUrl setAlt(java.lang.String alt) {
return (GenerateDownloadUrl) super.setAlt(alt);
}
@Override
public GenerateDownloadUrl setCallback(java.lang.String callback) {
return (GenerateDownloadUrl) super.setCallback(callback);
}
@Override
public GenerateDownloadUrl setFields(java.lang.String fields) {
return (GenerateDownloadUrl) super.setFields(fields);
}
@Override
public GenerateDownloadUrl setKey(java.lang.String key) {
return (GenerateDownloadUrl) super.setKey(key);
}
@Override
public GenerateDownloadUrl setOauthToken(java.lang.String oauthToken) {
return (GenerateDownloadUrl) super.setOauthToken(oauthToken);
}
@Override
public GenerateDownloadUrl setPrettyPrint(java.lang.Boolean prettyPrint) {
return (GenerateDownloadUrl) super.setPrettyPrint(prettyPrint);
}
@Override
public GenerateDownloadUrl setQuotaUser(java.lang.String quotaUser) {
return (GenerateDownloadUrl) super.setQuotaUser(quotaUser);
}
@Override
public GenerateDownloadUrl setUploadType(java.lang.String uploadType) {
return (GenerateDownloadUrl) super.setUploadType(uploadType);
}
@Override
public GenerateDownloadUrl setUploadProtocol(java.lang.String uploadProtocol) {
return (GenerateDownloadUrl) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. The name of function for which source code Google Cloud Storage signed URL
* should be generated.
*/
@com.google.api.client.util.Key
private java.lang.String name;
/** Required. The name of function for which source code Google Cloud Storage signed URL should be
generated.
*/
public java.lang.String getName() {
return name;
}
/**
* Required. The name of function for which source code Google Cloud Storage signed URL
* should be generated.
*/
public GenerateDownloadUrl setName(java.lang.String name) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/functions/[^/]+$");
}
this.name = name;
return this;
}
@Override
public GenerateDownloadUrl set(String parameterName, Object value) {
return (GenerateDownloadUrl) super.set(parameterName, value);
}
}
/**
* Returns a signed URL for uploading a function source code. For more information about the signed
* URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls. Once the
* function source code upload is complete, the used signed URL should be provided in CreateFunction
* or UpdateFunction request as a reference to the function source code. When uploading source code
* to the generated signed URL, please follow these restrictions: * Source file type should be a zip
* file. * No credentials should be attached - the signed URLs provide access to the target bucket
* using internal service identity; if credentials were attached, the identity from the credentials
* would be used, but that identity does not have permissions to upload files to the URL. When
* making a HTTP PUT request, these two headers need to be specified: * `content-type:
* application/zip` And this header SHOULD NOT be specified: * `Authorization: Bearer YOUR_TOKEN`
*
* Create a request for the method "functions.generateUploadUrl".
*
* This request holds the parameters needed by the cloudfunctions server. After setting any
* optional parameters, call the {@link GenerateUploadUrl#execute()} method to invoke the remote
* operation.
*
* @param parent Required. The project and location in which the Google Cloud Storage signed URL should be generated,
* specified in the format `projects/locations`.
* @param content the {@link com.google.api.services.cloudfunctions.v2.model.GenerateUploadUrlRequest}
* @return the request
*/
public GenerateUploadUrl generateUploadUrl(java.lang.String parent, com.google.api.services.cloudfunctions.v2.model.GenerateUploadUrlRequest content) throws java.io.IOException {
GenerateUploadUrl result = new GenerateUploadUrl(parent, content);
initialize(result);
return result;
}
public class GenerateUploadUrl extends CloudFunctionsRequest {
private static final String REST_PATH = "v2/{+parent}/functions:generateUploadUrl";
private final java.util.regex.Pattern PARENT_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+$");
/**
* Returns a signed URL for uploading a function source code. For more information about the
* signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls. Once
* the function source code upload is complete, the used signed URL should be provided in
* CreateFunction or UpdateFunction request as a reference to the function source code. When
* uploading source code to the generated signed URL, please follow these restrictions: * Source
* file type should be a zip file. * No credentials should be attached - the signed URLs provide
* access to the target bucket using internal service identity; if credentials were attached, the
* identity from the credentials would be used, but that identity does not have permissions to
* upload files to the URL. When making a HTTP PUT request, these two headers need to be
* specified: * `content-type: application/zip` And this header SHOULD NOT be specified: *
* `Authorization: Bearer YOUR_TOKEN`
*
* Create a request for the method "functions.generateUploadUrl".
*
* This request holds the parameters needed by the the cloudfunctions server. After setting any
* optional parameters, call the {@link GenerateUploadUrl#execute()} method to invoke the remote
* operation. {@link GenerateUploadUrl#initialize(com.google.api.client.googleapis.services.Ab
* stractGoogleClientRequest)} must be called to initialize this instance immediately after
* invoking the constructor.
*
* @param parent Required. The project and location in which the Google Cloud Storage signed URL should be generated,
* specified in the format `projects/locations`.
* @param content the {@link com.google.api.services.cloudfunctions.v2.model.GenerateUploadUrlRequest}
* @since 1.13
*/
protected GenerateUploadUrl(java.lang.String parent, com.google.api.services.cloudfunctions.v2.model.GenerateUploadUrlRequest content) {
super(CloudFunctions.this, "POST", REST_PATH, content, com.google.api.services.cloudfunctions.v2.model.GenerateUploadUrlResponse.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/[^/]+$");
}
}
@Override
public GenerateUploadUrl set$Xgafv(java.lang.String $Xgafv) {
return (GenerateUploadUrl) super.set$Xgafv($Xgafv);
}
@Override
public GenerateUploadUrl setAccessToken(java.lang.String accessToken) {
return (GenerateUploadUrl) super.setAccessToken(accessToken);
}
@Override
public GenerateUploadUrl setAlt(java.lang.String alt) {
return (GenerateUploadUrl) super.setAlt(alt);
}
@Override
public GenerateUploadUrl setCallback(java.lang.String callback) {
return (GenerateUploadUrl) super.setCallback(callback);
}
@Override
public GenerateUploadUrl setFields(java.lang.String fields) {
return (GenerateUploadUrl) super.setFields(fields);
}
@Override
public GenerateUploadUrl setKey(java.lang.String key) {
return (GenerateUploadUrl) super.setKey(key);
}
@Override
public GenerateUploadUrl setOauthToken(java.lang.String oauthToken) {
return (GenerateUploadUrl) super.setOauthToken(oauthToken);
}
@Override
public GenerateUploadUrl setPrettyPrint(java.lang.Boolean prettyPrint) {
return (GenerateUploadUrl) super.setPrettyPrint(prettyPrint);
}
@Override
public GenerateUploadUrl setQuotaUser(java.lang.String quotaUser) {
return (GenerateUploadUrl) super.setQuotaUser(quotaUser);
}
@Override
public GenerateUploadUrl setUploadType(java.lang.String uploadType) {
return (GenerateUploadUrl) super.setUploadType(uploadType);
}
@Override
public GenerateUploadUrl setUploadProtocol(java.lang.String uploadProtocol) {
return (GenerateUploadUrl) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. The project and location in which the Google Cloud Storage signed URL should
* be generated, 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 Google Cloud Storage signed URL should be
generated, specified in the format `projects/locations`.
*/
public java.lang.String getParent() {
return parent;
}
/**
* Required. The project and location in which the Google Cloud Storage signed URL should
* be generated, specified in the format `projects/locations`.
*/
public GenerateUploadUrl 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 GenerateUploadUrl set(String parameterName, Object value) {
return (GenerateUploadUrl) super.set(parameterName, value);
}
}
/**
* Returns a function with the given name from the requested project.
*
* Create a request for the method "functions.get".
*
* This request holds the parameters needed by the cloudfunctions server. After setting any
* optional parameters, call the {@link Get#execute()} method to invoke the remote operation.
*
* @param name Required. The name of the function which details should be obtained.
* @return the request
*/
public Get get(java.lang.String name) throws java.io.IOException {
Get result = new Get(name);
initialize(result);
return result;
}
public class Get extends CloudFunctionsRequest {
private static final String REST_PATH = "v2/{+name}";
private final java.util.regex.Pattern NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+/functions/[^/]+$");
/**
* Returns a function with the given name from the requested project.
*
* Create a request for the method "functions.get".
*
* This request holds the parameters needed by the the cloudfunctions server. After setting any
* optional parameters, call the {@link Get#execute()} method to invoke the remote operation.
* {@link Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
* must be called to initialize this instance immediately after invoking the constructor.
*
* @param name Required. The name of the function which details should be obtained.
* @since 1.13
*/
protected Get(java.lang.String name) {
super(CloudFunctions.this, "GET", REST_PATH, null, com.google.api.services.cloudfunctions.v2.model.Function.class);
this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/functions/[^/]+$");
}
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public Get set$Xgafv(java.lang.String $Xgafv) {
return (Get) super.set$Xgafv($Xgafv);
}
@Override
public Get setAccessToken(java.lang.String accessToken) {
return (Get) super.setAccessToken(accessToken);
}
@Override
public Get setAlt(java.lang.String alt) {
return (Get) super.setAlt(alt);
}
@Override
public Get setCallback(java.lang.String callback) {
return (Get) super.setCallback(callback);
}
@Override
public Get setFields(java.lang.String fields) {
return (Get) super.setFields(fields);
}
@Override
public Get setKey(java.lang.String key) {
return (Get) super.setKey(key);
}
@Override
public Get setOauthToken(java.lang.String oauthToken) {
return (Get) super.setOauthToken(oauthToken);
}
@Override
public Get setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Get) super.setPrettyPrint(prettyPrint);
}
@Override
public Get setQuotaUser(java.lang.String quotaUser) {
return (Get) super.setQuotaUser(quotaUser);
}
@Override
public Get setUploadType(java.lang.String uploadType) {
return (Get) super.setUploadType(uploadType);
}
@Override
public Get setUploadProtocol(java.lang.String uploadProtocol) {
return (Get) super.setUploadProtocol(uploadProtocol);
}
/** Required. The name of the function which details should be obtained. */
@com.google.api.client.util.Key
private java.lang.String name;
/** Required. The name of the function which details should be obtained.
*/
public java.lang.String getName() {
return name;
}
/** Required. The name of the function which details should be obtained. */
public Get setName(java.lang.String name) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/functions/[^/]+$");
}
this.name = name;
return this;
}
@Override
public Get set(String parameterName, Object value) {
return (Get) super.set(parameterName, value);
}
}
/**
* Gets the access control policy for a resource. Returns an empty policy if the resource exists and
* does not have a policy set.
*
* Create a request for the method "functions.getIamPolicy".
*
* This request holds the parameters needed by the cloudfunctions server. After setting any
* optional parameters, call the {@link GetIamPolicy#execute()} method to invoke the remote
* operation.
*
* @param resource REQUIRED: The resource for which the policy is being requested. See [Resource
* names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for
* this field.
* @return the request
*/
public GetIamPolicy getIamPolicy(java.lang.String resource) throws java.io.IOException {
GetIamPolicy result = new GetIamPolicy(resource);
initialize(result);
return result;
}
public class GetIamPolicy extends CloudFunctionsRequest {
private static final String REST_PATH = "v2/{+resource}:getIamPolicy";
private final java.util.regex.Pattern RESOURCE_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+/functions/[^/]+$");
/**
* Gets the access control policy for a resource. Returns an empty policy if the resource exists
* and does not have a policy set.
*
* Create a request for the method "functions.getIamPolicy".
*
* This request holds the parameters needed by the the cloudfunctions server. After setting any
* optional parameters, call the {@link GetIamPolicy#execute()} method to invoke the remote
* operation. {@link
* GetIamPolicy#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
* must be called to initialize this instance immediately after invoking the constructor.
*
* @param resource REQUIRED: The resource for which the policy is being requested. See [Resource
* names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for
* this field.
* @since 1.13
*/
protected GetIamPolicy(java.lang.String resource) {
super(CloudFunctions.this, "GET", REST_PATH, null, com.google.api.services.cloudfunctions.v2.model.Policy.class);
this.resource = com.google.api.client.util.Preconditions.checkNotNull(resource, "Required parameter resource must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(RESOURCE_PATTERN.matcher(resource).matches(),
"Parameter resource must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/functions/[^/]+$");
}
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public GetIamPolicy set$Xgafv(java.lang.String $Xgafv) {
return (GetIamPolicy) super.set$Xgafv($Xgafv);
}
@Override
public GetIamPolicy setAccessToken(java.lang.String accessToken) {
return (GetIamPolicy) super.setAccessToken(accessToken);
}
@Override
public GetIamPolicy setAlt(java.lang.String alt) {
return (GetIamPolicy) super.setAlt(alt);
}
@Override
public GetIamPolicy setCallback(java.lang.String callback) {
return (GetIamPolicy) super.setCallback(callback);
}
@Override
public GetIamPolicy setFields(java.lang.String fields) {
return (GetIamPolicy) super.setFields(fields);
}
@Override
public GetIamPolicy setKey(java.lang.String key) {
return (GetIamPolicy) super.setKey(key);
}
@Override
public GetIamPolicy setOauthToken(java.lang.String oauthToken) {
return (GetIamPolicy) super.setOauthToken(oauthToken);
}
@Override
public GetIamPolicy setPrettyPrint(java.lang.Boolean prettyPrint) {
return (GetIamPolicy) super.setPrettyPrint(prettyPrint);
}
@Override
public GetIamPolicy setQuotaUser(java.lang.String quotaUser) {
return (GetIamPolicy) super.setQuotaUser(quotaUser);
}
@Override
public GetIamPolicy setUploadType(java.lang.String uploadType) {
return (GetIamPolicy) super.setUploadType(uploadType);
}
@Override
public GetIamPolicy setUploadProtocol(java.lang.String uploadProtocol) {
return (GetIamPolicy) super.setUploadProtocol(uploadProtocol);
}
/**
* REQUIRED: The resource for which the policy is being requested. See [Resource
* names](https://cloud.google.com/apis/design/resource_names) for the appropriate value
* for this field.
*/
@com.google.api.client.util.Key
private java.lang.String resource;
/** REQUIRED: The resource for which the policy is being requested. See [Resource
names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this
field.
*/
public java.lang.String getResource() {
return resource;
}
/**
* REQUIRED: The resource for which the policy is being requested. See [Resource
* names](https://cloud.google.com/apis/design/resource_names) for the appropriate value
* for this field.
*/
public GetIamPolicy setResource(java.lang.String resource) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(RESOURCE_PATTERN.matcher(resource).matches(),
"Parameter resource must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/functions/[^/]+$");
}
this.resource = resource;
return this;
}
/**
* Optional. The maximum policy version that will be used to format the policy. Valid
* values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests
* for policies with any conditional role bindings must specify version 3. Policies with
* no conditional role bindings may specify any valid value or leave the field unset. The
* policy in the response might use the policy version that you specified, or it might use
* a lower policy version. For example, if you specify version 3, but the policy has no
* conditional role bindings, the response uses version 1. To learn which resources
* support conditions in their IAM policies, see the [IAM
* documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
*/
@com.google.api.client.util.Key("options.requestedPolicyVersion")
private java.lang.Integer optionsRequestedPolicyVersion;
/** Optional. The maximum policy version that will be used to format the policy. Valid values are 0, 1,
and 3. Requests specifying an invalid value will be rejected. Requests for policies with any
conditional role bindings must specify version 3. Policies with no conditional role bindings may
specify any valid value or leave the field unset. The policy in the response might use the policy
version that you specified, or it might use a lower policy version. For example, if you specify
version 3, but the policy has no conditional role bindings, the response uses version 1. To learn
which resources support conditions in their IAM policies, see the [IAM
documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
*/
public java.lang.Integer getOptionsRequestedPolicyVersion() {
return optionsRequestedPolicyVersion;
}
/**
* Optional. The maximum policy version that will be used to format the policy. Valid
* values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests
* for policies with any conditional role bindings must specify version 3. Policies with
* no conditional role bindings may specify any valid value or leave the field unset. The
* policy in the response might use the policy version that you specified, or it might use
* a lower policy version. For example, if you specify version 3, but the policy has no
* conditional role bindings, the response uses version 1. To learn which resources
* support conditions in their IAM policies, see the [IAM
* documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
*/
public GetIamPolicy setOptionsRequestedPolicyVersion(java.lang.Integer optionsRequestedPolicyVersion) {
this.optionsRequestedPolicyVersion = optionsRequestedPolicyVersion;
return this;
}
@Override
public GetIamPolicy set(String parameterName, Object value) {
return (GetIamPolicy) super.set(parameterName, value);
}
}
/**
* Returns a list of functions that belong to the requested project.
*
* Create a request for the method "functions.list".
*
* This request holds the parameters needed by the cloudfunctions server. After setting any
* optional parameters, call the {@link List#execute()} method to invoke the remote operation.
*
* @param parent Required. The project and location from which the function should be listed, specified in the format
* `projects/locations` If you want to list functions in all locations, use "-" in place of a
* location. When listing functions in all locations, if one or more location(s) are
* unreachable, the response will contain functions from all reachable locations along with
* the names of any unreachable locations.
* @return the request
*/
public List list(java.lang.String parent) throws java.io.IOException {
List result = new List(parent);
initialize(result);
return result;
}
public class List extends CloudFunctionsRequest {
private static final String REST_PATH = "v2/{+parent}/functions";
private final java.util.regex.Pattern PARENT_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+$");
/**
* Returns a list of functions that belong to the requested project.
*
* Create a request for the method "functions.list".
*
* This request holds the parameters needed by the the cloudfunctions server. After setting any
* optional parameters, call the {@link List#execute()} method to invoke the remote operation.
* {@link List#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 from which the function should be listed, specified in the format
* `projects/locations` If you want to list functions in all locations, use "-" in place of a
* location. When listing functions in all locations, if one or more location(s) are
* unreachable, the response will contain functions from all reachable locations along with
* the names of any unreachable locations.
* @since 1.13
*/
protected List(java.lang.String parent) {
super(CloudFunctions.this, "GET", REST_PATH, null, com.google.api.services.cloudfunctions.v2.model.ListFunctionsResponse.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/[^/]+$");
}
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public List set$Xgafv(java.lang.String $Xgafv) {
return (List) super.set$Xgafv($Xgafv);
}
@Override
public List setAccessToken(java.lang.String accessToken) {
return (List) super.setAccessToken(accessToken);
}
@Override
public List setAlt(java.lang.String alt) {
return (List) super.setAlt(alt);
}
@Override
public List setCallback(java.lang.String callback) {
return (List) super.setCallback(callback);
}
@Override
public List setFields(java.lang.String fields) {
return (List) super.setFields(fields);
}
@Override
public List setKey(java.lang.String key) {
return (List) super.setKey(key);
}
@Override
public List setOauthToken(java.lang.String oauthToken) {
return (List) super.setOauthToken(oauthToken);
}
@Override
public List setPrettyPrint(java.lang.Boolean prettyPrint) {
return (List) super.setPrettyPrint(prettyPrint);
}
@Override
public List setQuotaUser(java.lang.String quotaUser) {
return (List) super.setQuotaUser(quotaUser);
}
@Override
public List setUploadType(java.lang.String uploadType) {
return (List) super.setUploadType(uploadType);
}
@Override
public List setUploadProtocol(java.lang.String uploadProtocol) {
return (List) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. The project and location from which the function should be listed, specified
* in the format `projects/locations` If you want to list functions in all locations, use
* "-" in place of a location. When listing functions in all locations, if one or more
* location(s) are unreachable, the response will contain functions from all reachable
* locations along with the names of any unreachable locations.
*/
@com.google.api.client.util.Key
private java.lang.String parent;
/** Required. The project and location from which the function should be listed, specified in the
format `projects/locations` If you want to list functions in all locations, use "-" in place of a
location. When listing functions in all locations, if one or more location(s) are unreachable, the
response will contain functions from all reachable locations along with the names of any
unreachable locations.
*/
public java.lang.String getParent() {
return parent;
}
/**
* Required. The project and location from which the function should be listed, specified
* in the format `projects/locations` If you want to list functions in all locations, use
* "-" in place of a location. When listing functions in all locations, if one or more
* location(s) are unreachable, the response will contain functions from all reachable
* locations along with the names of any unreachable locations.
*/
public List 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;
}
/**
* The filter for Functions that match the filter expression, following the syntax
* outlined in https://google.aip.dev/160.
*/
@com.google.api.client.util.Key
private java.lang.String filter;
/** The filter for Functions that match the filter expression, following the syntax outlined in
https://google.aip.dev/160.
*/
public java.lang.String getFilter() {
return filter;
}
/**
* The filter for Functions that match the filter expression, following the syntax
* outlined in https://google.aip.dev/160.
*/
public List setFilter(java.lang.String filter) {
this.filter = filter;
return this;
}
/**
* The sorting order of the resources returned. Value should be a comma separated list of
* fields. The default sorting oder is ascending. See https://google.aip.dev/132#ordering.
*/
@com.google.api.client.util.Key
private java.lang.String orderBy;
/** The sorting order of the resources returned. Value should be a comma separated list of fields. The
default sorting oder is ascending. See https://google.aip.dev/132#ordering.
*/
public java.lang.String getOrderBy() {
return orderBy;
}
/**
* The sorting order of the resources returned. Value should be a comma separated list of
* fields. The default sorting oder is ascending. See https://google.aip.dev/132#ordering.
*/
public List setOrderBy(java.lang.String orderBy) {
this.orderBy = orderBy;
return this;
}
/**
* Maximum number of functions to return per call. The largest allowed page_size is 1,000,
* if the page_size is omitted or specified as greater than 1,000 then it will be replaced
* as 1,000. The size of the list response can be less than specified when used with
* filters.
*/
@com.google.api.client.util.Key
private java.lang.Integer pageSize;
/** Maximum number of functions to return per call. The largest allowed page_size is 1,000, if the
page_size is omitted or specified as greater than 1,000 then it will be replaced as 1,000. The size
of the list response can be less than specified when used with filters.
*/
public java.lang.Integer getPageSize() {
return pageSize;
}
/**
* Maximum number of functions to return per call. The largest allowed page_size is 1,000,
* if the page_size is omitted or specified as greater than 1,000 then it will be replaced
* as 1,000. The size of the list response can be less than specified when used with
* filters.
*/
public List setPageSize(java.lang.Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* The value returned by the last `ListFunctionsResponse`; indicates that this is a
* continuation of a prior `ListFunctions` call, and that the system should return the
* next page of data.
*/
@com.google.api.client.util.Key
private java.lang.String pageToken;
/** The value returned by the last `ListFunctionsResponse`; indicates that this is a continuation of a
prior `ListFunctions` call, and that the system should return the next page of data.
*/
public java.lang.String getPageToken() {
return pageToken;
}
/**
* The value returned by the last `ListFunctionsResponse`; indicates that this is a
* continuation of a prior `ListFunctions` call, and that the system should return the
* next page of data.
*/
public List setPageToken(java.lang.String pageToken) {
this.pageToken = pageToken;
return this;
}
@Override
public List set(String parameterName, Object value) {
return (List) super.set(parameterName, value);
}
}
/**
* Updates existing function.
*
* Create a request for the method "functions.patch".
*
* This request holds the parameters needed by the cloudfunctions server. After setting any
* optional parameters, call the {@link Patch#execute()} method to invoke the remote operation.
*
* @param name A user-defined name of the function. Function names must be unique globally and match pattern
* `projects/locations/functions`
* @param content the {@link com.google.api.services.cloudfunctions.v2.model.Function}
* @return the request
*/
public Patch patch(java.lang.String name, com.google.api.services.cloudfunctions.v2.model.Function content) throws java.io.IOException {
Patch result = new Patch(name, content);
initialize(result);
return result;
}
public class Patch extends CloudFunctionsRequest {
private static final String REST_PATH = "v2/{+name}";
private final java.util.regex.Pattern NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+/functions/[^/]+$");
/**
* Updates existing function.
*
* Create a request for the method "functions.patch".
*
* This request holds the parameters needed by the the cloudfunctions server. After setting any
* optional parameters, call the {@link Patch#execute()} method to invoke the remote operation.
* {@link
* Patch#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)} must
* be called to initialize this instance immediately after invoking the constructor.
*
* @param name A user-defined name of the function. Function names must be unique globally and match pattern
* `projects/locations/functions`
* @param content the {@link com.google.api.services.cloudfunctions.v2.model.Function}
* @since 1.13
*/
protected Patch(java.lang.String name, com.google.api.services.cloudfunctions.v2.model.Function content) {
super(CloudFunctions.this, "PATCH", REST_PATH, content, com.google.api.services.cloudfunctions.v2.model.Operation.class);
this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/functions/[^/]+$");
}
}
@Override
public Patch set$Xgafv(java.lang.String $Xgafv) {
return (Patch) super.set$Xgafv($Xgafv);
}
@Override
public Patch setAccessToken(java.lang.String accessToken) {
return (Patch) super.setAccessToken(accessToken);
}
@Override
public Patch setAlt(java.lang.String alt) {
return (Patch) super.setAlt(alt);
}
@Override
public Patch setCallback(java.lang.String callback) {
return (Patch) super.setCallback(callback);
}
@Override
public Patch setFields(java.lang.String fields) {
return (Patch) super.setFields(fields);
}
@Override
public Patch setKey(java.lang.String key) {
return (Patch) super.setKey(key);
}
@Override
public Patch setOauthToken(java.lang.String oauthToken) {
return (Patch) super.setOauthToken(oauthToken);
}
@Override
public Patch setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Patch) super.setPrettyPrint(prettyPrint);
}
@Override
public Patch setQuotaUser(java.lang.String quotaUser) {
return (Patch) super.setQuotaUser(quotaUser);
}
@Override
public Patch setUploadType(java.lang.String uploadType) {
return (Patch) super.setUploadType(uploadType);
}
@Override
public Patch setUploadProtocol(java.lang.String uploadProtocol) {
return (Patch) super.setUploadProtocol(uploadProtocol);
}
/**
* A user-defined name of the function. Function names must be unique globally and match
* pattern `projects/locations/functions`
*/
@com.google.api.client.util.Key
private java.lang.String name;
/** A user-defined name of the function. Function names must be unique globally and match pattern
`projects/locations/functions`
*/
public java.lang.String getName() {
return name;
}
/**
* A user-defined name of the function. Function names must be unique globally and match
* pattern `projects/locations/functions`
*/
public Patch setName(java.lang.String name) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/functions/[^/]+$");
}
this.name = name;
return this;
}
/**
* The list of fields to be updated. If no field mask is provided, all provided fields in
* the request will be updated.
*/
@com.google.api.client.util.Key
private String updateMask;
/** The list of fields to be updated. If no field mask is provided, all provided fields in the request
will be updated.
*/
public String getUpdateMask() {
return updateMask;
}
/**
* The list of fields to be updated. If no field mask is provided, all provided fields in
* the request will be updated.
*/
public Patch setUpdateMask(String updateMask) {
this.updateMask = updateMask;
return this;
}
@Override
public Patch set(String parameterName, Object value) {
return (Patch) super.set(parameterName, value);
}
}
/**
* Sets the access control policy on the specified resource. Replaces any existing policy. Can
* return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
*
* Create a request for the method "functions.setIamPolicy".
*
* This request holds the parameters needed by the cloudfunctions server. After setting any
* optional parameters, call the {@link SetIamPolicy#execute()} method to invoke the remote
* operation.
*
* @param resource REQUIRED: The resource for which the policy is being specified. See [Resource
* names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for
* this field.
* @param content the {@link com.google.api.services.cloudfunctions.v2.model.SetIamPolicyRequest}
* @return the request
*/
public SetIamPolicy setIamPolicy(java.lang.String resource, com.google.api.services.cloudfunctions.v2.model.SetIamPolicyRequest content) throws java.io.IOException {
SetIamPolicy result = new SetIamPolicy(resource, content);
initialize(result);
return result;
}
public class SetIamPolicy extends CloudFunctionsRequest {
private static final String REST_PATH = "v2/{+resource}:setIamPolicy";
private final java.util.regex.Pattern RESOURCE_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+/functions/[^/]+$");
/**
* Sets the access control policy on the specified resource. Replaces any existing policy. Can
* return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
*
* Create a request for the method "functions.setIamPolicy".
*
* This request holds the parameters needed by the the cloudfunctions server. After setting any
* optional parameters, call the {@link SetIamPolicy#execute()} method to invoke the remote
* operation. {@link
* SetIamPolicy#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
* must be called to initialize this instance immediately after invoking the constructor.
*
* @param resource REQUIRED: The resource for which the policy is being specified. See [Resource
* names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for
* this field.
* @param content the {@link com.google.api.services.cloudfunctions.v2.model.SetIamPolicyRequest}
* @since 1.13
*/
protected SetIamPolicy(java.lang.String resource, com.google.api.services.cloudfunctions.v2.model.SetIamPolicyRequest content) {
super(CloudFunctions.this, "POST", REST_PATH, content, com.google.api.services.cloudfunctions.v2.model.Policy.class);
this.resource = com.google.api.client.util.Preconditions.checkNotNull(resource, "Required parameter resource must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(RESOURCE_PATTERN.matcher(resource).matches(),
"Parameter resource must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/functions/[^/]+$");
}
}
@Override
public SetIamPolicy set$Xgafv(java.lang.String $Xgafv) {
return (SetIamPolicy) super.set$Xgafv($Xgafv);
}
@Override
public SetIamPolicy setAccessToken(java.lang.String accessToken) {
return (SetIamPolicy) super.setAccessToken(accessToken);
}
@Override
public SetIamPolicy setAlt(java.lang.String alt) {
return (SetIamPolicy) super.setAlt(alt);
}
@Override
public SetIamPolicy setCallback(java.lang.String callback) {
return (SetIamPolicy) super.setCallback(callback);
}
@Override
public SetIamPolicy setFields(java.lang.String fields) {
return (SetIamPolicy) super.setFields(fields);
}
@Override
public SetIamPolicy setKey(java.lang.String key) {
return (SetIamPolicy) super.setKey(key);
}
@Override
public SetIamPolicy setOauthToken(java.lang.String oauthToken) {
return (SetIamPolicy) super.setOauthToken(oauthToken);
}
@Override
public SetIamPolicy setPrettyPrint(java.lang.Boolean prettyPrint) {
return (SetIamPolicy) super.setPrettyPrint(prettyPrint);
}
@Override
public SetIamPolicy setQuotaUser(java.lang.String quotaUser) {
return (SetIamPolicy) super.setQuotaUser(quotaUser);
}
@Override
public SetIamPolicy setUploadType(java.lang.String uploadType) {
return (SetIamPolicy) super.setUploadType(uploadType);
}
@Override
public SetIamPolicy setUploadProtocol(java.lang.String uploadProtocol) {
return (SetIamPolicy) super.setUploadProtocol(uploadProtocol);
}
/**
* REQUIRED: The resource for which the policy is being specified. See [Resource
* names](https://cloud.google.com/apis/design/resource_names) for the appropriate value
* for this field.
*/
@com.google.api.client.util.Key
private java.lang.String resource;
/** REQUIRED: The resource for which the policy is being specified. See [Resource
names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this
field.
*/
public java.lang.String getResource() {
return resource;
}
/**
* REQUIRED: The resource for which the policy is being specified. See [Resource
* names](https://cloud.google.com/apis/design/resource_names) for the appropriate value
* for this field.
*/
public SetIamPolicy setResource(java.lang.String resource) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(RESOURCE_PATTERN.matcher(resource).matches(),
"Parameter resource must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/functions/[^/]+$");
}
this.resource = resource;
return this;
}
@Override
public SetIamPolicy set(String parameterName, Object value) {
return (SetIamPolicy) super.set(parameterName, value);
}
}
/**
* Returns permissions that a caller has on the specified resource. If the resource does not exist,
* this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is
* designed to be used for building permission-aware UIs and command-line tools, not for
* authorization checking. This operation may "fail open" without warning.
*
* Create a request for the method "functions.testIamPermissions".
*
* This request holds the parameters needed by the cloudfunctions server. After setting any
* optional parameters, call the {@link TestIamPermissions#execute()} method to invoke the remote
* operation.
*
* @param resource REQUIRED: The resource for which the policy detail is being requested. See [Resource
* names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for
* this field.
* @param content the {@link com.google.api.services.cloudfunctions.v2.model.TestIamPermissionsRequest}
* @return the request
*/
public TestIamPermissions testIamPermissions(java.lang.String resource, com.google.api.services.cloudfunctions.v2.model.TestIamPermissionsRequest content) throws java.io.IOException {
TestIamPermissions result = new TestIamPermissions(resource, content);
initialize(result);
return result;
}
public class TestIamPermissions extends CloudFunctionsRequest {
private static final String REST_PATH = "v2/{+resource}:testIamPermissions";
private final java.util.regex.Pattern RESOURCE_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+/functions/[^/]+$");
/**
* Returns permissions that a caller has on the specified resource. If the resource does not
* exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This
* operation is designed to be used for building permission-aware UIs and command-line tools, not
* for authorization checking. This operation may "fail open" without warning.
*
* Create a request for the method "functions.testIamPermissions".
*
* This request holds the parameters needed by the the cloudfunctions server. After setting any
* optional parameters, call the {@link TestIamPermissions#execute()} method to invoke the remote
* operation. {@link TestIamPermissions#initialize(com.google.api.client.googleapis.services.A
* bstractGoogleClientRequest)} must be called to initialize this instance immediately after
* invoking the constructor.
*
* @param resource REQUIRED: The resource for which the policy detail is being requested. See [Resource
* names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for
* this field.
* @param content the {@link com.google.api.services.cloudfunctions.v2.model.TestIamPermissionsRequest}
* @since 1.13
*/
protected TestIamPermissions(java.lang.String resource, com.google.api.services.cloudfunctions.v2.model.TestIamPermissionsRequest content) {
super(CloudFunctions.this, "POST", REST_PATH, content, com.google.api.services.cloudfunctions.v2.model.TestIamPermissionsResponse.class);
this.resource = com.google.api.client.util.Preconditions.checkNotNull(resource, "Required parameter resource must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(RESOURCE_PATTERN.matcher(resource).matches(),
"Parameter resource must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/functions/[^/]+$");
}
}
@Override
public TestIamPermissions set$Xgafv(java.lang.String $Xgafv) {
return (TestIamPermissions) super.set$Xgafv($Xgafv);
}
@Override
public TestIamPermissions setAccessToken(java.lang.String accessToken) {
return (TestIamPermissions) super.setAccessToken(accessToken);
}
@Override
public TestIamPermissions setAlt(java.lang.String alt) {
return (TestIamPermissions) super.setAlt(alt);
}
@Override
public TestIamPermissions setCallback(java.lang.String callback) {
return (TestIamPermissions) super.setCallback(callback);
}
@Override
public TestIamPermissions setFields(java.lang.String fields) {
return (TestIamPermissions) super.setFields(fields);
}
@Override
public TestIamPermissions setKey(java.lang.String key) {
return (TestIamPermissions) super.setKey(key);
}
@Override
public TestIamPermissions setOauthToken(java.lang.String oauthToken) {
return (TestIamPermissions) super.setOauthToken(oauthToken);
}
@Override
public TestIamPermissions setPrettyPrint(java.lang.Boolean prettyPrint) {
return (TestIamPermissions) super.setPrettyPrint(prettyPrint);
}
@Override
public TestIamPermissions setQuotaUser(java.lang.String quotaUser) {
return (TestIamPermissions) super.setQuotaUser(quotaUser);
}
@Override
public TestIamPermissions setUploadType(java.lang.String uploadType) {
return (TestIamPermissions) super.setUploadType(uploadType);
}
@Override
public TestIamPermissions setUploadProtocol(java.lang.String uploadProtocol) {
return (TestIamPermissions) super.setUploadProtocol(uploadProtocol);
}
/**
* REQUIRED: The resource for which the policy detail is being requested. See [Resource
* names](https://cloud.google.com/apis/design/resource_names) for the appropriate value
* for this field.
*/
@com.google.api.client.util.Key
private java.lang.String resource;
/** REQUIRED: The resource for which the policy detail is being requested. See [Resource
names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this
field.
*/
public java.lang.String getResource() {
return resource;
}
/**
* REQUIRED: The resource for which the policy detail is being requested. See [Resource
* names](https://cloud.google.com/apis/design/resource_names) for the appropriate value
* for this field.
*/
public TestIamPermissions setResource(java.lang.String resource) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(RESOURCE_PATTERN.matcher(resource).matches(),
"Parameter resource must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/functions/[^/]+$");
}
this.resource = resource;
return this;
}
@Override
public TestIamPermissions set(String parameterName, Object value) {
return (TestIamPermissions) super.set(parameterName, value);
}
}
}
/**
* An accessor for creating requests from the Operations collection.
*
* The typical use is:
*
* {@code CloudFunctions cloudfunctions = new CloudFunctions(...);}
* {@code CloudFunctions.Operations.List request = cloudfunctions.operations().list(parameters ...)}
*
*
* @return the resource collection
*/
public Operations operations() {
return new Operations();
}
/**
* The "operations" collection of methods.
*/
public class Operations {
/**
* Gets the latest state of a long-running operation. Clients can use this method to poll the
* operation result at intervals as recommended by the API service.
*
* Create a request for the method "operations.get".
*
* This request holds the parameters needed by the cloudfunctions server. After setting any
* optional parameters, call the {@link Get#execute()} method to invoke the remote operation.
*
* @param name The name of the operation resource.
* @return the request
*/
public Get get(java.lang.String name) throws java.io.IOException {
Get result = new Get(name);
initialize(result);
return result;
}
public class Get extends CloudFunctionsRequest {
private static final String REST_PATH = "v2/{+name}";
private final java.util.regex.Pattern NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+/operations/[^/]+$");
/**
* Gets the latest state of a long-running operation. Clients can use this method to poll the
* operation result at intervals as recommended by the API service.
*
* Create a request for the method "operations.get".
*
* This request holds the parameters needed by the the cloudfunctions server. After setting any
* optional parameters, call the {@link Get#execute()} method to invoke the remote operation.
* {@link Get#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
* must be called to initialize this instance immediately after invoking the constructor.
*
* @param name The name of the operation resource.
* @since 1.13
*/
protected Get(java.lang.String name) {
super(CloudFunctions.this, "GET", REST_PATH, null, com.google.api.services.cloudfunctions.v2.model.Operation.class);
this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/operations/[^/]+$");
}
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public Get set$Xgafv(java.lang.String $Xgafv) {
return (Get) super.set$Xgafv($Xgafv);
}
@Override
public Get setAccessToken(java.lang.String accessToken) {
return (Get) super.setAccessToken(accessToken);
}
@Override
public Get setAlt(java.lang.String alt) {
return (Get) super.setAlt(alt);
}
@Override
public Get setCallback(java.lang.String callback) {
return (Get) super.setCallback(callback);
}
@Override
public Get setFields(java.lang.String fields) {
return (Get) super.setFields(fields);
}
@Override
public Get setKey(java.lang.String key) {
return (Get) super.setKey(key);
}
@Override
public Get setOauthToken(java.lang.String oauthToken) {
return (Get) super.setOauthToken(oauthToken);
}
@Override
public Get setPrettyPrint(java.lang.Boolean prettyPrint) {
return (Get) super.setPrettyPrint(prettyPrint);
}
@Override
public Get setQuotaUser(java.lang.String quotaUser) {
return (Get) super.setQuotaUser(quotaUser);
}
@Override
public Get setUploadType(java.lang.String uploadType) {
return (Get) super.setUploadType(uploadType);
}
@Override
public Get setUploadProtocol(java.lang.String uploadProtocol) {
return (Get) super.setUploadProtocol(uploadProtocol);
}
/** The name of the operation resource. */
@com.google.api.client.util.Key
private java.lang.String name;
/** The name of the operation resource.
*/
public java.lang.String getName() {
return name;
}
/** The name of the operation resource. */
public Get setName(java.lang.String name) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+/operations/[^/]+$");
}
this.name = name;
return this;
}
@Override
public Get set(String parameterName, Object value) {
return (Get) super.set(parameterName, value);
}
}
/**
* Lists operations that match the specified filter in the request. If the server doesn't support
* this method, it returns `UNIMPLEMENTED`.
*
* Create a request for the method "operations.list".
*
* This request holds the parameters needed by the cloudfunctions server. After setting any
* optional parameters, call the {@link List#execute()} method to invoke the remote operation.
*
* @param name Must not be set.
* @return the request
*/
public List list(java.lang.String name) throws java.io.IOException {
List result = new List(name);
initialize(result);
return result;
}
public class List extends CloudFunctionsRequest {
private static final String REST_PATH = "v2/{+name}/operations";
private final java.util.regex.Pattern NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+$");
/**
* Lists operations that match the specified filter in the request. If the server doesn't support
* this method, it returns `UNIMPLEMENTED`.
*
* Create a request for the method "operations.list".
*
* This request holds the parameters needed by the the cloudfunctions server. After setting any
* optional parameters, call the {@link List#execute()} method to invoke the remote operation.
* {@link List#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
* must be called to initialize this instance immediately after invoking the constructor.
*
* @param name Must not be set.
* @since 1.13
*/
protected List(java.lang.String name) {
super(CloudFunctions.this, "GET", REST_PATH, null, com.google.api.services.cloudfunctions.v2.model.ListOperationsResponse.class);
this.name = com.google.api.client.util.Preconditions.checkNotNull(name, "Required parameter name must be specified.");
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+$");
}
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public List set$Xgafv(java.lang.String $Xgafv) {
return (List) super.set$Xgafv($Xgafv);
}
@Override
public List setAccessToken(java.lang.String accessToken) {
return (List) super.setAccessToken(accessToken);
}
@Override
public List setAlt(java.lang.String alt) {
return (List) super.setAlt(alt);
}
@Override
public List setCallback(java.lang.String callback) {
return (List) super.setCallback(callback);
}
@Override
public List setFields(java.lang.String fields) {
return (List) super.setFields(fields);
}
@Override
public List setKey(java.lang.String key) {
return (List) super.setKey(key);
}
@Override
public List setOauthToken(java.lang.String oauthToken) {
return (List) super.setOauthToken(oauthToken);
}
@Override
public List setPrettyPrint(java.lang.Boolean prettyPrint) {
return (List) super.setPrettyPrint(prettyPrint);
}
@Override
public List setQuotaUser(java.lang.String quotaUser) {
return (List) super.setQuotaUser(quotaUser);
}
@Override
public List setUploadType(java.lang.String uploadType) {
return (List) super.setUploadType(uploadType);
}
@Override
public List setUploadProtocol(java.lang.String uploadProtocol) {
return (List) super.setUploadProtocol(uploadProtocol);
}
/** Must not be set. */
@com.google.api.client.util.Key
private java.lang.String name;
/** Must not be set.
*/
public java.lang.String getName() {
return name;
}
/** Must not be set. */
public List setName(java.lang.String name) {
if (!getSuppressPatternChecks()) {
com.google.api.client.util.Preconditions.checkArgument(NAME_PATTERN.matcher(name).matches(),
"Parameter name must conform to the pattern " +
"^projects/[^/]+/locations/[^/]+$");
}
this.name = name;
return this;
}
/**
* Required. A filter for matching the requested operations. The supported formats of
* *filter* are: To query for a specific function: project:*,location:*,function:* To
* query for all of the latest operations for a project: project:*,latest:true
*/
@com.google.api.client.util.Key
private java.lang.String filter;
/** Required. A filter for matching the requested operations. The supported formats of *filter* are: To
query for a specific function: project:*,location:*,function:* To query for all of the latest
operations for a project: project:*,latest:true
*/
public java.lang.String getFilter() {
return filter;
}
/**
* Required. A filter for matching the requested operations. The supported formats of
* *filter* are: To query for a specific function: project:*,location:*,function:* To
* query for all of the latest operations for a project: project:*,latest:true
*/
public List setFilter(java.lang.String filter) {
this.filter = filter;
return this;
}
/**
* The maximum number of records that should be returned. Requested page size cannot
* exceed 100. If not set, the default page size is 100. Pagination is only supported when
* querying for a specific function.
*/
@com.google.api.client.util.Key
private java.lang.Integer pageSize;
/** The maximum number of records that should be returned. Requested page size cannot exceed 100. If
not set, the default page size is 100. Pagination is only supported when querying for a specific
function.
*/
public java.lang.Integer getPageSize() {
return pageSize;
}
/**
* The maximum number of records that should be returned. Requested page size cannot
* exceed 100. If not set, the default page size is 100. Pagination is only supported when
* querying for a specific function.
*/
public List setPageSize(java.lang.Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* Token identifying which result to start with, which is returned by a previous list
* call. Pagination is only supported when querying for a specific function.
*/
@com.google.api.client.util.Key
private java.lang.String pageToken;
/** Token identifying which result to start with, which is returned by a previous list call. Pagination
is only supported when querying for a specific function.
*/
public java.lang.String getPageToken() {
return pageToken;
}
/**
* Token identifying which result to start with, which is returned by a previous list
* call. Pagination is only supported when querying for a specific function.
*/
public List setPageToken(java.lang.String pageToken) {
this.pageToken = pageToken;
return this;
}
@Override
public List set(String parameterName, Object value) {
return (List) super.set(parameterName, value);
}
}
}
/**
* An accessor for creating requests from the Runtimes collection.
*
* The typical use is:
*
* {@code CloudFunctions cloudfunctions = new CloudFunctions(...);}
* {@code CloudFunctions.Runtimes.List request = cloudfunctions.runtimes().list(parameters ...)}
*
*
* @return the resource collection
*/
public Runtimes runtimes() {
return new Runtimes();
}
/**
* The "runtimes" collection of methods.
*/
public class Runtimes {
/**
* Returns a list of runtimes that are supported for the requested project.
*
* Create a request for the method "runtimes.list".
*
* This request holds the parameters needed by the cloudfunctions server. After setting any
* optional parameters, call the {@link List#execute()} method to invoke the remote operation.
*
* @param parent Required. The project and location from which the runtimes should be listed, specified in the format
* `projects/locations`
* @return the request
*/
public List list(java.lang.String parent) throws java.io.IOException {
List result = new List(parent);
initialize(result);
return result;
}
public class List extends CloudFunctionsRequest {
private static final String REST_PATH = "v2/{+parent}/runtimes";
private final java.util.regex.Pattern PARENT_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+$");
/**
* Returns a list of runtimes that are supported for the requested project.
*
* Create a request for the method "runtimes.list".
*
* This request holds the parameters needed by the the cloudfunctions server. After setting any
* optional parameters, call the {@link List#execute()} method to invoke the remote operation.
* {@link List#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 from which the runtimes should be listed, specified in the format
* `projects/locations`
* @since 1.13
*/
protected List(java.lang.String parent) {
super(CloudFunctions.this, "GET", REST_PATH, null, com.google.api.services.cloudfunctions.v2.model.ListRuntimesResponse.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/[^/]+$");
}
}
@Override
public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
return super.executeUsingHead();
}
@Override
public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
return super.buildHttpRequestUsingHead();
}
@Override
public List set$Xgafv(java.lang.String $Xgafv) {
return (List) super.set$Xgafv($Xgafv);
}
@Override
public List setAccessToken(java.lang.String accessToken) {
return (List) super.setAccessToken(accessToken);
}
@Override
public List setAlt(java.lang.String alt) {
return (List) super.setAlt(alt);
}
@Override
public List setCallback(java.lang.String callback) {
return (List) super.setCallback(callback);
}
@Override
public List setFields(java.lang.String fields) {
return (List) super.setFields(fields);
}
@Override
public List setKey(java.lang.String key) {
return (List) super.setKey(key);
}
@Override
public List setOauthToken(java.lang.String oauthToken) {
return (List) super.setOauthToken(oauthToken);
}
@Override
public List setPrettyPrint(java.lang.Boolean prettyPrint) {
return (List) super.setPrettyPrint(prettyPrint);
}
@Override
public List setQuotaUser(java.lang.String quotaUser) {
return (List) super.setQuotaUser(quotaUser);
}
@Override
public List setUploadType(java.lang.String uploadType) {
return (List) super.setUploadType(uploadType);
}
@Override
public List setUploadProtocol(java.lang.String uploadProtocol) {
return (List) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. The project and location from which the runtimes should be listed, specified
* in the format `projects/locations`
*/
@com.google.api.client.util.Key
private java.lang.String parent;
/** Required. The project and location from which the runtimes should be listed, specified in the
format `projects/locations`
*/
public java.lang.String getParent() {
return parent;
}
/**
* Required. The project and location from which the runtimes should be listed, specified
* in the format `projects/locations`
*/
public List 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;
}
/**
* The filter for Runtimes that match the filter expression, following the syntax outlined
* in https://google.aip.dev/160.
*/
@com.google.api.client.util.Key
private java.lang.String filter;
/** The filter for Runtimes that match the filter expression, following the syntax outlined in
https://google.aip.dev/160.
*/
public java.lang.String getFilter() {
return filter;
}
/**
* The filter for Runtimes that match the filter expression, following the syntax outlined
* in https://google.aip.dev/160.
*/
public List setFilter(java.lang.String filter) {
this.filter = filter;
return this;
}
@Override
public List set(String parameterName, Object value) {
return (List) super.set(parameterName, value);
}
}
}
}
}
/**
* Builder for {@link CloudFunctions}.
*
*
* Implementation is not thread-safe.
*
*
* @since 1.3.0
*/
public static final class Builder extends com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient.Builder {
private static String chooseEndpoint(com.google.api.client.http.HttpTransport transport) {
// If the GOOGLE_API_USE_MTLS_ENDPOINT environment variable value is "always", use mTLS endpoint.
// If the env variable is "auto", use mTLS endpoint if and only if the transport is mTLS.
// Use the regular endpoint for all other cases.
String useMtlsEndpoint = System.getenv("GOOGLE_API_USE_MTLS_ENDPOINT");
useMtlsEndpoint = useMtlsEndpoint == null ? "auto" : useMtlsEndpoint;
if ("always".equals(useMtlsEndpoint) || ("auto".equals(useMtlsEndpoint) && transport != null && transport.isMtls())) {
return DEFAULT_MTLS_ROOT_URL;
}
return DEFAULT_ROOT_URL;
}
/**
* Returns an instance of a new builder.
*
* @param transport HTTP transport, which should normally be:
*
* - Google App Engine:
* {@code com.google.api.client.extensions.appengine.http.UrlFetchTransport}
* - Android: {@code newCompatibleTransport} from
* {@code com.google.api.client.extensions.android.http.AndroidHttp}
* - Java: {@link com.google.api.client.googleapis.javanet.GoogleNetHttpTransport#newTrustedTransport()}
*
*
* @param jsonFactory JSON factory, which may be:
*
* - Jackson: {@code com.google.api.client.json.jackson2.JacksonFactory}
* - Google GSON: {@code com.google.api.client.json.gson.GsonFactory}
* - Android Honeycomb or higher:
* {@code com.google.api.client.extensions.android.json.AndroidJsonFactory}
*
* @param httpRequestInitializer HTTP request initializer or {@code null} for none
* @since 1.7
*/
public Builder(com.google.api.client.http.HttpTransport transport, com.google.api.client.json.JsonFactory jsonFactory,
com.google.api.client.http.HttpRequestInitializer httpRequestInitializer) {
super(
transport,
jsonFactory,
Builder.chooseEndpoint(transport),
DEFAULT_SERVICE_PATH,
httpRequestInitializer,
false);
setBatchPath(DEFAULT_BATCH_PATH);
}
/** Builds a new instance of {@link CloudFunctions}. */
@Override
public CloudFunctions build() {
return new CloudFunctions(this);
}
@Override
public Builder setRootUrl(String rootUrl) {
return (Builder) super.setRootUrl(rootUrl);
}
@Override
public Builder setServicePath(String servicePath) {
return (Builder) super.setServicePath(servicePath);
}
@Override
public Builder setBatchPath(String batchPath) {
return (Builder) super.setBatchPath(batchPath);
}
@Override
public Builder setHttpRequestInitializer(com.google.api.client.http.HttpRequestInitializer httpRequestInitializer) {
return (Builder) super.setHttpRequestInitializer(httpRequestInitializer);
}
@Override
public Builder setApplicationName(String applicationName) {
return (Builder) super.setApplicationName(applicationName);
}
@Override
public Builder setSuppressPatternChecks(boolean suppressPatternChecks) {
return (Builder) super.setSuppressPatternChecks(suppressPatternChecks);
}
@Override
public Builder setSuppressRequiredParameterChecks(boolean suppressRequiredParameterChecks) {
return (Builder) super.setSuppressRequiredParameterChecks(suppressRequiredParameterChecks);
}
@Override
public Builder setSuppressAllChecks(boolean suppressAllChecks) {
return (Builder) super.setSuppressAllChecks(suppressAllChecks);
}
/**
* Set the {@link CloudFunctionsRequestInitializer}.
*
* @since 1.12
*/
public Builder setCloudFunctionsRequestInitializer(
CloudFunctionsRequestInitializer cloudfunctionsRequestInitializer) {
return (Builder) super.setGoogleClientRequestInitializer(cloudfunctionsRequestInitializer);
}
@Override
public Builder setGoogleClientRequestInitializer(
com.google.api.client.googleapis.services.GoogleClientRequestInitializer googleClientRequestInitializer) {
return (Builder) super.setGoogleClientRequestInitializer(googleClientRequestInitializer);
}
}
}