com.google.api.services.cloudfunctions.v2alpha.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.v2alpha;
/**
* Service definition for CloudFunctions (v2alpha).
*
*
* 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 = "v2alpha/{+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.v2alpha.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 {
/**
* Aborts generation upgrade process for a function with the given name from the specified project.
* Deletes all 2nd Gen copy related configuration and resources which were created during the
* upgrade process.
*
* Create a request for the method "functions.abortFunctionUpgrade".
*
* This request holds the parameters needed by the cloudfunctions server. After setting any
* optional parameters, call the {@link AbortFunctionUpgrade#execute()} method to invoke the remote
* operation.
*
* @param name Required. The name of the function for which upgrade should be aborted.
* @param content the {@link com.google.api.services.cloudfunctions.v2alpha.model.AbortFunctionUpgradeRequest}
* @return the request
*/
public AbortFunctionUpgrade abortFunctionUpgrade(java.lang.String name, com.google.api.services.cloudfunctions.v2alpha.model.AbortFunctionUpgradeRequest content) throws java.io.IOException {
AbortFunctionUpgrade result = new AbortFunctionUpgrade(name, content);
initialize(result);
return result;
}
public class AbortFunctionUpgrade extends CloudFunctionsRequest {
private static final String REST_PATH = "v2alpha/{+name}:abortFunctionUpgrade";
private final java.util.regex.Pattern NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+/functions/[^/]+$");
/**
* Aborts generation upgrade process for a function with the given name from the specified
* project. Deletes all 2nd Gen copy related configuration and resources which were created during
* the upgrade process.
*
* Create a request for the method "functions.abortFunctionUpgrade".
*
* This request holds the parameters needed by the the cloudfunctions server. After setting any
* optional parameters, call the {@link AbortFunctionUpgrade#execute()} method to invoke the
* remote operation. {@link AbortFunctionUpgrade#initialize(com.google.api.client.googleapis.s
* ervices.AbstractGoogleClientRequest)} must be called to initialize this instance immediately
* after invoking the constructor.
*
* @param name Required. The name of the function for which upgrade should be aborted.
* @param content the {@link com.google.api.services.cloudfunctions.v2alpha.model.AbortFunctionUpgradeRequest}
* @since 1.13
*/
protected AbortFunctionUpgrade(java.lang.String name, com.google.api.services.cloudfunctions.v2alpha.model.AbortFunctionUpgradeRequest content) {
super(CloudFunctions.this, "POST", REST_PATH, content, com.google.api.services.cloudfunctions.v2alpha.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 AbortFunctionUpgrade set$Xgafv(java.lang.String $Xgafv) {
return (AbortFunctionUpgrade) super.set$Xgafv($Xgafv);
}
@Override
public AbortFunctionUpgrade setAccessToken(java.lang.String accessToken) {
return (AbortFunctionUpgrade) super.setAccessToken(accessToken);
}
@Override
public AbortFunctionUpgrade setAlt(java.lang.String alt) {
return (AbortFunctionUpgrade) super.setAlt(alt);
}
@Override
public AbortFunctionUpgrade setCallback(java.lang.String callback) {
return (AbortFunctionUpgrade) super.setCallback(callback);
}
@Override
public AbortFunctionUpgrade setFields(java.lang.String fields) {
return (AbortFunctionUpgrade) super.setFields(fields);
}
@Override
public AbortFunctionUpgrade setKey(java.lang.String key) {
return (AbortFunctionUpgrade) super.setKey(key);
}
@Override
public AbortFunctionUpgrade setOauthToken(java.lang.String oauthToken) {
return (AbortFunctionUpgrade) super.setOauthToken(oauthToken);
}
@Override
public AbortFunctionUpgrade setPrettyPrint(java.lang.Boolean prettyPrint) {
return (AbortFunctionUpgrade) super.setPrettyPrint(prettyPrint);
}
@Override
public AbortFunctionUpgrade setQuotaUser(java.lang.String quotaUser) {
return (AbortFunctionUpgrade) super.setQuotaUser(quotaUser);
}
@Override
public AbortFunctionUpgrade setUploadType(java.lang.String uploadType) {
return (AbortFunctionUpgrade) super.setUploadType(uploadType);
}
@Override
public AbortFunctionUpgrade setUploadProtocol(java.lang.String uploadProtocol) {
return (AbortFunctionUpgrade) super.setUploadProtocol(uploadProtocol);
}
/** Required. The name of the function for which upgrade should be aborted. */
@com.google.api.client.util.Key
private java.lang.String name;
/** Required. The name of the function for which upgrade should be aborted.
*/
public java.lang.String getName() {
return name;
}
/** Required. The name of the function for which upgrade should be aborted. */
public AbortFunctionUpgrade 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 AbortFunctionUpgrade set(String parameterName, Object value) {
return (AbortFunctionUpgrade) super.set(parameterName, value);
}
}
/**
* Finalizes the upgrade after which function upgrade can not be rolled back. This is the last step
* of the multi step process to upgrade 1st Gen functions to 2nd Gen. Deletes all original 1st Gen
* related configuration and resources.
*
* Create a request for the method "functions.commitFunctionUpgrade".
*
* This request holds the parameters needed by the cloudfunctions server. After setting any
* optional parameters, call the {@link CommitFunctionUpgrade#execute()} method to invoke the remote
* operation.
*
* @param name Required. The name of the function for which upgrade should be finalized.
* @param content the {@link com.google.api.services.cloudfunctions.v2alpha.model.CommitFunctionUpgradeRequest}
* @return the request
*/
public CommitFunctionUpgrade commitFunctionUpgrade(java.lang.String name, com.google.api.services.cloudfunctions.v2alpha.model.CommitFunctionUpgradeRequest content) throws java.io.IOException {
CommitFunctionUpgrade result = new CommitFunctionUpgrade(name, content);
initialize(result);
return result;
}
public class CommitFunctionUpgrade extends CloudFunctionsRequest {
private static final String REST_PATH = "v2alpha/{+name}:commitFunctionUpgrade";
private final java.util.regex.Pattern NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+/functions/[^/]+$");
/**
* Finalizes the upgrade after which function upgrade can not be rolled back. This is the last
* step of the multi step process to upgrade 1st Gen functions to 2nd Gen. Deletes all original
* 1st Gen related configuration and resources.
*
* Create a request for the method "functions.commitFunctionUpgrade".
*
* This request holds the parameters needed by the the cloudfunctions server. After setting any
* optional parameters, call the {@link CommitFunctionUpgrade#execute()} method to invoke the
* remote operation. {@link CommitFunctionUpgrade#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 for which upgrade should be finalized.
* @param content the {@link com.google.api.services.cloudfunctions.v2alpha.model.CommitFunctionUpgradeRequest}
* @since 1.13
*/
protected CommitFunctionUpgrade(java.lang.String name, com.google.api.services.cloudfunctions.v2alpha.model.CommitFunctionUpgradeRequest content) {
super(CloudFunctions.this, "POST", REST_PATH, content, com.google.api.services.cloudfunctions.v2alpha.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 CommitFunctionUpgrade set$Xgafv(java.lang.String $Xgafv) {
return (CommitFunctionUpgrade) super.set$Xgafv($Xgafv);
}
@Override
public CommitFunctionUpgrade setAccessToken(java.lang.String accessToken) {
return (CommitFunctionUpgrade) super.setAccessToken(accessToken);
}
@Override
public CommitFunctionUpgrade setAlt(java.lang.String alt) {
return (CommitFunctionUpgrade) super.setAlt(alt);
}
@Override
public CommitFunctionUpgrade setCallback(java.lang.String callback) {
return (CommitFunctionUpgrade) super.setCallback(callback);
}
@Override
public CommitFunctionUpgrade setFields(java.lang.String fields) {
return (CommitFunctionUpgrade) super.setFields(fields);
}
@Override
public CommitFunctionUpgrade setKey(java.lang.String key) {
return (CommitFunctionUpgrade) super.setKey(key);
}
@Override
public CommitFunctionUpgrade setOauthToken(java.lang.String oauthToken) {
return (CommitFunctionUpgrade) super.setOauthToken(oauthToken);
}
@Override
public CommitFunctionUpgrade setPrettyPrint(java.lang.Boolean prettyPrint) {
return (CommitFunctionUpgrade) super.setPrettyPrint(prettyPrint);
}
@Override
public CommitFunctionUpgrade setQuotaUser(java.lang.String quotaUser) {
return (CommitFunctionUpgrade) super.setQuotaUser(quotaUser);
}
@Override
public CommitFunctionUpgrade setUploadType(java.lang.String uploadType) {
return (CommitFunctionUpgrade) super.setUploadType(uploadType);
}
@Override
public CommitFunctionUpgrade setUploadProtocol(java.lang.String uploadProtocol) {
return (CommitFunctionUpgrade) super.setUploadProtocol(uploadProtocol);
}
/** Required. The name of the function for which upgrade should be finalized. */
@com.google.api.client.util.Key
private java.lang.String name;
/** Required. The name of the function for which upgrade should be finalized.
*/
public java.lang.String getName() {
return name;
}
/** Required. The name of the function for which upgrade should be finalized. */
public CommitFunctionUpgrade 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 CommitFunctionUpgrade set(String parameterName, Object value) {
return (CommitFunctionUpgrade) super.set(parameterName, value);
}
}
/**
* 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.v2alpha.model.Function}
* @return the request
*/
public Create create(java.lang.String parent, com.google.api.services.cloudfunctions.v2alpha.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 = "v2alpha/{+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.v2alpha.model.Function}
* @since 1.13
*/
protected Create(java.lang.String parent, com.google.api.services.cloudfunctions.v2alpha.model.Function content) {
super(CloudFunctions.this, "POST", REST_PATH, content, com.google.api.services.cloudfunctions.v2alpha.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 = "v2alpha/{+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.v2alpha.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);
}
}
/**
* Detaches 2nd Gen function to Cloud Run function.
*
* Create a request for the method "functions.detachFunction".
*
* This request holds the parameters needed by the cloudfunctions server. After setting any
* optional parameters, call the {@link DetachFunction#execute()} method to invoke the remote
* operation.
*
* @param name Required. The name of the function for which should be detached.
* @param content the {@link com.google.api.services.cloudfunctions.v2alpha.model.DetachFunctionRequest}
* @return the request
*/
public DetachFunction detachFunction(java.lang.String name, com.google.api.services.cloudfunctions.v2alpha.model.DetachFunctionRequest content) throws java.io.IOException {
DetachFunction result = new DetachFunction(name, content);
initialize(result);
return result;
}
public class DetachFunction extends CloudFunctionsRequest {
private static final String REST_PATH = "v2alpha/{+name}:detachFunction";
private final java.util.regex.Pattern NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+/functions/[^/]+$");
/**
* Detaches 2nd Gen function to Cloud Run function.
*
* Create a request for the method "functions.detachFunction".
*
* This request holds the parameters needed by the the cloudfunctions server. After setting any
* optional parameters, call the {@link DetachFunction#execute()} method to invoke the remote
* operation. {@link DetachFunction#initialize(com.google.api.client.googleapis.services.Abstr
* actGoogleClientRequest)} must be called to initialize this instance immediately after invoking
* the constructor.
*
* @param name Required. The name of the function for which should be detached.
* @param content the {@link com.google.api.services.cloudfunctions.v2alpha.model.DetachFunctionRequest}
* @since 1.13
*/
protected DetachFunction(java.lang.String name, com.google.api.services.cloudfunctions.v2alpha.model.DetachFunctionRequest content) {
super(CloudFunctions.this, "POST", REST_PATH, content, com.google.api.services.cloudfunctions.v2alpha.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 DetachFunction set$Xgafv(java.lang.String $Xgafv) {
return (DetachFunction) super.set$Xgafv($Xgafv);
}
@Override
public DetachFunction setAccessToken(java.lang.String accessToken) {
return (DetachFunction) super.setAccessToken(accessToken);
}
@Override
public DetachFunction setAlt(java.lang.String alt) {
return (DetachFunction) super.setAlt(alt);
}
@Override
public DetachFunction setCallback(java.lang.String callback) {
return (DetachFunction) super.setCallback(callback);
}
@Override
public DetachFunction setFields(java.lang.String fields) {
return (DetachFunction) super.setFields(fields);
}
@Override
public DetachFunction setKey(java.lang.String key) {
return (DetachFunction) super.setKey(key);
}
@Override
public DetachFunction setOauthToken(java.lang.String oauthToken) {
return (DetachFunction) super.setOauthToken(oauthToken);
}
@Override
public DetachFunction setPrettyPrint(java.lang.Boolean prettyPrint) {
return (DetachFunction) super.setPrettyPrint(prettyPrint);
}
@Override
public DetachFunction setQuotaUser(java.lang.String quotaUser) {
return (DetachFunction) super.setQuotaUser(quotaUser);
}
@Override
public DetachFunction setUploadType(java.lang.String uploadType) {
return (DetachFunction) super.setUploadType(uploadType);
}
@Override
public DetachFunction setUploadProtocol(java.lang.String uploadProtocol) {
return (DetachFunction) super.setUploadProtocol(uploadProtocol);
}
/** Required. The name of the function for which should be detached. */
@com.google.api.client.util.Key
private java.lang.String name;
/** Required. The name of the function for which should be detached.
*/
public java.lang.String getName() {
return name;
}
/** Required. The name of the function for which should be detached. */
public DetachFunction 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 DetachFunction set(String parameterName, Object value) {
return (DetachFunction) 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.v2alpha.model.GenerateDownloadUrlRequest}
* @return the request
*/
public GenerateDownloadUrl generateDownloadUrl(java.lang.String name, com.google.api.services.cloudfunctions.v2alpha.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 = "v2alpha/{+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.v2alpha.model.GenerateDownloadUrlRequest}
* @since 1.13
*/
protected GenerateDownloadUrl(java.lang.String name, com.google.api.services.cloudfunctions.v2alpha.model.GenerateDownloadUrlRequest content) {
super(CloudFunctions.this, "POST", REST_PATH, content, com.google.api.services.cloudfunctions.v2alpha.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, specify this header: * `content-type: application/zip` Do not specify
* this header: * `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.v2alpha.model.GenerateUploadUrlRequest}
* @return the request
*/
public GenerateUploadUrl generateUploadUrl(java.lang.String parent, com.google.api.services.cloudfunctions.v2alpha.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 = "v2alpha/{+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, specify this header: * `content-type:
* application/zip` Do not specify this header: * `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.v2alpha.model.GenerateUploadUrlRequest}
* @since 1.13
*/
protected GenerateUploadUrl(java.lang.String parent, com.google.api.services.cloudfunctions.v2alpha.model.GenerateUploadUrlRequest content) {
super(CloudFunctions.this, "POST", REST_PATH, content, com.google.api.services.cloudfunctions.v2alpha.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 = "v2alpha/{+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.v2alpha.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;
}
/**
* Optional. The optional version of the 1st gen function whose details should be
* obtained. The version of a 1st gen function is an integer that starts from 1 and gets
* incremented on redeployments. GCF may keep historical configs for old versions of 1st
* gen function. This field can be specified to fetch the historical configs. This field
* is valid only for GCF 1st gen function.
*/
@com.google.api.client.util.Key
private java.lang.String revision;
/** Optional. The optional version of the 1st gen function whose details should be obtained. The
version of a 1st gen function is an integer that starts from 1 and gets incremented on
redeployments. GCF may keep historical configs for old versions of 1st gen function. This field can
be specified to fetch the historical configs. This field is valid only for GCF 1st gen function.
*/
public java.lang.String getRevision() {
return revision;
}
/**
* Optional. The optional version of the 1st gen function whose details should be
* obtained. The version of a 1st gen function is an integer that starts from 1 and gets
* incremented on redeployments. GCF may keep historical configs for old versions of 1st
* gen function. This field can be specified to fetch the historical configs. This field
* is valid only for GCF 1st gen function.
*/
public Get setRevision(java.lang.String revision) {
this.revision = revision;
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 = "v2alpha/{+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.v2alpha.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 = "v2alpha/{+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.v2alpha.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 order 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 order 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 order 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.v2alpha.model.Function}
* @return the request
*/
public Patch patch(java.lang.String name, com.google.api.services.cloudfunctions.v2alpha.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 = "v2alpha/{+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.v2alpha.model.Function}
* @since 1.13
*/
protected Patch(java.lang.String name, com.google.api.services.cloudfunctions.v2alpha.model.Function content) {
super(CloudFunctions.this, "PATCH", REST_PATH, content, com.google.api.services.cloudfunctions.v2alpha.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 fields 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 fields will be updated.
*/
public String getUpdateMask() {
return updateMask;
}
/**
* The list of fields to be updated. If no field mask is provided, all fields 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);
}
}
/**
* Changes the traffic target of a function from the original 1st Gen function to the 2nd Gen copy.
* This is the second step of the multi step process to upgrade 1st Gen functions to 2nd Gen. After
* this operation, all new traffic will be served by 2nd Gen copy.
*
* Create a request for the method "functions.redirectFunctionUpgradeTraffic".
*
* This request holds the parameters needed by the cloudfunctions server. After setting any
* optional parameters, call the {@link RedirectFunctionUpgradeTraffic#execute()} method to invoke
* the remote operation.
*
* @param name Required. The name of the function for which traffic target should be changed to 2nd Gen from 1st
* Gen.
* @param content the {@link com.google.api.services.cloudfunctions.v2alpha.model.RedirectFunctionUpgradeTrafficRequest}
* @return the request
*/
public RedirectFunctionUpgradeTraffic redirectFunctionUpgradeTraffic(java.lang.String name, com.google.api.services.cloudfunctions.v2alpha.model.RedirectFunctionUpgradeTrafficRequest content) throws java.io.IOException {
RedirectFunctionUpgradeTraffic result = new RedirectFunctionUpgradeTraffic(name, content);
initialize(result);
return result;
}
public class RedirectFunctionUpgradeTraffic extends CloudFunctionsRequest {
private static final String REST_PATH = "v2alpha/{+name}:redirectFunctionUpgradeTraffic";
private final java.util.regex.Pattern NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+/functions/[^/]+$");
/**
* Changes the traffic target of a function from the original 1st Gen function to the 2nd Gen
* copy. This is the second step of the multi step process to upgrade 1st Gen functions to 2nd
* Gen. After this operation, all new traffic will be served by 2nd Gen copy.
*
* Create a request for the method "functions.redirectFunctionUpgradeTraffic".
*
* This request holds the parameters needed by the the cloudfunctions server. After setting any
* optional parameters, call the {@link RedirectFunctionUpgradeTraffic#execute()} method to invoke
* the remote operation. {@link RedirectFunctionUpgradeTraffic#initialize(com.google.api.clien
* t.googleapis.services.AbstractGoogleClientRequest)} must be called to initialize this instance
* immediately after invoking the constructor.
*
* @param name Required. The name of the function for which traffic target should be changed to 2nd Gen from 1st
* Gen.
* @param content the {@link com.google.api.services.cloudfunctions.v2alpha.model.RedirectFunctionUpgradeTrafficRequest}
* @since 1.13
*/
protected RedirectFunctionUpgradeTraffic(java.lang.String name, com.google.api.services.cloudfunctions.v2alpha.model.RedirectFunctionUpgradeTrafficRequest content) {
super(CloudFunctions.this, "POST", REST_PATH, content, com.google.api.services.cloudfunctions.v2alpha.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 RedirectFunctionUpgradeTraffic set$Xgafv(java.lang.String $Xgafv) {
return (RedirectFunctionUpgradeTraffic) super.set$Xgafv($Xgafv);
}
@Override
public RedirectFunctionUpgradeTraffic setAccessToken(java.lang.String accessToken) {
return (RedirectFunctionUpgradeTraffic) super.setAccessToken(accessToken);
}
@Override
public RedirectFunctionUpgradeTraffic setAlt(java.lang.String alt) {
return (RedirectFunctionUpgradeTraffic) super.setAlt(alt);
}
@Override
public RedirectFunctionUpgradeTraffic setCallback(java.lang.String callback) {
return (RedirectFunctionUpgradeTraffic) super.setCallback(callback);
}
@Override
public RedirectFunctionUpgradeTraffic setFields(java.lang.String fields) {
return (RedirectFunctionUpgradeTraffic) super.setFields(fields);
}
@Override
public RedirectFunctionUpgradeTraffic setKey(java.lang.String key) {
return (RedirectFunctionUpgradeTraffic) super.setKey(key);
}
@Override
public RedirectFunctionUpgradeTraffic setOauthToken(java.lang.String oauthToken) {
return (RedirectFunctionUpgradeTraffic) super.setOauthToken(oauthToken);
}
@Override
public RedirectFunctionUpgradeTraffic setPrettyPrint(java.lang.Boolean prettyPrint) {
return (RedirectFunctionUpgradeTraffic) super.setPrettyPrint(prettyPrint);
}
@Override
public RedirectFunctionUpgradeTraffic setQuotaUser(java.lang.String quotaUser) {
return (RedirectFunctionUpgradeTraffic) super.setQuotaUser(quotaUser);
}
@Override
public RedirectFunctionUpgradeTraffic setUploadType(java.lang.String uploadType) {
return (RedirectFunctionUpgradeTraffic) super.setUploadType(uploadType);
}
@Override
public RedirectFunctionUpgradeTraffic setUploadProtocol(java.lang.String uploadProtocol) {
return (RedirectFunctionUpgradeTraffic) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. The name of the function for which traffic target should be changed to 2nd
* Gen from 1st Gen.
*/
@com.google.api.client.util.Key
private java.lang.String name;
/** Required. The name of the function for which traffic target should be changed to 2nd Gen from 1st
Gen.
*/
public java.lang.String getName() {
return name;
}
/**
* Required. The name of the function for which traffic target should be changed to 2nd
* Gen from 1st Gen.
*/
public RedirectFunctionUpgradeTraffic 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 RedirectFunctionUpgradeTraffic set(String parameterName, Object value) {
return (RedirectFunctionUpgradeTraffic) super.set(parameterName, value);
}
}
/**
* Reverts the traffic target of a function from the 2nd Gen copy to the original 1st Gen function.
* After this operation, all new traffic would be served by the 1st Gen.
*
* Create a request for the method "functions.rollbackFunctionUpgradeTraffic".
*
* This request holds the parameters needed by the cloudfunctions server. After setting any
* optional parameters, call the {@link RollbackFunctionUpgradeTraffic#execute()} method to invoke
* the remote operation.
*
* @param name Required. The name of the function for which traffic target should be changed back to 1st Gen from
* 2nd Gen.
* @param content the {@link com.google.api.services.cloudfunctions.v2alpha.model.RollbackFunctionUpgradeTrafficRequest}
* @return the request
*/
public RollbackFunctionUpgradeTraffic rollbackFunctionUpgradeTraffic(java.lang.String name, com.google.api.services.cloudfunctions.v2alpha.model.RollbackFunctionUpgradeTrafficRequest content) throws java.io.IOException {
RollbackFunctionUpgradeTraffic result = new RollbackFunctionUpgradeTraffic(name, content);
initialize(result);
return result;
}
public class RollbackFunctionUpgradeTraffic extends CloudFunctionsRequest {
private static final String REST_PATH = "v2alpha/{+name}:rollbackFunctionUpgradeTraffic";
private final java.util.regex.Pattern NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+/functions/[^/]+$");
/**
* Reverts the traffic target of a function from the 2nd Gen copy to the original 1st Gen
* function. After this operation, all new traffic would be served by the 1st Gen.
*
* Create a request for the method "functions.rollbackFunctionUpgradeTraffic".
*
* This request holds the parameters needed by the the cloudfunctions server. After setting any
* optional parameters, call the {@link RollbackFunctionUpgradeTraffic#execute()} method to invoke
* the remote operation. {@link RollbackFunctionUpgradeTraffic#initialize(com.google.api.clien
* t.googleapis.services.AbstractGoogleClientRequest)} must be called to initialize this instance
* immediately after invoking the constructor.
*
* @param name Required. The name of the function for which traffic target should be changed back to 1st Gen from
* 2nd Gen.
* @param content the {@link com.google.api.services.cloudfunctions.v2alpha.model.RollbackFunctionUpgradeTrafficRequest}
* @since 1.13
*/
protected RollbackFunctionUpgradeTraffic(java.lang.String name, com.google.api.services.cloudfunctions.v2alpha.model.RollbackFunctionUpgradeTrafficRequest content) {
super(CloudFunctions.this, "POST", REST_PATH, content, com.google.api.services.cloudfunctions.v2alpha.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 RollbackFunctionUpgradeTraffic set$Xgafv(java.lang.String $Xgafv) {
return (RollbackFunctionUpgradeTraffic) super.set$Xgafv($Xgafv);
}
@Override
public RollbackFunctionUpgradeTraffic setAccessToken(java.lang.String accessToken) {
return (RollbackFunctionUpgradeTraffic) super.setAccessToken(accessToken);
}
@Override
public RollbackFunctionUpgradeTraffic setAlt(java.lang.String alt) {
return (RollbackFunctionUpgradeTraffic) super.setAlt(alt);
}
@Override
public RollbackFunctionUpgradeTraffic setCallback(java.lang.String callback) {
return (RollbackFunctionUpgradeTraffic) super.setCallback(callback);
}
@Override
public RollbackFunctionUpgradeTraffic setFields(java.lang.String fields) {
return (RollbackFunctionUpgradeTraffic) super.setFields(fields);
}
@Override
public RollbackFunctionUpgradeTraffic setKey(java.lang.String key) {
return (RollbackFunctionUpgradeTraffic) super.setKey(key);
}
@Override
public RollbackFunctionUpgradeTraffic setOauthToken(java.lang.String oauthToken) {
return (RollbackFunctionUpgradeTraffic) super.setOauthToken(oauthToken);
}
@Override
public RollbackFunctionUpgradeTraffic setPrettyPrint(java.lang.Boolean prettyPrint) {
return (RollbackFunctionUpgradeTraffic) super.setPrettyPrint(prettyPrint);
}
@Override
public RollbackFunctionUpgradeTraffic setQuotaUser(java.lang.String quotaUser) {
return (RollbackFunctionUpgradeTraffic) super.setQuotaUser(quotaUser);
}
@Override
public RollbackFunctionUpgradeTraffic setUploadType(java.lang.String uploadType) {
return (RollbackFunctionUpgradeTraffic) super.setUploadType(uploadType);
}
@Override
public RollbackFunctionUpgradeTraffic setUploadProtocol(java.lang.String uploadProtocol) {
return (RollbackFunctionUpgradeTraffic) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. The name of the function for which traffic target should be changed back to
* 1st Gen from 2nd Gen.
*/
@com.google.api.client.util.Key
private java.lang.String name;
/** Required. The name of the function for which traffic target should be changed back to 1st Gen from
2nd Gen.
*/
public java.lang.String getName() {
return name;
}
/**
* Required. The name of the function for which traffic target should be changed back to
* 1st Gen from 2nd Gen.
*/
public RollbackFunctionUpgradeTraffic 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 RollbackFunctionUpgradeTraffic set(String parameterName, Object value) {
return (RollbackFunctionUpgradeTraffic) 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.v2alpha.model.SetIamPolicyRequest}
* @return the request
*/
public SetIamPolicy setIamPolicy(java.lang.String resource, com.google.api.services.cloudfunctions.v2alpha.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 = "v2alpha/{+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.v2alpha.model.SetIamPolicyRequest}
* @since 1.13
*/
protected SetIamPolicy(java.lang.String resource, com.google.api.services.cloudfunctions.v2alpha.model.SetIamPolicyRequest content) {
super(CloudFunctions.this, "POST", REST_PATH, content, com.google.api.services.cloudfunctions.v2alpha.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);
}
}
/**
* Creates a 2nd Gen copy of the function configuration based on the 1st Gen function with the given
* name. This is the first step of the multi step process to upgrade 1st Gen functions to 2nd Gen.
* Only 2nd Gen configuration is setup as part of this request and traffic continues to be served by
* 1st Gen.
*
* Create a request for the method "functions.setupFunctionUpgradeConfig".
*
* This request holds the parameters needed by the cloudfunctions server. After setting any
* optional parameters, call the {@link SetupFunctionUpgradeConfig#execute()} method to invoke the
* remote operation.
*
* @param name Required. The name of the function which should have configuration copied for upgrade.
* @param content the {@link com.google.api.services.cloudfunctions.v2alpha.model.SetupFunctionUpgradeConfigRequest}
* @return the request
*/
public SetupFunctionUpgradeConfig setupFunctionUpgradeConfig(java.lang.String name, com.google.api.services.cloudfunctions.v2alpha.model.SetupFunctionUpgradeConfigRequest content) throws java.io.IOException {
SetupFunctionUpgradeConfig result = new SetupFunctionUpgradeConfig(name, content);
initialize(result);
return result;
}
public class SetupFunctionUpgradeConfig extends CloudFunctionsRequest {
private static final String REST_PATH = "v2alpha/{+name}:setupFunctionUpgradeConfig";
private final java.util.regex.Pattern NAME_PATTERN =
java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+/functions/[^/]+$");
/**
* Creates a 2nd Gen copy of the function configuration based on the 1st Gen function with the
* given name. This is the first step of the multi step process to upgrade 1st Gen functions to
* 2nd Gen. Only 2nd Gen configuration is setup as part of this request and traffic continues to
* be served by 1st Gen.
*
* Create a request for the method "functions.setupFunctionUpgradeConfig".
*
* This request holds the parameters needed by the the cloudfunctions server. After setting any
* optional parameters, call the {@link SetupFunctionUpgradeConfig#execute()} method to invoke the
* remote operation. {@link SetupFunctionUpgradeConfig#initialize(com.google.api.client.google
* apis.services.AbstractGoogleClientRequest)} must be called to initialize this instance
* immediately after invoking the constructor.
*
* @param name Required. The name of the function which should have configuration copied for upgrade.
* @param content the {@link com.google.api.services.cloudfunctions.v2alpha.model.SetupFunctionUpgradeConfigRequest}
* @since 1.13
*/
protected SetupFunctionUpgradeConfig(java.lang.String name, com.google.api.services.cloudfunctions.v2alpha.model.SetupFunctionUpgradeConfigRequest content) {
super(CloudFunctions.this, "POST", REST_PATH, content, com.google.api.services.cloudfunctions.v2alpha.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 SetupFunctionUpgradeConfig set$Xgafv(java.lang.String $Xgafv) {
return (SetupFunctionUpgradeConfig) super.set$Xgafv($Xgafv);
}
@Override
public SetupFunctionUpgradeConfig setAccessToken(java.lang.String accessToken) {
return (SetupFunctionUpgradeConfig) super.setAccessToken(accessToken);
}
@Override
public SetupFunctionUpgradeConfig setAlt(java.lang.String alt) {
return (SetupFunctionUpgradeConfig) super.setAlt(alt);
}
@Override
public SetupFunctionUpgradeConfig setCallback(java.lang.String callback) {
return (SetupFunctionUpgradeConfig) super.setCallback(callback);
}
@Override
public SetupFunctionUpgradeConfig setFields(java.lang.String fields) {
return (SetupFunctionUpgradeConfig) super.setFields(fields);
}
@Override
public SetupFunctionUpgradeConfig setKey(java.lang.String key) {
return (SetupFunctionUpgradeConfig) super.setKey(key);
}
@Override
public SetupFunctionUpgradeConfig setOauthToken(java.lang.String oauthToken) {
return (SetupFunctionUpgradeConfig) super.setOauthToken(oauthToken);
}
@Override
public SetupFunctionUpgradeConfig setPrettyPrint(java.lang.Boolean prettyPrint) {
return (SetupFunctionUpgradeConfig) super.setPrettyPrint(prettyPrint);
}
@Override
public SetupFunctionUpgradeConfig setQuotaUser(java.lang.String quotaUser) {
return (SetupFunctionUpgradeConfig) super.setQuotaUser(quotaUser);
}
@Override
public SetupFunctionUpgradeConfig setUploadType(java.lang.String uploadType) {
return (SetupFunctionUpgradeConfig) super.setUploadType(uploadType);
}
@Override
public SetupFunctionUpgradeConfig setUploadProtocol(java.lang.String uploadProtocol) {
return (SetupFunctionUpgradeConfig) super.setUploadProtocol(uploadProtocol);
}
/**
* Required. The name of the function which should have configuration copied for upgrade.
*/
@com.google.api.client.util.Key
private java.lang.String name;
/** Required. The name of the function which should have configuration copied for upgrade.
*/
public java.lang.String getName() {
return name;
}
/**
* Required. The name of the function which should have configuration copied for upgrade.
*/
public SetupFunctionUpgradeConfig 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 SetupFunctionUpgradeConfig set(String parameterName, Object value) {
return (SetupFunctionUpgradeConfig) 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.v2alpha.model.TestIamPermissionsRequest}
* @return the request
*/
public TestIamPermissions testIamPermissions(java.lang.String resource, com.google.api.services.cloudfunctions.v2alpha.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 = "v2alpha/{+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.v2alpha.model.TestIamPermissionsRequest}
* @since 1.13
*/
protected TestIamPermissions(java.lang.String resource, com.google.api.services.cloudfunctions.v2alpha.model.TestIamPermissionsRequest content) {
super(CloudFunctions.this, "POST", REST_PATH, content, com.google.api.services.cloudfunctions.v2alpha.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 = "v2alpha/{+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.v2alpha.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 The name of the operation's parent resource.
* @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 = "v2alpha/{+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 The name of the operation's parent resource.
* @since 1.13
*/
protected List(java.lang.String name) {
super(CloudFunctions.this, "GET", REST_PATH, null, com.google.api.services.cloudfunctions.v2alpha.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);
}
/** The name of the operation's parent resource. */
@com.google.api.client.util.Key
private java.lang.String name;
/** The name of the operation's parent resource.
*/
public java.lang.String getName() {
return name;
}
/** The name of the operation's parent resource. */
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;
}
/** The standard list filter. */
@com.google.api.client.util.Key
private java.lang.String filter;
/** The standard list filter.
*/
public java.lang.String getFilter() {
return filter;
}
/** The standard list filter. */
public List setFilter(java.lang.String filter) {
this.filter = filter;
return this;
}
/** The standard list page size. */
@com.google.api.client.util.Key
private java.lang.Integer pageSize;
/** The standard list page size.
*/
public java.lang.Integer getPageSize() {
return pageSize;
}
/** The standard list page size. */
public List setPageSize(java.lang.Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/** The standard list page token. */
@com.google.api.client.util.Key
private java.lang.String pageToken;
/** The standard list page token.
*/
public java.lang.String getPageToken() {
return pageToken;
}
/** The standard list page token. */
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 = "v2alpha/{+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.v2alpha.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);
}
@Override
public Builder setUniverseDomain(String universeDomain) {
return (Builder) super.setUniverseDomain(universeDomain);
}
}
}