From 2271ef712ec08f45d9973f543bfbf9243dc6e436 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 8 Feb 2024 00:24:17 -0800 Subject: [PATCH] feat(all): auto-regenerate discovery clients (#2405) --- androidpublisher/v3/androidpublisher-api.json | 6 +- androidpublisher/v3/androidpublisher-gen.go | 21 +- cloudfunctions/v1/cloudfunctions-api.json | 8 +- cloudfunctions/v1/cloudfunctions-gen.go | 11 +- cloudfunctions/v2/cloudfunctions-api.json | 230 ++- cloudfunctions/v2/cloudfunctions-gen.go | 1788 ++++++++++++----- .../v2alpha/cloudfunctions-api.json | 230 ++- cloudfunctions/v2alpha/cloudfunctions-gen.go | 1788 ++++++++++++----- cloudfunctions/v2beta/cloudfunctions-api.json | 230 ++- cloudfunctions/v2beta/cloudfunctions-gen.go | 1788 ++++++++++++----- cloudidentity/v1beta1/cloudidentity-api.json | 4 +- cloudidentity/v1beta1/cloudidentity-gen.go | 3 +- composer/v1/composer-api.json | 366 +++- composer/v1/composer-gen.go | 1733 ++++++++++++++++ compute/v0.alpha/compute-api.json | 63 +- compute/v0.alpha/compute-gen.go | 118 +- dataform/v1beta1/dataform-api.json | 8 +- dataform/v1beta1/dataform-gen.go | 14 +- dataplex/v1/dataplex-api.json | 77 +- dataplex/v1/dataplex-gen.go | 95 + gkebackup/v1/gkebackup-api.json | 4 +- gkebackup/v1/gkebackup-gen.go | 6 +- .../v1/networkconnectivity-api.json | 4 +- .../v1/networkconnectivity-gen.go | 6 +- .../v1alpha1/networkconnectivity-api.json | 4 +- .../v1alpha1/networkconnectivity-gen.go | 6 +- run/v1/run-api.json | 9 +- run/v1/run-gen.go | 1 + run/v2/run-api.json | 7 +- sqladmin/v1/sqladmin-api.json | 17 +- sqladmin/v1/sqladmin-gen.go | 26 +- sqladmin/v1beta4/sqladmin-api.json | 17 +- sqladmin/v1beta4/sqladmin-gen.go | 26 +- storage/v1/storage-api.json | 9 +- storage/v1/storage-gen.go | 15 + testing/v1/testing-api.json | 41 +- testing/v1/testing-gen.go | 63 +- trafficdirector/v3/trafficdirector-api.json | 6 +- trafficdirector/v3/trafficdirector-gen.go | 22 +- 39 files changed, 7287 insertions(+), 1583 deletions(-) diff --git a/androidpublisher/v3/androidpublisher-api.json b/androidpublisher/v3/androidpublisher-api.json index e10b52c1515..af0a26db8a3 100644 --- a/androidpublisher/v3/androidpublisher-api.json +++ b/androidpublisher/v3/androidpublisher-api.json @@ -4724,7 +4724,7 @@ } } }, - "revision": "20240129", + "revision": "20240207", "rootUrl": "https://androidpublisher.googleapis.com/", "schemas": { "Abi": { @@ -5235,6 +5235,10 @@ "description": "Represents a base plan that automatically renews at the end of its subscription period.", "id": "AutoRenewingBasePlanType", "properties": { + "accountHoldDuration": { + "description": "Optional. Account hold period of the subscription, specified in ISO 8601 format. Acceptable values must be in DAYS and in the range P0D (zero days) to P30D (30 days). If not specified, the default value is P30D (30 days).", + "type": "string" + }, "billingPeriodDuration": { "description": "Required. Subscription period, specified in ISO 8601 format. For a list of acceptable billing periods, refer to the help center.", "type": "string" diff --git a/androidpublisher/v3/androidpublisher-gen.go b/androidpublisher/v3/androidpublisher-gen.go index 5c23d5fbb39..745e2e6caa6 100644 --- a/androidpublisher/v3/androidpublisher-gen.go +++ b/androidpublisher/v3/androidpublisher-gen.go @@ -1443,6 +1443,12 @@ func (s *AssetSliceSet) MarshalJSON() ([]byte, error) { // AutoRenewingBasePlanType: Represents a base plan that automatically // renews at the end of its subscription period. type AutoRenewingBasePlanType struct { + // AccountHoldDuration: Optional. Account hold period of the + // subscription, specified in ISO 8601 format. Acceptable values must be + // in DAYS and in the range P0D (zero days) to P30D (30 days). If not + // specified, the default value is P30D (30 days). + AccountHoldDuration string `json:"accountHoldDuration,omitempty"` + // BillingPeriodDuration: Required. Subscription period, specified in // ISO 8601 format. For a list of acceptable billing periods, refer to // the help center. @@ -1495,16 +1501,15 @@ type AutoRenewingBasePlanType struct { // "RESUBSCRIBE_STATE_INACTIVE" - Resubscribe is inactive. ResubscribeState string `json:"resubscribeState,omitempty"` - // ForceSendFields is a list of field names (e.g. - // "BillingPeriodDuration") to unconditionally include in API requests. - // By default, fields with empty or default values are omitted from API - // requests. However, any non-pointer, non-interface field appearing in - // ForceSendFields will be sent to the server regardless of whether the - // field is empty or not. This may be used to include empty fields in - // Patch requests. + // ForceSendFields is a list of field names (e.g. "AccountHoldDuration") + // to unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "BillingPeriodDuration") to + // NullFields is a list of field names (e.g. "AccountHoldDuration") to // include in API requests with the JSON null value. By default, fields // with empty values are omitted from API requests. However, any field // with an empty value appearing in NullFields will be sent to the diff --git a/cloudfunctions/v1/cloudfunctions-api.json b/cloudfunctions/v1/cloudfunctions-api.json index 210ba07f595..2efa379967f 100644 --- a/cloudfunctions/v1/cloudfunctions-api.json +++ b/cloudfunctions/v1/cloudfunctions-api.json @@ -552,7 +552,7 @@ } } }, - "revision": "20240118", + "revision": "20240205", "rootUrl": "https://cloudfunctions.googleapis.com/", "schemas": { "AuditConfig": { @@ -691,6 +691,10 @@ "readOnly": true, "type": "string" }, + "buildServiceAccount": { + "description": "Optional. A service account the user provides for use with Cloud Build.", + "type": "string" + }, "buildWorkerPool": { "description": "Name of the Cloud Build Custom Worker Pool that should be used to build the function. The format of this field is `projects/{project}/locations/{region}/workerPools/{workerPool}` where `{project}` and `{region}` are the project id and region respectively where the worker pool is defined and `{workerPool}` is the short name of the worker pool. If the project id is not the same as the function, then the Cloud Functions Service Agent (`service-@gcf-admin-robot.iam.gserviceaccount.com`) must be granted the role Cloud Build Custom Workers Builder (`roles/cloudbuild.customworkers.builder`) in the project.", "type": "string" @@ -700,7 +704,7 @@ "type": "string" }, "dockerRegistry": { - "description": "Docker Registry to use for this deployment. If `docker_repository` field is specified, this field will be automatically set as `ARTIFACT_REGISTRY`. If unspecified, it currently defaults to `CONTAINER_REGISTRY`. This field may be overridden by the backend for eligible deployments.", + "description": "Docker Registry to use for this deployment. If unspecified, it defaults to `ARTIFACT_REGISTRY`. If `docker_repository` field is specified, this field should either be left unspecified or set to `ARTIFACT_REGISTRY`.", "enum": [ "DOCKER_REGISTRY_UNSPECIFIED", "CONTAINER_REGISTRY", diff --git a/cloudfunctions/v1/cloudfunctions-gen.go b/cloudfunctions/v1/cloudfunctions-gen.go index 5d86d9b4409..8d0eefb9479 100644 --- a/cloudfunctions/v1/cloudfunctions-gen.go +++ b/cloudfunctions/v1/cloudfunctions-gen.go @@ -505,6 +505,10 @@ type CloudFunction struct { // deployment. `projects//locations//builds/`. BuildName string `json:"buildName,omitempty"` + // BuildServiceAccount: Optional. A service account the user provides + // for use with Cloud Build. + BuildServiceAccount string `json:"buildServiceAccount,omitempty"` + // BuildWorkerPool: Name of the Cloud Build Custom Worker Pool that // should be used to build the function. The format of this field is // `projects/{project}/locations/{region}/workerPools/{workerPool}` @@ -521,10 +525,9 @@ type CloudFunction struct { Description string `json:"description,omitempty"` // DockerRegistry: Docker Registry to use for this deployment. If - // `docker_repository` field is specified, this field will be - // automatically set as `ARTIFACT_REGISTRY`. If unspecified, it - // currently defaults to `CONTAINER_REGISTRY`. This field may be - // overridden by the backend for eligible deployments. + // unspecified, it defaults to `ARTIFACT_REGISTRY`. If + // `docker_repository` field is specified, this field should either be + // left unspecified or set to `ARTIFACT_REGISTRY`. // // Possible values: // "DOCKER_REGISTRY_UNSPECIFIED" - Unspecified. diff --git a/cloudfunctions/v2/cloudfunctions-api.json b/cloudfunctions/v2/cloudfunctions-api.json index 9c3260dbcc1..e3024c557d3 100644 --- a/cloudfunctions/v2/cloudfunctions-api.json +++ b/cloudfunctions/v2/cloudfunctions-api.json @@ -154,6 +154,62 @@ "resources": { "functions": { "methods": { + "abortFunctionUpgrade": { + "description": "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.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:abortFunctionUpgrade", + "httpMethod": "POST", + "id": "cloudfunctions.projects.locations.functions.abortFunctionUpgrade", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the function for which upgrade should be aborted.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}:abortFunctionUpgrade", + "request": { + "$ref": "AbortFunctionUpgradeRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "commitFunctionUpgrade": { + "description": "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.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:commitFunctionUpgrade", + "httpMethod": "POST", + "id": "cloudfunctions.projects.locations.functions.commitFunctionUpgrade", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the function for which upgrade should be finalized.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}:commitFunctionUpgrade", + "request": { + "$ref": "CommitFunctionUpgradeRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "create": { "description": "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.", "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions", @@ -404,6 +460,62 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "redirectFunctionUpgradeTraffic": { + "description": "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.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:redirectFunctionUpgradeTraffic", + "httpMethod": "POST", + "id": "cloudfunctions.projects.locations.functions.redirectFunctionUpgradeTraffic", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the function for which traffic target should be changed to 2nd Gen from 1st Gen.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}:redirectFunctionUpgradeTraffic", + "request": { + "$ref": "RedirectFunctionUpgradeTrafficRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "rollbackFunctionUpgradeTraffic": { + "description": "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.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:rollbackFunctionUpgradeTraffic", + "httpMethod": "POST", + "id": "cloudfunctions.projects.locations.functions.rollbackFunctionUpgradeTraffic", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the function for which traffic target should be changed back to 1st Gen from 2nd Gen.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}:rollbackFunctionUpgradeTraffic", + "request": { + "$ref": "RollbackFunctionUpgradeTrafficRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "setIamPolicy": { "description": "Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.", "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:setIamPolicy", @@ -432,6 +544,34 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "setupFunctionUpgradeConfig": { + "description": "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.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:setupFunctionUpgradeConfig", + "httpMethod": "POST", + "id": "cloudfunctions.projects.locations.functions.setupFunctionUpgradeConfig", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the function which should have configuration copied for upgrade.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}:setupFunctionUpgradeConfig", + "request": { + "$ref": "SetupFunctionUpgradeConfigRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "testIamPermissions": { "description": "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.", "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:testIamPermissions", @@ -571,9 +711,15 @@ } } }, - "revision": "20240118", + "revision": "20240205", "rootUrl": "https://cloudfunctions.googleapis.com/", "schemas": { + "AbortFunctionUpgradeRequest": { + "description": "Request for the `AbortFunctionUpgrade` method.", + "id": "AbortFunctionUpgradeRequest", + "properties": {}, + "type": "object" + }, "AuditConfig": { "description": "Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs. If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted. Example Policy with multiple AuditConfigs: { \"audit_configs\": [ { \"service\": \"allServices\", \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\", \"exempted_members\": [ \"user:jose@example.com\" ] }, { \"log_type\": \"DATA_WRITE\" }, { \"log_type\": \"ADMIN_READ\" } ] }, { \"service\": \"sampleservice.googleapis.com\", \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\" }, { \"log_type\": \"DATA_WRITE\", \"exempted_members\": [ \"user:aliya@example.com\" ] } ] } ] } For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts `jose@example.com` from DATA_READ logging, and `aliya@example.com` from DATA_WRITE logging.", "id": "AuditConfig", @@ -724,6 +870,12 @@ }, "type": "object" }, + "CommitFunctionUpgradeRequest": { + "description": "Request for the `CommitFunctionUpgrade` method.", + "id": "CommitFunctionUpgradeRequest", + "properties": {}, + "type": "object" + }, "Date": { "description": "Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp", "id": "Date", @@ -853,6 +1005,12 @@ "$ref": "BuildConfig", "description": "Describes the Build step of the function that builds a container from the given source." }, + "createTime": { + "description": "Output only. The create timestamp of a Cloud Function. This is only applicable to 2nd Gen functions.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, "description": { "description": "User-provided description of a function.", "type": "string" @@ -934,6 +1092,11 @@ "readOnly": true, "type": "string" }, + "upgradeInfo": { + "$ref": "UpgradeInfo", + "description": "Output only. UpgradeInfo for this Cloud Function", + "readOnly": true + }, "url": { "description": "Output only. The deployed url for the function.", "readOnly": true, @@ -1846,6 +2009,12 @@ }, "type": "object" }, + "RedirectFunctionUpgradeTrafficRequest": { + "description": "Request for the `RedirectFunctionUpgradeTraffic` method.", + "id": "RedirectFunctionUpgradeTrafficRequest", + "properties": {}, + "type": "object" + }, "RepoSource": { "description": "Location of the source in a Google Cloud Source Repository.", "id": "RepoSource", @@ -1877,6 +2046,12 @@ }, "type": "object" }, + "RollbackFunctionUpgradeTrafficRequest": { + "description": "Request for the `RollbackFunctionUpgradeTraffic` method.", + "id": "RollbackFunctionUpgradeTrafficRequest", + "properties": {}, + "type": "object" + }, "Runtime": { "description": "Describes a runtime and any special information (e.g., deprecation status) related to it.", "id": "Runtime", @@ -2150,6 +2325,12 @@ }, "type": "object" }, + "SetupFunctionUpgradeConfigRequest": { + "description": "Request for the `SetupFunctionUpgradeConfig` method.", + "id": "SetupFunctionUpgradeConfigRequest", + "properties": {}, + "type": "object" + }, "Source": { "description": "The location of the function source code.", "id": "Source", @@ -2262,6 +2443,53 @@ } }, "type": "object" + }, + "UpgradeInfo": { + "description": "Information related to: * A function's eligibility for 1st Gen to 2nd Gen migration * Current state of migration for function undergoing migration.", + "id": "UpgradeInfo", + "properties": { + "buildConfig": { + "$ref": "BuildConfig", + "description": "Describes the Build step of the function that builds a container to prepare for 2nd gen upgrade." + }, + "eventTrigger": { + "$ref": "EventTrigger", + "description": "Describes the Event trigger which has been setup to prepare for 2nd gen upgrade." + }, + "serviceConfig": { + "$ref": "ServiceConfig", + "description": "Describes the Cloud Run service which has been setup to prepare for 2nd gen upgrade." + }, + "upgradeState": { + "description": "UpgradeState of the function", + "enum": [ + "UPGRADE_STATE_UNSPECIFIED", + "ELIGIBLE_FOR_2ND_GEN_UPGRADE", + "UPGRADE_OPERATION_IN_PROGRESS", + "SETUP_FUNCTION_UPGRADE_CONFIG_SUCCESSFUL", + "SETUP_FUNCTION_UPGRADE_CONFIG_ERROR", + "ABORT_FUNCTION_UPGRADE_ERROR", + "REDIRECT_FUNCTION_UPGRADE_TRAFFIC_SUCCESSFUL", + "REDIRECT_FUNCTION_UPGRADE_TRAFFIC_ERROR", + "ROLLBACK_FUNCTION_UPGRADE_TRAFFIC_ERROR", + "COMMIT_FUNCTION_UPGRADE_ERROR" + ], + "enumDescriptions": [ + "Unspecified state. Most functions are in this upgrade state.", + "Functions in this state are eligible for 1st Gen -\u003e 2nd Gen upgrade.", + "An upgrade related operation is in progress.", + "SetupFunctionUpgradeConfig API was successful and a 2nd Gen function has been created based on 1st Gen function instance.", + "SetupFunctionUpgradeConfig API was un-successful.", + "AbortFunctionUpgrade API was un-successful.", + "RedirectFunctionUpgradeTraffic API was successful and traffic is served by 2nd Gen function stack.", + "RedirectFunctionUpgradeTraffic API was un-successful.", + "RollbackFunctionUpgradeTraffic API was un-successful.", + "CommitFunctionUpgrade API was un-successful." + ], + "type": "string" + } + }, + "type": "object" } }, "servicePath": "", diff --git a/cloudfunctions/v2/cloudfunctions-gen.go b/cloudfunctions/v2/cloudfunctions-gen.go index 0eb53c1b6ee..a0878043dcf 100644 --- a/cloudfunctions/v2/cloudfunctions-gen.go +++ b/cloudfunctions/v2/cloudfunctions-gen.go @@ -212,6 +212,11 @@ type ProjectsLocationsRuntimesService struct { s *Service } +// AbortFunctionUpgradeRequest: Request for the `AbortFunctionUpgrade` +// method. +type AbortFunctionUpgradeRequest struct { +} + // AuditConfig: Specifies the audit configuration for a service. The // configuration determines which permission types are logged, and what // identities, if any, are exempted from logging. An AuditConfig must @@ -540,6 +545,11 @@ func (s *BuildConfig) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// CommitFunctionUpgradeRequest: Request for the `CommitFunctionUpgrade` +// method. +type CommitFunctionUpgradeRequest struct { +} + // Date: Represents a whole or partial calendar date, such as a // birthday. The time of day and time zone are either specified // elsewhere or are insignificant. The date is relative to the Gregorian @@ -779,6 +789,10 @@ type Function struct { // container from the given source. BuildConfig *BuildConfig `json:"buildConfig,omitempty"` + // CreateTime: Output only. The create timestamp of a Cloud Function. + // This is only applicable to 2nd Gen functions. + CreateTime string `json:"createTime,omitempty"` + // Description: User-provided description of a function. Description string `json:"description,omitempty"` @@ -837,6 +851,9 @@ type Function struct { // Function. UpdateTime string `json:"updateTime,omitempty"` + // UpgradeInfo: Output only. UpgradeInfo for this Cloud Function + UpgradeInfo *UpgradeInfo `json:"upgradeInfo,omitempty"` + // Url: Output only. The deployed url for the function. Url string `json:"url,omitempty"` @@ -2086,6 +2103,11 @@ func (s *Policy) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// RedirectFunctionUpgradeTrafficRequest: Request for the +// `RedirectFunctionUpgradeTraffic` method. +type RedirectFunctionUpgradeTrafficRequest struct { +} + // RepoSource: Location of the source in a Google Cloud Source // Repository. type RepoSource struct { @@ -2138,6 +2160,11 @@ func (s *RepoSource) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// RollbackFunctionUpgradeTrafficRequest: Request for the +// `RollbackFunctionUpgradeTraffic` method. +type RollbackFunctionUpgradeTrafficRequest struct { +} + // Runtime: Describes a runtime and any special information (e.g., // deprecation status) related to it. type Runtime struct { @@ -2520,6 +2547,11 @@ func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// SetupFunctionUpgradeConfigRequest: Request for the +// `SetupFunctionUpgradeConfig` method. +type SetupFunctionUpgradeConfigRequest struct { +} + // Source: The location of the function source code. type Source struct { // GitUri: If provided, get the source from GitHub repository. This @@ -2746,6 +2778,72 @@ func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// UpgradeInfo: Information related to: * A function's eligibility for +// 1st Gen to 2nd Gen migration * Current state of migration for +// function undergoing migration. +type UpgradeInfo struct { + // BuildConfig: Describes the Build step of the function that builds a + // container to prepare for 2nd gen upgrade. + BuildConfig *BuildConfig `json:"buildConfig,omitempty"` + + // EventTrigger: Describes the Event trigger which has been setup to + // prepare for 2nd gen upgrade. + EventTrigger *EventTrigger `json:"eventTrigger,omitempty"` + + // ServiceConfig: Describes the Cloud Run service which has been setup + // to prepare for 2nd gen upgrade. + ServiceConfig *ServiceConfig `json:"serviceConfig,omitempty"` + + // UpgradeState: UpgradeState of the function + // + // Possible values: + // "UPGRADE_STATE_UNSPECIFIED" - Unspecified state. Most functions are + // in this upgrade state. + // "ELIGIBLE_FOR_2ND_GEN_UPGRADE" - Functions in this state are + // eligible for 1st Gen -> 2nd Gen upgrade. + // "UPGRADE_OPERATION_IN_PROGRESS" - An upgrade related operation is + // in progress. + // "SETUP_FUNCTION_UPGRADE_CONFIG_SUCCESSFUL" - + // SetupFunctionUpgradeConfig API was successful and a 2nd Gen function + // has been created based on 1st Gen function instance. + // "SETUP_FUNCTION_UPGRADE_CONFIG_ERROR" - SetupFunctionUpgradeConfig + // API was un-successful. + // "ABORT_FUNCTION_UPGRADE_ERROR" - AbortFunctionUpgrade API was + // un-successful. + // "REDIRECT_FUNCTION_UPGRADE_TRAFFIC_SUCCESSFUL" - + // RedirectFunctionUpgradeTraffic API was successful and traffic is + // served by 2nd Gen function stack. + // "REDIRECT_FUNCTION_UPGRADE_TRAFFIC_ERROR" - + // RedirectFunctionUpgradeTraffic API was un-successful. + // "ROLLBACK_FUNCTION_UPGRADE_TRAFFIC_ERROR" - + // RollbackFunctionUpgradeTraffic API was un-successful. + // "COMMIT_FUNCTION_UPGRADE_ERROR" - CommitFunctionUpgrade API was + // un-successful. + UpgradeState string `json:"upgradeState,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BuildConfig") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "BuildConfig") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *UpgradeInfo) MarshalJSON() ([]byte, error) { + type NoMethod UpgradeInfo + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // method id "cloudfunctions.projects.locations.list": type ProjectsLocationsListCall struct { @@ -2955,43 +3053,34 @@ func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocat } } -// method id "cloudfunctions.projects.locations.functions.create": +// method id "cloudfunctions.projects.locations.functions.abortFunctionUpgrade": -type ProjectsLocationsFunctionsCreateCall struct { - s *Service - parent string - function *Function - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsFunctionsAbortFunctionUpgradeCall struct { + s *Service + name string + abortfunctionupgraderequest *AbortFunctionUpgradeRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: 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. +// AbortFunctionUpgrade: 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. // -// - parent: The project and location in which the function should be -// created, specified in the format `projects/*/locations/*`. -func (r *ProjectsLocationsFunctionsService) Create(parent string, function *Function) *ProjectsLocationsFunctionsCreateCall { - c := &ProjectsLocationsFunctionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.function = function - return c -} - -// FunctionId sets the optional parameter "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-/. -func (c *ProjectsLocationsFunctionsCreateCall) FunctionId(functionId string) *ProjectsLocationsFunctionsCreateCall { - c.urlParams_.Set("functionId", functionId) +// - name: The name of the function for which upgrade should be aborted. +func (r *ProjectsLocationsFunctionsService) AbortFunctionUpgrade(name string, abortfunctionupgraderequest *AbortFunctionUpgradeRequest) *ProjectsLocationsFunctionsAbortFunctionUpgradeCall { + c := &ProjectsLocationsFunctionsAbortFunctionUpgradeCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.abortfunctionupgraderequest = abortfunctionupgraderequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsFunctionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsCreateCall { +func (c *ProjectsLocationsFunctionsAbortFunctionUpgradeCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsAbortFunctionUpgradeCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -2999,21 +3088,21 @@ func (c *ProjectsLocationsFunctionsCreateCall) Fields(s ...googleapi.Field) *Pro // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsFunctionsCreateCall) Context(ctx context.Context) *ProjectsLocationsFunctionsCreateCall { +func (c *ProjectsLocationsFunctionsAbortFunctionUpgradeCall) Context(ctx context.Context) *ProjectsLocationsFunctionsAbortFunctionUpgradeCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsFunctionsCreateCall) Header() http.Header { +func (c *ProjectsLocationsFunctionsAbortFunctionUpgradeCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsFunctionsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsFunctionsAbortFunctionUpgradeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -3021,14 +3110,14 @@ func (c *ProjectsLocationsFunctionsCreateCall) doRequest(alt string) (*http.Resp } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.function) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.abortfunctionupgraderequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/functions") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:abortFunctionUpgrade") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -3036,19 +3125,19 @@ func (c *ProjectsLocationsFunctionsCreateCall) doRequest(alt string) (*http.Resp } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "cloudfunctions.projects.locations.functions.create" call. +// Do executes the "cloudfunctions.projects.locations.functions.abortFunctionUpgrade" call. // Exactly one of *Operation or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsLocationsFunctionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *ProjectsLocationsFunctionsAbortFunctionUpgradeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3079,30 +3168,25 @@ func (c *ProjectsLocationsFunctionsCreateCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "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.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions", + // "description": "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.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:abortFunctionUpgrade", // "httpMethod": "POST", - // "id": "cloudfunctions.projects.locations.functions.create", + // "id": "cloudfunctions.projects.locations.functions.abortFunctionUpgrade", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "functionId": { - // "description": "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-/.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The project and location in which the function should be created, specified in the format `projects/*/locations/*`", + // "name": { + // "description": "Required. The name of the function for which upgrade should be aborted.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/functions", + // "path": "v2/{+name}:abortFunctionUpgrade", // "request": { - // "$ref": "Function" + // "$ref": "AbortFunctionUpgradeRequest" // }, // "response": { // "$ref": "Operation" @@ -3114,31 +3198,35 @@ func (c *ProjectsLocationsFunctionsCreateCall) Do(opts ...googleapi.CallOption) } -// method id "cloudfunctions.projects.locations.functions.delete": +// method id "cloudfunctions.projects.locations.functions.commitFunctionUpgrade": -type ProjectsLocationsFunctionsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsFunctionsCommitFunctionUpgradeCall struct { + s *Service + name string + commitfunctionupgraderequest *CommitFunctionUpgradeRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: 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. +// CommitFunctionUpgrade: 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. // -// - name: The name of the function which should be deleted. -func (r *ProjectsLocationsFunctionsService) Delete(name string) *ProjectsLocationsFunctionsDeleteCall { - c := &ProjectsLocationsFunctionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the function for which upgrade should be +// finalized. +func (r *ProjectsLocationsFunctionsService) CommitFunctionUpgrade(name string, commitfunctionupgraderequest *CommitFunctionUpgradeRequest) *ProjectsLocationsFunctionsCommitFunctionUpgradeCall { + c := &ProjectsLocationsFunctionsCommitFunctionUpgradeCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.commitfunctionupgraderequest = commitfunctionupgraderequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsFunctionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsDeleteCall { +func (c *ProjectsLocationsFunctionsCommitFunctionUpgradeCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsCommitFunctionUpgradeCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -3146,21 +3234,21 @@ func (c *ProjectsLocationsFunctionsDeleteCall) Fields(s ...googleapi.Field) *Pro // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsFunctionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsFunctionsDeleteCall { +func (c *ProjectsLocationsFunctionsCommitFunctionUpgradeCall) Context(ctx context.Context) *ProjectsLocationsFunctionsCommitFunctionUpgradeCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsFunctionsDeleteCall) Header() http.Header { +func (c *ProjectsLocationsFunctionsCommitFunctionUpgradeCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsFunctionsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsFunctionsCommitFunctionUpgradeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -3168,11 +3256,16 @@ func (c *ProjectsLocationsFunctionsDeleteCall) doRequest(alt string) (*http.Resp } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitfunctionupgraderequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:commitFunctionUpgrade") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -3183,14 +3276,14 @@ func (c *ProjectsLocationsFunctionsDeleteCall) doRequest(alt string) (*http.Resp return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "cloudfunctions.projects.locations.functions.delete" call. +// Do executes the "cloudfunctions.projects.locations.functions.commitFunctionUpgrade" call. // Exactly one of *Operation or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsLocationsFunctionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *ProjectsLocationsFunctionsCommitFunctionUpgradeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3221,23 +3314,26 @@ func (c *ProjectsLocationsFunctionsDeleteCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "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.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}", - // "httpMethod": "DELETE", - // "id": "cloudfunctions.projects.locations.functions.delete", + // "description": "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.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:commitFunctionUpgrade", + // "httpMethod": "POST", + // "id": "cloudfunctions.projects.locations.functions.commitFunctionUpgrade", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The name of the function which should be deleted.", + // "description": "Required. The name of the function for which upgrade should be finalized.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+name}:commitFunctionUpgrade", + // "request": { + // "$ref": "CommitFunctionUpgradeRequest" + // }, // "response": { // "$ref": "Operation" // }, @@ -3248,36 +3344,43 @@ func (c *ProjectsLocationsFunctionsDeleteCall) Do(opts ...googleapi.CallOption) } -// method id "cloudfunctions.projects.locations.functions.generateDownloadUrl": +// method id "cloudfunctions.projects.locations.functions.create": -type ProjectsLocationsFunctionsGenerateDownloadUrlCall struct { - s *Service - name string - generatedownloadurlrequest *GenerateDownloadUrlRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsFunctionsCreateCall struct { + s *Service + parent string + function *Function + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// GenerateDownloadUrl: 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: 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. // -// - name: The name of function for which source code Google Cloud -// Storage signed URL should be generated. -func (r *ProjectsLocationsFunctionsService) GenerateDownloadUrl(name string, generatedownloadurlrequest *GenerateDownloadUrlRequest) *ProjectsLocationsFunctionsGenerateDownloadUrlCall { - c := &ProjectsLocationsFunctionsGenerateDownloadUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.generatedownloadurlrequest = generatedownloadurlrequest +// - parent: The project and location in which the function should be +// created, specified in the format `projects/*/locations/*`. +func (r *ProjectsLocationsFunctionsService) Create(parent string, function *Function) *ProjectsLocationsFunctionsCreateCall { + c := &ProjectsLocationsFunctionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.function = function + return c +} + +// FunctionId sets the optional parameter "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-/. +func (c *ProjectsLocationsFunctionsCreateCall) FunctionId(functionId string) *ProjectsLocationsFunctionsCreateCall { + c.urlParams_.Set("functionId", functionId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGenerateDownloadUrlCall { +func (c *ProjectsLocationsFunctionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -3285,21 +3388,21 @@ func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Fields(s ...googleap // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGenerateDownloadUrlCall { +func (c *ProjectsLocationsFunctionsCreateCall) Context(ctx context.Context) *ProjectsLocationsFunctionsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Header() http.Header { +func (c *ProjectsLocationsFunctionsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsFunctionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -3307,14 +3410,14 @@ func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) doRequest(alt string } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generatedownloadurlrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.function) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:generateDownloadUrl") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/functions") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -3322,19 +3425,19 @@ func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) doRequest(alt string } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "cloudfunctions.projects.locations.functions.generateDownloadUrl" call. -// Exactly one of *GenerateDownloadUrlResponse or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GenerateDownloadUrlResponse.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Do(opts ...googleapi.CallOption) (*GenerateDownloadUrlResponse, error) { +// Do executes the "cloudfunctions.projects.locations.functions.create" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsFunctionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3353,7 +3456,7 @@ func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Do(opts ...googleapi if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GenerateDownloadUrlResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -3365,28 +3468,33 @@ func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Do(opts ...googleapi } return ret, nil // { - // "description": "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", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:generateDownloadUrl", + // "description": "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.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions", // "httpMethod": "POST", - // "id": "cloudfunctions.projects.locations.functions.generateDownloadUrl", + // "id": "cloudfunctions.projects.locations.functions.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The name of function for which source code Google Cloud Storage signed URL should be generated.", + // "functionId": { + // "description": "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-/.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The project and location in which the function should be created, specified in the format `projects/*/locations/*`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}:generateDownloadUrl", + // "path": "v2/{+parent}/functions", // "request": { - // "$ref": "GenerateDownloadUrlRequest" + // "$ref": "Function" // }, // "response": { - // "$ref": "GenerateDownloadUrlResponse" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -3395,46 +3503,31 @@ func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Do(opts ...googleapi } -// method id "cloudfunctions.projects.locations.functions.generateUploadUrl": +// method id "cloudfunctions.projects.locations.functions.delete": -type ProjectsLocationsFunctionsGenerateUploadUrlCall struct { - s *Service - parent string - generateuploadurlrequest *GenerateUploadUrlRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsFunctionsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// GenerateUploadUrl: 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` +// Delete: 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. // -// - parent: The project and location in which the Google Cloud Storage -// signed URL should be generated, specified in the format -// `projects/*/locations/*`. -func (r *ProjectsLocationsFunctionsService) GenerateUploadUrl(parent string, generateuploadurlrequest *GenerateUploadUrlRequest) *ProjectsLocationsFunctionsGenerateUploadUrlCall { - c := &ProjectsLocationsFunctionsGenerateUploadUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.generateuploadurlrequest = generateuploadurlrequest +// - name: The name of the function which should be deleted. +func (r *ProjectsLocationsFunctionsService) Delete(name string) *ProjectsLocationsFunctionsDeleteCall { + c := &ProjectsLocationsFunctionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGenerateUploadUrlCall { +func (c *ProjectsLocationsFunctionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -3442,21 +3535,21 @@ func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Fields(s ...googleapi. // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGenerateUploadUrlCall { +func (c *ProjectsLocationsFunctionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsFunctionsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Header() http.Header { +func (c *ProjectsLocationsFunctionsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsFunctionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -3464,34 +3557,29 @@ func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) doRequest(alt string) } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateuploadurlrequest) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/functions:generateUploadUrl") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "cloudfunctions.projects.locations.functions.generateUploadUrl" call. -// Exactly one of *GenerateUploadUrlResponse or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GenerateUploadUrlResponse.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Do(opts ...googleapi.CallOption) (*GenerateUploadUrlResponse, error) { +// Do executes the "cloudfunctions.projects.locations.functions.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsFunctionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3510,7 +3598,7 @@ func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Do(opts ...googleapi.C if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GenerateUploadUrlResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -3522,28 +3610,25 @@ func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Do(opts ...googleapi.C } return ret, nil // { - // "description": "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`", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions:generateUploadUrl", - // "httpMethod": "POST", - // "id": "cloudfunctions.projects.locations.functions.generateUploadUrl", + // "description": "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.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}", + // "httpMethod": "DELETE", + // "id": "cloudfunctions.projects.locations.functions.delete", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. The project and location in which the Google Cloud Storage signed URL should be generated, specified in the format `projects/*/locations/*`.", + // "name": { + // "description": "Required. The name of the function which should be deleted.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/functions:generateUploadUrl", - // "request": { - // "$ref": "GenerateUploadUrlRequest" - // }, + // "path": "v2/{+name}", // "response": { - // "$ref": "GenerateUploadUrlResponse" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -3552,78 +3637,75 @@ func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Do(opts ...googleapi.C } -// method id "cloudfunctions.projects.locations.functions.get": +// method id "cloudfunctions.projects.locations.functions.generateDownloadUrl": -type ProjectsLocationsFunctionsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsFunctionsGenerateDownloadUrlCall struct { + s *Service + name string + generatedownloadurlrequest *GenerateDownloadUrlRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Returns a function with the given name from the requested -// project. +// GenerateDownloadUrl: 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 // -// - name: The name of the function which details should be obtained. -func (r *ProjectsLocationsFunctionsService) Get(name string) *ProjectsLocationsFunctionsGetCall { - c := &ProjectsLocationsFunctionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of function for which source code Google Cloud +// Storage signed URL should be generated. +func (r *ProjectsLocationsFunctionsService) GenerateDownloadUrl(name string, generatedownloadurlrequest *GenerateDownloadUrlRequest) *ProjectsLocationsFunctionsGenerateDownloadUrlCall { + c := &ProjectsLocationsFunctionsGenerateDownloadUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.generatedownloadurlrequest = generatedownloadurlrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsFunctionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGetCall { +func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGenerateDownloadUrlCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsFunctionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsFunctionsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsFunctionsGetCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGetCall { +func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGenerateDownloadUrlCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsFunctionsGetCall) Header() http.Header { +func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsFunctionsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.generatedownloadurlrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:generateDownloadUrl") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -3634,14 +3716,14 @@ func (c *ProjectsLocationsFunctionsGetCall) doRequest(alt string) (*http.Respons return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "cloudfunctions.projects.locations.functions.get" call. -// Exactly one of *Function or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Function.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *ProjectsLocationsFunctionsGetCall) Do(opts ...googleapi.CallOption) (*Function, error) { +// Do executes the "cloudfunctions.projects.locations.functions.generateDownloadUrl" call. +// Exactly one of *GenerateDownloadUrlResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GenerateDownloadUrlResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Do(opts ...googleapi.CallOption) (*GenerateDownloadUrlResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3660,7 +3742,7 @@ func (c *ProjectsLocationsFunctionsGetCall) Do(opts ...googleapi.CallOption) (*F if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Function{ + ret := &GenerateDownloadUrlResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -3672,25 +3754,28 @@ func (c *ProjectsLocationsFunctionsGetCall) Do(opts ...googleapi.CallOption) (*F } return ret, nil // { - // "description": "Returns a function with the given name from the requested project.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}", - // "httpMethod": "GET", - // "id": "cloudfunctions.projects.locations.functions.get", + // "description": "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", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:generateDownloadUrl", + // "httpMethod": "POST", + // "id": "cloudfunctions.projects.locations.functions.generateDownloadUrl", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The name of the function which details should be obtained.", + // "description": "Required. The name of function for which source code Google Cloud Storage signed URL should be generated.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+name}:generateDownloadUrl", + // "request": { + // "$ref": "GenerateDownloadUrlRequest" + // }, // "response": { - // "$ref": "Function" + // "$ref": "GenerateDownloadUrlResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -3699,118 +3784,103 @@ func (c *ProjectsLocationsFunctionsGetCall) Do(opts ...googleapi.CallOption) (*F } -// method id "cloudfunctions.projects.locations.functions.getIamPolicy": +// method id "cloudfunctions.projects.locations.functions.generateUploadUrl": -type ProjectsLocationsFunctionsGetIamPolicyCall struct { - s *Service - resource string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsFunctionsGenerateUploadUrlCall struct { + s *Service + parent string + generateuploadurlrequest *GenerateUploadUrlRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// GetIamPolicy: Gets the access control policy for a resource. Returns -// an empty policy if the resource exists and does not have a policy -// set. +// GenerateUploadUrl: 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` // -// - 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. -func (r *ProjectsLocationsFunctionsService) GetIamPolicy(resource string) *ProjectsLocationsFunctionsGetIamPolicyCall { - c := &ProjectsLocationsFunctionsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.resource = resource - return c -} - -// OptionsRequestedPolicyVersion sets the optional parameter -// "options.requestedPolicyVersion": 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). -func (c *ProjectsLocationsFunctionsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsFunctionsGetIamPolicyCall { - c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) +// - parent: The project and location in which the Google Cloud Storage +// signed URL should be generated, specified in the format +// `projects/*/locations/*`. +func (r *ProjectsLocationsFunctionsService) GenerateUploadUrl(parent string, generateuploadurlrequest *GenerateUploadUrlRequest) *ProjectsLocationsFunctionsGenerateUploadUrlCall { + c := &ProjectsLocationsFunctionsGenerateUploadUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.generateuploadurlrequest = generateuploadurlrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGetIamPolicyCall { +func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGenerateUploadUrlCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsFunctionsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsFunctionsGetIamPolicyCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGetIamPolicyCall { +func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGenerateUploadUrlCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Header() http.Header { +func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsFunctionsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateuploadurlrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+resource}:getIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/functions:generateUploadUrl") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "resource": c.resource, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "cloudfunctions.projects.locations.functions.getIamPolicy" call. -// Exactly one of *Policy or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Policy.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +// Do executes the "cloudfunctions.projects.locations.functions.generateUploadUrl" call. +// Exactly one of *GenerateUploadUrlResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GenerateUploadUrlResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Do(opts ...googleapi.CallOption) (*GenerateUploadUrlResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3829,7 +3899,7 @@ func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Policy{ + ret := &GenerateUploadUrlResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -3841,31 +3911,28 @@ func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Do(opts ...googleapi.CallOp } return ret, nil // { - // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:getIamPolicy", - // "httpMethod": "GET", - // "id": "cloudfunctions.projects.locations.functions.getIamPolicy", + // "description": "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`", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions:generateUploadUrl", + // "httpMethod": "POST", + // "id": "cloudfunctions.projects.locations.functions.generateUploadUrl", // "parameterOrder": [ - // "resource" + // "parent" // ], // "parameters": { - // "options.requestedPolicyVersion": { - // "description": "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).", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "resource": { - // "description": "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.", + // "parent": { + // "description": "Required. The project and location in which the Google Cloud Storage signed URL should be generated, specified in the format `projects/*/locations/*`.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+resource}:getIamPolicy", + // "path": "v2/{+parent}/functions:generateUploadUrl", + // "request": { + // "$ref": "GenerateUploadUrlRequest" + // }, // "response": { - // "$ref": "Policy" + // "$ref": "GenerateUploadUrlResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -3874,73 +3941,31 @@ func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Do(opts ...googleapi.CallOp } -// method id "cloudfunctions.projects.locations.functions.list": +// method id "cloudfunctions.projects.locations.functions.get": -type ProjectsLocationsFunctionsListCall struct { +type ProjectsLocationsFunctionsGetCall struct { s *Service - parent string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Returns a list of functions that belong to the requested +// Get: Returns a function with the given name from the requested // project. // -// - parent: 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. -func (r *ProjectsLocationsFunctionsService) List(parent string) *ProjectsLocationsFunctionsListCall { - c := &ProjectsLocationsFunctionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// Filter sets the optional parameter "filter": The filter for Functions -// that match the filter expression, following the syntax outlined in -// https://google.aip.dev/160. -func (c *ProjectsLocationsFunctionsListCall) Filter(filter string) *ProjectsLocationsFunctionsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// OrderBy sets the optional parameter "orderBy": The sorting order of -// the resources returned. Value should be a comma separated list of -// fields. The default sorting oder is ascending. See -// https://google.aip.dev/132#ordering. -func (c *ProjectsLocationsFunctionsListCall) OrderBy(orderBy string) *ProjectsLocationsFunctionsListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageSize sets the optional parameter "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. -func (c *ProjectsLocationsFunctionsListCall) PageSize(pageSize int64) *ProjectsLocationsFunctionsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "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. -func (c *ProjectsLocationsFunctionsListCall) PageToken(pageToken string) *ProjectsLocationsFunctionsListCall { - c.urlParams_.Set("pageToken", pageToken) +// - name: The name of the function which details should be obtained. +func (r *ProjectsLocationsFunctionsService) Get(name string) *ProjectsLocationsFunctionsGetCall { + c := &ProjectsLocationsFunctionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsFunctionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsListCall { +func (c *ProjectsLocationsFunctionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -3950,7 +3975,7 @@ func (c *ProjectsLocationsFunctionsListCall) Fields(s ...googleapi.Field) *Proje // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsFunctionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsFunctionsListCall { +func (c *ProjectsLocationsFunctionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsFunctionsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -3958,54 +3983,762 @@ func (c *ProjectsLocationsFunctionsListCall) IfNoneMatch(entityTag string) *Proj // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsFunctionsListCall) Context(ctx context.Context) *ProjectsLocationsFunctionsListCall { +func (c *ProjectsLocationsFunctionsGetCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsFunctionsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsFunctionsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "cloudfunctions.projects.locations.functions.get" call. +// Exactly one of *Function or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Function.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsFunctionsGetCall) Do(opts ...googleapi.CallOption) (*Function, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Function{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a function with the given name from the requested project.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}", + // "httpMethod": "GET", + // "id": "cloudfunctions.projects.locations.functions.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The name of the function which details should be obtained.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+name}", + // "response": { + // "$ref": "Function" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudfunctions.projects.locations.functions.getIamPolicy": + +type ProjectsLocationsFunctionsGetIamPolicyCall struct { + s *Service + resource string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// GetIamPolicy: Gets the access control policy for a resource. Returns +// an empty policy if the resource exists and does not have a policy +// set. +// +// - 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. +func (r *ProjectsLocationsFunctionsService) GetIamPolicy(resource string) *ProjectsLocationsFunctionsGetIamPolicyCall { + c := &ProjectsLocationsFunctionsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.resource = resource + return c +} + +// OptionsRequestedPolicyVersion sets the optional parameter +// "options.requestedPolicyVersion": 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). +func (c *ProjectsLocationsFunctionsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsFunctionsGetIamPolicyCall { + c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGetIamPolicyCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsFunctionsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsFunctionsGetIamPolicyCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGetIamPolicyCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsFunctionsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+resource}:getIamPolicy") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "cloudfunctions.projects.locations.functions.getIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:getIamPolicy", + // "httpMethod": "GET", + // "id": "cloudfunctions.projects.locations.functions.getIamPolicy", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "options.requestedPolicyVersion": { + // "description": "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).", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "resource": { + // "description": "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.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+resource}:getIamPolicy", + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudfunctions.projects.locations.functions.list": + +type ProjectsLocationsFunctionsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Returns a list of functions that belong to the requested +// project. +// +// - parent: 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. +func (r *ProjectsLocationsFunctionsService) List(parent string) *ProjectsLocationsFunctionsListCall { + c := &ProjectsLocationsFunctionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": The filter for Functions +// that match the filter expression, following the syntax outlined in +// https://google.aip.dev/160. +func (c *ProjectsLocationsFunctionsListCall) Filter(filter string) *ProjectsLocationsFunctionsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// OrderBy sets the optional parameter "orderBy": The sorting order of +// the resources returned. Value should be a comma separated list of +// fields. The default sorting oder is ascending. See +// https://google.aip.dev/132#ordering. +func (c *ProjectsLocationsFunctionsListCall) OrderBy(orderBy string) *ProjectsLocationsFunctionsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageSize sets the optional parameter "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. +func (c *ProjectsLocationsFunctionsListCall) PageSize(pageSize int64) *ProjectsLocationsFunctionsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "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. +func (c *ProjectsLocationsFunctionsListCall) PageToken(pageToken string) *ProjectsLocationsFunctionsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsFunctionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsFunctionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsFunctionsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsFunctionsListCall) Context(ctx context.Context) *ProjectsLocationsFunctionsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsFunctionsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsFunctionsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/functions") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "cloudfunctions.projects.locations.functions.list" call. +// Exactly one of *ListFunctionsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListFunctionsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsFunctionsListCall) Do(opts ...googleapi.CallOption) (*ListFunctionsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ListFunctionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a list of functions that belong to the requested project.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions", + // "httpMethod": "GET", + // "id": "cloudfunctions.projects.locations.functions.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "filter": { + // "description": "The filter for Functions that match the filter expression, following the syntax outlined in https://google.aip.dev/160.", + // "location": "query", + // "type": "string" + // }, + // "orderBy": { + // "description": "The sorting order of the resources returned. Value should be a comma separated list of fields. The default sorting oder is ascending. See https://google.aip.dev/132#ordering.", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "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.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "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.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "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.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+parent}/functions", + // "response": { + // "$ref": "ListFunctionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsFunctionsListCall) Pages(ctx context.Context, f func(*ListFunctionsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "cloudfunctions.projects.locations.functions.patch": + +type ProjectsLocationsFunctionsPatchCall struct { + s *Service + name string + function *Function + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates existing function. +// +// - name: A user-defined name of the function. Function names must be +// unique globally and match pattern +// `projects/*/locations/*/functions/*`. +func (r *ProjectsLocationsFunctionsService) Patch(name string, function *Function) *ProjectsLocationsFunctionsPatchCall { + c := &ProjectsLocationsFunctionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.function = function + return c +} + +// UpdateMask sets the optional parameter "updateMask": The list of +// fields to be updated. If no field mask is provided, all provided +// fields in the request will be updated. +func (c *ProjectsLocationsFunctionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsFunctionsPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsFunctionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsFunctionsPatchCall) Context(ctx context.Context) *ProjectsLocationsFunctionsPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsFunctionsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsFunctionsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.function) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "cloudfunctions.projects.locations.functions.patch" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsFunctionsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates existing function.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}", + // "httpMethod": "PATCH", + // "id": "cloudfunctions.projects.locations.functions.patch", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "A user-defined name of the function. Function names must be unique globally and match pattern `projects/*/locations/*/functions/*`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "The list of fields to be updated. If no field mask is provided, all provided fields in the request will be updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v2/{+name}", + // "request": { + // "$ref": "Function" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudfunctions.projects.locations.functions.redirectFunctionUpgradeTraffic": + +type ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall struct { + s *Service + name string + redirectfunctionupgradetrafficrequest *RedirectFunctionUpgradeTrafficRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// RedirectFunctionUpgradeTraffic: 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. +// +// - name: The name of the function for which traffic target should be +// changed to 2nd Gen from 1st Gen. +func (r *ProjectsLocationsFunctionsService) RedirectFunctionUpgradeTraffic(name string, redirectfunctionupgradetrafficrequest *RedirectFunctionUpgradeTrafficRequest) *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall { + c := &ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.redirectfunctionupgradetrafficrequest = redirectfunctionupgradetrafficrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall) Context(ctx context.Context) *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsFunctionsListCall) Header() http.Header { +func (c *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsFunctionsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.redirectfunctionupgradetrafficrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/functions") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:redirectFunctionUpgradeTraffic") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "cloudfunctions.projects.locations.functions.list" call. -// Exactly one of *ListFunctionsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListFunctionsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsFunctionsListCall) Do(opts ...googleapi.CallOption) (*ListFunctionsResponse, error) { +// Do executes the "cloudfunctions.projects.locations.functions.redirectFunctionUpgradeTraffic" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4024,7 +4757,7 @@ func (c *ProjectsLocationsFunctionsListCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListFunctionsResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4036,46 +4769,28 @@ func (c *ProjectsLocationsFunctionsListCall) Do(opts ...googleapi.CallOption) (* } return ret, nil // { - // "description": "Returns a list of functions that belong to the requested project.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions", - // "httpMethod": "GET", - // "id": "cloudfunctions.projects.locations.functions.list", + // "description": "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.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:redirectFunctionUpgradeTraffic", + // "httpMethod": "POST", + // "id": "cloudfunctions.projects.locations.functions.redirectFunctionUpgradeTraffic", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "filter": { - // "description": "The filter for Functions that match the filter expression, following the syntax outlined in https://google.aip.dev/160.", - // "location": "query", - // "type": "string" - // }, - // "orderBy": { - // "description": "The sorting order of the resources returned. Value should be a comma separated list of fields. The default sorting oder is ascending. See https://google.aip.dev/132#ordering.", - // "location": "query", - // "type": "string" - // }, - // "pageSize": { - // "description": "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.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "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.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "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.", + // "name": { + // "description": "Required. The name of the function for which traffic target should be changed to 2nd Gen from 1st Gen.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2/{+parent}/functions", + // "path": "v2/{+name}:redirectFunctionUpgradeTraffic", + // "request": { + // "$ref": "RedirectFunctionUpgradeTrafficRequest" + // }, // "response": { - // "$ref": "ListFunctionsResponse" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -4084,62 +4799,34 @@ func (c *ProjectsLocationsFunctionsListCall) Do(opts ...googleapi.CallOption) (* } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsFunctionsListCall) Pages(ctx context.Context, f func(*ListFunctionsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "cloudfunctions.projects.locations.functions.patch": +// method id "cloudfunctions.projects.locations.functions.rollbackFunctionUpgradeTraffic": -type ProjectsLocationsFunctionsPatchCall struct { - s *Service - name string - function *Function - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall struct { + s *Service + name string + rollbackfunctionupgradetrafficrequest *RollbackFunctionUpgradeTrafficRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates existing function. +// RollbackFunctionUpgradeTraffic: 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. // -// - name: A user-defined name of the function. Function names must be -// unique globally and match pattern -// `projects/*/locations/*/functions/*`. -func (r *ProjectsLocationsFunctionsService) Patch(name string, function *Function) *ProjectsLocationsFunctionsPatchCall { - c := &ProjectsLocationsFunctionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the function for which traffic target should be +// changed back to 1st Gen from 2nd Gen. +func (r *ProjectsLocationsFunctionsService) RollbackFunctionUpgradeTraffic(name string, rollbackfunctionupgradetrafficrequest *RollbackFunctionUpgradeTrafficRequest) *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall { + c := &ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.function = function - return c -} - -// UpdateMask sets the optional parameter "updateMask": The list of -// fields to be updated. If no field mask is provided, all provided -// fields in the request will be updated. -func (c *ProjectsLocationsFunctionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsFunctionsPatchCall { - c.urlParams_.Set("updateMask", updateMask) + c.rollbackfunctionupgradetrafficrequest = rollbackfunctionupgradetrafficrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsFunctionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsPatchCall { +func (c *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -4147,21 +4834,21 @@ func (c *ProjectsLocationsFunctionsPatchCall) Fields(s ...googleapi.Field) *Proj // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsFunctionsPatchCall) Context(ctx context.Context) *ProjectsLocationsFunctionsPatchCall { +func (c *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall) Context(ctx context.Context) *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsFunctionsPatchCall) Header() http.Header { +func (c *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsFunctionsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -4169,16 +4856,16 @@ func (c *ProjectsLocationsFunctionsPatchCall) doRequest(alt string) (*http.Respo } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.function) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackfunctionupgradetrafficrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:rollbackFunctionUpgradeTraffic") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -4189,14 +4876,14 @@ func (c *ProjectsLocationsFunctionsPatchCall) doRequest(alt string) (*http.Respo return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "cloudfunctions.projects.locations.functions.patch" call. +// Do executes the "cloudfunctions.projects.locations.functions.rollbackFunctionUpgradeTraffic" call. // Exactly one of *Operation or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsLocationsFunctionsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4227,31 +4914,25 @@ func (c *ProjectsLocationsFunctionsPatchCall) Do(opts ...googleapi.CallOption) ( } return ret, nil // { - // "description": "Updates existing function.", - // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}", - // "httpMethod": "PATCH", - // "id": "cloudfunctions.projects.locations.functions.patch", + // "description": "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.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:rollbackFunctionUpgradeTraffic", + // "httpMethod": "POST", + // "id": "cloudfunctions.projects.locations.functions.rollbackFunctionUpgradeTraffic", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "A user-defined name of the function. Function names must be unique globally and match pattern `projects/*/locations/*/functions/*`", + // "description": "Required. The name of the function for which traffic target should be changed back to 1st Gen from 2nd Gen.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "The list of fields to be updated. If no field mask is provided, all provided fields in the request will be updated.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2/{+name}", + // "path": "v2/{+name}:rollbackFunctionUpgradeTraffic", // "request": { - // "$ref": "Function" + // "$ref": "RollbackFunctionUpgradeTrafficRequest" // }, // "response": { // "$ref": "Operation" @@ -4410,6 +5091,153 @@ func (c *ProjectsLocationsFunctionsSetIamPolicyCall) Do(opts ...googleapi.CallOp } +// method id "cloudfunctions.projects.locations.functions.setupFunctionUpgradeConfig": + +type ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall struct { + s *Service + name string + setupfunctionupgradeconfigrequest *SetupFunctionUpgradeConfigRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// SetupFunctionUpgradeConfig: 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. +// +// - name: The name of the function which should have configuration +// copied for upgrade. +func (r *ProjectsLocationsFunctionsService) SetupFunctionUpgradeConfig(name string, setupfunctionupgradeconfigrequest *SetupFunctionUpgradeConfigRequest) *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall { + c := &ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.setupfunctionupgradeconfigrequest = setupfunctionupgradeconfigrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall) Context(ctx context.Context) *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.setupfunctionupgradeconfigrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:setupFunctionUpgradeConfig") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "cloudfunctions.projects.locations.functions.setupFunctionUpgradeConfig" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:setupFunctionUpgradeConfig", + // "httpMethod": "POST", + // "id": "cloudfunctions.projects.locations.functions.setupFunctionUpgradeConfig", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The name of the function which should have configuration copied for upgrade.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+name}:setupFunctionUpgradeConfig", + // "request": { + // "$ref": "SetupFunctionUpgradeConfigRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + // method id "cloudfunctions.projects.locations.functions.testIamPermissions": type ProjectsLocationsFunctionsTestIamPermissionsCall struct { diff --git a/cloudfunctions/v2alpha/cloudfunctions-api.json b/cloudfunctions/v2alpha/cloudfunctions-api.json index 7dc57a31834..3062b20fff0 100644 --- a/cloudfunctions/v2alpha/cloudfunctions-api.json +++ b/cloudfunctions/v2alpha/cloudfunctions-api.json @@ -154,6 +154,62 @@ "resources": { "functions": { "methods": { + "abortFunctionUpgrade": { + "description": "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.", + "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:abortFunctionUpgrade", + "httpMethod": "POST", + "id": "cloudfunctions.projects.locations.functions.abortFunctionUpgrade", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the function for which upgrade should be aborted.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2alpha/{+name}:abortFunctionUpgrade", + "request": { + "$ref": "AbortFunctionUpgradeRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "commitFunctionUpgrade": { + "description": "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.", + "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:commitFunctionUpgrade", + "httpMethod": "POST", + "id": "cloudfunctions.projects.locations.functions.commitFunctionUpgrade", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the function for which upgrade should be finalized.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2alpha/{+name}:commitFunctionUpgrade", + "request": { + "$ref": "CommitFunctionUpgradeRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "create": { "description": "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.", "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/functions", @@ -404,6 +460,62 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "redirectFunctionUpgradeTraffic": { + "description": "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.", + "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:redirectFunctionUpgradeTraffic", + "httpMethod": "POST", + "id": "cloudfunctions.projects.locations.functions.redirectFunctionUpgradeTraffic", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the function for which traffic target should be changed to 2nd Gen from 1st Gen.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2alpha/{+name}:redirectFunctionUpgradeTraffic", + "request": { + "$ref": "RedirectFunctionUpgradeTrafficRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "rollbackFunctionUpgradeTraffic": { + "description": "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.", + "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:rollbackFunctionUpgradeTraffic", + "httpMethod": "POST", + "id": "cloudfunctions.projects.locations.functions.rollbackFunctionUpgradeTraffic", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the function for which traffic target should be changed back to 1st Gen from 2nd Gen.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2alpha/{+name}:rollbackFunctionUpgradeTraffic", + "request": { + "$ref": "RollbackFunctionUpgradeTrafficRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "setIamPolicy": { "description": "Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.", "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:setIamPolicy", @@ -432,6 +544,34 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "setupFunctionUpgradeConfig": { + "description": "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.", + "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:setupFunctionUpgradeConfig", + "httpMethod": "POST", + "id": "cloudfunctions.projects.locations.functions.setupFunctionUpgradeConfig", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the function which should have configuration copied for upgrade.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2alpha/{+name}:setupFunctionUpgradeConfig", + "request": { + "$ref": "SetupFunctionUpgradeConfigRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "testIamPermissions": { "description": "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.", "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:testIamPermissions", @@ -571,9 +711,15 @@ } } }, - "revision": "20240118", + "revision": "20240205", "rootUrl": "https://cloudfunctions.googleapis.com/", "schemas": { + "AbortFunctionUpgradeRequest": { + "description": "Request for the `AbortFunctionUpgrade` method.", + "id": "AbortFunctionUpgradeRequest", + "properties": {}, + "type": "object" + }, "AuditConfig": { "description": "Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs. If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted. Example Policy with multiple AuditConfigs: { \"audit_configs\": [ { \"service\": \"allServices\", \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\", \"exempted_members\": [ \"user:jose@example.com\" ] }, { \"log_type\": \"DATA_WRITE\" }, { \"log_type\": \"ADMIN_READ\" } ] }, { \"service\": \"sampleservice.googleapis.com\", \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\" }, { \"log_type\": \"DATA_WRITE\", \"exempted_members\": [ \"user:aliya@example.com\" ] } ] } ] } For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts `jose@example.com` from DATA_READ logging, and `aliya@example.com` from DATA_WRITE logging.", "id": "AuditConfig", @@ -724,6 +870,12 @@ }, "type": "object" }, + "CommitFunctionUpgradeRequest": { + "description": "Request for the `CommitFunctionUpgrade` method.", + "id": "CommitFunctionUpgradeRequest", + "properties": {}, + "type": "object" + }, "Date": { "description": "Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp", "id": "Date", @@ -853,6 +1005,12 @@ "$ref": "BuildConfig", "description": "Describes the Build step of the function that builds a container from the given source." }, + "createTime": { + "description": "Output only. The create timestamp of a Cloud Function. This is only applicable to 2nd Gen functions.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, "description": { "description": "User-provided description of a function.", "type": "string" @@ -934,6 +1092,11 @@ "readOnly": true, "type": "string" }, + "upgradeInfo": { + "$ref": "UpgradeInfo", + "description": "Output only. UpgradeInfo for this Cloud Function", + "readOnly": true + }, "url": { "description": "Output only. The deployed url for the function.", "readOnly": true, @@ -1846,6 +2009,12 @@ }, "type": "object" }, + "RedirectFunctionUpgradeTrafficRequest": { + "description": "Request for the `RedirectFunctionUpgradeTraffic` method.", + "id": "RedirectFunctionUpgradeTrafficRequest", + "properties": {}, + "type": "object" + }, "RepoSource": { "description": "Location of the source in a Google Cloud Source Repository.", "id": "RepoSource", @@ -1877,6 +2046,12 @@ }, "type": "object" }, + "RollbackFunctionUpgradeTrafficRequest": { + "description": "Request for the `RollbackFunctionUpgradeTraffic` method.", + "id": "RollbackFunctionUpgradeTrafficRequest", + "properties": {}, + "type": "object" + }, "Runtime": { "description": "Describes a runtime and any special information (e.g., deprecation status) related to it.", "id": "Runtime", @@ -2150,6 +2325,12 @@ }, "type": "object" }, + "SetupFunctionUpgradeConfigRequest": { + "description": "Request for the `SetupFunctionUpgradeConfig` method.", + "id": "SetupFunctionUpgradeConfigRequest", + "properties": {}, + "type": "object" + }, "Source": { "description": "The location of the function source code.", "id": "Source", @@ -2262,6 +2443,53 @@ } }, "type": "object" + }, + "UpgradeInfo": { + "description": "Information related to: * A function's eligibility for 1st Gen to 2nd Gen migration * Current state of migration for function undergoing migration.", + "id": "UpgradeInfo", + "properties": { + "buildConfig": { + "$ref": "BuildConfig", + "description": "Describes the Build step of the function that builds a container to prepare for 2nd gen upgrade." + }, + "eventTrigger": { + "$ref": "EventTrigger", + "description": "Describes the Event trigger which has been setup to prepare for 2nd gen upgrade." + }, + "serviceConfig": { + "$ref": "ServiceConfig", + "description": "Describes the Cloud Run service which has been setup to prepare for 2nd gen upgrade." + }, + "upgradeState": { + "description": "UpgradeState of the function", + "enum": [ + "UPGRADE_STATE_UNSPECIFIED", + "ELIGIBLE_FOR_2ND_GEN_UPGRADE", + "UPGRADE_OPERATION_IN_PROGRESS", + "SETUP_FUNCTION_UPGRADE_CONFIG_SUCCESSFUL", + "SETUP_FUNCTION_UPGRADE_CONFIG_ERROR", + "ABORT_FUNCTION_UPGRADE_ERROR", + "REDIRECT_FUNCTION_UPGRADE_TRAFFIC_SUCCESSFUL", + "REDIRECT_FUNCTION_UPGRADE_TRAFFIC_ERROR", + "ROLLBACK_FUNCTION_UPGRADE_TRAFFIC_ERROR", + "COMMIT_FUNCTION_UPGRADE_ERROR" + ], + "enumDescriptions": [ + "Unspecified state. Most functions are in this upgrade state.", + "Functions in this state are eligible for 1st Gen -\u003e 2nd Gen upgrade.", + "An upgrade related operation is in progress.", + "SetupFunctionUpgradeConfig API was successful and a 2nd Gen function has been created based on 1st Gen function instance.", + "SetupFunctionUpgradeConfig API was un-successful.", + "AbortFunctionUpgrade API was un-successful.", + "RedirectFunctionUpgradeTraffic API was successful and traffic is served by 2nd Gen function stack.", + "RedirectFunctionUpgradeTraffic API was un-successful.", + "RollbackFunctionUpgradeTraffic API was un-successful.", + "CommitFunctionUpgrade API was un-successful." + ], + "type": "string" + } + }, + "type": "object" } }, "servicePath": "", diff --git a/cloudfunctions/v2alpha/cloudfunctions-gen.go b/cloudfunctions/v2alpha/cloudfunctions-gen.go index 91479b93615..126d1544b6d 100644 --- a/cloudfunctions/v2alpha/cloudfunctions-gen.go +++ b/cloudfunctions/v2alpha/cloudfunctions-gen.go @@ -212,6 +212,11 @@ type ProjectsLocationsRuntimesService struct { s *Service } +// AbortFunctionUpgradeRequest: Request for the `AbortFunctionUpgrade` +// method. +type AbortFunctionUpgradeRequest struct { +} + // AuditConfig: Specifies the audit configuration for a service. The // configuration determines which permission types are logged, and what // identities, if any, are exempted from logging. An AuditConfig must @@ -540,6 +545,11 @@ func (s *BuildConfig) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// CommitFunctionUpgradeRequest: Request for the `CommitFunctionUpgrade` +// method. +type CommitFunctionUpgradeRequest struct { +} + // Date: Represents a whole or partial calendar date, such as a // birthday. The time of day and time zone are either specified // elsewhere or are insignificant. The date is relative to the Gregorian @@ -779,6 +789,10 @@ type Function struct { // container from the given source. BuildConfig *BuildConfig `json:"buildConfig,omitempty"` + // CreateTime: Output only. The create timestamp of a Cloud Function. + // This is only applicable to 2nd Gen functions. + CreateTime string `json:"createTime,omitempty"` + // Description: User-provided description of a function. Description string `json:"description,omitempty"` @@ -837,6 +851,9 @@ type Function struct { // Function. UpdateTime string `json:"updateTime,omitempty"` + // UpgradeInfo: Output only. UpgradeInfo for this Cloud Function + UpgradeInfo *UpgradeInfo `json:"upgradeInfo,omitempty"` + // Url: Output only. The deployed url for the function. Url string `json:"url,omitempty"` @@ -2086,6 +2103,11 @@ func (s *Policy) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// RedirectFunctionUpgradeTrafficRequest: Request for the +// `RedirectFunctionUpgradeTraffic` method. +type RedirectFunctionUpgradeTrafficRequest struct { +} + // RepoSource: Location of the source in a Google Cloud Source // Repository. type RepoSource struct { @@ -2138,6 +2160,11 @@ func (s *RepoSource) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// RollbackFunctionUpgradeTrafficRequest: Request for the +// `RollbackFunctionUpgradeTraffic` method. +type RollbackFunctionUpgradeTrafficRequest struct { +} + // Runtime: Describes a runtime and any special information (e.g., // deprecation status) related to it. type Runtime struct { @@ -2520,6 +2547,11 @@ func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// SetupFunctionUpgradeConfigRequest: Request for the +// `SetupFunctionUpgradeConfig` method. +type SetupFunctionUpgradeConfigRequest struct { +} + // Source: The location of the function source code. type Source struct { // GitUri: If provided, get the source from GitHub repository. This @@ -2746,6 +2778,72 @@ func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// UpgradeInfo: Information related to: * A function's eligibility for +// 1st Gen to 2nd Gen migration * Current state of migration for +// function undergoing migration. +type UpgradeInfo struct { + // BuildConfig: Describes the Build step of the function that builds a + // container to prepare for 2nd gen upgrade. + BuildConfig *BuildConfig `json:"buildConfig,omitempty"` + + // EventTrigger: Describes the Event trigger which has been setup to + // prepare for 2nd gen upgrade. + EventTrigger *EventTrigger `json:"eventTrigger,omitempty"` + + // ServiceConfig: Describes the Cloud Run service which has been setup + // to prepare for 2nd gen upgrade. + ServiceConfig *ServiceConfig `json:"serviceConfig,omitempty"` + + // UpgradeState: UpgradeState of the function + // + // Possible values: + // "UPGRADE_STATE_UNSPECIFIED" - Unspecified state. Most functions are + // in this upgrade state. + // "ELIGIBLE_FOR_2ND_GEN_UPGRADE" - Functions in this state are + // eligible for 1st Gen -> 2nd Gen upgrade. + // "UPGRADE_OPERATION_IN_PROGRESS" - An upgrade related operation is + // in progress. + // "SETUP_FUNCTION_UPGRADE_CONFIG_SUCCESSFUL" - + // SetupFunctionUpgradeConfig API was successful and a 2nd Gen function + // has been created based on 1st Gen function instance. + // "SETUP_FUNCTION_UPGRADE_CONFIG_ERROR" - SetupFunctionUpgradeConfig + // API was un-successful. + // "ABORT_FUNCTION_UPGRADE_ERROR" - AbortFunctionUpgrade API was + // un-successful. + // "REDIRECT_FUNCTION_UPGRADE_TRAFFIC_SUCCESSFUL" - + // RedirectFunctionUpgradeTraffic API was successful and traffic is + // served by 2nd Gen function stack. + // "REDIRECT_FUNCTION_UPGRADE_TRAFFIC_ERROR" - + // RedirectFunctionUpgradeTraffic API was un-successful. + // "ROLLBACK_FUNCTION_UPGRADE_TRAFFIC_ERROR" - + // RollbackFunctionUpgradeTraffic API was un-successful. + // "COMMIT_FUNCTION_UPGRADE_ERROR" - CommitFunctionUpgrade API was + // un-successful. + UpgradeState string `json:"upgradeState,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BuildConfig") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "BuildConfig") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *UpgradeInfo) MarshalJSON() ([]byte, error) { + type NoMethod UpgradeInfo + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // method id "cloudfunctions.projects.locations.list": type ProjectsLocationsListCall struct { @@ -2955,43 +3053,34 @@ func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocat } } -// method id "cloudfunctions.projects.locations.functions.create": +// method id "cloudfunctions.projects.locations.functions.abortFunctionUpgrade": -type ProjectsLocationsFunctionsCreateCall struct { - s *Service - parent string - function *Function - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsFunctionsAbortFunctionUpgradeCall struct { + s *Service + name string + abortfunctionupgraderequest *AbortFunctionUpgradeRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: 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. +// AbortFunctionUpgrade: 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. // -// - parent: The project and location in which the function should be -// created, specified in the format `projects/*/locations/*`. -func (r *ProjectsLocationsFunctionsService) Create(parent string, function *Function) *ProjectsLocationsFunctionsCreateCall { - c := &ProjectsLocationsFunctionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.function = function - return c -} - -// FunctionId sets the optional parameter "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-/. -func (c *ProjectsLocationsFunctionsCreateCall) FunctionId(functionId string) *ProjectsLocationsFunctionsCreateCall { - c.urlParams_.Set("functionId", functionId) +// - name: The name of the function for which upgrade should be aborted. +func (r *ProjectsLocationsFunctionsService) AbortFunctionUpgrade(name string, abortfunctionupgraderequest *AbortFunctionUpgradeRequest) *ProjectsLocationsFunctionsAbortFunctionUpgradeCall { + c := &ProjectsLocationsFunctionsAbortFunctionUpgradeCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.abortfunctionupgraderequest = abortfunctionupgraderequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsFunctionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsCreateCall { +func (c *ProjectsLocationsFunctionsAbortFunctionUpgradeCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsAbortFunctionUpgradeCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -2999,21 +3088,21 @@ func (c *ProjectsLocationsFunctionsCreateCall) Fields(s ...googleapi.Field) *Pro // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsFunctionsCreateCall) Context(ctx context.Context) *ProjectsLocationsFunctionsCreateCall { +func (c *ProjectsLocationsFunctionsAbortFunctionUpgradeCall) Context(ctx context.Context) *ProjectsLocationsFunctionsAbortFunctionUpgradeCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsFunctionsCreateCall) Header() http.Header { +func (c *ProjectsLocationsFunctionsAbortFunctionUpgradeCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsFunctionsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsFunctionsAbortFunctionUpgradeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -3021,14 +3110,14 @@ func (c *ProjectsLocationsFunctionsCreateCall) doRequest(alt string) (*http.Resp } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.function) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.abortfunctionupgraderequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/functions") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}:abortFunctionUpgrade") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -3036,19 +3125,19 @@ func (c *ProjectsLocationsFunctionsCreateCall) doRequest(alt string) (*http.Resp } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "cloudfunctions.projects.locations.functions.create" call. +// Do executes the "cloudfunctions.projects.locations.functions.abortFunctionUpgrade" call. // Exactly one of *Operation or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsLocationsFunctionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *ProjectsLocationsFunctionsAbortFunctionUpgradeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3079,30 +3168,25 @@ func (c *ProjectsLocationsFunctionsCreateCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "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.", - // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/functions", + // "description": "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.", + // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:abortFunctionUpgrade", // "httpMethod": "POST", - // "id": "cloudfunctions.projects.locations.functions.create", + // "id": "cloudfunctions.projects.locations.functions.abortFunctionUpgrade", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "functionId": { - // "description": "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-/.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The project and location in which the function should be created, specified in the format `projects/*/locations/*`", + // "name": { + // "description": "Required. The name of the function for which upgrade should be aborted.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2alpha/{+parent}/functions", + // "path": "v2alpha/{+name}:abortFunctionUpgrade", // "request": { - // "$ref": "Function" + // "$ref": "AbortFunctionUpgradeRequest" // }, // "response": { // "$ref": "Operation" @@ -3114,31 +3198,35 @@ func (c *ProjectsLocationsFunctionsCreateCall) Do(opts ...googleapi.CallOption) } -// method id "cloudfunctions.projects.locations.functions.delete": +// method id "cloudfunctions.projects.locations.functions.commitFunctionUpgrade": -type ProjectsLocationsFunctionsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsFunctionsCommitFunctionUpgradeCall struct { + s *Service + name string + commitfunctionupgraderequest *CommitFunctionUpgradeRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: 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. +// CommitFunctionUpgrade: 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. // -// - name: The name of the function which should be deleted. -func (r *ProjectsLocationsFunctionsService) Delete(name string) *ProjectsLocationsFunctionsDeleteCall { - c := &ProjectsLocationsFunctionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the function for which upgrade should be +// finalized. +func (r *ProjectsLocationsFunctionsService) CommitFunctionUpgrade(name string, commitfunctionupgraderequest *CommitFunctionUpgradeRequest) *ProjectsLocationsFunctionsCommitFunctionUpgradeCall { + c := &ProjectsLocationsFunctionsCommitFunctionUpgradeCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.commitfunctionupgraderequest = commitfunctionupgraderequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsFunctionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsDeleteCall { +func (c *ProjectsLocationsFunctionsCommitFunctionUpgradeCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsCommitFunctionUpgradeCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -3146,21 +3234,21 @@ func (c *ProjectsLocationsFunctionsDeleteCall) Fields(s ...googleapi.Field) *Pro // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsFunctionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsFunctionsDeleteCall { +func (c *ProjectsLocationsFunctionsCommitFunctionUpgradeCall) Context(ctx context.Context) *ProjectsLocationsFunctionsCommitFunctionUpgradeCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsFunctionsDeleteCall) Header() http.Header { +func (c *ProjectsLocationsFunctionsCommitFunctionUpgradeCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsFunctionsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsFunctionsCommitFunctionUpgradeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -3168,11 +3256,16 @@ func (c *ProjectsLocationsFunctionsDeleteCall) doRequest(alt string) (*http.Resp } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitfunctionupgraderequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}:commitFunctionUpgrade") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -3183,14 +3276,14 @@ func (c *ProjectsLocationsFunctionsDeleteCall) doRequest(alt string) (*http.Resp return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "cloudfunctions.projects.locations.functions.delete" call. +// Do executes the "cloudfunctions.projects.locations.functions.commitFunctionUpgrade" call. // Exactly one of *Operation or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsLocationsFunctionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *ProjectsLocationsFunctionsCommitFunctionUpgradeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3221,23 +3314,26 @@ func (c *ProjectsLocationsFunctionsDeleteCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "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.", - // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}", - // "httpMethod": "DELETE", - // "id": "cloudfunctions.projects.locations.functions.delete", + // "description": "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.", + // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:commitFunctionUpgrade", + // "httpMethod": "POST", + // "id": "cloudfunctions.projects.locations.functions.commitFunctionUpgrade", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The name of the function which should be deleted.", + // "description": "Required. The name of the function for which upgrade should be finalized.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2alpha/{+name}", + // "path": "v2alpha/{+name}:commitFunctionUpgrade", + // "request": { + // "$ref": "CommitFunctionUpgradeRequest" + // }, // "response": { // "$ref": "Operation" // }, @@ -3248,36 +3344,43 @@ func (c *ProjectsLocationsFunctionsDeleteCall) Do(opts ...googleapi.CallOption) } -// method id "cloudfunctions.projects.locations.functions.generateDownloadUrl": +// method id "cloudfunctions.projects.locations.functions.create": -type ProjectsLocationsFunctionsGenerateDownloadUrlCall struct { - s *Service - name string - generatedownloadurlrequest *GenerateDownloadUrlRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsFunctionsCreateCall struct { + s *Service + parent string + function *Function + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// GenerateDownloadUrl: 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: 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. // -// - name: The name of function for which source code Google Cloud -// Storage signed URL should be generated. -func (r *ProjectsLocationsFunctionsService) GenerateDownloadUrl(name string, generatedownloadurlrequest *GenerateDownloadUrlRequest) *ProjectsLocationsFunctionsGenerateDownloadUrlCall { - c := &ProjectsLocationsFunctionsGenerateDownloadUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.generatedownloadurlrequest = generatedownloadurlrequest +// - parent: The project and location in which the function should be +// created, specified in the format `projects/*/locations/*`. +func (r *ProjectsLocationsFunctionsService) Create(parent string, function *Function) *ProjectsLocationsFunctionsCreateCall { + c := &ProjectsLocationsFunctionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.function = function + return c +} + +// FunctionId sets the optional parameter "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-/. +func (c *ProjectsLocationsFunctionsCreateCall) FunctionId(functionId string) *ProjectsLocationsFunctionsCreateCall { + c.urlParams_.Set("functionId", functionId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGenerateDownloadUrlCall { +func (c *ProjectsLocationsFunctionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -3285,21 +3388,21 @@ func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Fields(s ...googleap // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGenerateDownloadUrlCall { +func (c *ProjectsLocationsFunctionsCreateCall) Context(ctx context.Context) *ProjectsLocationsFunctionsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Header() http.Header { +func (c *ProjectsLocationsFunctionsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsFunctionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -3307,14 +3410,14 @@ func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) doRequest(alt string } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generatedownloadurlrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.function) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}:generateDownloadUrl") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/functions") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -3322,19 +3425,19 @@ func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) doRequest(alt string } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "cloudfunctions.projects.locations.functions.generateDownloadUrl" call. -// Exactly one of *GenerateDownloadUrlResponse or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GenerateDownloadUrlResponse.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Do(opts ...googleapi.CallOption) (*GenerateDownloadUrlResponse, error) { +// Do executes the "cloudfunctions.projects.locations.functions.create" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsFunctionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3353,7 +3456,7 @@ func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Do(opts ...googleapi if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GenerateDownloadUrlResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -3365,28 +3468,33 @@ func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Do(opts ...googleapi } return ret, nil // { - // "description": "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", - // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:generateDownloadUrl", + // "description": "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.", + // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/functions", // "httpMethod": "POST", - // "id": "cloudfunctions.projects.locations.functions.generateDownloadUrl", + // "id": "cloudfunctions.projects.locations.functions.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The name of function for which source code Google Cloud Storage signed URL should be generated.", + // "functionId": { + // "description": "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-/.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The project and location in which the function should be created, specified in the format `projects/*/locations/*`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2alpha/{+name}:generateDownloadUrl", + // "path": "v2alpha/{+parent}/functions", // "request": { - // "$ref": "GenerateDownloadUrlRequest" + // "$ref": "Function" // }, // "response": { - // "$ref": "GenerateDownloadUrlResponse" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -3395,46 +3503,31 @@ func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Do(opts ...googleapi } -// method id "cloudfunctions.projects.locations.functions.generateUploadUrl": +// method id "cloudfunctions.projects.locations.functions.delete": -type ProjectsLocationsFunctionsGenerateUploadUrlCall struct { - s *Service - parent string - generateuploadurlrequest *GenerateUploadUrlRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsFunctionsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// GenerateUploadUrl: 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` +// Delete: 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. // -// - parent: The project and location in which the Google Cloud Storage -// signed URL should be generated, specified in the format -// `projects/*/locations/*`. -func (r *ProjectsLocationsFunctionsService) GenerateUploadUrl(parent string, generateuploadurlrequest *GenerateUploadUrlRequest) *ProjectsLocationsFunctionsGenerateUploadUrlCall { - c := &ProjectsLocationsFunctionsGenerateUploadUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.generateuploadurlrequest = generateuploadurlrequest +// - name: The name of the function which should be deleted. +func (r *ProjectsLocationsFunctionsService) Delete(name string) *ProjectsLocationsFunctionsDeleteCall { + c := &ProjectsLocationsFunctionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGenerateUploadUrlCall { +func (c *ProjectsLocationsFunctionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -3442,21 +3535,21 @@ func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Fields(s ...googleapi. // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGenerateUploadUrlCall { +func (c *ProjectsLocationsFunctionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsFunctionsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Header() http.Header { +func (c *ProjectsLocationsFunctionsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsFunctionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -3464,34 +3557,29 @@ func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) doRequest(alt string) } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateuploadurlrequest) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/functions:generateUploadUrl") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "cloudfunctions.projects.locations.functions.generateUploadUrl" call. -// Exactly one of *GenerateUploadUrlResponse or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GenerateUploadUrlResponse.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Do(opts ...googleapi.CallOption) (*GenerateUploadUrlResponse, error) { +// Do executes the "cloudfunctions.projects.locations.functions.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsFunctionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3510,7 +3598,7 @@ func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Do(opts ...googleapi.C if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GenerateUploadUrlResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -3522,28 +3610,25 @@ func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Do(opts ...googleapi.C } return ret, nil // { - // "description": "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`", - // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/functions:generateUploadUrl", - // "httpMethod": "POST", - // "id": "cloudfunctions.projects.locations.functions.generateUploadUrl", + // "description": "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.", + // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}", + // "httpMethod": "DELETE", + // "id": "cloudfunctions.projects.locations.functions.delete", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. The project and location in which the Google Cloud Storage signed URL should be generated, specified in the format `projects/*/locations/*`.", + // "name": { + // "description": "Required. The name of the function which should be deleted.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2alpha/{+parent}/functions:generateUploadUrl", - // "request": { - // "$ref": "GenerateUploadUrlRequest" - // }, + // "path": "v2alpha/{+name}", // "response": { - // "$ref": "GenerateUploadUrlResponse" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -3552,78 +3637,75 @@ func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Do(opts ...googleapi.C } -// method id "cloudfunctions.projects.locations.functions.get": +// method id "cloudfunctions.projects.locations.functions.generateDownloadUrl": -type ProjectsLocationsFunctionsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsFunctionsGenerateDownloadUrlCall struct { + s *Service + name string + generatedownloadurlrequest *GenerateDownloadUrlRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Returns a function with the given name from the requested -// project. +// GenerateDownloadUrl: 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 // -// - name: The name of the function which details should be obtained. -func (r *ProjectsLocationsFunctionsService) Get(name string) *ProjectsLocationsFunctionsGetCall { - c := &ProjectsLocationsFunctionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of function for which source code Google Cloud +// Storage signed URL should be generated. +func (r *ProjectsLocationsFunctionsService) GenerateDownloadUrl(name string, generatedownloadurlrequest *GenerateDownloadUrlRequest) *ProjectsLocationsFunctionsGenerateDownloadUrlCall { + c := &ProjectsLocationsFunctionsGenerateDownloadUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.generatedownloadurlrequest = generatedownloadurlrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsFunctionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGetCall { +func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGenerateDownloadUrlCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsFunctionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsFunctionsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsFunctionsGetCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGetCall { +func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGenerateDownloadUrlCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsFunctionsGetCall) Header() http.Header { +func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsFunctionsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.generatedownloadurlrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}:generateDownloadUrl") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -3634,14 +3716,14 @@ func (c *ProjectsLocationsFunctionsGetCall) doRequest(alt string) (*http.Respons return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "cloudfunctions.projects.locations.functions.get" call. -// Exactly one of *Function or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Function.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *ProjectsLocationsFunctionsGetCall) Do(opts ...googleapi.CallOption) (*Function, error) { +// Do executes the "cloudfunctions.projects.locations.functions.generateDownloadUrl" call. +// Exactly one of *GenerateDownloadUrlResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GenerateDownloadUrlResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Do(opts ...googleapi.CallOption) (*GenerateDownloadUrlResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3660,7 +3742,7 @@ func (c *ProjectsLocationsFunctionsGetCall) Do(opts ...googleapi.CallOption) (*F if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Function{ + ret := &GenerateDownloadUrlResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -3672,25 +3754,28 @@ func (c *ProjectsLocationsFunctionsGetCall) Do(opts ...googleapi.CallOption) (*F } return ret, nil // { - // "description": "Returns a function with the given name from the requested project.", - // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}", - // "httpMethod": "GET", - // "id": "cloudfunctions.projects.locations.functions.get", + // "description": "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", + // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:generateDownloadUrl", + // "httpMethod": "POST", + // "id": "cloudfunctions.projects.locations.functions.generateDownloadUrl", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The name of the function which details should be obtained.", + // "description": "Required. The name of function for which source code Google Cloud Storage signed URL should be generated.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2alpha/{+name}", + // "path": "v2alpha/{+name}:generateDownloadUrl", + // "request": { + // "$ref": "GenerateDownloadUrlRequest" + // }, // "response": { - // "$ref": "Function" + // "$ref": "GenerateDownloadUrlResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -3699,118 +3784,103 @@ func (c *ProjectsLocationsFunctionsGetCall) Do(opts ...googleapi.CallOption) (*F } -// method id "cloudfunctions.projects.locations.functions.getIamPolicy": +// method id "cloudfunctions.projects.locations.functions.generateUploadUrl": -type ProjectsLocationsFunctionsGetIamPolicyCall struct { - s *Service - resource string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsFunctionsGenerateUploadUrlCall struct { + s *Service + parent string + generateuploadurlrequest *GenerateUploadUrlRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// GetIamPolicy: Gets the access control policy for a resource. Returns -// an empty policy if the resource exists and does not have a policy -// set. +// GenerateUploadUrl: 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` // -// - 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. -func (r *ProjectsLocationsFunctionsService) GetIamPolicy(resource string) *ProjectsLocationsFunctionsGetIamPolicyCall { - c := &ProjectsLocationsFunctionsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.resource = resource - return c -} - -// OptionsRequestedPolicyVersion sets the optional parameter -// "options.requestedPolicyVersion": 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). -func (c *ProjectsLocationsFunctionsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsFunctionsGetIamPolicyCall { - c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) +// - parent: The project and location in which the Google Cloud Storage +// signed URL should be generated, specified in the format +// `projects/*/locations/*`. +func (r *ProjectsLocationsFunctionsService) GenerateUploadUrl(parent string, generateuploadurlrequest *GenerateUploadUrlRequest) *ProjectsLocationsFunctionsGenerateUploadUrlCall { + c := &ProjectsLocationsFunctionsGenerateUploadUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.generateuploadurlrequest = generateuploadurlrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGetIamPolicyCall { +func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGenerateUploadUrlCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsFunctionsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsFunctionsGetIamPolicyCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGetIamPolicyCall { +func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGenerateUploadUrlCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Header() http.Header { +func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsFunctionsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateuploadurlrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+resource}:getIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/functions:generateUploadUrl") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "resource": c.resource, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "cloudfunctions.projects.locations.functions.getIamPolicy" call. -// Exactly one of *Policy or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Policy.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +// Do executes the "cloudfunctions.projects.locations.functions.generateUploadUrl" call. +// Exactly one of *GenerateUploadUrlResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GenerateUploadUrlResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Do(opts ...googleapi.CallOption) (*GenerateUploadUrlResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3829,7 +3899,7 @@ func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Policy{ + ret := &GenerateUploadUrlResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -3841,31 +3911,28 @@ func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Do(opts ...googleapi.CallOp } return ret, nil // { - // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", - // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:getIamPolicy", - // "httpMethod": "GET", - // "id": "cloudfunctions.projects.locations.functions.getIamPolicy", + // "description": "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`", + // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/functions:generateUploadUrl", + // "httpMethod": "POST", + // "id": "cloudfunctions.projects.locations.functions.generateUploadUrl", // "parameterOrder": [ - // "resource" + // "parent" // ], // "parameters": { - // "options.requestedPolicyVersion": { - // "description": "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).", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "resource": { - // "description": "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.", + // "parent": { + // "description": "Required. The project and location in which the Google Cloud Storage signed URL should be generated, specified in the format `projects/*/locations/*`.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2alpha/{+resource}:getIamPolicy", + // "path": "v2alpha/{+parent}/functions:generateUploadUrl", + // "request": { + // "$ref": "GenerateUploadUrlRequest" + // }, // "response": { - // "$ref": "Policy" + // "$ref": "GenerateUploadUrlResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -3874,73 +3941,31 @@ func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Do(opts ...googleapi.CallOp } -// method id "cloudfunctions.projects.locations.functions.list": +// method id "cloudfunctions.projects.locations.functions.get": -type ProjectsLocationsFunctionsListCall struct { +type ProjectsLocationsFunctionsGetCall struct { s *Service - parent string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Returns a list of functions that belong to the requested +// Get: Returns a function with the given name from the requested // project. // -// - parent: 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. -func (r *ProjectsLocationsFunctionsService) List(parent string) *ProjectsLocationsFunctionsListCall { - c := &ProjectsLocationsFunctionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// Filter sets the optional parameter "filter": The filter for Functions -// that match the filter expression, following the syntax outlined in -// https://google.aip.dev/160. -func (c *ProjectsLocationsFunctionsListCall) Filter(filter string) *ProjectsLocationsFunctionsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// OrderBy sets the optional parameter "orderBy": The sorting order of -// the resources returned. Value should be a comma separated list of -// fields. The default sorting oder is ascending. See -// https://google.aip.dev/132#ordering. -func (c *ProjectsLocationsFunctionsListCall) OrderBy(orderBy string) *ProjectsLocationsFunctionsListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageSize sets the optional parameter "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. -func (c *ProjectsLocationsFunctionsListCall) PageSize(pageSize int64) *ProjectsLocationsFunctionsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "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. -func (c *ProjectsLocationsFunctionsListCall) PageToken(pageToken string) *ProjectsLocationsFunctionsListCall { - c.urlParams_.Set("pageToken", pageToken) +// - name: The name of the function which details should be obtained. +func (r *ProjectsLocationsFunctionsService) Get(name string) *ProjectsLocationsFunctionsGetCall { + c := &ProjectsLocationsFunctionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsFunctionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsListCall { +func (c *ProjectsLocationsFunctionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -3950,7 +3975,7 @@ func (c *ProjectsLocationsFunctionsListCall) Fields(s ...googleapi.Field) *Proje // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsFunctionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsFunctionsListCall { +func (c *ProjectsLocationsFunctionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsFunctionsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -3958,54 +3983,762 @@ func (c *ProjectsLocationsFunctionsListCall) IfNoneMatch(entityTag string) *Proj // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsFunctionsListCall) Context(ctx context.Context) *ProjectsLocationsFunctionsListCall { +func (c *ProjectsLocationsFunctionsGetCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsFunctionsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsFunctionsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "cloudfunctions.projects.locations.functions.get" call. +// Exactly one of *Function or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Function.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsFunctionsGetCall) Do(opts ...googleapi.CallOption) (*Function, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Function{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a function with the given name from the requested project.", + // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}", + // "httpMethod": "GET", + // "id": "cloudfunctions.projects.locations.functions.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The name of the function which details should be obtained.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2alpha/{+name}", + // "response": { + // "$ref": "Function" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudfunctions.projects.locations.functions.getIamPolicy": + +type ProjectsLocationsFunctionsGetIamPolicyCall struct { + s *Service + resource string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// GetIamPolicy: Gets the access control policy for a resource. Returns +// an empty policy if the resource exists and does not have a policy +// set. +// +// - 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. +func (r *ProjectsLocationsFunctionsService) GetIamPolicy(resource string) *ProjectsLocationsFunctionsGetIamPolicyCall { + c := &ProjectsLocationsFunctionsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.resource = resource + return c +} + +// OptionsRequestedPolicyVersion sets the optional parameter +// "options.requestedPolicyVersion": 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). +func (c *ProjectsLocationsFunctionsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsFunctionsGetIamPolicyCall { + c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGetIamPolicyCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsFunctionsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsFunctionsGetIamPolicyCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGetIamPolicyCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsFunctionsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+resource}:getIamPolicy") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "cloudfunctions.projects.locations.functions.getIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", + // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:getIamPolicy", + // "httpMethod": "GET", + // "id": "cloudfunctions.projects.locations.functions.getIamPolicy", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "options.requestedPolicyVersion": { + // "description": "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).", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "resource": { + // "description": "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.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2alpha/{+resource}:getIamPolicy", + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudfunctions.projects.locations.functions.list": + +type ProjectsLocationsFunctionsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Returns a list of functions that belong to the requested +// project. +// +// - parent: 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. +func (r *ProjectsLocationsFunctionsService) List(parent string) *ProjectsLocationsFunctionsListCall { + c := &ProjectsLocationsFunctionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": The filter for Functions +// that match the filter expression, following the syntax outlined in +// https://google.aip.dev/160. +func (c *ProjectsLocationsFunctionsListCall) Filter(filter string) *ProjectsLocationsFunctionsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// OrderBy sets the optional parameter "orderBy": The sorting order of +// the resources returned. Value should be a comma separated list of +// fields. The default sorting oder is ascending. See +// https://google.aip.dev/132#ordering. +func (c *ProjectsLocationsFunctionsListCall) OrderBy(orderBy string) *ProjectsLocationsFunctionsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageSize sets the optional parameter "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. +func (c *ProjectsLocationsFunctionsListCall) PageSize(pageSize int64) *ProjectsLocationsFunctionsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "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. +func (c *ProjectsLocationsFunctionsListCall) PageToken(pageToken string) *ProjectsLocationsFunctionsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsFunctionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsFunctionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsFunctionsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsFunctionsListCall) Context(ctx context.Context) *ProjectsLocationsFunctionsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsFunctionsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsFunctionsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/functions") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "cloudfunctions.projects.locations.functions.list" call. +// Exactly one of *ListFunctionsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListFunctionsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsFunctionsListCall) Do(opts ...googleapi.CallOption) (*ListFunctionsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ListFunctionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a list of functions that belong to the requested project.", + // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/functions", + // "httpMethod": "GET", + // "id": "cloudfunctions.projects.locations.functions.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "filter": { + // "description": "The filter for Functions that match the filter expression, following the syntax outlined in https://google.aip.dev/160.", + // "location": "query", + // "type": "string" + // }, + // "orderBy": { + // "description": "The sorting order of the resources returned. Value should be a comma separated list of fields. The default sorting oder is ascending. See https://google.aip.dev/132#ordering.", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "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.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "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.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "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.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2alpha/{+parent}/functions", + // "response": { + // "$ref": "ListFunctionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsFunctionsListCall) Pages(ctx context.Context, f func(*ListFunctionsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "cloudfunctions.projects.locations.functions.patch": + +type ProjectsLocationsFunctionsPatchCall struct { + s *Service + name string + function *Function + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates existing function. +// +// - name: A user-defined name of the function. Function names must be +// unique globally and match pattern +// `projects/*/locations/*/functions/*`. +func (r *ProjectsLocationsFunctionsService) Patch(name string, function *Function) *ProjectsLocationsFunctionsPatchCall { + c := &ProjectsLocationsFunctionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.function = function + return c +} + +// UpdateMask sets the optional parameter "updateMask": The list of +// fields to be updated. If no field mask is provided, all provided +// fields in the request will be updated. +func (c *ProjectsLocationsFunctionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsFunctionsPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsFunctionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsFunctionsPatchCall) Context(ctx context.Context) *ProjectsLocationsFunctionsPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsFunctionsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsFunctionsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.function) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "cloudfunctions.projects.locations.functions.patch" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsFunctionsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates existing function.", + // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}", + // "httpMethod": "PATCH", + // "id": "cloudfunctions.projects.locations.functions.patch", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "A user-defined name of the function. Function names must be unique globally and match pattern `projects/*/locations/*/functions/*`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "The list of fields to be updated. If no field mask is provided, all provided fields in the request will be updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v2alpha/{+name}", + // "request": { + // "$ref": "Function" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudfunctions.projects.locations.functions.redirectFunctionUpgradeTraffic": + +type ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall struct { + s *Service + name string + redirectfunctionupgradetrafficrequest *RedirectFunctionUpgradeTrafficRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// RedirectFunctionUpgradeTraffic: 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. +// +// - name: The name of the function for which traffic target should be +// changed to 2nd Gen from 1st Gen. +func (r *ProjectsLocationsFunctionsService) RedirectFunctionUpgradeTraffic(name string, redirectfunctionupgradetrafficrequest *RedirectFunctionUpgradeTrafficRequest) *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall { + c := &ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.redirectfunctionupgradetrafficrequest = redirectfunctionupgradetrafficrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall) Context(ctx context.Context) *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsFunctionsListCall) Header() http.Header { +func (c *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsFunctionsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.redirectfunctionupgradetrafficrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+parent}/functions") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}:redirectFunctionUpgradeTraffic") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "cloudfunctions.projects.locations.functions.list" call. -// Exactly one of *ListFunctionsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListFunctionsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsFunctionsListCall) Do(opts ...googleapi.CallOption) (*ListFunctionsResponse, error) { +// Do executes the "cloudfunctions.projects.locations.functions.redirectFunctionUpgradeTraffic" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4024,7 +4757,7 @@ func (c *ProjectsLocationsFunctionsListCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListFunctionsResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4036,46 +4769,28 @@ func (c *ProjectsLocationsFunctionsListCall) Do(opts ...googleapi.CallOption) (* } return ret, nil // { - // "description": "Returns a list of functions that belong to the requested project.", - // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/functions", - // "httpMethod": "GET", - // "id": "cloudfunctions.projects.locations.functions.list", + // "description": "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.", + // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:redirectFunctionUpgradeTraffic", + // "httpMethod": "POST", + // "id": "cloudfunctions.projects.locations.functions.redirectFunctionUpgradeTraffic", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "filter": { - // "description": "The filter for Functions that match the filter expression, following the syntax outlined in https://google.aip.dev/160.", - // "location": "query", - // "type": "string" - // }, - // "orderBy": { - // "description": "The sorting order of the resources returned. Value should be a comma separated list of fields. The default sorting oder is ascending. See https://google.aip.dev/132#ordering.", - // "location": "query", - // "type": "string" - // }, - // "pageSize": { - // "description": "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.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "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.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "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.", + // "name": { + // "description": "Required. The name of the function for which traffic target should be changed to 2nd Gen from 1st Gen.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2alpha/{+parent}/functions", + // "path": "v2alpha/{+name}:redirectFunctionUpgradeTraffic", + // "request": { + // "$ref": "RedirectFunctionUpgradeTrafficRequest" + // }, // "response": { - // "$ref": "ListFunctionsResponse" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -4084,62 +4799,34 @@ func (c *ProjectsLocationsFunctionsListCall) Do(opts ...googleapi.CallOption) (* } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsFunctionsListCall) Pages(ctx context.Context, f func(*ListFunctionsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "cloudfunctions.projects.locations.functions.patch": +// method id "cloudfunctions.projects.locations.functions.rollbackFunctionUpgradeTraffic": -type ProjectsLocationsFunctionsPatchCall struct { - s *Service - name string - function *Function - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall struct { + s *Service + name string + rollbackfunctionupgradetrafficrequest *RollbackFunctionUpgradeTrafficRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates existing function. +// RollbackFunctionUpgradeTraffic: 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. // -// - name: A user-defined name of the function. Function names must be -// unique globally and match pattern -// `projects/*/locations/*/functions/*`. -func (r *ProjectsLocationsFunctionsService) Patch(name string, function *Function) *ProjectsLocationsFunctionsPatchCall { - c := &ProjectsLocationsFunctionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the function for which traffic target should be +// changed back to 1st Gen from 2nd Gen. +func (r *ProjectsLocationsFunctionsService) RollbackFunctionUpgradeTraffic(name string, rollbackfunctionupgradetrafficrequest *RollbackFunctionUpgradeTrafficRequest) *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall { + c := &ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.function = function - return c -} - -// UpdateMask sets the optional parameter "updateMask": The list of -// fields to be updated. If no field mask is provided, all provided -// fields in the request will be updated. -func (c *ProjectsLocationsFunctionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsFunctionsPatchCall { - c.urlParams_.Set("updateMask", updateMask) + c.rollbackfunctionupgradetrafficrequest = rollbackfunctionupgradetrafficrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsFunctionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsPatchCall { +func (c *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -4147,21 +4834,21 @@ func (c *ProjectsLocationsFunctionsPatchCall) Fields(s ...googleapi.Field) *Proj // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsFunctionsPatchCall) Context(ctx context.Context) *ProjectsLocationsFunctionsPatchCall { +func (c *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall) Context(ctx context.Context) *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsFunctionsPatchCall) Header() http.Header { +func (c *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsFunctionsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -4169,16 +4856,16 @@ func (c *ProjectsLocationsFunctionsPatchCall) doRequest(alt string) (*http.Respo } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.function) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackfunctionupgradetrafficrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}:rollbackFunctionUpgradeTraffic") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -4189,14 +4876,14 @@ func (c *ProjectsLocationsFunctionsPatchCall) doRequest(alt string) (*http.Respo return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "cloudfunctions.projects.locations.functions.patch" call. +// Do executes the "cloudfunctions.projects.locations.functions.rollbackFunctionUpgradeTraffic" call. // Exactly one of *Operation or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsLocationsFunctionsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4227,31 +4914,25 @@ func (c *ProjectsLocationsFunctionsPatchCall) Do(opts ...googleapi.CallOption) ( } return ret, nil // { - // "description": "Updates existing function.", - // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}", - // "httpMethod": "PATCH", - // "id": "cloudfunctions.projects.locations.functions.patch", + // "description": "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.", + // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:rollbackFunctionUpgradeTraffic", + // "httpMethod": "POST", + // "id": "cloudfunctions.projects.locations.functions.rollbackFunctionUpgradeTraffic", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "A user-defined name of the function. Function names must be unique globally and match pattern `projects/*/locations/*/functions/*`", + // "description": "Required. The name of the function for which traffic target should be changed back to 1st Gen from 2nd Gen.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "The list of fields to be updated. If no field mask is provided, all provided fields in the request will be updated.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2alpha/{+name}", + // "path": "v2alpha/{+name}:rollbackFunctionUpgradeTraffic", // "request": { - // "$ref": "Function" + // "$ref": "RollbackFunctionUpgradeTrafficRequest" // }, // "response": { // "$ref": "Operation" @@ -4410,6 +5091,153 @@ func (c *ProjectsLocationsFunctionsSetIamPolicyCall) Do(opts ...googleapi.CallOp } +// method id "cloudfunctions.projects.locations.functions.setupFunctionUpgradeConfig": + +type ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall struct { + s *Service + name string + setupfunctionupgradeconfigrequest *SetupFunctionUpgradeConfigRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// SetupFunctionUpgradeConfig: 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. +// +// - name: The name of the function which should have configuration +// copied for upgrade. +func (r *ProjectsLocationsFunctionsService) SetupFunctionUpgradeConfig(name string, setupfunctionupgradeconfigrequest *SetupFunctionUpgradeConfigRequest) *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall { + c := &ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.setupfunctionupgradeconfigrequest = setupfunctionupgradeconfigrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall) Context(ctx context.Context) *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.setupfunctionupgradeconfigrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha/{+name}:setupFunctionUpgradeConfig") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "cloudfunctions.projects.locations.functions.setupFunctionUpgradeConfig" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.", + // "flatPath": "v2alpha/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:setupFunctionUpgradeConfig", + // "httpMethod": "POST", + // "id": "cloudfunctions.projects.locations.functions.setupFunctionUpgradeConfig", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The name of the function which should have configuration copied for upgrade.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2alpha/{+name}:setupFunctionUpgradeConfig", + // "request": { + // "$ref": "SetupFunctionUpgradeConfigRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + // method id "cloudfunctions.projects.locations.functions.testIamPermissions": type ProjectsLocationsFunctionsTestIamPermissionsCall struct { diff --git a/cloudfunctions/v2beta/cloudfunctions-api.json b/cloudfunctions/v2beta/cloudfunctions-api.json index 14f323faaf3..b6ab296667e 100644 --- a/cloudfunctions/v2beta/cloudfunctions-api.json +++ b/cloudfunctions/v2beta/cloudfunctions-api.json @@ -154,6 +154,62 @@ "resources": { "functions": { "methods": { + "abortFunctionUpgrade": { + "description": "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.", + "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:abortFunctionUpgrade", + "httpMethod": "POST", + "id": "cloudfunctions.projects.locations.functions.abortFunctionUpgrade", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the function for which upgrade should be aborted.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2beta/{+name}:abortFunctionUpgrade", + "request": { + "$ref": "AbortFunctionUpgradeRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "commitFunctionUpgrade": { + "description": "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.", + "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:commitFunctionUpgrade", + "httpMethod": "POST", + "id": "cloudfunctions.projects.locations.functions.commitFunctionUpgrade", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the function for which upgrade should be finalized.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2beta/{+name}:commitFunctionUpgrade", + "request": { + "$ref": "CommitFunctionUpgradeRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "create": { "description": "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.", "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/functions", @@ -404,6 +460,62 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "redirectFunctionUpgradeTraffic": { + "description": "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.", + "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:redirectFunctionUpgradeTraffic", + "httpMethod": "POST", + "id": "cloudfunctions.projects.locations.functions.redirectFunctionUpgradeTraffic", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the function for which traffic target should be changed to 2nd Gen from 1st Gen.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2beta/{+name}:redirectFunctionUpgradeTraffic", + "request": { + "$ref": "RedirectFunctionUpgradeTrafficRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "rollbackFunctionUpgradeTraffic": { + "description": "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.", + "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:rollbackFunctionUpgradeTraffic", + "httpMethod": "POST", + "id": "cloudfunctions.projects.locations.functions.rollbackFunctionUpgradeTraffic", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the function for which traffic target should be changed back to 1st Gen from 2nd Gen.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2beta/{+name}:rollbackFunctionUpgradeTraffic", + "request": { + "$ref": "RollbackFunctionUpgradeTrafficRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "setIamPolicy": { "description": "Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.", "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:setIamPolicy", @@ -432,6 +544,34 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "setupFunctionUpgradeConfig": { + "description": "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.", + "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:setupFunctionUpgradeConfig", + "httpMethod": "POST", + "id": "cloudfunctions.projects.locations.functions.setupFunctionUpgradeConfig", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the function which should have configuration copied for upgrade.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2beta/{+name}:setupFunctionUpgradeConfig", + "request": { + "$ref": "SetupFunctionUpgradeConfigRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "testIamPermissions": { "description": "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.", "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:testIamPermissions", @@ -571,9 +711,15 @@ } } }, - "revision": "20240118", + "revision": "20240205", "rootUrl": "https://cloudfunctions.googleapis.com/", "schemas": { + "AbortFunctionUpgradeRequest": { + "description": "Request for the `AbortFunctionUpgrade` method.", + "id": "AbortFunctionUpgradeRequest", + "properties": {}, + "type": "object" + }, "AuditConfig": { "description": "Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs. If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted. Example Policy with multiple AuditConfigs: { \"audit_configs\": [ { \"service\": \"allServices\", \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\", \"exempted_members\": [ \"user:jose@example.com\" ] }, { \"log_type\": \"DATA_WRITE\" }, { \"log_type\": \"ADMIN_READ\" } ] }, { \"service\": \"sampleservice.googleapis.com\", \"audit_log_configs\": [ { \"log_type\": \"DATA_READ\" }, { \"log_type\": \"DATA_WRITE\", \"exempted_members\": [ \"user:aliya@example.com\" ] } ] } ] } For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts `jose@example.com` from DATA_READ logging, and `aliya@example.com` from DATA_WRITE logging.", "id": "AuditConfig", @@ -724,6 +870,12 @@ }, "type": "object" }, + "CommitFunctionUpgradeRequest": { + "description": "Request for the `CommitFunctionUpgrade` method.", + "id": "CommitFunctionUpgradeRequest", + "properties": {}, + "type": "object" + }, "Date": { "description": "Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp", "id": "Date", @@ -853,6 +1005,12 @@ "$ref": "BuildConfig", "description": "Describes the Build step of the function that builds a container from the given source." }, + "createTime": { + "description": "Output only. The create timestamp of a Cloud Function. This is only applicable to 2nd Gen functions.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, "description": { "description": "User-provided description of a function.", "type": "string" @@ -934,6 +1092,11 @@ "readOnly": true, "type": "string" }, + "upgradeInfo": { + "$ref": "UpgradeInfo", + "description": "Output only. UpgradeInfo for this Cloud Function", + "readOnly": true + }, "url": { "description": "Output only. The deployed url for the function.", "readOnly": true, @@ -1846,6 +2009,12 @@ }, "type": "object" }, + "RedirectFunctionUpgradeTrafficRequest": { + "description": "Request for the `RedirectFunctionUpgradeTraffic` method.", + "id": "RedirectFunctionUpgradeTrafficRequest", + "properties": {}, + "type": "object" + }, "RepoSource": { "description": "Location of the source in a Google Cloud Source Repository.", "id": "RepoSource", @@ -1877,6 +2046,12 @@ }, "type": "object" }, + "RollbackFunctionUpgradeTrafficRequest": { + "description": "Request for the `RollbackFunctionUpgradeTraffic` method.", + "id": "RollbackFunctionUpgradeTrafficRequest", + "properties": {}, + "type": "object" + }, "Runtime": { "description": "Describes a runtime and any special information (e.g., deprecation status) related to it.", "id": "Runtime", @@ -2150,6 +2325,12 @@ }, "type": "object" }, + "SetupFunctionUpgradeConfigRequest": { + "description": "Request for the `SetupFunctionUpgradeConfig` method.", + "id": "SetupFunctionUpgradeConfigRequest", + "properties": {}, + "type": "object" + }, "Source": { "description": "The location of the function source code.", "id": "Source", @@ -2262,6 +2443,53 @@ } }, "type": "object" + }, + "UpgradeInfo": { + "description": "Information related to: * A function's eligibility for 1st Gen to 2nd Gen migration * Current state of migration for function undergoing migration.", + "id": "UpgradeInfo", + "properties": { + "buildConfig": { + "$ref": "BuildConfig", + "description": "Describes the Build step of the function that builds a container to prepare for 2nd gen upgrade." + }, + "eventTrigger": { + "$ref": "EventTrigger", + "description": "Describes the Event trigger which has been setup to prepare for 2nd gen upgrade." + }, + "serviceConfig": { + "$ref": "ServiceConfig", + "description": "Describes the Cloud Run service which has been setup to prepare for 2nd gen upgrade." + }, + "upgradeState": { + "description": "UpgradeState of the function", + "enum": [ + "UPGRADE_STATE_UNSPECIFIED", + "ELIGIBLE_FOR_2ND_GEN_UPGRADE", + "UPGRADE_OPERATION_IN_PROGRESS", + "SETUP_FUNCTION_UPGRADE_CONFIG_SUCCESSFUL", + "SETUP_FUNCTION_UPGRADE_CONFIG_ERROR", + "ABORT_FUNCTION_UPGRADE_ERROR", + "REDIRECT_FUNCTION_UPGRADE_TRAFFIC_SUCCESSFUL", + "REDIRECT_FUNCTION_UPGRADE_TRAFFIC_ERROR", + "ROLLBACK_FUNCTION_UPGRADE_TRAFFIC_ERROR", + "COMMIT_FUNCTION_UPGRADE_ERROR" + ], + "enumDescriptions": [ + "Unspecified state. Most functions are in this upgrade state.", + "Functions in this state are eligible for 1st Gen -\u003e 2nd Gen upgrade.", + "An upgrade related operation is in progress.", + "SetupFunctionUpgradeConfig API was successful and a 2nd Gen function has been created based on 1st Gen function instance.", + "SetupFunctionUpgradeConfig API was un-successful.", + "AbortFunctionUpgrade API was un-successful.", + "RedirectFunctionUpgradeTraffic API was successful and traffic is served by 2nd Gen function stack.", + "RedirectFunctionUpgradeTraffic API was un-successful.", + "RollbackFunctionUpgradeTraffic API was un-successful.", + "CommitFunctionUpgrade API was un-successful." + ], + "type": "string" + } + }, + "type": "object" } }, "servicePath": "", diff --git a/cloudfunctions/v2beta/cloudfunctions-gen.go b/cloudfunctions/v2beta/cloudfunctions-gen.go index 832bc012ace..dd696e0f871 100644 --- a/cloudfunctions/v2beta/cloudfunctions-gen.go +++ b/cloudfunctions/v2beta/cloudfunctions-gen.go @@ -212,6 +212,11 @@ type ProjectsLocationsRuntimesService struct { s *Service } +// AbortFunctionUpgradeRequest: Request for the `AbortFunctionUpgrade` +// method. +type AbortFunctionUpgradeRequest struct { +} + // AuditConfig: Specifies the audit configuration for a service. The // configuration determines which permission types are logged, and what // identities, if any, are exempted from logging. An AuditConfig must @@ -540,6 +545,11 @@ func (s *BuildConfig) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// CommitFunctionUpgradeRequest: Request for the `CommitFunctionUpgrade` +// method. +type CommitFunctionUpgradeRequest struct { +} + // Date: Represents a whole or partial calendar date, such as a // birthday. The time of day and time zone are either specified // elsewhere or are insignificant. The date is relative to the Gregorian @@ -779,6 +789,10 @@ type Function struct { // container from the given source. BuildConfig *BuildConfig `json:"buildConfig,omitempty"` + // CreateTime: Output only. The create timestamp of a Cloud Function. + // This is only applicable to 2nd Gen functions. + CreateTime string `json:"createTime,omitempty"` + // Description: User-provided description of a function. Description string `json:"description,omitempty"` @@ -837,6 +851,9 @@ type Function struct { // Function. UpdateTime string `json:"updateTime,omitempty"` + // UpgradeInfo: Output only. UpgradeInfo for this Cloud Function + UpgradeInfo *UpgradeInfo `json:"upgradeInfo,omitempty"` + // Url: Output only. The deployed url for the function. Url string `json:"url,omitempty"` @@ -2086,6 +2103,11 @@ func (s *Policy) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// RedirectFunctionUpgradeTrafficRequest: Request for the +// `RedirectFunctionUpgradeTraffic` method. +type RedirectFunctionUpgradeTrafficRequest struct { +} + // RepoSource: Location of the source in a Google Cloud Source // Repository. type RepoSource struct { @@ -2138,6 +2160,11 @@ func (s *RepoSource) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// RollbackFunctionUpgradeTrafficRequest: Request for the +// `RollbackFunctionUpgradeTraffic` method. +type RollbackFunctionUpgradeTrafficRequest struct { +} + // Runtime: Describes a runtime and any special information (e.g., // deprecation status) related to it. type Runtime struct { @@ -2520,6 +2547,11 @@ func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// SetupFunctionUpgradeConfigRequest: Request for the +// `SetupFunctionUpgradeConfig` method. +type SetupFunctionUpgradeConfigRequest struct { +} + // Source: The location of the function source code. type Source struct { // GitUri: If provided, get the source from GitHub repository. This @@ -2746,6 +2778,72 @@ func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// UpgradeInfo: Information related to: * A function's eligibility for +// 1st Gen to 2nd Gen migration * Current state of migration for +// function undergoing migration. +type UpgradeInfo struct { + // BuildConfig: Describes the Build step of the function that builds a + // container to prepare for 2nd gen upgrade. + BuildConfig *BuildConfig `json:"buildConfig,omitempty"` + + // EventTrigger: Describes the Event trigger which has been setup to + // prepare for 2nd gen upgrade. + EventTrigger *EventTrigger `json:"eventTrigger,omitempty"` + + // ServiceConfig: Describes the Cloud Run service which has been setup + // to prepare for 2nd gen upgrade. + ServiceConfig *ServiceConfig `json:"serviceConfig,omitempty"` + + // UpgradeState: UpgradeState of the function + // + // Possible values: + // "UPGRADE_STATE_UNSPECIFIED" - Unspecified state. Most functions are + // in this upgrade state. + // "ELIGIBLE_FOR_2ND_GEN_UPGRADE" - Functions in this state are + // eligible for 1st Gen -> 2nd Gen upgrade. + // "UPGRADE_OPERATION_IN_PROGRESS" - An upgrade related operation is + // in progress. + // "SETUP_FUNCTION_UPGRADE_CONFIG_SUCCESSFUL" - + // SetupFunctionUpgradeConfig API was successful and a 2nd Gen function + // has been created based on 1st Gen function instance. + // "SETUP_FUNCTION_UPGRADE_CONFIG_ERROR" - SetupFunctionUpgradeConfig + // API was un-successful. + // "ABORT_FUNCTION_UPGRADE_ERROR" - AbortFunctionUpgrade API was + // un-successful. + // "REDIRECT_FUNCTION_UPGRADE_TRAFFIC_SUCCESSFUL" - + // RedirectFunctionUpgradeTraffic API was successful and traffic is + // served by 2nd Gen function stack. + // "REDIRECT_FUNCTION_UPGRADE_TRAFFIC_ERROR" - + // RedirectFunctionUpgradeTraffic API was un-successful. + // "ROLLBACK_FUNCTION_UPGRADE_TRAFFIC_ERROR" - + // RollbackFunctionUpgradeTraffic API was un-successful. + // "COMMIT_FUNCTION_UPGRADE_ERROR" - CommitFunctionUpgrade API was + // un-successful. + UpgradeState string `json:"upgradeState,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BuildConfig") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "BuildConfig") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *UpgradeInfo) MarshalJSON() ([]byte, error) { + type NoMethod UpgradeInfo + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // method id "cloudfunctions.projects.locations.list": type ProjectsLocationsListCall struct { @@ -2955,43 +3053,34 @@ func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocat } } -// method id "cloudfunctions.projects.locations.functions.create": +// method id "cloudfunctions.projects.locations.functions.abortFunctionUpgrade": -type ProjectsLocationsFunctionsCreateCall struct { - s *Service - parent string - function *Function - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsFunctionsAbortFunctionUpgradeCall struct { + s *Service + name string + abortfunctionupgraderequest *AbortFunctionUpgradeRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Create: 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. +// AbortFunctionUpgrade: 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. // -// - parent: The project and location in which the function should be -// created, specified in the format `projects/*/locations/*`. -func (r *ProjectsLocationsFunctionsService) Create(parent string, function *Function) *ProjectsLocationsFunctionsCreateCall { - c := &ProjectsLocationsFunctionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.function = function - return c -} - -// FunctionId sets the optional parameter "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-/. -func (c *ProjectsLocationsFunctionsCreateCall) FunctionId(functionId string) *ProjectsLocationsFunctionsCreateCall { - c.urlParams_.Set("functionId", functionId) +// - name: The name of the function for which upgrade should be aborted. +func (r *ProjectsLocationsFunctionsService) AbortFunctionUpgrade(name string, abortfunctionupgraderequest *AbortFunctionUpgradeRequest) *ProjectsLocationsFunctionsAbortFunctionUpgradeCall { + c := &ProjectsLocationsFunctionsAbortFunctionUpgradeCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.abortfunctionupgraderequest = abortfunctionupgraderequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsFunctionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsCreateCall { +func (c *ProjectsLocationsFunctionsAbortFunctionUpgradeCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsAbortFunctionUpgradeCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -2999,21 +3088,21 @@ func (c *ProjectsLocationsFunctionsCreateCall) Fields(s ...googleapi.Field) *Pro // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsFunctionsCreateCall) Context(ctx context.Context) *ProjectsLocationsFunctionsCreateCall { +func (c *ProjectsLocationsFunctionsAbortFunctionUpgradeCall) Context(ctx context.Context) *ProjectsLocationsFunctionsAbortFunctionUpgradeCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsFunctionsCreateCall) Header() http.Header { +func (c *ProjectsLocationsFunctionsAbortFunctionUpgradeCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsFunctionsCreateCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsFunctionsAbortFunctionUpgradeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -3021,14 +3110,14 @@ func (c *ProjectsLocationsFunctionsCreateCall) doRequest(alt string) (*http.Resp } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.function) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.abortfunctionupgraderequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/functions") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}:abortFunctionUpgrade") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -3036,19 +3125,19 @@ func (c *ProjectsLocationsFunctionsCreateCall) doRequest(alt string) (*http.Resp } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "cloudfunctions.projects.locations.functions.create" call. +// Do executes the "cloudfunctions.projects.locations.functions.abortFunctionUpgrade" call. // Exactly one of *Operation or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsLocationsFunctionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *ProjectsLocationsFunctionsAbortFunctionUpgradeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3079,30 +3168,25 @@ func (c *ProjectsLocationsFunctionsCreateCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "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.", - // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/functions", + // "description": "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.", + // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:abortFunctionUpgrade", // "httpMethod": "POST", - // "id": "cloudfunctions.projects.locations.functions.create", + // "id": "cloudfunctions.projects.locations.functions.abortFunctionUpgrade", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "functionId": { - // "description": "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-/.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "Required. The project and location in which the function should be created, specified in the format `projects/*/locations/*`", + // "name": { + // "description": "Required. The name of the function for which upgrade should be aborted.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2beta/{+parent}/functions", + // "path": "v2beta/{+name}:abortFunctionUpgrade", // "request": { - // "$ref": "Function" + // "$ref": "AbortFunctionUpgradeRequest" // }, // "response": { // "$ref": "Operation" @@ -3114,31 +3198,35 @@ func (c *ProjectsLocationsFunctionsCreateCall) Do(opts ...googleapi.CallOption) } -// method id "cloudfunctions.projects.locations.functions.delete": +// method id "cloudfunctions.projects.locations.functions.commitFunctionUpgrade": -type ProjectsLocationsFunctionsDeleteCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsFunctionsCommitFunctionUpgradeCall struct { + s *Service + name string + commitfunctionupgraderequest *CommitFunctionUpgradeRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: 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. +// CommitFunctionUpgrade: 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. // -// - name: The name of the function which should be deleted. -func (r *ProjectsLocationsFunctionsService) Delete(name string) *ProjectsLocationsFunctionsDeleteCall { - c := &ProjectsLocationsFunctionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the function for which upgrade should be +// finalized. +func (r *ProjectsLocationsFunctionsService) CommitFunctionUpgrade(name string, commitfunctionupgraderequest *CommitFunctionUpgradeRequest) *ProjectsLocationsFunctionsCommitFunctionUpgradeCall { + c := &ProjectsLocationsFunctionsCommitFunctionUpgradeCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.commitfunctionupgraderequest = commitfunctionupgraderequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsFunctionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsDeleteCall { +func (c *ProjectsLocationsFunctionsCommitFunctionUpgradeCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsCommitFunctionUpgradeCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -3146,21 +3234,21 @@ func (c *ProjectsLocationsFunctionsDeleteCall) Fields(s ...googleapi.Field) *Pro // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsFunctionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsFunctionsDeleteCall { +func (c *ProjectsLocationsFunctionsCommitFunctionUpgradeCall) Context(ctx context.Context) *ProjectsLocationsFunctionsCommitFunctionUpgradeCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsFunctionsDeleteCall) Header() http.Header { +func (c *ProjectsLocationsFunctionsCommitFunctionUpgradeCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsFunctionsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsFunctionsCommitFunctionUpgradeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -3168,11 +3256,16 @@ func (c *ProjectsLocationsFunctionsDeleteCall) doRequest(alt string) (*http.Resp } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitfunctionupgraderequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}:commitFunctionUpgrade") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -3183,14 +3276,14 @@ func (c *ProjectsLocationsFunctionsDeleteCall) doRequest(alt string) (*http.Resp return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "cloudfunctions.projects.locations.functions.delete" call. +// Do executes the "cloudfunctions.projects.locations.functions.commitFunctionUpgrade" call. // Exactly one of *Operation or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsLocationsFunctionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *ProjectsLocationsFunctionsCommitFunctionUpgradeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3221,23 +3314,26 @@ func (c *ProjectsLocationsFunctionsDeleteCall) Do(opts ...googleapi.CallOption) } return ret, nil // { - // "description": "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.", - // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}", - // "httpMethod": "DELETE", - // "id": "cloudfunctions.projects.locations.functions.delete", + // "description": "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.", + // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:commitFunctionUpgrade", + // "httpMethod": "POST", + // "id": "cloudfunctions.projects.locations.functions.commitFunctionUpgrade", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The name of the function which should be deleted.", + // "description": "Required. The name of the function for which upgrade should be finalized.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2beta/{+name}", + // "path": "v2beta/{+name}:commitFunctionUpgrade", + // "request": { + // "$ref": "CommitFunctionUpgradeRequest" + // }, // "response": { // "$ref": "Operation" // }, @@ -3248,36 +3344,43 @@ func (c *ProjectsLocationsFunctionsDeleteCall) Do(opts ...googleapi.CallOption) } -// method id "cloudfunctions.projects.locations.functions.generateDownloadUrl": +// method id "cloudfunctions.projects.locations.functions.create": -type ProjectsLocationsFunctionsGenerateDownloadUrlCall struct { - s *Service - name string - generatedownloadurlrequest *GenerateDownloadUrlRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsFunctionsCreateCall struct { + s *Service + parent string + function *Function + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// GenerateDownloadUrl: 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: 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. // -// - name: The name of function for which source code Google Cloud -// Storage signed URL should be generated. -func (r *ProjectsLocationsFunctionsService) GenerateDownloadUrl(name string, generatedownloadurlrequest *GenerateDownloadUrlRequest) *ProjectsLocationsFunctionsGenerateDownloadUrlCall { - c := &ProjectsLocationsFunctionsGenerateDownloadUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - c.generatedownloadurlrequest = generatedownloadurlrequest +// - parent: The project and location in which the function should be +// created, specified in the format `projects/*/locations/*`. +func (r *ProjectsLocationsFunctionsService) Create(parent string, function *Function) *ProjectsLocationsFunctionsCreateCall { + c := &ProjectsLocationsFunctionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.function = function + return c +} + +// FunctionId sets the optional parameter "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-/. +func (c *ProjectsLocationsFunctionsCreateCall) FunctionId(functionId string) *ProjectsLocationsFunctionsCreateCall { + c.urlParams_.Set("functionId", functionId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGenerateDownloadUrlCall { +func (c *ProjectsLocationsFunctionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsCreateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -3285,21 +3388,21 @@ func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Fields(s ...googleap // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGenerateDownloadUrlCall { +func (c *ProjectsLocationsFunctionsCreateCall) Context(ctx context.Context) *ProjectsLocationsFunctionsCreateCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Header() http.Header { +func (c *ProjectsLocationsFunctionsCreateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsFunctionsCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -3307,14 +3410,14 @@ func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) doRequest(alt string } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generatedownloadurlrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.function) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}:generateDownloadUrl") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/functions") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -3322,19 +3425,19 @@ func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) doRequest(alt string } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "name": c.name, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "cloudfunctions.projects.locations.functions.generateDownloadUrl" call. -// Exactly one of *GenerateDownloadUrlResponse or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GenerateDownloadUrlResponse.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Do(opts ...googleapi.CallOption) (*GenerateDownloadUrlResponse, error) { +// Do executes the "cloudfunctions.projects.locations.functions.create" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsFunctionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3353,7 +3456,7 @@ func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Do(opts ...googleapi if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GenerateDownloadUrlResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -3365,28 +3468,33 @@ func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Do(opts ...googleapi } return ret, nil // { - // "description": "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", - // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:generateDownloadUrl", + // "description": "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.", + // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/functions", // "httpMethod": "POST", - // "id": "cloudfunctions.projects.locations.functions.generateDownloadUrl", + // "id": "cloudfunctions.projects.locations.functions.create", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { - // "name": { - // "description": "Required. The name of function for which source code Google Cloud Storage signed URL should be generated.", + // "functionId": { + // "description": "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-/.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The project and location in which the function should be created, specified in the format `projects/*/locations/*`", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2beta/{+name}:generateDownloadUrl", + // "path": "v2beta/{+parent}/functions", // "request": { - // "$ref": "GenerateDownloadUrlRequest" + // "$ref": "Function" // }, // "response": { - // "$ref": "GenerateDownloadUrlResponse" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -3395,46 +3503,31 @@ func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Do(opts ...googleapi } -// method id "cloudfunctions.projects.locations.functions.generateUploadUrl": +// method id "cloudfunctions.projects.locations.functions.delete": -type ProjectsLocationsFunctionsGenerateUploadUrlCall struct { - s *Service - parent string - generateuploadurlrequest *GenerateUploadUrlRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsFunctionsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// GenerateUploadUrl: 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` +// Delete: 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. // -// - parent: The project and location in which the Google Cloud Storage -// signed URL should be generated, specified in the format -// `projects/*/locations/*`. -func (r *ProjectsLocationsFunctionsService) GenerateUploadUrl(parent string, generateuploadurlrequest *GenerateUploadUrlRequest) *ProjectsLocationsFunctionsGenerateUploadUrlCall { - c := &ProjectsLocationsFunctionsGenerateUploadUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - c.generateuploadurlrequest = generateuploadurlrequest +// - name: The name of the function which should be deleted. +func (r *ProjectsLocationsFunctionsService) Delete(name string) *ProjectsLocationsFunctionsDeleteCall { + c := &ProjectsLocationsFunctionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGenerateUploadUrlCall { +func (c *ProjectsLocationsFunctionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -3442,21 +3535,21 @@ func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Fields(s ...googleapi. // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGenerateUploadUrlCall { +func (c *ProjectsLocationsFunctionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsFunctionsDeleteCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Header() http.Header { +func (c *ProjectsLocationsFunctionsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsFunctionsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -3464,34 +3557,29 @@ func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) doRequest(alt string) } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateuploadurlrequest) - if err != nil { - return nil, err - } - reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/functions:generateUploadUrl") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "cloudfunctions.projects.locations.functions.generateUploadUrl" call. -// Exactly one of *GenerateUploadUrlResponse or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *GenerateUploadUrlResponse.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Do(opts ...googleapi.CallOption) (*GenerateUploadUrlResponse, error) { +// Do executes the "cloudfunctions.projects.locations.functions.delete" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsFunctionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3510,7 +3598,7 @@ func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Do(opts ...googleapi.C if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GenerateUploadUrlResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -3522,28 +3610,25 @@ func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Do(opts ...googleapi.C } return ret, nil // { - // "description": "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`", - // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/functions:generateUploadUrl", - // "httpMethod": "POST", - // "id": "cloudfunctions.projects.locations.functions.generateUploadUrl", + // "description": "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.", + // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}", + // "httpMethod": "DELETE", + // "id": "cloudfunctions.projects.locations.functions.delete", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "parent": { - // "description": "Required. The project and location in which the Google Cloud Storage signed URL should be generated, specified in the format `projects/*/locations/*`.", + // "name": { + // "description": "Required. The name of the function which should be deleted.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2beta/{+parent}/functions:generateUploadUrl", - // "request": { - // "$ref": "GenerateUploadUrlRequest" - // }, + // "path": "v2beta/{+name}", // "response": { - // "$ref": "GenerateUploadUrlResponse" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -3552,78 +3637,75 @@ func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Do(opts ...googleapi.C } -// method id "cloudfunctions.projects.locations.functions.get": +// method id "cloudfunctions.projects.locations.functions.generateDownloadUrl": -type ProjectsLocationsFunctionsGetCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsFunctionsGenerateDownloadUrlCall struct { + s *Service + name string + generatedownloadurlrequest *GenerateDownloadUrlRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Returns a function with the given name from the requested -// project. +// GenerateDownloadUrl: 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 // -// - name: The name of the function which details should be obtained. -func (r *ProjectsLocationsFunctionsService) Get(name string) *ProjectsLocationsFunctionsGetCall { - c := &ProjectsLocationsFunctionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of function for which source code Google Cloud +// Storage signed URL should be generated. +func (r *ProjectsLocationsFunctionsService) GenerateDownloadUrl(name string, generatedownloadurlrequest *GenerateDownloadUrlRequest) *ProjectsLocationsFunctionsGenerateDownloadUrlCall { + c := &ProjectsLocationsFunctionsGenerateDownloadUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name + c.generatedownloadurlrequest = generatedownloadurlrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsFunctionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGetCall { +func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGenerateDownloadUrlCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsFunctionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsFunctionsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsFunctionsGetCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGetCall { +func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGenerateDownloadUrlCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsFunctionsGetCall) Header() http.Header { +func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsFunctionsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.generatedownloadurlrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}:generateDownloadUrl") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -3634,14 +3716,14 @@ func (c *ProjectsLocationsFunctionsGetCall) doRequest(alt string) (*http.Respons return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "cloudfunctions.projects.locations.functions.get" call. -// Exactly one of *Function or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Function.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *ProjectsLocationsFunctionsGetCall) Do(opts ...googleapi.CallOption) (*Function, error) { +// Do executes the "cloudfunctions.projects.locations.functions.generateDownloadUrl" call. +// Exactly one of *GenerateDownloadUrlResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GenerateDownloadUrlResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Do(opts ...googleapi.CallOption) (*GenerateDownloadUrlResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3660,7 +3742,7 @@ func (c *ProjectsLocationsFunctionsGetCall) Do(opts ...googleapi.CallOption) (*F if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Function{ + ret := &GenerateDownloadUrlResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -3672,25 +3754,28 @@ func (c *ProjectsLocationsFunctionsGetCall) Do(opts ...googleapi.CallOption) (*F } return ret, nil // { - // "description": "Returns a function with the given name from the requested project.", - // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}", - // "httpMethod": "GET", - // "id": "cloudfunctions.projects.locations.functions.get", + // "description": "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", + // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:generateDownloadUrl", + // "httpMethod": "POST", + // "id": "cloudfunctions.projects.locations.functions.generateDownloadUrl", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "Required. The name of the function which details should be obtained.", + // "description": "Required. The name of function for which source code Google Cloud Storage signed URL should be generated.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2beta/{+name}", + // "path": "v2beta/{+name}:generateDownloadUrl", + // "request": { + // "$ref": "GenerateDownloadUrlRequest" + // }, // "response": { - // "$ref": "Function" + // "$ref": "GenerateDownloadUrlResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -3699,118 +3784,103 @@ func (c *ProjectsLocationsFunctionsGetCall) Do(opts ...googleapi.CallOption) (*F } -// method id "cloudfunctions.projects.locations.functions.getIamPolicy": +// method id "cloudfunctions.projects.locations.functions.generateUploadUrl": -type ProjectsLocationsFunctionsGetIamPolicyCall struct { - s *Service - resource string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsFunctionsGenerateUploadUrlCall struct { + s *Service + parent string + generateuploadurlrequest *GenerateUploadUrlRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// GetIamPolicy: Gets the access control policy for a resource. Returns -// an empty policy if the resource exists and does not have a policy -// set. +// GenerateUploadUrl: 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` // -// - 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. -func (r *ProjectsLocationsFunctionsService) GetIamPolicy(resource string) *ProjectsLocationsFunctionsGetIamPolicyCall { - c := &ProjectsLocationsFunctionsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.resource = resource - return c -} - -// OptionsRequestedPolicyVersion sets the optional parameter -// "options.requestedPolicyVersion": 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). -func (c *ProjectsLocationsFunctionsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsFunctionsGetIamPolicyCall { - c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) +// - parent: The project and location in which the Google Cloud Storage +// signed URL should be generated, specified in the format +// `projects/*/locations/*`. +func (r *ProjectsLocationsFunctionsService) GenerateUploadUrl(parent string, generateuploadurlrequest *GenerateUploadUrlRequest) *ProjectsLocationsFunctionsGenerateUploadUrlCall { + c := &ProjectsLocationsFunctionsGenerateUploadUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.generateuploadurlrequest = generateuploadurlrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGetIamPolicyCall { +func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGenerateUploadUrlCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLocationsFunctionsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsFunctionsGetIamPolicyCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGetIamPolicyCall { +func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGenerateUploadUrlCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Header() http.Header { +func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsFunctionsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateuploadurlrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+resource}:getIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/functions:generateUploadUrl") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "resource": c.resource, + "parent": c.parent, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "cloudfunctions.projects.locations.functions.getIamPolicy" call. -// Exactly one of *Policy or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Policy.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +// Do executes the "cloudfunctions.projects.locations.functions.generateUploadUrl" call. +// Exactly one of *GenerateUploadUrlResponse or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *GenerateUploadUrlResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsFunctionsGenerateUploadUrlCall) Do(opts ...googleapi.CallOption) (*GenerateUploadUrlResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3829,7 +3899,7 @@ func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Policy{ + ret := &GenerateUploadUrlResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -3841,31 +3911,28 @@ func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Do(opts ...googleapi.CallOp } return ret, nil // { - // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", - // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:getIamPolicy", - // "httpMethod": "GET", - // "id": "cloudfunctions.projects.locations.functions.getIamPolicy", + // "description": "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`", + // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/functions:generateUploadUrl", + // "httpMethod": "POST", + // "id": "cloudfunctions.projects.locations.functions.generateUploadUrl", // "parameterOrder": [ - // "resource" + // "parent" // ], // "parameters": { - // "options.requestedPolicyVersion": { - // "description": "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).", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "resource": { - // "description": "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.", + // "parent": { + // "description": "Required. The project and location in which the Google Cloud Storage signed URL should be generated, specified in the format `projects/*/locations/*`.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2beta/{+resource}:getIamPolicy", + // "path": "v2beta/{+parent}/functions:generateUploadUrl", + // "request": { + // "$ref": "GenerateUploadUrlRequest" + // }, // "response": { - // "$ref": "Policy" + // "$ref": "GenerateUploadUrlResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -3874,73 +3941,31 @@ func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Do(opts ...googleapi.CallOp } -// method id "cloudfunctions.projects.locations.functions.list": +// method id "cloudfunctions.projects.locations.functions.get": -type ProjectsLocationsFunctionsListCall struct { +type ProjectsLocationsFunctionsGetCall struct { s *Service - parent string + name string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Returns a list of functions that belong to the requested +// Get: Returns a function with the given name from the requested // project. // -// - parent: 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. -func (r *ProjectsLocationsFunctionsService) List(parent string) *ProjectsLocationsFunctionsListCall { - c := &ProjectsLocationsFunctionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.parent = parent - return c -} - -// Filter sets the optional parameter "filter": The filter for Functions -// that match the filter expression, following the syntax outlined in -// https://google.aip.dev/160. -func (c *ProjectsLocationsFunctionsListCall) Filter(filter string) *ProjectsLocationsFunctionsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// OrderBy sets the optional parameter "orderBy": The sorting order of -// the resources returned. Value should be a comma separated list of -// fields. The default sorting oder is ascending. See -// https://google.aip.dev/132#ordering. -func (c *ProjectsLocationsFunctionsListCall) OrderBy(orderBy string) *ProjectsLocationsFunctionsListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageSize sets the optional parameter "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. -func (c *ProjectsLocationsFunctionsListCall) PageSize(pageSize int64) *ProjectsLocationsFunctionsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "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. -func (c *ProjectsLocationsFunctionsListCall) PageToken(pageToken string) *ProjectsLocationsFunctionsListCall { - c.urlParams_.Set("pageToken", pageToken) +// - name: The name of the function which details should be obtained. +func (r *ProjectsLocationsFunctionsService) Get(name string) *ProjectsLocationsFunctionsGetCall { + c := &ProjectsLocationsFunctionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsFunctionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsListCall { +func (c *ProjectsLocationsFunctionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -3950,7 +3975,7 @@ func (c *ProjectsLocationsFunctionsListCall) Fields(s ...googleapi.Field) *Proje // getting updates only after the object has changed since the last // request. Use googleapi.IsNotModified to check whether the response // error from Do is the result of In-None-Match. -func (c *ProjectsLocationsFunctionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsFunctionsListCall { +func (c *ProjectsLocationsFunctionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsFunctionsGetCall { c.ifNoneMatch_ = entityTag return c } @@ -3958,54 +3983,762 @@ func (c *ProjectsLocationsFunctionsListCall) IfNoneMatch(entityTag string) *Proj // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsFunctionsListCall) Context(ctx context.Context) *ProjectsLocationsFunctionsListCall { +func (c *ProjectsLocationsFunctionsGetCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsFunctionsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsFunctionsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "cloudfunctions.projects.locations.functions.get" call. +// Exactly one of *Function or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Function.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsFunctionsGetCall) Do(opts ...googleapi.CallOption) (*Function, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Function{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a function with the given name from the requested project.", + // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}", + // "httpMethod": "GET", + // "id": "cloudfunctions.projects.locations.functions.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The name of the function which details should be obtained.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2beta/{+name}", + // "response": { + // "$ref": "Function" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudfunctions.projects.locations.functions.getIamPolicy": + +type ProjectsLocationsFunctionsGetIamPolicyCall struct { + s *Service + resource string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// GetIamPolicy: Gets the access control policy for a resource. Returns +// an empty policy if the resource exists and does not have a policy +// set. +// +// - 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. +func (r *ProjectsLocationsFunctionsService) GetIamPolicy(resource string) *ProjectsLocationsFunctionsGetIamPolicyCall { + c := &ProjectsLocationsFunctionsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.resource = resource + return c +} + +// OptionsRequestedPolicyVersion sets the optional parameter +// "options.requestedPolicyVersion": 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). +func (c *ProjectsLocationsFunctionsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsFunctionsGetIamPolicyCall { + c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGetIamPolicyCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsFunctionsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsFunctionsGetIamPolicyCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsFunctionsGetIamPolicyCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsFunctionsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+resource}:getIamPolicy") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "resource": c.resource, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "cloudfunctions.projects.locations.functions.getIamPolicy" call. +// Exactly one of *Policy or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", + // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:getIamPolicy", + // "httpMethod": "GET", + // "id": "cloudfunctions.projects.locations.functions.getIamPolicy", + // "parameterOrder": [ + // "resource" + // ], + // "parameters": { + // "options.requestedPolicyVersion": { + // "description": "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).", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "resource": { + // "description": "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.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2beta/{+resource}:getIamPolicy", + // "response": { + // "$ref": "Policy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudfunctions.projects.locations.functions.list": + +type ProjectsLocationsFunctionsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Returns a list of functions that belong to the requested +// project. +// +// - parent: 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. +func (r *ProjectsLocationsFunctionsService) List(parent string) *ProjectsLocationsFunctionsListCall { + c := &ProjectsLocationsFunctionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": The filter for Functions +// that match the filter expression, following the syntax outlined in +// https://google.aip.dev/160. +func (c *ProjectsLocationsFunctionsListCall) Filter(filter string) *ProjectsLocationsFunctionsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// OrderBy sets the optional parameter "orderBy": The sorting order of +// the resources returned. Value should be a comma separated list of +// fields. The default sorting oder is ascending. See +// https://google.aip.dev/132#ordering. +func (c *ProjectsLocationsFunctionsListCall) OrderBy(orderBy string) *ProjectsLocationsFunctionsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageSize sets the optional parameter "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. +func (c *ProjectsLocationsFunctionsListCall) PageSize(pageSize int64) *ProjectsLocationsFunctionsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "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. +func (c *ProjectsLocationsFunctionsListCall) PageToken(pageToken string) *ProjectsLocationsFunctionsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsFunctionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsFunctionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsFunctionsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsFunctionsListCall) Context(ctx context.Context) *ProjectsLocationsFunctionsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsFunctionsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsFunctionsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/functions") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "cloudfunctions.projects.locations.functions.list" call. +// Exactly one of *ListFunctionsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListFunctionsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsFunctionsListCall) Do(opts ...googleapi.CallOption) (*ListFunctionsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ListFunctionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns a list of functions that belong to the requested project.", + // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/functions", + // "httpMethod": "GET", + // "id": "cloudfunctions.projects.locations.functions.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "filter": { + // "description": "The filter for Functions that match the filter expression, following the syntax outlined in https://google.aip.dev/160.", + // "location": "query", + // "type": "string" + // }, + // "orderBy": { + // "description": "The sorting order of the resources returned. Value should be a comma separated list of fields. The default sorting oder is ascending. See https://google.aip.dev/132#ordering.", + // "location": "query", + // "type": "string" + // }, + // "pageSize": { + // "description": "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.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "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.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "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.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2beta/{+parent}/functions", + // "response": { + // "$ref": "ListFunctionsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsFunctionsListCall) Pages(ctx context.Context, f func(*ListFunctionsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "cloudfunctions.projects.locations.functions.patch": + +type ProjectsLocationsFunctionsPatchCall struct { + s *Service + name string + function *Function + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates existing function. +// +// - name: A user-defined name of the function. Function names must be +// unique globally and match pattern +// `projects/*/locations/*/functions/*`. +func (r *ProjectsLocationsFunctionsService) Patch(name string, function *Function) *ProjectsLocationsFunctionsPatchCall { + c := &ProjectsLocationsFunctionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.function = function + return c +} + +// UpdateMask sets the optional parameter "updateMask": The list of +// fields to be updated. If no field mask is provided, all provided +// fields in the request will be updated. +func (c *ProjectsLocationsFunctionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsFunctionsPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsFunctionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsFunctionsPatchCall) Context(ctx context.Context) *ProjectsLocationsFunctionsPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsFunctionsPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsFunctionsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.function) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "cloudfunctions.projects.locations.functions.patch" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsFunctionsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates existing function.", + // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}", + // "httpMethod": "PATCH", + // "id": "cloudfunctions.projects.locations.functions.patch", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "A user-defined name of the function. Function names must be unique globally and match pattern `projects/*/locations/*/functions/*`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "updateMask": { + // "description": "The list of fields to be updated. If no field mask is provided, all provided fields in the request will be updated.", + // "format": "google-fieldmask", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v2beta/{+name}", + // "request": { + // "$ref": "Function" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudfunctions.projects.locations.functions.redirectFunctionUpgradeTraffic": + +type ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall struct { + s *Service + name string + redirectfunctionupgradetrafficrequest *RedirectFunctionUpgradeTrafficRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// RedirectFunctionUpgradeTraffic: 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. +// +// - name: The name of the function for which traffic target should be +// changed to 2nd Gen from 1st Gen. +func (r *ProjectsLocationsFunctionsService) RedirectFunctionUpgradeTraffic(name string, redirectfunctionupgradetrafficrequest *RedirectFunctionUpgradeTrafficRequest) *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall { + c := &ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.redirectfunctionupgradetrafficrequest = redirectfunctionupgradetrafficrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall) Context(ctx context.Context) *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsFunctionsListCall) Header() http.Header { +func (c *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsFunctionsListCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.redirectfunctionupgradetrafficrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+parent}/functions") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}:redirectFunctionUpgradeTraffic") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "parent": c.parent, + "name": c.name, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "cloudfunctions.projects.locations.functions.list" call. -// Exactly one of *ListFunctionsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListFunctionsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLocationsFunctionsListCall) Do(opts ...googleapi.CallOption) (*ListFunctionsResponse, error) { +// Do executes the "cloudfunctions.projects.locations.functions.redirectFunctionUpgradeTraffic" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsFunctionsRedirectFunctionUpgradeTrafficCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4024,7 +4757,7 @@ func (c *ProjectsLocationsFunctionsListCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ListFunctionsResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4036,46 +4769,28 @@ func (c *ProjectsLocationsFunctionsListCall) Do(opts ...googleapi.CallOption) (* } return ret, nil // { - // "description": "Returns a list of functions that belong to the requested project.", - // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/functions", - // "httpMethod": "GET", - // "id": "cloudfunctions.projects.locations.functions.list", + // "description": "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.", + // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:redirectFunctionUpgradeTraffic", + // "httpMethod": "POST", + // "id": "cloudfunctions.projects.locations.functions.redirectFunctionUpgradeTraffic", // "parameterOrder": [ - // "parent" + // "name" // ], // "parameters": { - // "filter": { - // "description": "The filter for Functions that match the filter expression, following the syntax outlined in https://google.aip.dev/160.", - // "location": "query", - // "type": "string" - // }, - // "orderBy": { - // "description": "The sorting order of the resources returned. Value should be a comma separated list of fields. The default sorting oder is ascending. See https://google.aip.dev/132#ordering.", - // "location": "query", - // "type": "string" - // }, - // "pageSize": { - // "description": "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.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "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.", - // "location": "query", - // "type": "string" - // }, - // "parent": { - // "description": "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.", + // "name": { + // "description": "Required. The name of the function for which traffic target should be changed to 2nd Gen from 1st Gen.", // "location": "path", - // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", // "required": true, // "type": "string" // } // }, - // "path": "v2beta/{+parent}/functions", + // "path": "v2beta/{+name}:redirectFunctionUpgradeTraffic", + // "request": { + // "$ref": "RedirectFunctionUpgradeTrafficRequest" + // }, // "response": { - // "$ref": "ListFunctionsResponse" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -4084,62 +4799,34 @@ func (c *ProjectsLocationsFunctionsListCall) Do(opts ...googleapi.CallOption) (* } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsLocationsFunctionsListCall) Pages(ctx context.Context, f func(*ListFunctionsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -// method id "cloudfunctions.projects.locations.functions.patch": +// method id "cloudfunctions.projects.locations.functions.rollbackFunctionUpgradeTraffic": -type ProjectsLocationsFunctionsPatchCall struct { - s *Service - name string - function *Function - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall struct { + s *Service + name string + rollbackfunctionupgradetrafficrequest *RollbackFunctionUpgradeTrafficRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates existing function. +// RollbackFunctionUpgradeTraffic: 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. // -// - name: A user-defined name of the function. Function names must be -// unique globally and match pattern -// `projects/*/locations/*/functions/*`. -func (r *ProjectsLocationsFunctionsService) Patch(name string, function *Function) *ProjectsLocationsFunctionsPatchCall { - c := &ProjectsLocationsFunctionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - name: The name of the function for which traffic target should be +// changed back to 1st Gen from 2nd Gen. +func (r *ProjectsLocationsFunctionsService) RollbackFunctionUpgradeTraffic(name string, rollbackfunctionupgradetrafficrequest *RollbackFunctionUpgradeTrafficRequest) *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall { + c := &ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name - c.function = function - return c -} - -// UpdateMask sets the optional parameter "updateMask": The list of -// fields to be updated. If no field mask is provided, all provided -// fields in the request will be updated. -func (c *ProjectsLocationsFunctionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsFunctionsPatchCall { - c.urlParams_.Set("updateMask", updateMask) + c.rollbackfunctionupgradetrafficrequest = rollbackfunctionupgradetrafficrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ProjectsLocationsFunctionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsPatchCall { +func (c *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -4147,21 +4834,21 @@ func (c *ProjectsLocationsFunctionsPatchCall) Fields(s ...googleapi.Field) *Proj // Context sets the context to be used in this call's Do method. Any // pending HTTP request will be aborted if the provided context is // canceled. -func (c *ProjectsLocationsFunctionsPatchCall) Context(ctx context.Context) *ProjectsLocationsFunctionsPatchCall { +func (c *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall) Context(ctx context.Context) *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall { c.ctx_ = ctx return c } // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsFunctionsPatchCall) Header() http.Header { +func (c *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsLocationsFunctionsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) for k, v := range c.header_ { @@ -4169,16 +4856,16 @@ func (c *ProjectsLocationsFunctionsPatchCall) doRequest(alt string) (*http.Respo } reqHeaders.Set("User-Agent", c.s.userAgent()) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.function) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackfunctionupgradetrafficrequest) if err != nil { return nil, err } reqHeaders.Set("Content-Type", "application/json") c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}:rollbackFunctionUpgradeTraffic") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -4189,14 +4876,14 @@ func (c *ProjectsLocationsFunctionsPatchCall) doRequest(alt string) (*http.Respo return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "cloudfunctions.projects.locations.functions.patch" call. +// Do executes the "cloudfunctions.projects.locations.functions.rollbackFunctionUpgradeTraffic" call. // Exactly one of *Operation or error will be non-nil. Any non-2xx // status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified // to check whether the returned error was because // http.StatusNotModified was returned. -func (c *ProjectsLocationsFunctionsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *ProjectsLocationsFunctionsRollbackFunctionUpgradeTrafficCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4227,31 +4914,25 @@ func (c *ProjectsLocationsFunctionsPatchCall) Do(opts ...googleapi.CallOption) ( } return ret, nil // { - // "description": "Updates existing function.", - // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}", - // "httpMethod": "PATCH", - // "id": "cloudfunctions.projects.locations.functions.patch", + // "description": "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.", + // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:rollbackFunctionUpgradeTraffic", + // "httpMethod": "POST", + // "id": "cloudfunctions.projects.locations.functions.rollbackFunctionUpgradeTraffic", // "parameterOrder": [ // "name" // ], // "parameters": { // "name": { - // "description": "A user-defined name of the function. Function names must be unique globally and match pattern `projects/*/locations/*/functions/*`", + // "description": "Required. The name of the function for which traffic target should be changed back to 1st Gen from 2nd Gen.", // "location": "path", // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", // "required": true, // "type": "string" - // }, - // "updateMask": { - // "description": "The list of fields to be updated. If no field mask is provided, all provided fields in the request will be updated.", - // "format": "google-fieldmask", - // "location": "query", - // "type": "string" // } // }, - // "path": "v2beta/{+name}", + // "path": "v2beta/{+name}:rollbackFunctionUpgradeTraffic", // "request": { - // "$ref": "Function" + // "$ref": "RollbackFunctionUpgradeTrafficRequest" // }, // "response": { // "$ref": "Operation" @@ -4410,6 +5091,153 @@ func (c *ProjectsLocationsFunctionsSetIamPolicyCall) Do(opts ...googleapi.CallOp } +// method id "cloudfunctions.projects.locations.functions.setupFunctionUpgradeConfig": + +type ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall struct { + s *Service + name string + setupfunctionupgradeconfigrequest *SetupFunctionUpgradeConfigRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// SetupFunctionUpgradeConfig: 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. +// +// - name: The name of the function which should have configuration +// copied for upgrade. +func (r *ProjectsLocationsFunctionsService) SetupFunctionUpgradeConfig(name string, setupfunctionupgradeconfigrequest *SetupFunctionUpgradeConfigRequest) *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall { + c := &ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.setupfunctionupgradeconfigrequest = setupfunctionupgradeconfigrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall) Context(ctx context.Context) *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.setupfunctionupgradeconfigrequest) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta/{+name}:setupFunctionUpgradeConfig") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "cloudfunctions.projects.locations.functions.setupFunctionUpgradeConfig" call. +// Exactly one of *Operation or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsLocationsFunctionsSetupFunctionUpgradeConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.", + // "flatPath": "v2beta/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}:setupFunctionUpgradeConfig", + // "httpMethod": "POST", + // "id": "cloudfunctions.projects.locations.functions.setupFunctionUpgradeConfig", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The name of the function which should have configuration copied for upgrade.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2beta/{+name}:setupFunctionUpgradeConfig", + // "request": { + // "$ref": "SetupFunctionUpgradeConfigRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + // method id "cloudfunctions.projects.locations.functions.testIamPermissions": type ProjectsLocationsFunctionsTestIamPermissionsCall struct { diff --git a/cloudidentity/v1beta1/cloudidentity-api.json b/cloudidentity/v1beta1/cloudidentity-api.json index d1732602aa3..1d4a068e368 100644 --- a/cloudidentity/v1beta1/cloudidentity-api.json +++ b/cloudidentity/v1beta1/cloudidentity-api.json @@ -2015,7 +2015,7 @@ } } }, - "revision": "20240201", + "revision": "20240206", "rootUrl": "https://cloudidentity.googleapis.com/", "schemas": { "AddIdpCredentialOperationMetadata": { @@ -2151,7 +2151,7 @@ "type": "object" }, "BrowserInfo": { - "description": "Browser-specific fields reported by the Endpoint Verification extension. See go/additionalattributesdesign and go/caa-webprotect-attributes-extension LINT.IfChange", + "description": "Browser-specific fields reported by the Endpoint Verification extension. LINT.IfChange", "id": "BrowserInfo", "properties": { "browserManagementState": { diff --git a/cloudidentity/v1beta1/cloudidentity-gen.go b/cloudidentity/v1beta1/cloudidentity-gen.go index 134fddbc845..a9cd118b723 100644 --- a/cloudidentity/v1beta1/cloudidentity-gen.go +++ b/cloudidentity/v1beta1/cloudidentity-gen.go @@ -595,8 +595,7 @@ func (s *BrowserAttributes) MarshalJSON() ([]byte, error) { } // BrowserInfo: Browser-specific fields reported by the Endpoint -// Verification extension. See go/additionalattributesdesign and -// go/caa-webprotect-attributes-extension LINT.IfChange +// Verification extension. LINT.IfChange type BrowserInfo struct { // BrowserManagementState: Output only. Browser's management state. // diff --git a/composer/v1/composer-api.json b/composer/v1/composer-api.json index 16b994ecb23..1497154436c 100644 --- a/composer/v1/composer-api.json +++ b/composer/v1/composer-api.json @@ -454,6 +454,298 @@ } }, "resources": { + "userWorkloadsConfigMaps": { + "methods": { + "create": { + "description": "Creates a user workloads ConfigMap. This method is supported for Cloud Composer environments in versions composer-3.*.*-airflow-*.*.* and newer.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}/userWorkloadsConfigMaps", + "httpMethod": "POST", + "id": "composer.projects.locations.environments.userWorkloadsConfigMaps.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The environment name to create a ConfigMap for, in the form: \"projects/{projectId}/locations/{locationId}/environments/{environmentId}\"", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/userWorkloadsConfigMaps", + "request": { + "$ref": "UserWorkloadsConfigMap" + }, + "response": { + "$ref": "UserWorkloadsConfigMap" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Deletes a user workloads ConfigMap. This method is supported for Cloud Composer environments in versions composer-3.*.*-airflow-*.*.* and newer.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}/userWorkloadsConfigMaps/{userWorkloadsConfigMapsId}", + "httpMethod": "DELETE", + "id": "composer.projects.locations.environments.userWorkloadsConfigMaps.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The ConfigMap to delete, in the form: \"projects/{projectId}/locations/{locationId}/environments/{environmentId}/userWorkloadsConfigMaps/{userWorkloadsConfigMapId}\"", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+/userWorkloadsConfigMaps/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets an existing user workloads ConfigMap. This method is supported for Cloud Composer environments in versions composer-3.*.*-airflow-*.*.* and newer.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}/userWorkloadsConfigMaps/{userWorkloadsConfigMapsId}", + "httpMethod": "GET", + "id": "composer.projects.locations.environments.userWorkloadsConfigMaps.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the ConfigMap to get, in the form: \"projects/{projectId}/locations/{locationId}/environments/{environmentId}/userWorkloadsConfigMaps/{userWorkloadsConfigMapId}\"", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+/userWorkloadsConfigMaps/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "UserWorkloadsConfigMap" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists user workloads ConfigMaps. This method is supported for Cloud Composer environments in versions composer-3.*.*-airflow-*.*.* and newer.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}/userWorkloadsConfigMaps", + "httpMethod": "GET", + "id": "composer.projects.locations.environments.userWorkloadsConfigMaps.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of ConfigMaps to return.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. The next_page_token value returned from a previous List request, if any.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. List ConfigMaps in the given environment, in the form: \"projects/{projectId}/locations/{locationId}/environments/{environmentId}\"", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/userWorkloadsConfigMaps", + "response": { + "$ref": "ListUserWorkloadsConfigMapsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "update": { + "description": "Updates a user workloads ConfigMap. This method is supported for Cloud Composer environments in versions composer-3.*.*-airflow-*.*.* and newer.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}/userWorkloadsConfigMaps/{userWorkloadsConfigMapsId}", + "httpMethod": "PUT", + "id": "composer.projects.locations.environments.userWorkloadsConfigMaps.update", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Identifier. The resource name of the ConfigMap, in the form: \"projects/{projectId}/locations/{locationId}/environments/{environmentId}/userWorkloadsConfigMaps/{userWorkloadsConfigMapId}\"", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+/userWorkloadsConfigMaps/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "request": { + "$ref": "UserWorkloadsConfigMap" + }, + "response": { + "$ref": "UserWorkloadsConfigMap" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, + "userWorkloadsSecrets": { + "methods": { + "create": { + "description": "Creates a user workloads Secret. This method is supported for Cloud Composer environments in versions composer-3.*.*-airflow-*.*.* and newer.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}/userWorkloadsSecrets", + "httpMethod": "POST", + "id": "composer.projects.locations.environments.userWorkloadsSecrets.create", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "Required. The environment name to create a Secret for, in the form: \"projects/{projectId}/locations/{locationId}/environments/{environmentId}\"", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/userWorkloadsSecrets", + "request": { + "$ref": "UserWorkloadsSecret" + }, + "response": { + "$ref": "UserWorkloadsSecret" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "description": "Deletes a user workloads Secret. This method is supported for Cloud Composer environments in versions composer-3.*.*-airflow-*.*.* and newer.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}/userWorkloadsSecrets/{userWorkloadsSecretsId}", + "httpMethod": "DELETE", + "id": "composer.projects.locations.environments.userWorkloadsSecrets.delete", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The Secret to delete, in the form: \"projects/{projectId}/locations/{locationId}/environments/{environmentId}/userWorkloadsSecrets/{userWorkloadsSecretId}\"", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+/userWorkloadsSecrets/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "Empty" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "description": "Gets an existing user workloads Secret. Values of the \"data\" field in the response are cleared. This method is supported for Cloud Composer environments in versions composer-3.*.*-airflow-*.*.* and newer.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}/userWorkloadsSecrets/{userWorkloadsSecretsId}", + "httpMethod": "GET", + "id": "composer.projects.locations.environments.userWorkloadsSecrets.get", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The resource name of the Secret to get, in the form: \"projects/{projectId}/locations/{locationId}/environments/{environmentId}/userWorkloadsSecrets/{userWorkloadsSecretId}\"", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+/userWorkloadsSecrets/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "response": { + "$ref": "UserWorkloadsSecret" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "list": { + "description": "Lists user workloads Secrets. This method is supported for Cloud Composer environments in versions composer-3.*.*-airflow-*.*.* and newer.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}/userWorkloadsSecrets", + "httpMethod": "GET", + "id": "composer.projects.locations.environments.userWorkloadsSecrets.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Optional. The maximum number of Secrets to return.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Optional. The next_page_token value returned from a previous List request, if any.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. List Secrets in the given environment, in the form: \"projects/{projectId}/locations/{locationId}/environments/{environmentId}\"", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/userWorkloadsSecrets", + "response": { + "$ref": "ListUserWorkloadsSecretsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "update": { + "description": "Updates a user workloads Secret. This method is supported for Cloud Composer environments in versions composer-3.*.*-airflow-*.*.* and newer.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}/userWorkloadsSecrets/{userWorkloadsSecretsId}", + "httpMethod": "PUT", + "id": "composer.projects.locations.environments.userWorkloadsSecrets.update", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Identifier. The resource name of the Secret, in the form: \"projects/{projectId}/locations/{locationId}/environments/{environmentId}/userWorkloadsSecrets/{userWorkloadsSecretId}\"", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+/userWorkloadsSecrets/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}", + "request": { + "$ref": "UserWorkloadsSecret" + }, + "response": { + "$ref": "UserWorkloadsSecret" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, "workloads": { "methods": { "list": { @@ -646,7 +938,7 @@ } } }, - "revision": "20240123", + "revision": "20240204", "rootUrl": "https://composer.googleapis.com/", "schemas": { "AllowedIpRange": { @@ -1300,6 +1592,42 @@ }, "type": "object" }, + "ListUserWorkloadsConfigMapsResponse": { + "description": "The user workloads ConfigMaps for a given environment.", + "id": "ListUserWorkloadsConfigMapsResponse", + "properties": { + "nextPageToken": { + "description": "The page token used to query for the next page if one exists.", + "type": "string" + }, + "userWorkloadsConfigMaps": { + "description": "The list of ConfigMaps returned by a ListUserWorkloadsConfigMapsRequest.", + "items": { + "$ref": "UserWorkloadsConfigMap" + }, + "type": "array" + } + }, + "type": "object" + }, + "ListUserWorkloadsSecretsResponse": { + "description": "The user workloads Secrets for a given environment.", + "id": "ListUserWorkloadsSecretsResponse", + "properties": { + "nextPageToken": { + "description": "The page token used to query for the next page if one exists.", + "type": "string" + }, + "userWorkloadsSecrets": { + "description": "The list of Secrets returned by a ListUserWorkloadsSecretsRequest.", + "items": { + "$ref": "UserWorkloadsSecret" + }, + "type": "array" + } + }, + "type": "object" + }, "ListWorkloadsResponse": { "description": "Response to ListWorkloadsRequest.", "id": "ListWorkloadsResponse", @@ -1960,6 +2288,42 @@ }, "type": "object" }, + "UserWorkloadsConfigMap": { + "description": "User workloads ConfigMap used by Airflow tasks that run with Kubernetes executor or KubernetesPodOperator.", + "id": "UserWorkloadsConfigMap", + "properties": { + "data": { + "additionalProperties": { + "type": "string" + }, + "description": "Optional. The \"data\" field of Kubernetes ConfigMap, organized in key-value pairs. For details see: https://kubernetes.io/docs/concepts/configuration/configmap/", + "type": "object" + }, + "name": { + "description": "Identifier. The resource name of the ConfigMap, in the form: \"projects/{projectId}/locations/{locationId}/environments/{environmentId}/userWorkloadsConfigMaps/{userWorkloadsConfigMapId}\"", + "type": "string" + } + }, + "type": "object" + }, + "UserWorkloadsSecret": { + "description": "User workloads Secret used by Airflow tasks that run with Kubernetes executor or KubernetesPodOperator.", + "id": "UserWorkloadsSecret", + "properties": { + "data": { + "additionalProperties": { + "type": "string" + }, + "description": "Optional. The \"data\" field of Kubernetes Secret, organized in key-value pairs, which can contain sensitive values such as a password, a token, or a key. The values for all keys have to be base64-encoded strings. For details see: https://kubernetes.io/docs/concepts/configuration/secret/", + "type": "object" + }, + "name": { + "description": "Identifier. The resource name of the Secret, in the form: \"projects/{projectId}/locations/{locationId}/environments/{environmentId}/userWorkloadsSecrets/{userWorkloadsSecretId}\"", + "type": "string" + } + }, + "type": "object" + }, "WebServerConfig": { "description": "The configuration settings for the Airflow web server App Engine instance. Supported for Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*", "id": "WebServerConfig", diff --git a/composer/v1/composer-gen.go b/composer/v1/composer-gen.go index e9f57cc3c6b..e8c50888c12 100644 --- a/composer/v1/composer-gen.go +++ b/composer/v1/composer-gen.go @@ -187,6 +187,8 @@ type ProjectsLocationsService struct { func NewProjectsLocationsEnvironmentsService(s *Service) *ProjectsLocationsEnvironmentsService { rs := &ProjectsLocationsEnvironmentsService{s: s} + rs.UserWorkloadsConfigMaps = NewProjectsLocationsEnvironmentsUserWorkloadsConfigMapsService(s) + rs.UserWorkloadsSecrets = NewProjectsLocationsEnvironmentsUserWorkloadsSecretsService(s) rs.Workloads = NewProjectsLocationsEnvironmentsWorkloadsService(s) return rs } @@ -194,9 +196,31 @@ func NewProjectsLocationsEnvironmentsService(s *Service) *ProjectsLocationsEnvir type ProjectsLocationsEnvironmentsService struct { s *Service + UserWorkloadsConfigMaps *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsService + + UserWorkloadsSecrets *ProjectsLocationsEnvironmentsUserWorkloadsSecretsService + Workloads *ProjectsLocationsEnvironmentsWorkloadsService } +func NewProjectsLocationsEnvironmentsUserWorkloadsConfigMapsService(s *Service) *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsService { + rs := &ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsService{s: s} + return rs +} + +type ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsService struct { + s *Service +} + +func NewProjectsLocationsEnvironmentsUserWorkloadsSecretsService(s *Service) *ProjectsLocationsEnvironmentsUserWorkloadsSecretsService { + rs := &ProjectsLocationsEnvironmentsUserWorkloadsSecretsService{s: s} + return rs +} + +type ProjectsLocationsEnvironmentsUserWorkloadsSecretsService struct { + s *Service +} + func NewProjectsLocationsEnvironmentsWorkloadsService(s *Service) *ProjectsLocationsEnvironmentsWorkloadsService { rs := &ProjectsLocationsEnvironmentsWorkloadsService{s: s} return rs @@ -1341,6 +1365,82 @@ func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// ListUserWorkloadsConfigMapsResponse: The user workloads ConfigMaps +// for a given environment. +type ListUserWorkloadsConfigMapsResponse struct { + // NextPageToken: The page token used to query for the next page if one + // exists. + NextPageToken string `json:"nextPageToken,omitempty"` + + // UserWorkloadsConfigMaps: The list of ConfigMaps returned by a + // ListUserWorkloadsConfigMapsRequest. + UserWorkloadsConfigMaps []*UserWorkloadsConfigMap `json:"userWorkloadsConfigMaps,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "NextPageToken") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ListUserWorkloadsConfigMapsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListUserWorkloadsConfigMapsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ListUserWorkloadsSecretsResponse: The user workloads Secrets for a +// given environment. +type ListUserWorkloadsSecretsResponse struct { + // NextPageToken: The page token used to query for the next page if one + // exists. + NextPageToken string `json:"nextPageToken,omitempty"` + + // UserWorkloadsSecrets: The list of Secrets returned by a + // ListUserWorkloadsSecretsRequest. + UserWorkloadsSecrets []*UserWorkloadsSecret `json:"userWorkloadsSecrets,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "NextPageToken") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "NextPageToken") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ListUserWorkloadsSecretsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListUserWorkloadsSecretsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // ListWorkloadsResponse: Response to ListWorkloadsRequest. type ListWorkloadsResponse struct { // NextPageToken: The page token used to query for the next page if one @@ -2589,6 +2689,88 @@ func (s *TriggererResource) UnmarshalJSON(data []byte) error { return nil } +// UserWorkloadsConfigMap: User workloads ConfigMap used by Airflow +// tasks that run with Kubernetes executor or KubernetesPodOperator. +type UserWorkloadsConfigMap struct { + // Data: Optional. The "data" field of Kubernetes ConfigMap, organized + // in key-value pairs. For details see: + // https://kubernetes.io/docs/concepts/configuration/configmap/ + Data map[string]string `json:"data,omitempty"` + + // Name: Identifier. The resource name of the ConfigMap, in the form: + // "projects/{projectId}/locations/{locationId}/environments/{environment + // Id}/userWorkloadsConfigMaps/{userWorkloadsConfigMapId}" + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Data") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Data") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *UserWorkloadsConfigMap) MarshalJSON() ([]byte, error) { + type NoMethod UserWorkloadsConfigMap + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// UserWorkloadsSecret: User workloads Secret used by Airflow tasks that +// run with Kubernetes executor or KubernetesPodOperator. +type UserWorkloadsSecret struct { + // Data: Optional. The "data" field of Kubernetes Secret, organized in + // key-value pairs, which can contain sensitive values such as a + // password, a token, or a key. The values for all keys have to be + // base64-encoded strings. For details see: + // https://kubernetes.io/docs/concepts/configuration/secret/ + Data map[string]string `json:"data,omitempty"` + + // Name: Identifier. The resource name of the Secret, in the form: + // "projects/{projectId}/locations/{locationId}/environments/{environment + // Id}/userWorkloadsSecrets/{userWorkloadsSecretId}" + Name string `json:"name,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Data") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Data") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *UserWorkloadsSecret) MarshalJSON() ([]byte, error) { + type NoMethod UserWorkloadsSecret + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // WebServerConfig: The configuration settings for the Airflow web // server App Engine instance. Supported for Cloud Composer environments // in versions composer-1.*.*-airflow-*.*.* @@ -4692,6 +4874,1557 @@ func (c *ProjectsLocationsEnvironmentsStopAirflowCommandCall) Do(opts ...googlea } +// method id "composer.projects.locations.environments.userWorkloadsConfigMaps.create": + +type ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsCreateCall struct { + s *Service + parent string + userworkloadsconfigmap *UserWorkloadsConfigMap + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a user workloads ConfigMap. This method is supported +// for Cloud Composer environments in versions +// composer-3.*.*-airflow-*.*.* and newer. +// +// - parent: The environment name to create a ConfigMap for, in the +// form: +// "projects/{projectId}/locations/{locationId}/environments/{environme +// ntId}". +func (r *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsService) Create(parent string, userworkloadsconfigmap *UserWorkloadsConfigMap) *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsCreateCall { + c := &ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.userworkloadsconfigmap = userworkloadsconfigmap + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsCreateCall) Context(ctx context.Context) *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.userworkloadsconfigmap) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/userWorkloadsConfigMaps") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "composer.projects.locations.environments.userWorkloadsConfigMaps.create" call. +// Exactly one of *UserWorkloadsConfigMap or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *UserWorkloadsConfigMap.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsCreateCall) Do(opts ...googleapi.CallOption) (*UserWorkloadsConfigMap, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &UserWorkloadsConfigMap{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a user workloads ConfigMap. This method is supported for Cloud Composer environments in versions composer-3.*.*-airflow-*.*.* and newer.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}/userWorkloadsConfigMaps", + // "httpMethod": "POST", + // "id": "composer.projects.locations.environments.userWorkloadsConfigMaps.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. The environment name to create a ConfigMap for, in the form: \"projects/{projectId}/locations/{locationId}/environments/{environmentId}\"", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+parent}/userWorkloadsConfigMaps", + // "request": { + // "$ref": "UserWorkloadsConfigMap" + // }, + // "response": { + // "$ref": "UserWorkloadsConfigMap" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "composer.projects.locations.environments.userWorkloadsConfigMaps.delete": + +type ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a user workloads ConfigMap. This method is supported +// for Cloud Composer environments in versions +// composer-3.*.*-airflow-*.*.* and newer. +// +// - name: The ConfigMap to delete, in the form: +// "projects/{projectId}/locations/{locationId}/environments/{environme +// ntId}/userWorkloadsConfigMaps/{userWorkloadsConfigMapId}". +func (r *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsService) Delete(name string) *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsDeleteCall { + c := &ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsDeleteCall) Context(ctx context.Context) *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "composer.projects.locations.environments.userWorkloadsConfigMaps.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a user workloads ConfigMap. This method is supported for Cloud Composer environments in versions composer-3.*.*-airflow-*.*.* and newer.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}/userWorkloadsConfigMaps/{userWorkloadsConfigMapsId}", + // "httpMethod": "DELETE", + // "id": "composer.projects.locations.environments.userWorkloadsConfigMaps.delete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The ConfigMap to delete, in the form: \"projects/{projectId}/locations/{locationId}/environments/{environmentId}/userWorkloadsConfigMaps/{userWorkloadsConfigMapId}\"", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+/userWorkloadsConfigMaps/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "composer.projects.locations.environments.userWorkloadsConfigMaps.get": + +type ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets an existing user workloads ConfigMap. This method is +// supported for Cloud Composer environments in versions +// composer-3.*.*-airflow-*.*.* and newer. +// +// - name: The resource name of the ConfigMap to get, in the form: +// "projects/{projectId}/locations/{locationId}/environments/{environme +// ntId}/userWorkloadsConfigMaps/{userWorkloadsConfigMapId}". +func (r *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsService) Get(name string) *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsGetCall { + c := &ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsGetCall) Context(ctx context.Context) *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "composer.projects.locations.environments.userWorkloadsConfigMaps.get" call. +// Exactly one of *UserWorkloadsConfigMap or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *UserWorkloadsConfigMap.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsGetCall) Do(opts ...googleapi.CallOption) (*UserWorkloadsConfigMap, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &UserWorkloadsConfigMap{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets an existing user workloads ConfigMap. This method is supported for Cloud Composer environments in versions composer-3.*.*-airflow-*.*.* and newer.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}/userWorkloadsConfigMaps/{userWorkloadsConfigMapsId}", + // "httpMethod": "GET", + // "id": "composer.projects.locations.environments.userWorkloadsConfigMaps.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource name of the ConfigMap to get, in the form: \"projects/{projectId}/locations/{locationId}/environments/{environmentId}/userWorkloadsConfigMaps/{userWorkloadsConfigMapId}\"", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+/userWorkloadsConfigMaps/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "response": { + // "$ref": "UserWorkloadsConfigMap" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "composer.projects.locations.environments.userWorkloadsConfigMaps.list": + +type ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists user workloads ConfigMaps. This method is supported for +// Cloud Composer environments in versions composer-3.*.*-airflow-*.*.* +// and newer. +// +// - parent: List ConfigMaps in the given environment, in the form: +// "projects/{projectId}/locations/{locationId}/environments/{environme +// ntId}". +func (r *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsService) List(parent string) *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsListCall { + c := &ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of ConfigMaps to return. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsListCall) PageSize(pageSize int64) *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The +// next_page_token value returned from a previous List request, if any. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsListCall) PageToken(pageToken string) *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsListCall) Context(ctx context.Context) *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/userWorkloadsConfigMaps") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "composer.projects.locations.environments.userWorkloadsConfigMaps.list" call. +// Exactly one of *ListUserWorkloadsConfigMapsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ListUserWorkloadsConfigMapsResponse.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsListCall) Do(opts ...googleapi.CallOption) (*ListUserWorkloadsConfigMapsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ListUserWorkloadsConfigMapsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists user workloads ConfigMaps. This method is supported for Cloud Composer environments in versions composer-3.*.*-airflow-*.*.* and newer.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}/userWorkloadsConfigMaps", + // "httpMethod": "GET", + // "id": "composer.projects.locations.environments.userWorkloadsConfigMaps.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "pageSize": { + // "description": "Optional. The maximum number of ConfigMaps to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. The next_page_token value returned from a previous List request, if any.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. List ConfigMaps in the given environment, in the form: \"projects/{projectId}/locations/{locationId}/environments/{environmentId}\"", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+parent}/userWorkloadsConfigMaps", + // "response": { + // "$ref": "ListUserWorkloadsConfigMapsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsListCall) Pages(ctx context.Context, f func(*ListUserWorkloadsConfigMapsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "composer.projects.locations.environments.userWorkloadsConfigMaps.update": + +type ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsUpdateCall struct { + s *Service + name string + userworkloadsconfigmap *UserWorkloadsConfigMap + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Update: Updates a user workloads ConfigMap. This method is supported +// for Cloud Composer environments in versions +// composer-3.*.*-airflow-*.*.* and newer. +// +// - name: Identifier. The resource name of the ConfigMap, in the form: +// "projects/{projectId}/locations/{locationId}/environments/{environme +// ntId}/userWorkloadsConfigMaps/{userWorkloadsConfigMapId}". +func (r *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsService) Update(name string, userworkloadsconfigmap *UserWorkloadsConfigMap) *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsUpdateCall { + c := &ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.userworkloadsconfigmap = userworkloadsconfigmap + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsUpdateCall) Fields(s ...googleapi.Field) *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsUpdateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsUpdateCall) Context(ctx context.Context) *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsUpdateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsUpdateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsUpdateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.userworkloadsconfigmap) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PUT", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "composer.projects.locations.environments.userWorkloadsConfigMaps.update" call. +// Exactly one of *UserWorkloadsConfigMap or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *UserWorkloadsConfigMap.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsConfigMapsUpdateCall) Do(opts ...googleapi.CallOption) (*UserWorkloadsConfigMap, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &UserWorkloadsConfigMap{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a user workloads ConfigMap. This method is supported for Cloud Composer environments in versions composer-3.*.*-airflow-*.*.* and newer.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}/userWorkloadsConfigMaps/{userWorkloadsConfigMapsId}", + // "httpMethod": "PUT", + // "id": "composer.projects.locations.environments.userWorkloadsConfigMaps.update", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Identifier. The resource name of the ConfigMap, in the form: \"projects/{projectId}/locations/{locationId}/environments/{environmentId}/userWorkloadsConfigMaps/{userWorkloadsConfigMapId}\"", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+/userWorkloadsConfigMaps/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "request": { + // "$ref": "UserWorkloadsConfigMap" + // }, + // "response": { + // "$ref": "UserWorkloadsConfigMap" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "composer.projects.locations.environments.userWorkloadsSecrets.create": + +type ProjectsLocationsEnvironmentsUserWorkloadsSecretsCreateCall struct { + s *Service + parent string + userworkloadssecret *UserWorkloadsSecret + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Create: Creates a user workloads Secret. This method is supported for +// Cloud Composer environments in versions composer-3.*.*-airflow-*.*.* +// and newer. +// +// - parent: The environment name to create a Secret for, in the form: +// "projects/{projectId}/locations/{locationId}/environments/{environme +// ntId}". +func (r *ProjectsLocationsEnvironmentsUserWorkloadsSecretsService) Create(parent string, userworkloadssecret *UserWorkloadsSecret) *ProjectsLocationsEnvironmentsUserWorkloadsSecretsCreateCall { + c := &ProjectsLocationsEnvironmentsUserWorkloadsSecretsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + c.userworkloadssecret = userworkloadssecret + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsEnvironmentsUserWorkloadsSecretsCreateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsCreateCall) Context(ctx context.Context) *ProjectsLocationsEnvironmentsUserWorkloadsSecretsCreateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsCreateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.userworkloadssecret) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/userWorkloadsSecrets") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "composer.projects.locations.environments.userWorkloadsSecrets.create" call. +// Exactly one of *UserWorkloadsSecret or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *UserWorkloadsSecret.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsCreateCall) Do(opts ...googleapi.CallOption) (*UserWorkloadsSecret, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &UserWorkloadsSecret{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a user workloads Secret. This method is supported for Cloud Composer environments in versions composer-3.*.*-airflow-*.*.* and newer.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}/userWorkloadsSecrets", + // "httpMethod": "POST", + // "id": "composer.projects.locations.environments.userWorkloadsSecrets.create", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "parent": { + // "description": "Required. The environment name to create a Secret for, in the form: \"projects/{projectId}/locations/{locationId}/environments/{environmentId}\"", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+parent}/userWorkloadsSecrets", + // "request": { + // "$ref": "UserWorkloadsSecret" + // }, + // "response": { + // "$ref": "UserWorkloadsSecret" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "composer.projects.locations.environments.userWorkloadsSecrets.delete": + +type ProjectsLocationsEnvironmentsUserWorkloadsSecretsDeleteCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes a user workloads Secret. This method is supported for +// Cloud Composer environments in versions composer-3.*.*-airflow-*.*.* +// and newer. +// +// - name: The Secret to delete, in the form: +// "projects/{projectId}/locations/{locationId}/environments/{environme +// ntId}/userWorkloadsSecrets/{userWorkloadsSecretId}". +func (r *ProjectsLocationsEnvironmentsUserWorkloadsSecretsService) Delete(name string) *ProjectsLocationsEnvironmentsUserWorkloadsSecretsDeleteCall { + c := &ProjectsLocationsEnvironmentsUserWorkloadsSecretsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsEnvironmentsUserWorkloadsSecretsDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsDeleteCall) Context(ctx context.Context) *ProjectsLocationsEnvironmentsUserWorkloadsSecretsDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "composer.projects.locations.environments.userWorkloadsSecrets.delete" call. +// Exactly one of *Empty or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Empty.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Empty{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes a user workloads Secret. This method is supported for Cloud Composer environments in versions composer-3.*.*-airflow-*.*.* and newer.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}/userWorkloadsSecrets/{userWorkloadsSecretsId}", + // "httpMethod": "DELETE", + // "id": "composer.projects.locations.environments.userWorkloadsSecrets.delete", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The Secret to delete, in the form: \"projects/{projectId}/locations/{locationId}/environments/{environmentId}/userWorkloadsSecrets/{userWorkloadsSecretId}\"", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+/userWorkloadsSecrets/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "response": { + // "$ref": "Empty" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "composer.projects.locations.environments.userWorkloadsSecrets.get": + +type ProjectsLocationsEnvironmentsUserWorkloadsSecretsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Gets an existing user workloads Secret. Values of the "data" +// field in the response are cleared. This method is supported for Cloud +// Composer environments in versions composer-3.*.*-airflow-*.*.* and +// newer. +// +// - name: The resource name of the Secret to get, in the form: +// "projects/{projectId}/locations/{locationId}/environments/{environme +// ntId}/userWorkloadsSecrets/{userWorkloadsSecretId}". +func (r *ProjectsLocationsEnvironmentsUserWorkloadsSecretsService) Get(name string) *ProjectsLocationsEnvironmentsUserWorkloadsSecretsGetCall { + c := &ProjectsLocationsEnvironmentsUserWorkloadsSecretsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsEnvironmentsUserWorkloadsSecretsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsEnvironmentsUserWorkloadsSecretsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsGetCall) Context(ctx context.Context) *ProjectsLocationsEnvironmentsUserWorkloadsSecretsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "composer.projects.locations.environments.userWorkloadsSecrets.get" call. +// Exactly one of *UserWorkloadsSecret or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *UserWorkloadsSecret.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsGetCall) Do(opts ...googleapi.CallOption) (*UserWorkloadsSecret, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &UserWorkloadsSecret{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Gets an existing user workloads Secret. Values of the \"data\" field in the response are cleared. This method is supported for Cloud Composer environments in versions composer-3.*.*-airflow-*.*.* and newer.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}/userWorkloadsSecrets/{userWorkloadsSecretsId}", + // "httpMethod": "GET", + // "id": "composer.projects.locations.environments.userWorkloadsSecrets.get", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The resource name of the Secret to get, in the form: \"projects/{projectId}/locations/{locationId}/environments/{environmentId}/userWorkloadsSecrets/{userWorkloadsSecretId}\"", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+/userWorkloadsSecrets/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "response": { + // "$ref": "UserWorkloadsSecret" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "composer.projects.locations.environments.userWorkloadsSecrets.list": + +type ProjectsLocationsEnvironmentsUserWorkloadsSecretsListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists user workloads Secrets. This method is supported for +// Cloud Composer environments in versions composer-3.*.*-airflow-*.*.* +// and newer. +// +// - parent: List Secrets in the given environment, in the form: +// "projects/{projectId}/locations/{locationId}/environments/{environme +// ntId}". +func (r *ProjectsLocationsEnvironmentsUserWorkloadsSecretsService) List(parent string) *ProjectsLocationsEnvironmentsUserWorkloadsSecretsListCall { + c := &ProjectsLocationsEnvironmentsUserWorkloadsSecretsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// PageSize sets the optional parameter "pageSize": The maximum number +// of Secrets to return. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsListCall) PageSize(pageSize int64) *ProjectsLocationsEnvironmentsUserWorkloadsSecretsListCall { + c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) + return c +} + +// PageToken sets the optional parameter "pageToken": The +// next_page_token value returned from a previous List request, if any. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsListCall) PageToken(pageToken string) *ProjectsLocationsEnvironmentsUserWorkloadsSecretsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsEnvironmentsUserWorkloadsSecretsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the optional parameter which makes the operation +// fail if the object's ETag matches the given value. This is useful for +// getting updates only after the object has changed since the last +// request. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsEnvironmentsUserWorkloadsSecretsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsListCall) Context(ctx context.Context) *ProjectsLocationsEnvironmentsUserWorkloadsSecretsListCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/userWorkloadsSecrets") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "parent": c.parent, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "composer.projects.locations.environments.userWorkloadsSecrets.list" call. +// Exactly one of *ListUserWorkloadsSecretsResponse or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ListUserWorkloadsSecretsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. +// Use googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsListCall) Do(opts ...googleapi.CallOption) (*ListUserWorkloadsSecretsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ListUserWorkloadsSecretsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists user workloads Secrets. This method is supported for Cloud Composer environments in versions composer-3.*.*-airflow-*.*.* and newer.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}/userWorkloadsSecrets", + // "httpMethod": "GET", + // "id": "composer.projects.locations.environments.userWorkloadsSecrets.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "pageSize": { + // "description": "Optional. The maximum number of Secrets to return.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Optional. The next_page_token value returned from a previous List request, if any.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. List Secrets in the given environment, in the form: \"projects/{projectId}/locations/{locationId}/environments/{environmentId}\"", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+parent}/userWorkloadsSecrets", + // "response": { + // "$ref": "ListUserWorkloadsSecretsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsListCall) Pages(ctx context.Context, f func(*ListUserWorkloadsSecretsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +// method id "composer.projects.locations.environments.userWorkloadsSecrets.update": + +type ProjectsLocationsEnvironmentsUserWorkloadsSecretsUpdateCall struct { + s *Service + name string + userworkloadssecret *UserWorkloadsSecret + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Update: Updates a user workloads Secret. This method is supported for +// Cloud Composer environments in versions composer-3.*.*-airflow-*.*.* +// and newer. +// +// - name: Identifier. The resource name of the Secret, in the form: +// "projects/{projectId}/locations/{locationId}/environments/{environme +// ntId}/userWorkloadsSecrets/{userWorkloadsSecretId}". +func (r *ProjectsLocationsEnvironmentsUserWorkloadsSecretsService) Update(name string, userworkloadssecret *UserWorkloadsSecret) *ProjectsLocationsEnvironmentsUserWorkloadsSecretsUpdateCall { + c := &ProjectsLocationsEnvironmentsUserWorkloadsSecretsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.userworkloadssecret = userworkloadssecret + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsUpdateCall) Fields(s ...googleapi.Field) *ProjectsLocationsEnvironmentsUserWorkloadsSecretsUpdateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsUpdateCall) Context(ctx context.Context) *ProjectsLocationsEnvironmentsUserWorkloadsSecretsUpdateCall { + c.ctx_ = ctx + return c +} + +// Header returns an http.Header that can be modified by the caller to +// add HTTP headers to the request. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsUpdateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsUpdateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := make(http.Header) + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version) + for k, v := range c.header_ { + reqHeaders[k] = v + } + reqHeaders.Set("User-Agent", c.s.userAgent()) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.userworkloadssecret) + if err != nil { + return nil, err + } + reqHeaders.Set("Content-Type", "application/json") + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PUT", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "composer.projects.locations.environments.userWorkloadsSecrets.update" call. +// Exactly one of *UserWorkloadsSecret or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *UserWorkloadsSecret.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ProjectsLocationsEnvironmentsUserWorkloadsSecretsUpdateCall) Do(opts ...googleapi.CallOption) (*UserWorkloadsSecret, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &UserWorkloadsSecret{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a user workloads Secret. This method is supported for Cloud Composer environments in versions composer-3.*.*-airflow-*.*.* and newer.", + // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}/userWorkloadsSecrets/{userWorkloadsSecretsId}", + // "httpMethod": "PUT", + // "id": "composer.projects.locations.environments.userWorkloadsSecrets.update", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Identifier. The resource name of the Secret, in the form: \"projects/{projectId}/locations/{locationId}/environments/{environmentId}/userWorkloadsSecrets/{userWorkloadsSecretId}\"", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+/userWorkloadsSecrets/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v1/{+name}", + // "request": { + // "$ref": "UserWorkloadsSecret" + // }, + // "response": { + // "$ref": "UserWorkloadsSecret" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + // method id "composer.projects.locations.environments.workloads.list": type ProjectsLocationsEnvironmentsWorkloadsListCall struct { diff --git a/compute/v0.alpha/compute-api.json b/compute/v0.alpha/compute-api.json index a7ec7628497..c039df45229 100644 --- a/compute/v0.alpha/compute-api.json +++ b/compute/v0.alpha/compute-api.json @@ -43863,7 +43863,7 @@ } } }, - "revision": "20240129", + "revision": "20240130", "rootUrl": "https://compute.googleapis.com/", "schemas": { "AWSV4Signature": { @@ -68587,10 +68587,10 @@ }, "appEngine": { "$ref": "NetworkEndpointGroupAppEngine", - "description": "Only valid when networkEndpointType is \"SERVERLESS\". Only one of cloudRun, appEngine or cloudFunction may be set." + "description": "Only valid when networkEndpointType is SERVERLESS. Only one of cloudRun, appEngine or cloudFunction may be set." }, "clientPortMappingMode": { - "description": "Only valid when networkEndpointType is \"GCE_VM_IP_PORT\" and the NEG is regional.", + "description": "Only valid when networkEndpointType is GCE_VM_IP_PORT and the NEG is regional.", "enum": [ "CLIENT_PORT_PER_ENDPOINT", "PORT_MAPPING_DISABLED" @@ -68603,18 +68603,18 @@ }, "cloudFunction": { "$ref": "NetworkEndpointGroupCloudFunction", - "description": "Only valid when networkEndpointType is \"SERVERLESS\". Only one of cloudRun, appEngine or cloudFunction may be set." + "description": "Only valid when networkEndpointType is SERVERLESS. Only one of cloudRun, appEngine or cloudFunction may be set." }, "cloudRun": { "$ref": "NetworkEndpointGroupCloudRun", - "description": "Only valid when networkEndpointType is \"SERVERLESS\". Only one of cloudRun, appEngine or cloudFunction may be set." + "description": "Only valid when networkEndpointType is SERVERLESS. Only one of cloudRun, appEngine or cloudFunction may be set." }, "creationTimestamp": { "description": "[Output Only] Creation timestamp in RFC3339 text format.", "type": "string" }, "defaultPort": { - "description": "The default port used if the port number is not specified in the network endpoint.", + "description": "The default port used if the port number is not specified in the network endpoint. If the network endpoint type is either GCE_VM_IP, SERVERLESS or PRIVATE_SERVICE_CONNECT, this field must not be specified.", "format": "int32", "type": "integer" }, @@ -68642,7 +68642,7 @@ "type": "string" }, "network": { - "description": "The URL of the network to which all network endpoints in the NEG belong. Uses \"default\" project network if unspecified.", + "description": "The URL of the network to which all network endpoints in the NEG belong. Uses default project network if unspecified.", "type": "string" }, "networkEndpointType": { @@ -68671,7 +68671,7 @@ "$ref": "NetworkEndpointGroupPscData" }, "pscTargetService": { - "description": "The target service url used to set up private service connection to a Google API or a PSC Producer Service Attachment. An example value is: \"asia-northeast3-cloudkms.googleapis.com\"", + "description": "The target service url used to set up private service connection to a Google API or a PSC Producer Service Attachment. An example value is: asia-northeast3-cloudkms.googleapis.com", "type": "string" }, "region": { @@ -68688,7 +68688,7 @@ }, "serverlessDeployment": { "$ref": "NetworkEndpointGroupServerlessDeployment", - "description": "Only valid when networkEndpointType is \"SERVERLESS\". Only one of cloudRun, appEngine, cloudFunction or serverlessDeployment may be set." + "description": "Only valid when networkEndpointType is SERVERLESS. Only one of cloudRun, appEngine, cloudFunction or serverlessDeployment may be set." }, "size": { "description": "[Output only] Number of network endpoints in the network endpoint group.", @@ -68880,15 +68880,15 @@ "id": "NetworkEndpointGroupAppEngine", "properties": { "service": { - "description": "Optional serving service. The service name is case-sensitive and must be 1-63 characters long. Example value: \"default\", \"my-service\".", + "description": "Optional serving service. The service name is case-sensitive and must be 1-63 characters long. Example value: default, my-service.", "type": "string" }, "urlMask": { - "description": "A template to parse service and version fields from a request URL. URL mask allows for routing to multiple App Engine services without having to create multiple Network Endpoint Groups and backend services. For example, the request URLs \"foo1-dot-appname.appspot.com/v1\" and \"foo1-dot-appname.appspot.com/v2\" can be backed by the same Serverless NEG with URL mask \"\u003cservice\u003e-dot-appname.appspot.com/\u003cversion\u003e\". The URL mask will parse them to { service = \"foo1\", version = \"v1\" } and { service = \"foo1\", version = \"v2\" } respectively.", + "description": "An URL mask is one of the main components of the Cloud Function. A template to parse service and version fields from a request URL. URL mask allows for routing to multiple App Engine services without having to create multiple Network Endpoint Groups and backend services. For example, the request URLs foo1-dot-appname.appspot.com/v1 and foo1-dot-appname.appspot.com/v2 can be backed by the same Serverless NEG with URL mask \u003cservice\u003e-dot-appname.appspot.com/\u003cversion\u003e. The URL mask will parse them to { service = \"foo1\", version = \"v1\" } and { service = \"foo1\", version = \"v2\" } respectively.", "type": "string" }, "version": { - "description": "Optional serving version. The version name is case-sensitive and must be 1-100 characters long. Example value: \"v1\", \"v2\".", + "description": "Optional serving version. The version name is case-sensitive and must be 1-100 characters long. Example value: v1, v2.", "type": "string" } }, @@ -68899,11 +68899,11 @@ "id": "NetworkEndpointGroupCloudFunction", "properties": { "function": { - "description": "A user-defined name of the Cloud Function. The function name is case-sensitive and must be 1-63 characters long. Example value: \"func1\".", + "description": "A user-defined name of the Cloud Function. The function name is case-sensitive and must be 1-63 characters long. Example value: func1.", "type": "string" }, "urlMask": { - "description": "A template to parse function field from a request URL. URL mask allows for routing to multiple Cloud Functions without having to create multiple Network Endpoint Groups and backend services. For example, request URLs \" mydomain.com/function1\" and \"mydomain.com/function2\" can be backed by the same Serverless NEG with URL mask \"/\u003cfunction\u003e\". The URL mask will parse them to { function = \"function1\" } and { function = \"function2\" } respectively.", + "description": "An URL mask is one of the main components of the Cloud Function. A template to parse function field from a request URL. URL mask allows for routing to multiple Cloud Functions without having to create multiple Network Endpoint Groups and backend services. For example, request URLs mydomain.com/function1 and mydomain.com/function2 can be backed by the same Serverless NEG with URL mask /\u003cfunction\u003e. The URL mask will parse them to { function = \"function1\" } and { function = \"function2\" } respectively.", "type": "string" } }, @@ -68922,7 +68922,7 @@ "type": "string" }, "urlMask": { - "description": "A template to parse \u003cservice\u003e and \u003ctag\u003e fields from a request URL. URL mask allows for routing to multiple Run services without having to create multiple network endpoint groups and backend services. For example, request URLs \"foo1.domain.com/bar1\" and \"foo1.domain.com/bar2\" can be backed by the same Serverless Network Endpoint Group (NEG) with URL mask \"\u003ctag\u003e.domain.com/\u003cservice\u003e\". The URL mask will parse them to { service=\"bar1\", tag=\"foo1\" } and { service=\"bar2\", tag=\"foo2\" } respectively.", + "description": "An URL mask is one of the main components of the Cloud Function. A template to parse \u003cservice\u003e and \u003ctag\u003e fields from a request URL. URL mask allows for routing to multiple Run services without having to create multiple network endpoint groups and backend services. For example, request URLs foo1.domain.com/bar1 and foo1.domain.com/bar2 can be backed by the same Serverless Network Endpoint Group (NEG) with URL mask \u003ctag\u003e.domain.com/\u003cservice\u003e. The URL mask will parse them to { service=\"bar1\", tag=\"foo1\" } and { service=\"bar2\", tag=\"foo2\" } respectively.", "type": "string" } }, @@ -68934,13 +68934,13 @@ "properties": { "defaultPort": { "deprecated": true, - "description": "The default port used if the port number is not specified in the network endpoint. [Deprecated] This field is deprecated.", + "description": "The default port used if the port number is not specified in the network endpoint. If the network endpoint type is either GCE_VM_IP, SERVERLESS or PRIVATE_SERVICE_CONNECT, this field must not be specified. [Deprecated] This field is deprecated.", "format": "int32", "type": "integer" }, "network": { "deprecated": true, - "description": "The URL of the network to which all network endpoints in the NEG belong. Uses \"default\" project network if unspecified. [Deprecated] This field is deprecated.", + "description": "The URL of the network to which all network endpoints in the NEG belong. Uses default project network if unspecified. [Deprecated] This field is deprecated.", "type": "string" }, "subnetwork": { @@ -69156,7 +69156,7 @@ "type": "string" }, "urlMask": { - "description": "A template to parse platform-specific fields from a request URL. URL mask allows for routing to multiple resources on the same serverless platform without having to create multiple Network Endpoint Groups and backend resources. The fields parsed by this template are platform-specific and are as follows: 1. API Gateway: The gateway ID 2. App Engine: The service and version 3. Cloud Functions: The function name 4. Cloud Run: The service and tag ", + "description": "An URL mask is one of the main components of the Cloud Function. A template to parse platform-specific fields from a request URL. URL mask allows for routing to multiple resources on the same serverless platform without having to create multiple Network Endpoint Groups and backend resources. The fields parsed by this template are platform-specific and are as follows: 1. API Gateway: The gateway ID 2. App Engine: The service and version 3. Cloud Functions: The function name 4. Cloud Run: The service and tag ", "type": "string" }, "version": { @@ -69547,6 +69547,18 @@ "format": "byte", "type": "string" }, + "igmpQuery": { + "description": "Indicate whether igmp query is enabled on the network interface or not. If enabled, also indicates the version of IGMP supported.", + "enum": [ + "IGMP_QUERY_DISABLED", + "IGMP_QUERY_V2" + ], + "enumDescriptions": [ + "The network interface has disabled IGMP query.", + "The network interface has enabled IGMP query - v2." + ], + "type": "string" + }, "internalIpv6PrefixLength": { "description": "The prefix length of the primary internal IPv6 range.", "format": "int32", @@ -86137,6 +86149,10 @@ "description": "[Output Only] URL of the region where the snapshot resides. Only applicable for regional snapshots.", "type": "string" }, + "resourceStatus": { + "$ref": "SnapshotResourceStatus", + "description": "[Output only] ResourceStatus of the Snapshot resource" + }, "satisfiesPzi": { "description": "Output only. Reserved for future use.", "readOnly": true, @@ -86572,6 +86588,17 @@ }, "type": "object" }, + "SnapshotResourceStatus": { + "id": "SnapshotResourceStatus", + "properties": { + "scheduledDeletionTime": { + "description": "[Output only] Scheduled deletion time of the snapshot. The snapshot will be deleted by the at any point within one hour after the deletion time.", + "format": "google-datetime", + "type": "string" + } + }, + "type": "object" + }, "SnapshotSettings": { "id": "SnapshotSettings", "properties": { diff --git a/compute/v0.alpha/compute-gen.go b/compute/v0.alpha/compute-gen.go index 79784354cb5..b603c461c8a 100644 --- a/compute/v0.alpha/compute-gen.go +++ b/compute/v0.alpha/compute-gen.go @@ -37091,12 +37091,12 @@ type NetworkEndpointGroup struct { // group. Annotations map[string]string `json:"annotations,omitempty"` - // AppEngine: Only valid when networkEndpointType is "SERVERLESS". Only + // AppEngine: Only valid when networkEndpointType is SERVERLESS. Only // one of cloudRun, appEngine or cloudFunction may be set. AppEngine *NetworkEndpointGroupAppEngine `json:"appEngine,omitempty"` // ClientPortMappingMode: Only valid when networkEndpointType is - // "GCE_VM_IP_PORT" and the NEG is regional. + // GCE_VM_IP_PORT and the NEG is regional. // // Possible values: // "CLIENT_PORT_PER_ENDPOINT" - For each endpoint there is exactly one @@ -37105,12 +37105,12 @@ type NetworkEndpointGroup struct { // port to destination. ClientPortMappingMode string `json:"clientPortMappingMode,omitempty"` - // CloudFunction: Only valid when networkEndpointType is "SERVERLESS". + // CloudFunction: Only valid when networkEndpointType is SERVERLESS. // Only one of cloudRun, appEngine or cloudFunction may be set. CloudFunction *NetworkEndpointGroupCloudFunction `json:"cloudFunction,omitempty"` - // CloudRun: Only valid when networkEndpointType is "SERVERLESS". Only - // one of cloudRun, appEngine or cloudFunction may be set. + // CloudRun: Only valid when networkEndpointType is SERVERLESS. Only one + // of cloudRun, appEngine or cloudFunction may be set. CloudRun *NetworkEndpointGroupCloudRun `json:"cloudRun,omitempty"` // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text @@ -37118,7 +37118,9 @@ type NetworkEndpointGroup struct { CreationTimestamp string `json:"creationTimestamp,omitempty"` // DefaultPort: The default port used if the port number is not - // specified in the network endpoint. + // specified in the network endpoint. If the network endpoint type is + // either GCE_VM_IP, SERVERLESS or PRIVATE_SERVICE_CONNECT, this field + // must not be specified. DefaultPort int64 `json:"defaultPort,omitempty"` // Description: An optional description of this resource. Provide this @@ -37148,7 +37150,7 @@ type NetworkEndpointGroup struct { Name string `json:"name,omitempty"` // Network: The URL of the network to which all network endpoints in the - // NEG belong. Uses "default" project network if unspecified. + // NEG belong. Uses default project network if unspecified. Network string `json:"network,omitempty"` // NetworkEndpointType: Type of network endpoints in this network @@ -37179,7 +37181,7 @@ type NetworkEndpointGroup struct { // PscTargetService: The target service url used to set up private // service connection to a Google API or a PSC Producer Service // Attachment. An example value is: - // "asia-northeast3-cloudkms.googleapis.com" + // asia-northeast3-cloudkms.googleapis.com PscTargetService string `json:"pscTargetService,omitempty"` // Region: [Output Only] The URL of the region where the network @@ -37194,7 +37196,7 @@ type NetworkEndpointGroup struct { SelfLinkWithId string `json:"selfLinkWithId,omitempty"` // ServerlessDeployment: Only valid when networkEndpointType is - // "SERVERLESS". Only one of cloudRun, appEngine, cloudFunction or + // SERVERLESS. Only one of cloudRun, appEngine, cloudFunction or // serverlessDeployment may be set. ServerlessDeployment *NetworkEndpointGroupServerlessDeployment `json:"serverlessDeployment,omitempty"` @@ -37449,24 +37451,23 @@ func (s *NetworkEndpointGroupAggregatedListWarningData) MarshalJSON() ([]byte, e // located in the same region as the Serverless NEG. type NetworkEndpointGroupAppEngine struct { // Service: Optional serving service. The service name is case-sensitive - // and must be 1-63 characters long. Example value: "default", - // "my-service". + // and must be 1-63 characters long. Example value: default, my-service. Service string `json:"service,omitempty"` - // UrlMask: A template to parse service and version fields from a + // UrlMask: An URL mask is one of the main components of the Cloud + // Function. A template to parse service and version fields from a // request URL. URL mask allows for routing to multiple App Engine // services without having to create multiple Network Endpoint Groups // and backend services. For example, the request URLs - // "foo1-dot-appname.appspot.com/v1" and - // "foo1-dot-appname.appspot.com/v2" can be backed by the same - // Serverless NEG with URL mask - // "-dot-appname.appspot.com/". The URL mask will - // parse them to { service = "foo1", version = "v1" } and { service = - // "foo1", version = "v2" } respectively. + // foo1-dot-appname.appspot.com/v1 and foo1-dot-appname.appspot.com/v2 + // can be backed by the same Serverless NEG with URL mask + // -dot-appname.appspot.com/. The URL mask will parse + // them to { service = "foo1", version = "v1" } and { service = "foo1", + // version = "v2" } respectively. UrlMask string `json:"urlMask,omitempty"` // Version: Optional serving version. The version name is case-sensitive - // and must be 1-100 characters long. Example value: "v1", "v2". + // and must be 1-100 characters long. Example value: v1, v2. Version string `json:"version,omitempty"` // ForceSendFields is a list of field names (e.g. "Service") to @@ -37499,16 +37500,17 @@ func (s *NetworkEndpointGroupAppEngine) MarshalJSON() ([]byte, error) { type NetworkEndpointGroupCloudFunction struct { // Function: A user-defined name of the Cloud Function. The function // name is case-sensitive and must be 1-63 characters long. Example - // value: "func1". + // value: func1. Function string `json:"function,omitempty"` - // UrlMask: A template to parse function field from a request URL. URL + // UrlMask: An URL mask is one of the main components of the Cloud + // Function. A template to parse function field from a request URL. URL // mask allows for routing to multiple Cloud Functions without having to // create multiple Network Endpoint Groups and backend services. For - // example, request URLs " mydomain.com/function1" and - // "mydomain.com/function2" can be backed by the same Serverless NEG - // with URL mask "/". The URL mask will parse them to { - // function = "function1" } and { function = "function2" } respectively. + // example, request URLs mydomain.com/function1 and + // mydomain.com/function2 can be backed by the same Serverless NEG with + // URL mask /. The URL mask will parse them to { function = + // "function1" } and { function = "function2" } respectively. UrlMask string `json:"urlMask,omitempty"` // ForceSendFields is a list of field names (e.g. "Function") to @@ -37551,12 +37553,13 @@ type NetworkEndpointGroupCloudRun struct { // "revision-0010". Tag string `json:"tag,omitempty"` - // UrlMask: A template to parse and fields from a + // UrlMask: An URL mask is one of the main components of the Cloud + // Function. A template to parse and fields from a // request URL. URL mask allows for routing to multiple Run services // without having to create multiple network endpoint groups and backend - // services. For example, request URLs "foo1.domain.com/bar1" and - // "foo1.domain.com/bar2" can be backed by the same Serverless Network - // Endpoint Group (NEG) with URL mask ".domain.com/". The + // services. For example, request URLs foo1.domain.com/bar1 and + // foo1.domain.com/bar2 can be backed by the same Serverless Network + // Endpoint Group (NEG) with URL mask .domain.com/. The // URL mask will parse them to { service="bar1", tag="foo1" } and { // service="bar2", tag="foo2" } respectively. UrlMask string `json:"urlMask,omitempty"` @@ -37588,13 +37591,14 @@ func (s *NetworkEndpointGroupCloudRun) MarshalJSON() ([]byte, error) { // fields for network endpoint group. type NetworkEndpointGroupLbNetworkEndpointGroup struct { // DefaultPort: The default port used if the port number is not - // specified in the network endpoint. [Deprecated] This field is - // deprecated. + // specified in the network endpoint. If the network endpoint type is + // either GCE_VM_IP, SERVERLESS or PRIVATE_SERVICE_CONNECT, this field + // must not be specified. [Deprecated] This field is deprecated. DefaultPort int64 `json:"defaultPort,omitempty"` // Network: The URL of the network to which all network endpoints in the - // NEG belong. Uses "default" project network if unspecified. - // [Deprecated] This field is deprecated. + // NEG belong. Uses default project network if unspecified. [Deprecated] + // This field is deprecated. Network string `json:"network,omitempty"` // Subnetwork: Optional URL of the subnetwork to which all network @@ -37887,7 +37891,8 @@ type NetworkEndpointGroupServerlessDeployment struct { // Functions: The function name 4. Cloud Run: The service name Resource string `json:"resource,omitempty"` - // UrlMask: A template to parse platform-specific fields from a request + // UrlMask: An URL mask is one of the main components of the Cloud + // Function. A template to parse platform-specific fields from a request // URL. URL mask allows for routing to multiple resources on the same // serverless platform without having to create multiple Network // Endpoint Groups and backend resources. The fields parsed by this @@ -38466,6 +38471,17 @@ type NetworkInterface struct { // Precondition Failed if the fingerprint is out of date. Fingerprint string `json:"fingerprint,omitempty"` + // IgmpQuery: Indicate whether igmp query is enabled on the network + // interface or not. If enabled, also indicates the version of IGMP + // supported. + // + // Possible values: + // "IGMP_QUERY_DISABLED" - The network interface has disabled IGMP + // query. + // "IGMP_QUERY_V2" - The network interface has enabled IGMP query - + // v2. + IgmpQuery string `json:"igmpQuery,omitempty"` + // InternalIpv6PrefixLength: The prefix length of the primary internal // IPv6 range. InternalIpv6PrefixLength int64 `json:"internalIpv6PrefixLength,omitempty"` @@ -61179,6 +61195,9 @@ type Snapshot struct { // Only applicable for regional snapshots. Region string `json:"region,omitempty"` + // ResourceStatus: [Output only] ResourceStatus of the Snapshot resource + ResourceStatus *SnapshotResourceStatus `json:"resourceStatus,omitempty"` + // SatisfiesPzi: Output only. Reserved for future use. SatisfiesPzi bool `json:"satisfiesPzi,omitempty"` @@ -61709,6 +61728,37 @@ func (s *SnapshotListWarningData) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +type SnapshotResourceStatus struct { + // ScheduledDeletionTime: [Output only] Scheduled deletion time of the + // snapshot. The snapshot will be deleted by the at any point within one + // hour after the deletion time. + ScheduledDeletionTime string `json:"scheduledDeletionTime,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "ScheduledDeletionTime") to unconditionally include in API requests. + // By default, fields with empty or default values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ScheduledDeletionTime") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *SnapshotResourceStatus) MarshalJSON() ([]byte, error) { + type NoMethod SnapshotResourceStatus + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + type SnapshotSettings struct { // AccessLocation: (Regional snapshots use only)Policy of which location // is allowed to access snapshot. diff --git a/dataform/v1beta1/dataform-api.json b/dataform/v1beta1/dataform-api.json index a22ce943585..8f75b98ce6a 100644 --- a/dataform/v1beta1/dataform-api.json +++ b/dataform/v1beta1/dataform-api.json @@ -2103,7 +2103,7 @@ } } }, - "revision": "20240127", + "revision": "20240203", "rootUrl": "https://dataform.googleapis.com/", "schemas": { "Assertion": { @@ -3480,6 +3480,12 @@ "description": "Represents a Dataform Git repository.", "id": "Repository", "properties": { + "createTime": { + "description": "Output only. The timestamp of when the repository was created.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, "displayName": { "description": "Optional. The repository's user-friendly name.", "type": "string" diff --git a/dataform/v1beta1/dataform-gen.go b/dataform/v1beta1/dataform-gen.go index dfb0ecde0d1..7ecf5dc7931 100644 --- a/dataform/v1beta1/dataform-gen.go +++ b/dataform/v1beta1/dataform-gen.go @@ -2732,6 +2732,10 @@ func (s *RemoveFileRequest) MarshalJSON() ([]byte, error) { // Repository: Represents a Dataform Git repository. type Repository struct { + // CreateTime: Output only. The timestamp of when the repository was + // created. + CreateTime string `json:"createTime,omitempty"` + // DisplayName: Optional. The repository's user-friendly name. DisplayName string `json:"displayName,omitempty"` @@ -2774,7 +2778,7 @@ type Repository struct { // server. googleapi.ServerResponse `json:"-"` - // ForceSendFields is a list of field names (e.g. "DisplayName") to + // ForceSendFields is a list of field names (e.g. "CreateTime") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be @@ -2782,10 +2786,10 @@ type Repository struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "DisplayName") to include - // in API requests with the JSON null value. By default, fields with - // empty values are omitted from API requests. However, any field with - // an empty value appearing in NullFields will be sent to the server as + // NullFields is a list of field names (e.g. "CreateTime") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` diff --git a/dataplex/v1/dataplex-api.json b/dataplex/v1/dataplex-api.json index 9a575325d9a..4a82229dc71 100644 --- a/dataplex/v1/dataplex-api.json +++ b/dataplex/v1/dataplex-api.json @@ -4360,7 +4360,7 @@ } } }, - "revision": "20240124", + "revision": "20240131", "rootUrl": "https://dataplex.googleapis.com/", "schemas": { "Empty": { @@ -7834,6 +7834,81 @@ }, "type": "object" }, + "GoogleCloudDataplexV1MetadataJobEvent": { + "description": "These messages contain information about the execution of a metadata job. The monitored resource is 'MetadataJob'.", + "id": "GoogleCloudDataplexV1MetadataJobEvent", + "properties": { + "importResult": { + "$ref": "GoogleCloudDataplexV1MetadataJobEventImportResult", + "description": "Import job results. Should only be populated on terminal states." + }, + "message": { + "description": "Message describing failure or success event.", + "type": "string" + }, + "resource": { + "description": "The resource name associated with the event. Supported resources included, but not limited to EntryGroup, MetadataJob, and Entry.", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudDataplexV1MetadataJobEventImportResult": { + "description": "Import job result for metadata job.", + "id": "GoogleCloudDataplexV1MetadataJobEventImportResult", + "properties": { + "createdEntries": { + "description": "Total number of entries created.", + "format": "int64", + "type": "string" + }, + "deletedEntries": { + "description": "Total number of entries deleted.", + "format": "int64", + "type": "string" + }, + "mutatedEntryGroups": { + "description": "The number of entry groups modified/specified by the import job.", + "format": "int64", + "type": "string" + }, + "recreatedEntries": { + "description": "Total number of entries recreated.", + "format": "int64", + "type": "string" + }, + "state": { + "description": "Output only. Terminal state of the import job.", + "enum": [ + "STATE_UNSPECIFIED", + "SUCCEEDED", + "FAILED", + "CANCELLED", + "RUNNING" + ], + "enumDescriptions": [ + "State Unspecified.", + "Import Job was successful.", + "Import Job was failed.", + "Import job was cancelled.", + "Import Job is running." + ], + "readOnly": true, + "type": "string" + }, + "unchangedEntries": { + "description": "Total number of entries left unchanged.", + "format": "int64", + "type": "string" + }, + "updatedEntries": { + "description": "Total number of entries updated.", + "format": "int64", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDataplexV1OperationMetadata": { "description": "Represents the metadata of a long-running operation.", "id": "GoogleCloudDataplexV1OperationMetadata", diff --git a/dataplex/v1/dataplex-gen.go b/dataplex/v1/dataplex-gen.go index 2e36a46e157..165c8562f1e 100644 --- a/dataplex/v1/dataplex-gen.go +++ b/dataplex/v1/dataplex-gen.go @@ -5722,6 +5722,101 @@ func (s *GoogleCloudDataplexV1ListZonesResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudDataplexV1MetadataJobEvent: These messages contain +// information about the execution of a metadata job. The monitored +// resource is 'MetadataJob'. +type GoogleCloudDataplexV1MetadataJobEvent struct { + // ImportResult: Import job results. Should only be populated on + // terminal states. + ImportResult *GoogleCloudDataplexV1MetadataJobEventImportResult `json:"importResult,omitempty"` + + // Message: Message describing failure or success event. + Message string `json:"message,omitempty"` + + // Resource: The resource name associated with the event. Supported + // resources included, but not limited to EntryGroup, MetadataJob, and + // Entry. + Resource string `json:"resource,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ImportResult") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ImportResult") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDataplexV1MetadataJobEvent) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDataplexV1MetadataJobEvent + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudDataplexV1MetadataJobEventImportResult: Import job result +// for metadata job. +type GoogleCloudDataplexV1MetadataJobEventImportResult struct { + // CreatedEntries: Total number of entries created. + CreatedEntries int64 `json:"createdEntries,omitempty,string"` + + // DeletedEntries: Total number of entries deleted. + DeletedEntries int64 `json:"deletedEntries,omitempty,string"` + + // MutatedEntryGroups: The number of entry groups modified/specified by + // the import job. + MutatedEntryGroups int64 `json:"mutatedEntryGroups,omitempty,string"` + + // RecreatedEntries: Total number of entries recreated. + RecreatedEntries int64 `json:"recreatedEntries,omitempty,string"` + + // State: Output only. Terminal state of the import job. + // + // Possible values: + // "STATE_UNSPECIFIED" - State Unspecified. + // "SUCCEEDED" - Import Job was successful. + // "FAILED" - Import Job was failed. + // "CANCELLED" - Import job was cancelled. + // "RUNNING" - Import Job is running. + State string `json:"state,omitempty"` + + // UnchangedEntries: Total number of entries left unchanged. + UnchangedEntries int64 `json:"unchangedEntries,omitempty,string"` + + // UpdatedEntries: Total number of entries updated. + UpdatedEntries int64 `json:"updatedEntries,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "CreatedEntries") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CreatedEntries") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *GoogleCloudDataplexV1MetadataJobEventImportResult) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDataplexV1MetadataJobEventImportResult + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudDataplexV1OperationMetadata: Represents the metadata of a // long-running operation. type GoogleCloudDataplexV1OperationMetadata struct { diff --git a/gkebackup/v1/gkebackup-api.json b/gkebackup/v1/gkebackup-api.json index 2c6b7db17f0..10eddc55392 100644 --- a/gkebackup/v1/gkebackup-api.json +++ b/gkebackup/v1/gkebackup-api.json @@ -1688,7 +1688,7 @@ } } }, - "revision": "20240101", + "revision": "20240131", "rootUrl": "https://gkebackup.googleapis.com/", "schemas": { "AuditConfig": { @@ -2054,7 +2054,7 @@ "type": "array" }, "role": { - "description": "Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.", + "description": "Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview of the IAM roles and permissions, see the [IAM documentation](https://cloud.google.com/iam/docs/roles-overview). For a list of the available pre-defined roles, see [here](https://cloud.google.com/iam/docs/understanding-roles).", "type": "string" } }, diff --git a/gkebackup/v1/gkebackup-gen.go b/gkebackup/v1/gkebackup-gen.go index c085618b209..6d3672cea66 100644 --- a/gkebackup/v1/gkebackup-gen.go +++ b/gkebackup/v1/gkebackup-gen.go @@ -775,7 +775,11 @@ type Binding struct { Members []string `json:"members,omitempty"` // Role: Role that is assigned to the list of `members`, or principals. - // For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + // For example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an + // overview of the IAM roles and permissions, see the IAM documentation + // (https://cloud.google.com/iam/docs/roles-overview). For a list of the + // available pre-defined roles, see here + // (https://cloud.google.com/iam/docs/understanding-roles). Role string `json:"role,omitempty"` // ForceSendFields is a list of field names (e.g. "Condition") to diff --git a/networkconnectivity/v1/networkconnectivity-api.json b/networkconnectivity/v1/networkconnectivity-api.json index 8e0f1a09abb..4eaaa6d2c57 100644 --- a/networkconnectivity/v1/networkconnectivity-api.json +++ b/networkconnectivity/v1/networkconnectivity-api.json @@ -2630,7 +2630,7 @@ } } }, - "revision": "20240103", + "revision": "20240131", "rootUrl": "https://networkconnectivity.googleapis.com/", "schemas": { "AcceptHubSpokeRequest": { @@ -2723,7 +2723,7 @@ "type": "array" }, "role": { - "description": "Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.", + "description": "Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview of the IAM roles and permissions, see the [IAM documentation](https://cloud.google.com/iam/docs/roles-overview). For a list of the available pre-defined roles, see [here](https://cloud.google.com/iam/docs/understanding-roles).", "type": "string" } }, diff --git a/networkconnectivity/v1/networkconnectivity-gen.go b/networkconnectivity/v1/networkconnectivity-gen.go index d045a5135f5..8995ecf71cb 100644 --- a/networkconnectivity/v1/networkconnectivity-gen.go +++ b/networkconnectivity/v1/networkconnectivity-gen.go @@ -579,7 +579,11 @@ type Binding struct { Members []string `json:"members,omitempty"` // Role: Role that is assigned to the list of `members`, or principals. - // For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + // For example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an + // overview of the IAM roles and permissions, see the IAM documentation + // (https://cloud.google.com/iam/docs/roles-overview). For a list of the + // available pre-defined roles, see here + // (https://cloud.google.com/iam/docs/understanding-roles). Role string `json:"role,omitempty"` // ForceSendFields is a list of field names (e.g. "Condition") to diff --git a/networkconnectivity/v1alpha1/networkconnectivity-api.json b/networkconnectivity/v1alpha1/networkconnectivity-api.json index 9284e2bcd80..6c6a41385f2 100644 --- a/networkconnectivity/v1alpha1/networkconnectivity-api.json +++ b/networkconnectivity/v1alpha1/networkconnectivity-api.json @@ -1116,7 +1116,7 @@ } } }, - "revision": "20240103", + "revision": "20240131", "rootUrl": "https://networkconnectivity.googleapis.com/", "schemas": { "AuditConfig": { @@ -1183,7 +1183,7 @@ "type": "array" }, "role": { - "description": "Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.", + "description": "Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview of the IAM roles and permissions, see the [IAM documentation](https://cloud.google.com/iam/docs/roles-overview). For a list of the available pre-defined roles, see [here](https://cloud.google.com/iam/docs/understanding-roles).", "type": "string" } }, diff --git a/networkconnectivity/v1alpha1/networkconnectivity-gen.go b/networkconnectivity/v1alpha1/networkconnectivity-gen.go index 77977a76fa3..04e613df806 100644 --- a/networkconnectivity/v1alpha1/networkconnectivity-gen.go +++ b/networkconnectivity/v1alpha1/networkconnectivity-gen.go @@ -413,7 +413,11 @@ type Binding struct { Members []string `json:"members,omitempty"` // Role: Role that is assigned to the list of `members`, or principals. - // For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + // For example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an + // overview of the IAM roles and permissions, see the IAM documentation + // (https://cloud.google.com/iam/docs/roles-overview). For a list of the + // available pre-defined roles, see here + // (https://cloud.google.com/iam/docs/understanding-roles). Role string `json:"role,omitempty"` // ForceSendFields is a list of field names (e.g. "Condition") to diff --git a/run/v1/run-api.json b/run/v1/run-api.json index 2ab51db206c..8802797b0cc 100644 --- a/run/v1/run-api.json +++ b/run/v1/run-api.json @@ -16,6 +16,11 @@ "discoveryVersion": "v1", "documentationLink": "https://cloud.google.com/run/", "endpoints": [ + { + "description": "Locational Endpoint", + "endpointUrl": "https://africa-south1-run.googleapis.com/", + "location": "africa-south1" + }, { "description": "Locational Endpoint", "endpointUrl": "https://asia-east1-run.googleapis.com/", @@ -2609,7 +2614,7 @@ } } }, - "revision": "20240128", + "revision": "20240204", "rootUrl": "https://run.googleapis.com/", "schemas": { "Addressable": { @@ -4022,7 +4027,7 @@ "additionalProperties": { "type": "string" }, - "description": "Unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. In Cloud Run, annotations with 'run.googleapis.com/' and 'autoscaling.knative.dev' are restricted, and the accepted annotations will be different depending on the resource type. * `autoscaling.knative.dev/maxScale`: Revision. * `autoscaling.knative.dev/minScale`: Revision. * `run.googleapis.com/binary-authorization-breakglass`: Service, Job, * `run.googleapis.com/binary-authorization`: Service, Job, Execution. * `run.googleapis.com/client-name`: All resources. * `run.googleapis.com/cloudsql-instances`: Revision, Execution. * `run.googleapis.com/container-dependencies`: Revision . * `run.googleapis.com/cpu-throttling`: Revision. * `run.googleapis.com/custom-audiences`: Service. * `run.googleapis.com/description`: Service. * `run.googleapis.com/encryption-key-shutdown-hours`: Revision * `run.googleapis.com/encryption-key`: Revision, Execution. * `run.googleapis.com/execution-environment`: Revision, Execution. * `run.googleapis.com/gc-traffic-tags`: Service. * `run.googleapis.com/ingress`: Service. * `run.googleapis.com/launch-stage`: Service, Job. * `run.googleapis.com/minScale`: Service (ALPHA) * `run.googleapis.com/network-interfaces`: Revision, Execution. * `run.googleapis.com/post-key-revocation-action-type`: Revision. * `run.googleapis.com/secrets`: Revision, Execution. * `run.googleapis.com/secure-session-agent`: Revision. * `run.googleapis.com/sessionAffinity`: Revision. * `run.googleapis.com/startup-cpu-boost`: Revision. * `run.googleapis.com/vpc-access-connector`: Revision, Execution. * `run.googleapis.com/vpc-access-egress`: Revision, Execution.", + "description": "Unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. In Cloud Run, annotations with 'run.googleapis.com/' and 'autoscaling.knative.dev' are restricted, and the accepted annotations will be different depending on the resource type. * `autoscaling.knative.dev/maxScale`: Revision. * `autoscaling.knative.dev/minScale`: Revision. * `run.googleapis.com/binary-authorization-breakglass`: Service, Job, * `run.googleapis.com/binary-authorization`: Service, Job, Execution. * `run.googleapis.com/client-name`: All resources. * `run.googleapis.com/cloudsql-instances`: Revision, Execution. * `run.googleapis.com/container-dependencies`: Revision . * `run.googleapis.com/cpu-throttling`: Revision. * `run.googleapis.com/custom-audiences`: Service. * `run.googleapis.com/default-url-disabled`: Service. * `run.googleapis.com/description`: Service. * `run.googleapis.com/encryption-key-shutdown-hours`: Revision * `run.googleapis.com/encryption-key`: Revision, Execution. * `run.googleapis.com/execution-environment`: Revision, Execution. * `run.googleapis.com/gc-traffic-tags`: Service. * `run.googleapis.com/ingress`: Service. * `run.googleapis.com/launch-stage`: Service, Job. * `run.googleapis.com/minScale`: Service (ALPHA) * `run.googleapis.com/network-interfaces`: Revision, Execution. * `run.googleapis.com/post-key-revocation-action-type`: Revision. * `run.googleapis.com/secrets`: Revision, Execution. * `run.googleapis.com/secure-session-agent`: Revision. * `run.googleapis.com/sessionAffinity`: Revision. * `run.googleapis.com/startup-cpu-boost`: Revision. * `run.googleapis.com/vpc-access-connector`: Revision, Execution. * `run.googleapis.com/vpc-access-egress`: Revision, Execution.", "type": "object" }, "clusterName": { diff --git a/run/v1/run-gen.go b/run/v1/run-gen.go index 4427e070b45..e9a1f632966 100644 --- a/run/v1/run-gen.go +++ b/run/v1/run-gen.go @@ -2958,6 +2958,7 @@ type ObjectMeta struct { // `run.googleapis.com/container-dependencies`: Revision . * // `run.googleapis.com/cpu-throttling`: Revision. * // `run.googleapis.com/custom-audiences`: Service. * + // `run.googleapis.com/default-url-disabled`: Service. * // `run.googleapis.com/description`: Service. * // `run.googleapis.com/encryption-key-shutdown-hours`: Revision * // `run.googleapis.com/encryption-key`: Revision, Execution. * diff --git a/run/v2/run-api.json b/run/v2/run-api.json index 9dc47300228..f89ba99c200 100644 --- a/run/v2/run-api.json +++ b/run/v2/run-api.json @@ -16,6 +16,11 @@ "discoveryVersion": "v1", "documentationLink": "https://cloud.google.com/run/", "endpoints": [ + { + "description": "Locational Endpoint", + "endpointUrl": "https://africa-south1-run.googleapis.com/", + "location": "africa-south1" + }, { "description": "Locational Endpoint", "endpointUrl": "https://asia-east1-run.googleapis.com/", @@ -1312,7 +1317,7 @@ } } }, - "revision": "20240128", + "revision": "20240204", "rootUrl": "https://run.googleapis.com/", "schemas": { "GoogleCloudRunV2BinaryAuthorization": { diff --git a/sqladmin/v1/sqladmin-api.json b/sqladmin/v1/sqladmin-api.json index b2b98b11ff0..507edd28fa5 100644 --- a/sqladmin/v1/sqladmin-api.json +++ b/sqladmin/v1/sqladmin-api.json @@ -2200,7 +2200,7 @@ } } }, - "revision": "20240201", + "revision": "20240205", "rootUrl": "https://sqladmin.googleapis.com/", "schemas": { "AclEntry": { @@ -3122,7 +3122,7 @@ "type": "string" }, "region": { - "description": "The geographical region. Can be: * `us-central` (`FIRST_GEN` instances only) * `us-central1` (`SECOND_GEN` instances only) * `asia-east1` or `europe-west1`. Defaults to `us-central` or `us-central1` depending on the instance type. The region cannot be changed after instance creation.", + "description": "The geographical region of the Cloud SQL instance. It can be one of the [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r) where Cloud SQL operates: For example, `asia-east1`, `europe-west1`, and `us-central1`. The default value is `us-central1`.", "type": "string" }, "replicaConfiguration": { @@ -4203,7 +4203,7 @@ "The SSL mode is unknown.", "Allow non-SSL/non-TLS and SSL/TLS connections. For SSL/TLS connections, the client certificate won't be verified. When this value is used, the legacy `require_ssl` flag must be false or cleared to avoid the conflict between values of two flags.", "Only allow connections encrypted with SSL/TLS. When this value is used, the legacy `require_ssl` flag must be false or cleared to avoid the conflict between values of two flags.", - "Only allow connections encrypted with SSL/TLS and with valid client certificates. When this value is used, the legacy `require_ssl` flag must be true or cleared to avoid the conflict between values of two flags." + "Only allow connections encrypted with SSL/TLS and with valid client certificates. When this value is used, the legacy `require_ssl` flag must be true or cleared to avoid the conflict between values of two flags. PostgreSQL clients or users that connect using IAM database authentication must use either the [Cloud SQL Auth Proxy](https://cloud.google.com/sql/docs/postgres/connect-auth-proxy) or [Cloud SQL Connectors](https://cloud.google.com/sql/docs/postgres/connect-connectors) to enforce client identity verification." ], "type": "string" } @@ -4763,7 +4763,8 @@ "type": "string" }, "disallowCompromisedCredentials": { - "description": "Disallow credentials that have been previously compromised by a public data breach.", + "deprecated": true, + "description": "This field is deprecated and will be removed in a future version of the API.", "type": "boolean" }, "disallowUsernameSubstring": { @@ -5220,7 +5221,9 @@ "INCOMPATIBLE_DATABASE_MINOR_VERSION", "SOURCE_MAX_SUBSCRIPTIONS", "UNABLE_TO_VERIFY_DEFINERS", - "SUBSCRIPTION_CALCULATION_STATUS" + "SUBSCRIPTION_CALCULATION_STATUS", + "PG_SUBSCRIPTION_COUNT", + "PG_SYNC_PARALLEL_LEVEL" ], "enumDescriptions": [ "", @@ -5263,7 +5266,9 @@ "The minor version of replica database is incompatible with the source.", "This warning message indicates that Cloud SQL uses the maximum number of subscriptions to migrate data from the source to the destination.", "Unable to verify definers on the source for MySQL.", - "If a time out occurs while the subscription counts are calculated, then this value is set to 1. Otherwise, this value is set to 2." + "If a time out occurs while the subscription counts are calculated, then this value is set to 1. Otherwise, this value is set to 2.", + "Count of subscriptions needed to sync source data for PostgreSQL database.", + "Final parallel level that is used to do migration." ], "type": "string" } diff --git a/sqladmin/v1/sqladmin-gen.go b/sqladmin/v1/sqladmin-gen.go index 218dcc663e0..8cf1ce79f65 100644 --- a/sqladmin/v1/sqladmin-gen.go +++ b/sqladmin/v1/sqladmin-gen.go @@ -1292,11 +1292,11 @@ type DatabaseInstance struct { // of PSC instance. PscServiceAttachmentLink string `json:"pscServiceAttachmentLink,omitempty"` - // Region: The geographical region. Can be: * `us-central` (`FIRST_GEN` - // instances only) * `us-central1` (`SECOND_GEN` instances only) * - // `asia-east1` or `europe-west1`. Defaults to `us-central` or - // `us-central1` depending on the instance type. The region cannot be - // changed after instance creation. + // Region: The geographical region of the Cloud SQL instance. It can be + // one of the regions + // (https://cloud.google.com/sql/docs/mysql/locations#location-r) where + // Cloud SQL operates: For example, `asia-east1`, `europe-west1`, and + // `us-central1`. The default value is `us-central1`. Region string `json:"region,omitempty"` // ReplicaConfiguration: Configuration specific to failover replicas and @@ -3055,7 +3055,13 @@ type IpConfiguration struct { // "TRUSTED_CLIENT_CERTIFICATE_REQUIRED" - Only allow connections // encrypted with SSL/TLS and with valid client certificates. When this // value is used, the legacy `require_ssl` flag must be true or cleared - // to avoid the conflict between values of two flags. + // to avoid the conflict between values of two flags. PostgreSQL clients + // or users that connect using IAM database authentication must use + // either the [Cloud SQL Auth + // Proxy](https://cloud.google.com/sql/docs/postgres/connect-auth-proxy) + // or [Cloud SQL + // Connectors](https://cloud.google.com/sql/docs/postgres/connect-connect + // ors) to enforce client identity verification. SslMode string `json:"sslMode,omitempty"` // ForceSendFields is a list of field names (e.g. "AllocatedIpRange") to @@ -3750,8 +3756,8 @@ type PasswordValidationPolicy struct { // numeric, and non-alphanumeric characters. Complexity string `json:"complexity,omitempty"` - // DisallowCompromisedCredentials: Disallow credentials that have been - // previously compromised by a public data breach. + // DisallowCompromisedCredentials: This field is deprecated and will be + // removed in a future version of the API. DisallowCompromisedCredentials bool `json:"disallowCompromisedCredentials,omitempty"` // DisallowUsernameSubstring: Disallow username as a part of the @@ -4375,6 +4381,10 @@ type SqlExternalSyncSettingError struct { // "SUBSCRIPTION_CALCULATION_STATUS" - If a time out occurs while the // subscription counts are calculated, then this value is set to 1. // Otherwise, this value is set to 2. + // "PG_SUBSCRIPTION_COUNT" - Count of subscriptions needed to sync + // source data for PostgreSQL database. + // "PG_SYNC_PARALLEL_LEVEL" - Final parallel level that is used to do + // migration. Type string `json:"type,omitempty"` // ForceSendFields is a list of field names (e.g. "Detail") to diff --git a/sqladmin/v1beta4/sqladmin-api.json b/sqladmin/v1beta4/sqladmin-api.json index 010648f4f7b..af9071f1943 100644 --- a/sqladmin/v1beta4/sqladmin-api.json +++ b/sqladmin/v1beta4/sqladmin-api.json @@ -2200,7 +2200,7 @@ } } }, - "revision": "20240201", + "revision": "20240205", "rootUrl": "https://sqladmin.googleapis.com/", "schemas": { "AclEntry": { @@ -3122,7 +3122,7 @@ "type": "string" }, "region": { - "description": "The geographical region. Can be: * `us-central` (`FIRST_GEN` instances only) * `us-central1` (`SECOND_GEN` instances only) * `asia-east1` or `europe-west1`. Defaults to `us-central` or `us-central1` depending on the instance type. The region cannot be changed after instance creation.", + "description": "The geographical region of the Cloud SQL instance. It can be one of the [regions](https://cloud.google.com/sql/docs/mysql/locations#location-r) where Cloud SQL operates: For example, `asia-east1`, `europe-west1`, and `us-central1`. The default value is `us-central1`.", "type": "string" }, "replicaConfiguration": { @@ -4204,7 +4204,7 @@ "The SSL mode is unknown.", "Allow non-SSL/non-TLS and SSL/TLS connections. For SSL/TLS connections, the client certificate won't be verified. When this value is used, the legacy `require_ssl` flag must be false or cleared to avoid the conflict between values of two flags.", "Only allow connections encrypted with SSL/TLS. When this value is used, the legacy `require_ssl` flag must be false or cleared to avoid the conflict between values of two flags.", - "Only allow connections encrypted with SSL/TLS and with valid client certificates. When this value is used, the legacy `require_ssl` flag must be true or cleared to avoid the conflict between values of two flags." + "Only allow connections encrypted with SSL/TLS and with valid client certificates. When this value is used, the legacy `require_ssl` flag must be true or cleared to avoid the conflict between values of two flags. PostgreSQL clients or users that connect using IAM database authentication must use either the [Cloud SQL Auth Proxy](https://cloud.google.com/sql/docs/postgres/connect-auth-proxy) or [Cloud SQL Connectors](https://cloud.google.com/sql/docs/postgres/connect-connectors) to enforce client identity verification." ], "type": "string" } @@ -4764,7 +4764,8 @@ "type": "string" }, "disallowCompromisedCredentials": { - "description": "Disallow credentials that have been previously compromised by a public data breach.", + "deprecated": true, + "description": "This field is deprecated and will be removed in a future version of the API.", "type": "boolean" }, "disallowUsernameSubstring": { @@ -5221,7 +5222,9 @@ "INCOMPATIBLE_DATABASE_MINOR_VERSION", "SOURCE_MAX_SUBSCRIPTIONS", "UNABLE_TO_VERIFY_DEFINERS", - "SUBSCRIPTION_CALCULATION_STATUS" + "SUBSCRIPTION_CALCULATION_STATUS", + "PG_SUBSCRIPTION_COUNT", + "PG_SYNC_PARALLEL_LEVEL" ], "enumDescriptions": [ "", @@ -5264,7 +5267,9 @@ "The minor version of replica database is incompatible with the source.", "This warning message indicates that Cloud SQL uses the maximum number of subscriptions to migrate data from the source to the destination.", "Unable to verify definers on the source for MySQL.", - "If a time out occurs while the subscription counts are calculated, then this value is set to 1. Otherwise, this value is set to 2." + "If a time out occurs while the subscription counts are calculated, then this value is set to 1. Otherwise, this value is set to 2.", + "Count of subscriptions needed to sync source data for PostgreSQL database.", + "Final parallel level that is used to do migration." ], "type": "string" } diff --git a/sqladmin/v1beta4/sqladmin-gen.go b/sqladmin/v1beta4/sqladmin-gen.go index 0b9f1d85969..1c7d16da35e 100644 --- a/sqladmin/v1beta4/sqladmin-gen.go +++ b/sqladmin/v1beta4/sqladmin-gen.go @@ -1291,11 +1291,11 @@ type DatabaseInstance struct { // of PSC instance. PscServiceAttachmentLink string `json:"pscServiceAttachmentLink,omitempty"` - // Region: The geographical region. Can be: * `us-central` (`FIRST_GEN` - // instances only) * `us-central1` (`SECOND_GEN` instances only) * - // `asia-east1` or `europe-west1`. Defaults to `us-central` or - // `us-central1` depending on the instance type. The region cannot be - // changed after instance creation. + // Region: The geographical region of the Cloud SQL instance. It can be + // one of the regions + // (https://cloud.google.com/sql/docs/mysql/locations#location-r) where + // Cloud SQL operates: For example, `asia-east1`, `europe-west1`, and + // `us-central1`. The default value is `us-central1`. Region string `json:"region,omitempty"` // ReplicaConfiguration: Configuration specific to failover replicas and @@ -3060,7 +3060,13 @@ type IpConfiguration struct { // "TRUSTED_CLIENT_CERTIFICATE_REQUIRED" - Only allow connections // encrypted with SSL/TLS and with valid client certificates. When this // value is used, the legacy `require_ssl` flag must be true or cleared - // to avoid the conflict between values of two flags. + // to avoid the conflict between values of two flags. PostgreSQL clients + // or users that connect using IAM database authentication must use + // either the [Cloud SQL Auth + // Proxy](https://cloud.google.com/sql/docs/postgres/connect-auth-proxy) + // or [Cloud SQL + // Connectors](https://cloud.google.com/sql/docs/postgres/connect-connect + // ors) to enforce client identity verification. SslMode string `json:"sslMode,omitempty"` // ForceSendFields is a list of field names (e.g. "AllocatedIpRange") to @@ -3755,8 +3761,8 @@ type PasswordValidationPolicy struct { // numeric, and non-alphanumeric characters. Complexity string `json:"complexity,omitempty"` - // DisallowCompromisedCredentials: Disallow credentials that have been - // previously compromised by a public data breach. + // DisallowCompromisedCredentials: This field is deprecated and will be + // removed in a future version of the API. DisallowCompromisedCredentials bool `json:"disallowCompromisedCredentials,omitempty"` // DisallowUsernameSubstring: Disallow username as a part of the @@ -4379,6 +4385,10 @@ type SqlExternalSyncSettingError struct { // "SUBSCRIPTION_CALCULATION_STATUS" - If a time out occurs while the // subscription counts are calculated, then this value is set to 1. // Otherwise, this value is set to 2. + // "PG_SUBSCRIPTION_COUNT" - Count of subscriptions needed to sync + // source data for PostgreSQL database. + // "PG_SYNC_PARALLEL_LEVEL" - Final parallel level that is used to do + // migration. Type string `json:"type,omitempty"` // ForceSendFields is a list of field names (e.g. "Detail") to diff --git a/storage/v1/storage-api.json b/storage/v1/storage-api.json index 54b059050fd..6535d954c78 100644 --- a/storage/v1/storage-api.json +++ b/storage/v1/storage-api.json @@ -33,7 +33,7 @@ "location": "me-central2" } ], - "etag": "\"36373537363133393131323733353738333730\"", + "etag": "\"3136303536373738333537393834303934353433\"", "icons": { "x16": "https://www.google.com/images/icons/product/cloud_storage-16.png", "x32": "https://www.google.com/images/icons/product/cloud_storage-32.png" @@ -1632,6 +1632,11 @@ "managedFolder" ], "parameters": { + "allowNonEmpty": { + "description": "Allows the deletion of a managed folder even if it is not empty. A managed folder is empty if there are no objects or managed folders that it applies to. Callers must have storage.managedFolders.setIamPolicy permission.", + "location": "query", + "type": "boolean" + }, "bucket": { "description": "Name of the bucket containing the managed folder.", "location": "path", @@ -4040,7 +4045,7 @@ } } }, - "revision": "20240202", + "revision": "20240205", "rootUrl": "https://storage.googleapis.com/", "schemas": { "AnywhereCache": { diff --git a/storage/v1/storage-gen.go b/storage/v1/storage-gen.go index bd7b76962de..f540f7c8382 100644 --- a/storage/v1/storage-gen.go +++ b/storage/v1/storage-gen.go @@ -9452,6 +9452,16 @@ func (r *ManagedFoldersService) Delete(bucket string, managedFolder string) *Man return c } +// AllowNonEmpty sets the optional parameter "allowNonEmpty": Allows the +// deletion of a managed folder even if it is not empty. A managed +// folder is empty if there are no objects or managed folders that it +// applies to. Callers must have storage.managedFolders.setIamPolicy +// permission. +func (c *ManagedFoldersDeleteCall) AllowNonEmpty(allowNonEmpty bool) *ManagedFoldersDeleteCall { + c.urlParams_.Set("allowNonEmpty", fmt.Sprint(allowNonEmpty)) + return c +} + // IfMetagenerationMatch sets the optional parameter // "ifMetagenerationMatch": If set, only deletes the managed folder if // its metageneration matches this value. @@ -9538,6 +9548,11 @@ func (c *ManagedFoldersDeleteCall) Do(opts ...googleapi.CallOption) error { // "managedFolder" // ], // "parameters": { + // "allowNonEmpty": { + // "description": "Allows the deletion of a managed folder even if it is not empty. A managed folder is empty if there are no objects or managed folders that it applies to. Callers must have storage.managedFolders.setIamPolicy permission.", + // "location": "query", + // "type": "boolean" + // }, // "bucket": { // "description": "Name of the bucket containing the managed folder.", // "location": "path", diff --git a/testing/v1/testing-api.json b/testing/v1/testing-api.json index 5ed705e5560..470922f64ef 100644 --- a/testing/v1/testing-api.json +++ b/testing/v1/testing-api.json @@ -114,7 +114,13 @@ "httpMethod": "POST", "id": "testing.applicationDetailService.getApkDetails", "parameterOrder": [], - "parameters": {}, + "parameters": { + "bundleLocation.gcsPath": { + "description": "A path to a file in Google Cloud Storage. Example: gs://build-app-1414623860166/app%40debug-unaligned.apk These paths are expected to be url encoded (percent encoding)", + "location": "query", + "type": "string" + } + }, "path": "v1/applicationDetailService/getApkDetails", "request": { "$ref": "FileReference" @@ -442,7 +448,7 @@ } } }, - "revision": "20231027", + "revision": "20240206", "rootUrl": "https://testing.googleapis.com/", "schemas": { "Account": { @@ -896,7 +902,7 @@ "type": "object" }, "ApkDetail": { - "description": "Android application details based on application manifest and apk archive contents.", + "description": "Android application details based on application manifest and archive contents.", "id": "ApkDetail", "properties": { "apkManifest": { @@ -1327,12 +1333,12 @@ "type": "object" }, "GetApkDetailsResponse": { - "description": "Response containing the details of the specified Android application APK.", + "description": "Response containing the details of the specified Android application.", "id": "GetApkDetailsResponse", "properties": { "apkDetail": { "$ref": "ApkDetail", - "description": "Details of the Android APK." + "description": "Details of the Android App." } }, "type": "object" @@ -1762,6 +1768,23 @@ }, "type": "object" }, + "MatrixErrorDetail": { + "description": "Describes a single error or issue with a matrix.", + "id": "MatrixErrorDetail", + "properties": { + "message": { + "description": "Output only. A human-readable message about how the error in the TestMatrix. Expands on the `reason` field with additional details and possible options to fix the issue.", + "readOnly": true, + "type": "string" + }, + "reason": { + "description": "Output only. The reason for the error. This is a constant value in UPPER_SNAKE_CASE that identifies the cause of the error.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, "Metadata": { "description": "A tag within a manifest. https://developer.android.com/guide/topics/manifest/meta-data-element.html", "id": "Metadata", @@ -2309,6 +2332,14 @@ "$ref": "EnvironmentMatrix", "description": "Required. The devices the tests are being executed on." }, + "extendedInvalidMatrixDetails": { + "description": "Output only. Details about why a matrix was deemed invalid. If multiple checks can be safely performed, they will be reported but no assumptions should be made about the length of this list.", + "items": { + "$ref": "MatrixErrorDetail" + }, + "readOnly": true, + "type": "array" + }, "failFast": { "description": "If true, only a single attempt at most will be made to run each execution/shard in the matrix. Flaky test attempts are not affected. Normally, 2 or more attempts are made if a potential infrastructure issue is detected. This feature is for latency sensitive workloads. The incidence of execution failures may be significantly greater for fail-fast matrices and support is more limited because of that expectation.", "type": "boolean" diff --git a/testing/v1/testing-gen.go b/testing/v1/testing-gen.go index eeb4227a9d8..93bbce81ad1 100644 --- a/testing/v1/testing-gen.go +++ b/testing/v1/testing-gen.go @@ -841,7 +841,7 @@ func (s *Apk) MarshalJSON() ([]byte, error) { } // ApkDetail: Android application details based on application manifest -// and apk archive contents. +// and archive contents. type ApkDetail struct { ApkManifest *ApkManifest `json:"apkManifest,omitempty"` @@ -1573,9 +1573,9 @@ func (s *FileReference) MarshalJSON() ([]byte, error) { } // GetApkDetailsResponse: Response containing the details of the -// specified Android application APK. +// specified Android application. type GetApkDetailsResponse struct { - // ApkDetail: Details of the Android APK. + // ApkDetail: Details of the Android App. ApkDetail *ApkDetail `json:"apkDetail,omitempty"` // ServerResponse contains the HTTP response code and headers from the @@ -2278,6 +2278,40 @@ func (s *ManualSharding) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// MatrixErrorDetail: Describes a single error or issue with a matrix. +type MatrixErrorDetail struct { + // Message: Output only. A human-readable message about how the error in + // the TestMatrix. Expands on the `reason` field with additional details + // and possible options to fix the issue. + Message string `json:"message,omitempty"` + + // Reason: Output only. The reason for the error. This is a constant + // value in UPPER_SNAKE_CASE that identifies the cause of the error. + Reason string `json:"reason,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Message") to + // unconditionally include in API requests. By default, fields with + // empty or default values are omitted from API requests. However, any + // non-pointer, non-interface field appearing in ForceSendFields will be + // sent to the server regardless of whether the field is empty or not. + // This may be used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Message") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *MatrixErrorDetail) MarshalJSON() ([]byte, error) { + type NoMethod MatrixErrorDetail + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // Metadata: A tag within a manifest. // https://developer.android.com/guide/topics/manifest/meta-data-element.html type Metadata struct { @@ -3261,6 +3295,12 @@ type TestMatrix struct { // on. EnvironmentMatrix *EnvironmentMatrix `json:"environmentMatrix,omitempty"` + // ExtendedInvalidMatrixDetails: Output only. Details about why a matrix + // was deemed invalid. If multiple checks can be safely performed, they + // will be reported but no assumptions should be made about the length + // of this list. + ExtendedInvalidMatrixDetails []*MatrixErrorDetail `json:"extendedInvalidMatrixDetails,omitempty"` + // FailFast: If true, only a single attempt at most will be made to run // each execution/shard in the matrix. Flaky test attempts are not // affected. Normally, 2 or more attempts are made if a potential @@ -3922,6 +3962,15 @@ func (r *ApplicationDetailServiceService) GetApkDetails(filereference *FileRefer return c } +// BundleLocationGcsPath sets the optional parameter +// "bundleLocation.gcsPath": A path to a file in Google Cloud Storage. +// Example: gs://build-app-1414623860166/app%40debug-unaligned.apk These +// paths are expected to be url encoded (percent encoding) +func (c *ApplicationDetailServiceGetApkDetailsCall) BundleLocationGcsPath(bundleLocationGcsPath string) *ApplicationDetailServiceGetApkDetailsCall { + c.urlParams_.Set("bundleLocation.gcsPath", bundleLocationGcsPath) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. @@ -4015,7 +4064,13 @@ func (c *ApplicationDetailServiceGetApkDetailsCall) Do(opts ...googleapi.CallOpt // "httpMethod": "POST", // "id": "testing.applicationDetailService.getApkDetails", // "parameterOrder": [], - // "parameters": {}, + // "parameters": { + // "bundleLocation.gcsPath": { + // "description": "A path to a file in Google Cloud Storage. Example: gs://build-app-1414623860166/app%40debug-unaligned.apk These paths are expected to be url encoded (percent encoding)", + // "location": "query", + // "type": "string" + // } + // }, // "path": "v1/applicationDetailService/getApkDetails", // "request": { // "$ref": "FileReference" diff --git a/trafficdirector/v3/trafficdirector-api.json b/trafficdirector/v3/trafficdirector-api.json index 0e96f293f26..1a072df0ee3 100644 --- a/trafficdirector/v3/trafficdirector-api.json +++ b/trafficdirector/v3/trafficdirector-api.json @@ -128,7 +128,7 @@ } } }, - "revision": "20231101", + "revision": "20240201", "rootUrl": "https://trafficdirector.googleapis.com/", "schemas": { "Address": { @@ -171,6 +171,10 @@ "description": "All xds configs for a particular client.", "id": "ClientConfig", "properties": { + "clientScope": { + "description": "For xDS clients, the scope in which the data is used. For example, gRPC indicates the data plane target or that the data is associated with gRPC server(s).", + "type": "string" + }, "genericXdsConfigs": { "description": "Represents generic xDS config and the exact config structure depends on the type URL (like Cluster if it is CDS)", "items": { diff --git a/trafficdirector/v3/trafficdirector-gen.go b/trafficdirector/v3/trafficdirector-gen.go index b2678feba11..1277c50f3ba 100644 --- a/trafficdirector/v3/trafficdirector-gen.go +++ b/trafficdirector/v3/trafficdirector-gen.go @@ -237,6 +237,11 @@ func (s *BuildVersion) MarshalJSON() ([]byte, error) { // ClientConfig: All xds configs for a particular client. type ClientConfig struct { + // ClientScope: For xDS clients, the scope in which the data is used. + // For example, gRPC indicates the data plane target or that the data is + // associated with gRPC server(s). + ClientScope string `json:"clientScope,omitempty"` + // GenericXdsConfigs: Represents generic xDS config and the exact config // structure depends on the type URL (like Cluster if it is CDS) GenericXdsConfigs []*GenericXdsConfig `json:"genericXdsConfigs,omitempty"` @@ -248,21 +253,20 @@ type ClientConfig struct { // which is much simpler and uniform in structure. XdsConfig []*PerXdsConfig `json:"xdsConfig,omitempty"` - // ForceSendFields is a list of field names (e.g. "GenericXdsConfigs") - // to unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "ClientScope") to + // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any // non-pointer, non-interface field appearing in ForceSendFields will be // sent to the server regardless of whether the field is empty or not. // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "GenericXdsConfigs") to - // include in API requests with the JSON null value. By default, fields - // with empty values are omitted from API requests. However, any field - // with an empty value appearing in NullFields will be sent to the - // server as null. It is an error if a field in this list has a - // non-empty value. This may be used to include null fields in Patch - // requests. + // NullFields is a list of field names (e.g. "ClientScope") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` }