From 6fde9e84b13e64b4398894db538e51a568eae2ba Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 14 Jul 2022 08:47:30 -0700 Subject: [PATCH] feat(all): auto-regenerate discovery clients (#1619) --- beyondcorp/v1alpha/beyondcorp-api.json | 262 +- beyondcorp/v1alpha/beyondcorp-gen.go | 318 +- cloudfunctions/v1/cloudfunctions-api.json | 149 +- cloudfunctions/v1/cloudfunctions-gen.go | 155 + cloudfunctions/v2/cloudfunctions-api.json | 1071 ++++++- cloudfunctions/v2/cloudfunctions-gen.go | 2761 +++++++++++++++-- .../v2alpha/cloudfunctions-api.json | 149 +- cloudfunctions/v2alpha/cloudfunctions-gen.go | 155 + cloudfunctions/v2beta/cloudfunctions-api.json | 149 +- cloudfunctions/v2beta/cloudfunctions-gen.go | 155 + cloudtasks/v2beta2/cloudtasks-api.json | 278 +- cloudtasks/v2beta2/cloudtasks-gen.go | 638 ++++ compute/v1/compute-api.json | 22 +- compute/v1/compute-gen.go | 25 +- datacatalog/v1/datacatalog-api.json | 33 +- datacatalog/v1/datacatalog-gen.go | 40 + domains/v1/domains-api.json | 4 +- domains/v1/domains-gen.go | 6 +- domains/v1beta1/domains-api.json | 4 +- domains/v1beta1/domains-gen.go | 6 +- drive/v2/drive-api.json | 388 ++- drive/v2/drive-gen.go | 840 ++++- drive/v3/drive-api.json | 368 ++- drive/v3/drive-gen.go | 788 ++++- memcache/v1beta2/memcache-api.json | 6 +- memcache/v1beta2/memcache-gen.go | 10 +- ondemandscanning/v1/ondemandscanning-api.json | 29 +- ondemandscanning/v1/ondemandscanning-gen.go | 43 +- .../v1beta1/ondemandscanning-api.json | 29 +- .../v1beta1/ondemandscanning-gen.go | 43 +- retail/v2/retail-api.json | 4 +- retail/v2/retail-gen.go | 2 +- retail/v2alpha/retail-api.json | 6 +- retail/v2alpha/retail-gen.go | 9 +- retail/v2beta/retail-api.json | 6 +- retail/v2beta/retail-gen.go | 9 +- run/v1/run-api.json | 4 +- run/v1/run-gen.go | 2 +- run/v2/run-api.json | 14 +- run/v2/run-gen.go | 8 +- 40 files changed, 8660 insertions(+), 328 deletions(-) diff --git a/beyondcorp/v1alpha/beyondcorp-api.json b/beyondcorp/v1alpha/beyondcorp-api.json index 76b9a055478..1ad1f097d4b 100644 --- a/beyondcorp/v1alpha/beyondcorp-api.json +++ b/beyondcorp/v1alpha/beyondcorp-api.json @@ -12,7 +12,7 @@ "baseUrl": "https://beyondcorp.googleapis.com/", "batchPath": "batch", "canonicalName": "BeyondCorp", - "description": "Beyondcorp Enterprise provides identity and context aware access controls for enterprise resources and enables zero-trust access. Using the Beyondcorp Enterprise APIs, enterprises can set up multi-cloud and on-prem connectivity using the App Connector hybrid connectivity solution.", + "description": "Beyondcorp Enterprise provides identity and context aware access controls for enterprise resources and enables zero-trust access. Using the Beyondcorp Enterprise APIs, enterprises can set up multi-cloud and on-prem connectivity solutions.", "discoveryVersion": "v1", "documentationLink": "https://cloud.google.com/", "fullyEncodeReservedExpansion": true, @@ -1384,7 +1384,7 @@ "type": "string" }, "updateMask": { - "description": "Required. Field mask is used to specify the fields to be overwritten in the ClientConnectorService resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten. Mutable fields: display_name.", + "description": "Required. Field mask is used to specify the fields to be overwritten in the ClientConnectorService resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten. Mutable fields: display_name, ingress.config.destination_routes.", "format": "google-fieldmask", "location": "query", "type": "string" @@ -2499,7 +2499,7 @@ } } }, - "revision": "20220616", + "revision": "20220712", "rootUrl": "https://beyondcorp.googleapis.com/", "schemas": { "AllocatedConnection": { @@ -3375,6 +3375,50 @@ }, "type": "object" }, + "GoogleCloudBeyondcorpAppconnectionsV1AppConnectionOperationMetadata": { + "description": "Represents the metadata of the long-running operation.", + "id": "GoogleCloudBeyondcorpAppconnectionsV1AppConnectionOperationMetadata", + "properties": { + "apiVersion": { + "description": "Output only. API version used to start the operation.", + "readOnly": true, + "type": "string" + }, + "createTime": { + "description": "Output only. The time the operation was created.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "endTime": { + "description": "Output only. The time the operation finished running.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "requestedCancellation": { + "description": "Output only. Identifies whether the user has requested cancellation of the operation. Operations that have successfully been cancelled have Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.", + "readOnly": true, + "type": "boolean" + }, + "statusMessage": { + "description": "Output only. Human-readable status of the operation, if any.", + "readOnly": true, + "type": "string" + }, + "target": { + "description": "Output only. Server-defined resource path for the target of the operation.", + "readOnly": true, + "type": "string" + }, + "verb": { + "description": "Output only. Name of the verb executed by the operation.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudBeyondcorpAppconnectionsV1alphaAppConnection": { "description": "A BeyondCorp AppConnection resource represents a BeyondCorp protected AppConnection to a remote application. It creates all the necessary GCP components needed for creating a BeyondCorp protected AppConnection. Multiple connectors can be authorised for a single AppConnection.", "id": "GoogleCloudBeyondcorpAppconnectionsV1alphaAppConnection", @@ -3483,7 +3527,7 @@ "id": "GoogleCloudBeyondcorpAppconnectionsV1alphaAppConnectionGateway", "properties": { "appGateway": { - "description": "Required. AppGateway name in following format: projects/{project_id}/locations/{location_id}/appgateways/{gateway_id}", + "description": "Required. AppGateway name in following format: `projects/{project_id}/locations/{location_id}/appgateways/{gateway_id}`", "type": "string" }, "ingressPort": { @@ -3615,7 +3659,7 @@ "description": "A BeyondCorp AppConnection in the project." }, "recentMigVms": { - "description": "If type=GCP_REGIONAL_MIG, contains most recent VM instances, like \"https://www.googleapis.com/compute/v1/projects/{project_id}/zones/{zone_id}/instances/{instance_id}\".", + "description": "If type=GCP_REGIONAL_MIG, contains most recent VM instances, like `https://www.googleapis.com/compute/v1/projects/{project_id}/zones/{zone_id}/instances/{instance_id}`.", "items": { "type": "string" }, @@ -3624,6 +3668,82 @@ }, "type": "object" }, + "GoogleCloudBeyondcorpAppconnectorsV1AppConnectorOperationMetadata": { + "description": "Represents the metadata of the long-running operation.", + "id": "GoogleCloudBeyondcorpAppconnectorsV1AppConnectorOperationMetadata", + "properties": { + "apiVersion": { + "description": "Output only. API version used to start the operation.", + "readOnly": true, + "type": "string" + }, + "createTime": { + "description": "Output only. The time the operation was created.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "endTime": { + "description": "Output only. The time the operation finished running.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "requestedCancellation": { + "description": "Output only. Identifies whether the user has requested cancellation of the operation. Operations that have successfully been cancelled have Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.", + "readOnly": true, + "type": "boolean" + }, + "statusMessage": { + "description": "Output only. Human-readable status of the operation, if any.", + "readOnly": true, + "type": "string" + }, + "target": { + "description": "Output only. Server-defined resource path for the target of the operation.", + "readOnly": true, + "type": "string" + }, + "verb": { + "description": "Output only. Name of the verb executed by the operation.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudBeyondcorpAppconnectorsV1ContainerHealthDetails": { + "description": "ContainerHealthDetails reflects the health details of a container.", + "id": "GoogleCloudBeyondcorpAppconnectorsV1ContainerHealthDetails", + "properties": { + "currentConfigVersion": { + "description": "The version of the current config.", + "type": "string" + }, + "errorMsg": { + "description": "The latest error message.", + "type": "string" + }, + "expectedConfigVersion": { + "description": "The version of the expected config.", + "type": "string" + }, + "extendedStatus": { + "additionalProperties": { + "type": "string" + }, + "description": "The extended status. Such as ExitCode, StartedAt, FinishedAt, etc.", + "type": "object" + } + }, + "type": "object" + }, + "GoogleCloudBeyondcorpAppconnectorsV1RemoteAgentDetails": { + "description": "RemoteAgentDetails reflects the details of a remote agent.", + "id": "GoogleCloudBeyondcorpAppconnectorsV1RemoteAgentDetails", + "properties": {}, + "type": "object" + }, "GoogleCloudBeyondcorpAppconnectorsV1alphaAppConnector": { "description": "A BeyondCorp connector resource that represents an application facing component deployed proximal to and with direct access to the application instances. It is used to establish connectivity between the remote enterprise environment and GCP. It initiates connections to the applications and can proxy the data from users over the connection.", "id": "GoogleCloudBeyondcorpAppconnectorsV1alphaAppConnector", @@ -3959,6 +4079,50 @@ }, "type": "object" }, + "GoogleCloudBeyondcorpAppgatewaysV1AppGatewayOperationMetadata": { + "description": "Represents the metadata of the long-running operation.", + "id": "GoogleCloudBeyondcorpAppgatewaysV1AppGatewayOperationMetadata", + "properties": { + "apiVersion": { + "description": "Output only. API version used to start the operation.", + "readOnly": true, + "type": "string" + }, + "createTime": { + "description": "Output only. The time the operation was created.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "endTime": { + "description": "Output only. The time the operation finished running.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "requestedCancellation": { + "description": "Output only. Identifies whether the user has requested cancellation of the operation. Operations that have successfully been cancelled have Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.", + "readOnly": true, + "type": "boolean" + }, + "statusMessage": { + "description": "Output only. Human-readable status of the operation, if any.", + "readOnly": true, + "type": "string" + }, + "target": { + "description": "Output only. Server-defined resource path for the target of the operation.", + "readOnly": true, + "type": "string" + }, + "verb": { + "description": "Output only. Name of the verb executed by the operation.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudBeyondcorpApplicationsV1alphaApplicationOperationMetadata": { "description": "Represents the metadata of the long-running operation.", "id": "GoogleCloudBeyondcorpApplicationsV1alphaApplicationOperationMetadata", @@ -3998,6 +4162,94 @@ }, "type": "object" }, + "GoogleCloudBeyondcorpClientconnectorservicesV1ClientConnectorServiceOperationMetadata": { + "description": "Represents the metadata of the long-running operation.", + "id": "GoogleCloudBeyondcorpClientconnectorservicesV1ClientConnectorServiceOperationMetadata", + "properties": { + "apiVersion": { + "description": "Output only. API version used to start the operation.", + "readOnly": true, + "type": "string" + }, + "createTime": { + "description": "Output only. The time the operation was created.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "endTime": { + "description": "Output only. The time the operation finished running.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "requestedCancellation": { + "description": "Output only. Identifies whether the user has requested cancellation of the operation. Operations that have successfully been cancelled have Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.", + "readOnly": true, + "type": "boolean" + }, + "statusMessage": { + "description": "Output only. Human-readable status of the operation, if any.", + "readOnly": true, + "type": "string" + }, + "target": { + "description": "Output only. Server-defined resource path for the target of the operation.", + "readOnly": true, + "type": "string" + }, + "verb": { + "description": "Output only. Name of the verb executed by the operation.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudBeyondcorpClientgatewaysV1ClientGatewayOperationMetadata": { + "description": "Represents the metadata of the long-running operation.", + "id": "GoogleCloudBeyondcorpClientgatewaysV1ClientGatewayOperationMetadata", + "properties": { + "apiVersion": { + "description": "Output only. API version used to start the operation.", + "readOnly": true, + "type": "string" + }, + "createTime": { + "description": "Output only. The time the operation was created.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "endTime": { + "description": "Output only. The time the operation finished running.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + }, + "requestedCancellation": { + "description": "Output only. Identifies whether the user has requested cancellation of the operation. Operations that have been cancelled successfully have Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.", + "readOnly": true, + "type": "boolean" + }, + "statusMessage": { + "description": "Output only. Human-readable status of the operation, if any.", + "readOnly": true, + "type": "string" + }, + "target": { + "description": "Output only. Server-defined resource path for the target of the operation.", + "readOnly": true, + "type": "string" + }, + "verb": { + "description": "Output only. Name of the verb executed by the operation.", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudLocationListLocationsResponse": { "description": "The response message for Locations.ListLocations.", "id": "GoogleCloudLocationListLocationsResponse", diff --git a/beyondcorp/v1alpha/beyondcorp-gen.go b/beyondcorp/v1alpha/beyondcorp-gen.go index 2e565faef43..c967dc284c5 100644 --- a/beyondcorp/v1alpha/beyondcorp-gen.go +++ b/beyondcorp/v1alpha/beyondcorp-gen.go @@ -1414,6 +1414,58 @@ func (s *Gateway) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudBeyondcorpAppconnectionsV1AppConnectionOperationMetadata: +// Represents the metadata of the long-running operation. +type GoogleCloudBeyondcorpAppconnectionsV1AppConnectionOperationMetadata struct { + // ApiVersion: Output only. API version used to start the operation. + ApiVersion string `json:"apiVersion,omitempty"` + + // CreateTime: Output only. The time the operation was created. + CreateTime string `json:"createTime,omitempty"` + + // EndTime: Output only. The time the operation finished running. + EndTime string `json:"endTime,omitempty"` + + // RequestedCancellation: Output only. Identifies whether the user has + // requested cancellation of the operation. Operations that have + // successfully been cancelled have Operation.error value with a + // google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + RequestedCancellation bool `json:"requestedCancellation,omitempty"` + + // StatusMessage: Output only. Human-readable status of the operation, + // if any. + StatusMessage string `json:"statusMessage,omitempty"` + + // Target: Output only. Server-defined resource path for the target of + // the operation. + Target string `json:"target,omitempty"` + + // Verb: Output only. Name of the verb executed by the operation. + Verb string `json:"verb,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ApiVersion") 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. "ApiVersion") 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 *GoogleCloudBeyondcorpAppconnectionsV1AppConnectionOperationMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudBeyondcorpAppconnectionsV1AppConnectionOperationMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudBeyondcorpAppconnectionsV1alphaAppConnection: A BeyondCorp // AppConnection resource represents a BeyondCorp protected // AppConnection to a remote application. It creates all the necessary @@ -1543,7 +1595,8 @@ func (s *GoogleCloudBeyondcorpAppconnectionsV1alphaAppConnectionApplicationEndpo // to enable connectivity. type GoogleCloudBeyondcorpAppconnectionsV1alphaAppConnectionGateway struct { // AppGateway: Required. AppGateway name in following format: - // projects/{project_id}/locations/{location_id}/appgateways/{gateway_id} + // `projects/{project_id}/locations/{location_id}/appgateways/{gateway_id + // }` AppGateway string `json:"appGateway,omitempty"` // IngressPort: Output only. Ingress port reserved on the gateways for @@ -1729,8 +1782,8 @@ type GoogleCloudBeyondcorpAppconnectionsV1alphaResolveAppConnectionsResponseAppC // RecentMigVms: If type=GCP_REGIONAL_MIG, contains most recent VM // instances, like - // "https://www.googleapis.com/compute/v1/projects/{project_id}/zones/{zo - // ne_id}/instances/{instance_id}". + // `https://www.googleapis.com/compute/v1/projects/{project_id}/zones/{zo + // ne_id}/instances/{instance_id}`. RecentMigVms []string `json:"recentMigVms,omitempty"` // ForceSendFields is a list of field names (e.g. "AppConnection") to @@ -1756,6 +1809,104 @@ func (s *GoogleCloudBeyondcorpAppconnectionsV1alphaResolveAppConnectionsResponse return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudBeyondcorpAppconnectorsV1AppConnectorOperationMetadata: +// Represents the metadata of the long-running operation. +type GoogleCloudBeyondcorpAppconnectorsV1AppConnectorOperationMetadata struct { + // ApiVersion: Output only. API version used to start the operation. + ApiVersion string `json:"apiVersion,omitempty"` + + // CreateTime: Output only. The time the operation was created. + CreateTime string `json:"createTime,omitempty"` + + // EndTime: Output only. The time the operation finished running. + EndTime string `json:"endTime,omitempty"` + + // RequestedCancellation: Output only. Identifies whether the user has + // requested cancellation of the operation. Operations that have + // successfully been cancelled have Operation.error value with a + // google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + RequestedCancellation bool `json:"requestedCancellation,omitempty"` + + // StatusMessage: Output only. Human-readable status of the operation, + // if any. + StatusMessage string `json:"statusMessage,omitempty"` + + // Target: Output only. Server-defined resource path for the target of + // the operation. + Target string `json:"target,omitempty"` + + // Verb: Output only. Name of the verb executed by the operation. + Verb string `json:"verb,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ApiVersion") 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. "ApiVersion") 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 *GoogleCloudBeyondcorpAppconnectorsV1AppConnectorOperationMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudBeyondcorpAppconnectorsV1AppConnectorOperationMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudBeyondcorpAppconnectorsV1ContainerHealthDetails: +// ContainerHealthDetails reflects the health details of a container. +type GoogleCloudBeyondcorpAppconnectorsV1ContainerHealthDetails struct { + // CurrentConfigVersion: The version of the current config. + CurrentConfigVersion string `json:"currentConfigVersion,omitempty"` + + // ErrorMsg: The latest error message. + ErrorMsg string `json:"errorMsg,omitempty"` + + // ExpectedConfigVersion: The version of the expected config. + ExpectedConfigVersion string `json:"expectedConfigVersion,omitempty"` + + // ExtendedStatus: The extended status. Such as ExitCode, StartedAt, + // FinishedAt, etc. + ExtendedStatus map[string]string `json:"extendedStatus,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "CurrentConfigVersion") 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. "CurrentConfigVersion") 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 *GoogleCloudBeyondcorpAppconnectorsV1ContainerHealthDetails) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudBeyondcorpAppconnectorsV1ContainerHealthDetails + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudBeyondcorpAppconnectorsV1RemoteAgentDetails: +// RemoteAgentDetails reflects the details of a remote agent. +type GoogleCloudBeyondcorpAppconnectorsV1RemoteAgentDetails struct { +} + // GoogleCloudBeyondcorpAppconnectorsV1alphaAppConnector: A BeyondCorp // connector resource that represents an application facing component // deployed proximal to and with direct access to the application @@ -2308,6 +2459,58 @@ func (s *GoogleCloudBeyondcorpAppconnectorsV1alphaResourceInfo) MarshalJSON() ([ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudBeyondcorpAppgatewaysV1AppGatewayOperationMetadata: +// Represents the metadata of the long-running operation. +type GoogleCloudBeyondcorpAppgatewaysV1AppGatewayOperationMetadata struct { + // ApiVersion: Output only. API version used to start the operation. + ApiVersion string `json:"apiVersion,omitempty"` + + // CreateTime: Output only. The time the operation was created. + CreateTime string `json:"createTime,omitempty"` + + // EndTime: Output only. The time the operation finished running. + EndTime string `json:"endTime,omitempty"` + + // RequestedCancellation: Output only. Identifies whether the user has + // requested cancellation of the operation. Operations that have + // successfully been cancelled have Operation.error value with a + // google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + RequestedCancellation bool `json:"requestedCancellation,omitempty"` + + // StatusMessage: Output only. Human-readable status of the operation, + // if any. + StatusMessage string `json:"statusMessage,omitempty"` + + // Target: Output only. Server-defined resource path for the target of + // the operation. + Target string `json:"target,omitempty"` + + // Verb: Output only. Name of the verb executed by the operation. + Verb string `json:"verb,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ApiVersion") 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. "ApiVersion") 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 *GoogleCloudBeyondcorpAppgatewaysV1AppGatewayOperationMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudBeyondcorpAppgatewaysV1AppGatewayOperationMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudBeyondcorpApplicationsV1alphaApplicationOperationMetadata: // Represents the metadata of the long-running operation. type GoogleCloudBeyondcorpApplicationsV1alphaApplicationOperationMetadata struct { @@ -2357,6 +2560,111 @@ func (s *GoogleCloudBeyondcorpApplicationsV1alphaApplicationOperationMetadata) M return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudBeyondcorpClientconnectorservicesV1ClientConnectorServiceOp +// erationMetadata: Represents the metadata of the long-running +// operation. +type GoogleCloudBeyondcorpClientconnectorservicesV1ClientConnectorServiceOperationMetadata struct { + // ApiVersion: Output only. API version used to start the operation. + ApiVersion string `json:"apiVersion,omitempty"` + + // CreateTime: Output only. The time the operation was created. + CreateTime string `json:"createTime,omitempty"` + + // EndTime: Output only. The time the operation finished running. + EndTime string `json:"endTime,omitempty"` + + // RequestedCancellation: Output only. Identifies whether the user has + // requested cancellation of the operation. Operations that have + // successfully been cancelled have Operation.error value with a + // google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + RequestedCancellation bool `json:"requestedCancellation,omitempty"` + + // StatusMessage: Output only. Human-readable status of the operation, + // if any. + StatusMessage string `json:"statusMessage,omitempty"` + + // Target: Output only. Server-defined resource path for the target of + // the operation. + Target string `json:"target,omitempty"` + + // Verb: Output only. Name of the verb executed by the operation. + Verb string `json:"verb,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ApiVersion") 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. "ApiVersion") 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 *GoogleCloudBeyondcorpClientconnectorservicesV1ClientConnectorServiceOperationMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudBeyondcorpClientconnectorservicesV1ClientConnectorServiceOperationMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudBeyondcorpClientgatewaysV1ClientGatewayOperationMetadata: +// Represents the metadata of the long-running operation. +type GoogleCloudBeyondcorpClientgatewaysV1ClientGatewayOperationMetadata struct { + // ApiVersion: Output only. API version used to start the operation. + ApiVersion string `json:"apiVersion,omitempty"` + + // CreateTime: Output only. The time the operation was created. + CreateTime string `json:"createTime,omitempty"` + + // EndTime: Output only. The time the operation finished running. + EndTime string `json:"endTime,omitempty"` + + // RequestedCancellation: Output only. Identifies whether the user has + // requested cancellation of the operation. Operations that have been + // cancelled successfully have Operation.error value with a + // google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. + RequestedCancellation bool `json:"requestedCancellation,omitempty"` + + // StatusMessage: Output only. Human-readable status of the operation, + // if any. + StatusMessage string `json:"statusMessage,omitempty"` + + // Target: Output only. Server-defined resource path for the target of + // the operation. + Target string `json:"target,omitempty"` + + // Verb: Output only. Name of the verb executed by the operation. + Verb string `json:"verb,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ApiVersion") 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. "ApiVersion") 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 *GoogleCloudBeyondcorpClientgatewaysV1ClientGatewayOperationMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudBeyondcorpClientgatewaysV1ClientGatewayOperationMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudLocationListLocationsResponse: The response message for // Locations.ListLocations. type GoogleCloudLocationListLocationsResponse struct { @@ -10014,7 +10322,7 @@ func (c *ProjectsLocationsClientConnectorServicesPatchCall) RequestId(requestId // in the update_mask are relative to the resource, not the full // request. A field will be overwritten if it is in the mask. If the // user does not provide a mask then all fields will be overwritten. -// Mutable fields: display_name. +// Mutable fields: display_name, ingress.config.destination_routes. func (c *ProjectsLocationsClientConnectorServicesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsClientConnectorServicesPatchCall { c.urlParams_.Set("updateMask", updateMask) return c @@ -10145,7 +10453,7 @@ func (c *ProjectsLocationsClientConnectorServicesPatchCall) Do(opts ...googleapi // "type": "string" // }, // "updateMask": { - // "description": "Required. Field mask is used to specify the fields to be overwritten in the ClientConnectorService resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten. Mutable fields: display_name.", + // "description": "Required. Field mask is used to specify the fields to be overwritten in the ClientConnectorService resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten. Mutable fields: display_name, ingress.config.destination_routes.", // "format": "google-fieldmask", // "location": "query", // "type": "string" diff --git a/cloudfunctions/v1/cloudfunctions-api.json b/cloudfunctions/v1/cloudfunctions-api.json index f539696b217..ca5f819ea20 100644 --- a/cloudfunctions/v1/cloudfunctions-api.json +++ b/cloudfunctions/v1/cloudfunctions-api.json @@ -546,7 +546,7 @@ } } }, - "revision": "20220509", + "revision": "20220707", "rootUrl": "https://cloudfunctions.googleapis.com/", "schemas": { "AuditConfig": { @@ -964,6 +964,153 @@ }, "type": "object" }, + "GoogleCloudFunctionsV2OperationMetadata": { + "description": "Represents the metadata of the long-running operation.", + "id": "GoogleCloudFunctionsV2OperationMetadata", + "properties": { + "apiVersion": { + "description": "API version used to start the operation.", + "type": "string" + }, + "cancelRequested": { + "description": "Identifies whether the user has requested cancellation of the operation. Operations that have successfully been cancelled have Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.", + "type": "boolean" + }, + "createTime": { + "description": "The time the operation was created.", + "format": "google-datetime", + "type": "string" + }, + "endTime": { + "description": "The time the operation finished running.", + "format": "google-datetime", + "type": "string" + }, + "requestResource": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "The original request that started the operation.", + "type": "object" + }, + "stages": { + "description": "Mechanism for reporting in-progress stages", + "items": { + "$ref": "GoogleCloudFunctionsV2Stage" + }, + "type": "array" + }, + "statusDetail": { + "description": "Human-readable status of the operation, if any.", + "type": "string" + }, + "target": { + "description": "Server-defined resource path for the target of the operation.", + "type": "string" + }, + "verb": { + "description": "Name of the verb executed by the operation.", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudFunctionsV2Stage": { + "description": "Each Stage of the deployment process", + "id": "GoogleCloudFunctionsV2Stage", + "properties": { + "message": { + "description": "Message describing the Stage", + "type": "string" + }, + "name": { + "description": "Name of the Stage. This will be unique for each Stage.", + "enum": [ + "NAME_UNSPECIFIED", + "ARTIFACT_REGISTRY", + "BUILD", + "SERVICE", + "TRIGGER", + "SERVICE_ROLLBACK", + "TRIGGER_ROLLBACK" + ], + "enumDescriptions": [ + "Not specified. Invalid name.", + "Artifact Regsitry Stage", + "Build Stage", + "Service Stage", + "Trigger Stage", + "Service Rollback Stage", + "Trigger Rollback Stage" + ], + "type": "string" + }, + "resource": { + "description": "Resource of the Stage", + "type": "string" + }, + "resourceUri": { + "description": "Link to the current Stage resource", + "type": "string" + }, + "state": { + "description": "Current state of the Stage", + "enum": [ + "STATE_UNSPECIFIED", + "NOT_STARTED", + "IN_PROGRESS", + "COMPLETE" + ], + "enumDescriptions": [ + "Not specified. Invalid state.", + "Stage has not started.", + "Stage is in progress.", + "Stage has completed." + ], + "type": "string" + }, + "stateMessages": { + "description": "State messages from the current Stage.", + "items": { + "$ref": "GoogleCloudFunctionsV2StateMessage" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudFunctionsV2StateMessage": { + "description": "Informational messages about the state of the Cloud Function or Operation.", + "id": "GoogleCloudFunctionsV2StateMessage", + "properties": { + "message": { + "description": "The message.", + "type": "string" + }, + "severity": { + "description": "Severity of the state message.", + "enum": [ + "SEVERITY_UNSPECIFIED", + "ERROR", + "WARNING", + "INFO" + ], + "enumDescriptions": [ + "Not specified. Invalid severity.", + "ERROR-level severity.", + "WARNING-level severity.", + "INFO-level severity." + ], + "type": "string" + }, + "type": { + "description": "One-word CamelCase type of the state message.", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudFunctionsV2alphaOperationMetadata": { "description": "Represents the metadata of the long-running operation.", "id": "GoogleCloudFunctionsV2alphaOperationMetadata", diff --git a/cloudfunctions/v1/cloudfunctions-gen.go b/cloudfunctions/v1/cloudfunctions-gen.go index cc712257262..efa666b5a9c 100644 --- a/cloudfunctions/v1/cloudfunctions-gen.go +++ b/cloudfunctions/v1/cloudfunctions-gen.go @@ -986,6 +986,161 @@ func (s *GenerateUploadUrlResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudFunctionsV2OperationMetadata: Represents the metadata of +// the long-running operation. +type GoogleCloudFunctionsV2OperationMetadata struct { + // ApiVersion: API version used to start the operation. + ApiVersion string `json:"apiVersion,omitempty"` + + // CancelRequested: Identifies whether the user has requested + // cancellation of the operation. Operations that have successfully been + // cancelled have Operation.error value with a google.rpc.Status.code of + // 1, corresponding to `Code.CANCELLED`. + CancelRequested bool `json:"cancelRequested,omitempty"` + + // CreateTime: The time the operation was created. + CreateTime string `json:"createTime,omitempty"` + + // EndTime: The time the operation finished running. + EndTime string `json:"endTime,omitempty"` + + // RequestResource: The original request that started the operation. + RequestResource googleapi.RawMessage `json:"requestResource,omitempty"` + + // Stages: Mechanism for reporting in-progress stages + Stages []*GoogleCloudFunctionsV2Stage `json:"stages,omitempty"` + + // StatusDetail: Human-readable status of the operation, if any. + StatusDetail string `json:"statusDetail,omitempty"` + + // Target: Server-defined resource path for the target of the operation. + Target string `json:"target,omitempty"` + + // Verb: Name of the verb executed by the operation. + Verb string `json:"verb,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ApiVersion") 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. "ApiVersion") 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 *GoogleCloudFunctionsV2OperationMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudFunctionsV2OperationMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudFunctionsV2Stage: Each Stage of the deployment process +type GoogleCloudFunctionsV2Stage struct { + // Message: Message describing the Stage + Message string `json:"message,omitempty"` + + // Name: Name of the Stage. This will be unique for each Stage. + // + // Possible values: + // "NAME_UNSPECIFIED" - Not specified. Invalid name. + // "ARTIFACT_REGISTRY" - Artifact Regsitry Stage + // "BUILD" - Build Stage + // "SERVICE" - Service Stage + // "TRIGGER" - Trigger Stage + // "SERVICE_ROLLBACK" - Service Rollback Stage + // "TRIGGER_ROLLBACK" - Trigger Rollback Stage + Name string `json:"name,omitempty"` + + // Resource: Resource of the Stage + Resource string `json:"resource,omitempty"` + + // ResourceUri: Link to the current Stage resource + ResourceUri string `json:"resourceUri,omitempty"` + + // State: Current state of the Stage + // + // Possible values: + // "STATE_UNSPECIFIED" - Not specified. Invalid state. + // "NOT_STARTED" - Stage has not started. + // "IN_PROGRESS" - Stage is in progress. + // "COMPLETE" - Stage has completed. + State string `json:"state,omitempty"` + + // StateMessages: State messages from the current Stage. + StateMessages []*GoogleCloudFunctionsV2StateMessage `json:"stateMessages,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 *GoogleCloudFunctionsV2Stage) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudFunctionsV2Stage + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudFunctionsV2StateMessage: Informational messages about the +// state of the Cloud Function or Operation. +type GoogleCloudFunctionsV2StateMessage struct { + // Message: The message. + Message string `json:"message,omitempty"` + + // Severity: Severity of the state message. + // + // Possible values: + // "SEVERITY_UNSPECIFIED" - Not specified. Invalid severity. + // "ERROR" - ERROR-level severity. + // "WARNING" - WARNING-level severity. + // "INFO" - INFO-level severity. + Severity string `json:"severity,omitempty"` + + // Type: One-word CamelCase type of the state message. + Type string `json:"type,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 *GoogleCloudFunctionsV2StateMessage) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudFunctionsV2StateMessage + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudFunctionsV2alphaOperationMetadata: Represents the metadata // of the long-running operation. type GoogleCloudFunctionsV2alphaOperationMetadata struct { diff --git a/cloudfunctions/v2/cloudfunctions-api.json b/cloudfunctions/v2/cloudfunctions-api.json index 32b30be7c05..318b9ce0664 100644 --- a/cloudfunctions/v2/cloudfunctions-api.json +++ b/cloudfunctions/v2/cloudfunctions-api.json @@ -154,6 +154,145 @@ "resources": { "functions": { "methods": { + "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", + "httpMethod": "POST", + "id": "cloudfunctions.projects.locations.functions.create", + "parameterOrder": [ + "parent" + ], + "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/*`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/functions", + "request": { + "$ref": "Function" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "delete": { + "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": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the function which should be deleted.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+name}", + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "generateDownloadUrl": { + "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 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}:generateDownloadUrl", + "request": { + "$ref": "GenerateDownloadUrlRequest" + }, + "response": { + "$ref": "GenerateDownloadUrlResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "generateUploadUrl": { + "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, these two headers need to be specified: * `content-type: application/zip` And this header SHOULD NOT be specified: * `Authorization: Bearer YOUR_TOKEN`", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions:generateUploadUrl", + "httpMethod": "POST", + "id": "cloudfunctions.projects.locations.functions.generateUploadUrl", + "parameterOrder": [ + "parent" + ], + "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/*`.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/functions:generateUploadUrl", + "request": { + "$ref": "GenerateUploadUrlRequest" + }, + "response": { + "$ref": "GenerateUploadUrlResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "get": { + "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" + ] + }, "getIamPolicy": { "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", @@ -185,6 +324,86 @@ "https://www.googleapis.com/auth/cloud-platform" ] }, + "list": { + "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.", + "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" + ] + }, + "patch": { + "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" + ] + }, "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", @@ -312,13 +531,47 @@ ] } } + }, + "runtimes": { + "methods": { + "list": { + "description": "Returns a list of runtimes that are supported for the requested project.", + "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/runtimes", + "httpMethod": "GET", + "id": "cloudfunctions.projects.locations.runtimes.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "filter": { + "description": "The filter for Runtimes that match the filter expression, following the syntax outlined in https://google.aip.dev/160.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Required. The project and location from which the runtimes should be listed, specified in the format `projects/*/locations/*`", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2/{+parent}/runtimes", + "response": { + "$ref": "ListRuntimesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } } } } } } }, - "revision": "20220509", + "revision": "20220707", "rootUrl": "https://cloudfunctions.googleapis.com/", "schemas": { "AuditConfig": { @@ -350,65 +603,449 @@ }, "type": "array" }, - "logType": { - "description": "The log type that this config enables.", + "logType": { + "description": "The log type that this config enables.", + "enum": [ + "LOG_TYPE_UNSPECIFIED", + "ADMIN_READ", + "DATA_WRITE", + "DATA_READ" + ], + "enumDescriptions": [ + "Default case. Should never be this.", + "Admin reads. Example: CloudIAM getIamPolicy", + "Data writes. Example: CloudSQL Users create", + "Data reads. Example: CloudSQL Users list" + ], + "type": "string" + } + }, + "type": "object" + }, + "Binding": { + "description": "Associates `members`, or principals, with a `role`.", + "id": "Binding", + "properties": { + "condition": { + "$ref": "Expr", + "description": "The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies)." + }, + "members": { + "description": "Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. ", + "items": { + "type": "string" + }, + "type": "array" + }, + "role": { + "description": "Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.", + "type": "string" + } + }, + "type": "object" + }, + "BuildConfig": { + "description": "Describes the Build step of the function that builds a container from the given source.", + "id": "BuildConfig", + "properties": { + "build": { + "description": "Output only. The Cloud Build name of the latest successful deployment of the function.", + "readOnly": true, + "type": "string" + }, + "dockerRepository": { + "description": "Optional. User managed repository created in Artifact Registry optionally with a customer managed encryption key. This is the repository to which the function docker image will be pushed after it is built by Cloud Build. If unspecified, GCF will create and use a repository named 'gcf-artifacts' for every deployed region. It must match the pattern `projects/{project}/locations/{location}/repositories/{repository}`. Cross-project repositories are not supported. Cross-location repositories are not supported. Repository format must be 'DOCKER'.", + "type": "string" + }, + "entryPoint": { + "description": "The name of the function (as defined in source code) that will be executed. Defaults to the resource name suffix, if not specified. For backward compatibility, if function with given name is not found, then the system will try to use function named \"function\". For Node.js this is name of a function exported by the module specified in `source_location`.", + "type": "string" + }, + "environmentVariables": { + "additionalProperties": { + "type": "string" + }, + "description": "User-provided build-time environment variables for the function", + "type": "object" + }, + "runtime": { + "description": "The runtime in which to run the function. Required when deploying a new function, optional when updating an existing function. For a complete list of possible choices, see the [`gcloud` command reference](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).", + "type": "string" + }, + "source": { + "$ref": "Source", + "description": "The location of the function source code." + }, + "sourceProvenance": { + "$ref": "SourceProvenance", + "description": "Output only. A permanent fixed identifier for source.", + "readOnly": true + }, + "workerPool": { + "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" + } + }, + "type": "object" + }, + "EventFilter": { + "description": "Filters events based on exact matches on the CloudEvents attributes.", + "id": "EventFilter", + "properties": { + "attribute": { + "description": "Required. The name of a CloudEvents attribute.", + "type": "string" + }, + "operator": { + "description": "Optional. The operator used for matching the events with the value of the filter. If not specified, only events that have an exact key-value pair specified in the filter are matched. The only allowed value is `match-path-pattern`.", + "type": "string" + }, + "value": { + "description": "Required. The value for the attribute.", + "type": "string" + } + }, + "type": "object" + }, + "EventTrigger": { + "description": "Describes EventTrigger, used to request events to be sent from another service.", + "id": "EventTrigger", + "properties": { + "channel": { + "description": "Optional. The name of the channel associated with the trigger in `projects/{project}/locations/{location}/channels/{channel}` format. You must provide a channel to receive events from Eventarc SaaS partners.", + "type": "string" + }, + "eventFilters": { + "description": "Criteria used to filter events.", + "items": { + "$ref": "EventFilter" + }, + "type": "array" + }, + "eventType": { + "description": "Required. The type of event to observe. For example: `google.cloud.audit.log.v1.written` or `google.cloud.pubsub.topic.v1.messagePublished`.", + "type": "string" + }, + "pubsubTopic": { + "description": "Optional. The name of a Pub/Sub topic in the same project that will be used as the transport topic for the event delivery. Format: `projects/{project}/topics/{topic}`. This is only valid for events of type `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here will not be deleted at function deletion.", + "type": "string" + }, + "retryPolicy": { + "description": "Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).", + "enum": [ + "RETRY_POLICY_UNSPECIFIED", + "RETRY_POLICY_DO_NOT_RETRY", + "RETRY_POLICY_RETRY" + ], + "enumDescriptions": [ + "Not specified.", + "Do not retry.", + "Retry on any failure, retry up to 7 days with an exponential backoff (capped at 10 seconds)." + ], + "type": "string" + }, + "serviceAccountEmail": { + "description": "Optional. The email of the trigger's service account. The service account must have permission to invoke Cloud Run services, the permission is `run.routes.invoke`. If empty, defaults to the Compute Engine default service account: `{project_number}-compute@developer.gserviceaccount.com`.", + "type": "string" + }, + "trigger": { + "description": "Output only. The resource name of the Eventarc trigger. The format of this field is `projects/{project}/locations/{region}/triggers/{trigger}`.", + "readOnly": true, + "type": "string" + }, + "triggerRegion": { + "description": "The region that the trigger will be in. The trigger will only receive events originating in this region. It can be the same region as the function, a different region or multi-region, or the global region. If not provided, defaults to the same region as the function.", + "type": "string" + } + }, + "type": "object" + }, + "Expr": { + "description": "Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: \"Summary size limit\" description: \"Determines if a summary is less than 100 chars\" expression: \"document.summary.size() \u003c 100\" Example (Equality): title: \"Requestor is owner\" description: \"Determines if requestor is the document owner\" expression: \"document.owner == request.auth.claims.email\" Example (Logic): title: \"Public documents\" description: \"Determine whether the document should be publicly visible\" expression: \"document.type != 'private' \u0026\u0026 document.type != 'internal'\" Example (Data Manipulation): title: \"Notification string\" description: \"Create a notification string with a timestamp.\" expression: \"'New message received at ' + string(document.create_time)\" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.", + "id": "Expr", + "properties": { + "description": { + "description": "Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.", + "type": "string" + }, + "expression": { + "description": "Textual representation of an expression in Common Expression Language syntax.", + "type": "string" + }, + "location": { + "description": "Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.", + "type": "string" + }, + "title": { + "description": "Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.", + "type": "string" + } + }, + "type": "object" + }, + "Function": { + "description": "Describes a Cloud Function that contains user computation executed in response to an event. It encapsulates function and trigger configurations.", + "id": "Function", + "properties": { + "buildConfig": { + "$ref": "BuildConfig", + "description": "Describes the Build step of the function that builds a container from the given source." + }, + "description": { + "description": "User-provided description of a function.", + "type": "string" + }, + "environment": { + "description": "Describe whether the function is gen1 or gen2.", + "enum": [ + "ENVIRONMENT_UNSPECIFIED", + "GEN_1", + "GEN_2" + ], + "enumDescriptions": [ + "Unspecified", + "Gen 1", + "Gen 2" + ], + "type": "string" + }, + "eventTrigger": { + "$ref": "EventTrigger", + "description": "An Eventarc trigger managed by Google Cloud Functions that fires events in response to a condition in another service." + }, + "labels": { + "additionalProperties": { + "type": "string" + }, + "description": "Labels associated with this Cloud Function.", + "type": "object" + }, + "name": { + "description": "A user-defined name of the function. Function names must be unique globally and match pattern `projects/*/locations/*/functions/*`", + "type": "string" + }, + "serviceConfig": { + "$ref": "ServiceConfig", + "description": "Describes the Service being deployed. Currently deploys services to Cloud Run (fully managed)." + }, + "state": { + "description": "Output only. State of the function.", + "enum": [ + "STATE_UNSPECIFIED", + "ACTIVE", + "FAILED", + "DEPLOYING", + "DELETING", + "UNKNOWN" + ], + "enumDescriptions": [ + "Not specified. Invalid state.", + "Function has been successfully deployed and is serving.", + "Function deployment failed and the function is not serving.", + "Function is being created or updated.", + "Function is being deleted.", + "Function deployment failed and the function serving state is undefined. The function should be updated or deleted to move it out of this state." + ], + "readOnly": true, + "type": "string" + }, + "stateMessages": { + "description": "Output only. State Messages for this Cloud Function.", + "items": { + "$ref": "GoogleCloudFunctionsV2StateMessage" + }, + "readOnly": true, + "type": "array" + }, + "updateTime": { + "description": "Output only. The last update timestamp of a Cloud Function.", + "format": "google-datetime", + "readOnly": true, + "type": "string" + } + }, + "type": "object" + }, + "GenerateDownloadUrlRequest": { + "description": "Request of `GenerateDownloadUrl` method.", + "id": "GenerateDownloadUrlRequest", + "properties": {}, + "type": "object" + }, + "GenerateDownloadUrlResponse": { + "description": "Response of `GenerateDownloadUrl` method.", + "id": "GenerateDownloadUrlResponse", + "properties": { + "downloadUrl": { + "description": "The generated Google Cloud Storage signed URL that should be used for function source code download.", + "type": "string" + } + }, + "type": "object" + }, + "GenerateUploadUrlRequest": { + "description": "Request of `GenerateSourceUploadUrl` method.", + "id": "GenerateUploadUrlRequest", + "properties": {}, + "type": "object" + }, + "GenerateUploadUrlResponse": { + "description": "Response of `GenerateSourceUploadUrl` method.", + "id": "GenerateUploadUrlResponse", + "properties": { + "storageSource": { + "$ref": "StorageSource", + "description": "The location of the source code in the upload bucket. Once the archive is uploaded using the `upload_url` use this field to set the `function.build_config.source.storage_source` during CreateFunction and UpdateFunction. Generation defaults to 0, as Cloud Storage provides a new generation only upon uploading a new object or version of an object." + }, + "uploadUrl": { + "description": "The generated Google Cloud Storage signed URL that should be used for a function source code upload. The uploaded file should be a zip archive which contains a function.", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudFunctionsV2OperationMetadata": { + "description": "Represents the metadata of the long-running operation.", + "id": "GoogleCloudFunctionsV2OperationMetadata", + "properties": { + "apiVersion": { + "description": "API version used to start the operation.", + "type": "string" + }, + "cancelRequested": { + "description": "Identifies whether the user has requested cancellation of the operation. Operations that have successfully been cancelled have Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.", + "type": "boolean" + }, + "createTime": { + "description": "The time the operation was created.", + "format": "google-datetime", + "type": "string" + }, + "endTime": { + "description": "The time the operation finished running.", + "format": "google-datetime", + "type": "string" + }, + "requestResource": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "The original request that started the operation.", + "type": "object" + }, + "stages": { + "description": "Mechanism for reporting in-progress stages", + "items": { + "$ref": "GoogleCloudFunctionsV2Stage" + }, + "type": "array" + }, + "statusDetail": { + "description": "Human-readable status of the operation, if any.", + "type": "string" + }, + "target": { + "description": "Server-defined resource path for the target of the operation.", + "type": "string" + }, + "verb": { + "description": "Name of the verb executed by the operation.", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudFunctionsV2Stage": { + "description": "Each Stage of the deployment process", + "id": "GoogleCloudFunctionsV2Stage", + "properties": { + "message": { + "description": "Message describing the Stage", + "type": "string" + }, + "name": { + "description": "Name of the Stage. This will be unique for each Stage.", + "enum": [ + "NAME_UNSPECIFIED", + "ARTIFACT_REGISTRY", + "BUILD", + "SERVICE", + "TRIGGER", + "SERVICE_ROLLBACK", + "TRIGGER_ROLLBACK" + ], + "enumDescriptions": [ + "Not specified. Invalid name.", + "Artifact Regsitry Stage", + "Build Stage", + "Service Stage", + "Trigger Stage", + "Service Rollback Stage", + "Trigger Rollback Stage" + ], + "type": "string" + }, + "resource": { + "description": "Resource of the Stage", + "type": "string" + }, + "resourceUri": { + "description": "Link to the current Stage resource", + "type": "string" + }, + "state": { + "description": "Current state of the Stage", "enum": [ - "LOG_TYPE_UNSPECIFIED", - "ADMIN_READ", - "DATA_WRITE", - "DATA_READ" + "STATE_UNSPECIFIED", + "NOT_STARTED", + "IN_PROGRESS", + "COMPLETE" ], "enumDescriptions": [ - "Default case. Should never be this.", - "Admin reads. Example: CloudIAM getIamPolicy", - "Data writes. Example: CloudSQL Users create", - "Data reads. Example: CloudSQL Users list" + "Not specified. Invalid state.", + "Stage has not started.", + "Stage is in progress.", + "Stage has completed." ], "type": "string" - } - }, - "type": "object" - }, - "Binding": { - "description": "Associates `members`, or principals, with a `role`.", - "id": "Binding", - "properties": { - "condition": { - "$ref": "Expr", - "description": "The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies)." }, - "members": { - "description": "Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. ", + "stateMessages": { + "description": "State messages from the current Stage.", "items": { - "type": "string" + "$ref": "GoogleCloudFunctionsV2StateMessage" }, "type": "array" - }, - "role": { - "description": "Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.", - "type": "string" } }, "type": "object" }, - "Expr": { - "description": "Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: \"Summary size limit\" description: \"Determines if a summary is less than 100 chars\" expression: \"document.summary.size() \u003c 100\" Example (Equality): title: \"Requestor is owner\" description: \"Determines if requestor is the document owner\" expression: \"document.owner == request.auth.claims.email\" Example (Logic): title: \"Public documents\" description: \"Determine whether the document should be publicly visible\" expression: \"document.type != 'private' \u0026\u0026 document.type != 'internal'\" Example (Data Manipulation): title: \"Notification string\" description: \"Create a notification string with a timestamp.\" expression: \"'New message received at ' + string(document.create_time)\" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.", - "id": "Expr", + "GoogleCloudFunctionsV2StateMessage": { + "description": "Informational messages about the state of the Cloud Function or Operation.", + "id": "GoogleCloudFunctionsV2StateMessage", "properties": { - "description": { - "description": "Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.", - "type": "string" - }, - "expression": { - "description": "Textual representation of an expression in Common Expression Language syntax.", + "message": { + "description": "The message.", "type": "string" }, - "location": { - "description": "Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.", + "severity": { + "description": "Severity of the state message.", + "enum": [ + "SEVERITY_UNSPECIFIED", + "ERROR", + "WARNING", + "INFO" + ], + "enumDescriptions": [ + "Not specified. Invalid severity.", + "ERROR-level severity.", + "WARNING-level severity.", + "INFO-level severity." + ], "type": "string" }, - "title": { - "description": "Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.", + "type": { + "description": "One-word CamelCase type of the state message.", "type": "string" } }, @@ -708,6 +1345,31 @@ }, "type": "object" }, + "ListFunctionsResponse": { + "description": "Response for the `ListFunctions` method.", + "id": "ListFunctionsResponse", + "properties": { + "functions": { + "description": "The functions that match the request.", + "items": { + "$ref": "Function" + }, + "type": "array" + }, + "nextPageToken": { + "description": "A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.", + "type": "string" + }, + "unreachable": { + "description": "Locations that could not be reached. The response does not include any functions from these locations.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, "ListLocationsResponse": { "description": "The response message for Locations.ListLocations.", "id": "ListLocationsResponse", @@ -744,6 +1406,20 @@ }, "type": "object" }, + "ListRuntimesResponse": { + "description": "Response for the `ListRuntimes` method.", + "id": "ListRuntimesResponse", + "properties": { + "runtimes": { + "description": "The runtimes that match the request.", + "items": { + "$ref": "Runtime" + }, + "type": "array" + } + }, + "type": "object" + }, "Location": { "description": "A resource that represents Google Cloud Platform location.", "id": "Location", @@ -901,6 +1577,267 @@ }, "type": "object" }, + "RepoSource": { + "description": "Location of the source in a Google Cloud Source Repository.", + "id": "RepoSource", + "properties": { + "branchName": { + "description": "Regex matching branches to build. The syntax of the regular expressions accepted is the syntax accepted by RE2 and described at https://github.com/google/re2/wiki/Syntax", + "type": "string" + }, + "commitSha": { + "description": "Explicit commit SHA to build.", + "type": "string" + }, + "dir": { + "description": "Directory, relative to the source root, in which to run the build. This must be a relative path. If a step's `dir` is specified and is an absolute path, this value is ignored for that step's execution. eg. helloworld (no leading slash allowed)", + "type": "string" + }, + "invertRegex": { + "description": "Only trigger a build if the revision regex does NOT match the revision regex.", + "type": "boolean" + }, + "projectId": { + "description": "ID of the project that owns the Cloud Source Repository. If omitted, the project ID requesting the build is assumed.", + "type": "string" + }, + "repoName": { + "description": "Name of the Cloud Source Repository.", + "type": "string" + }, + "tagName": { + "description": "Regex matching tags to build. The syntax of the regular expressions accepted is the syntax accepted by RE2 and described at https://github.com/google/re2/wiki/Syntax", + "type": "string" + } + }, + "type": "object" + }, + "Runtime": { + "description": "Describes a runtime and any special information (e.g., deprecation status) related to it.", + "id": "Runtime", + "properties": { + "displayName": { + "description": "The user facing name, eg 'Go 1.13', 'Node.js 12', etc.", + "type": "string" + }, + "environment": { + "description": "The environment for the runtime.", + "enum": [ + "ENVIRONMENT_UNSPECIFIED", + "GEN_1", + "GEN_2" + ], + "enumDescriptions": [ + "Unspecified", + "Gen 1", + "Gen 2" + ], + "type": "string" + }, + "name": { + "description": "The name of the runtime, e.g., 'go113', 'nodejs12', etc.", + "type": "string" + }, + "stage": { + "description": "The stage of life this runtime is in, e.g., BETA, GA, etc.", + "enum": [ + "RUNTIME_STAGE_UNSPECIFIED", + "DEVELOPMENT", + "ALPHA", + "BETA", + "GA", + "DEPRECATED", + "DECOMMISSIONED" + ], + "enumDescriptions": [ + "Not specified.", + "The runtime is in development.", + "The runtime is in the Alpha stage.", + "The runtime is in the Beta stage.", + "The runtime is generally available.", + "The runtime is deprecated.", + "The runtime is no longer supported." + ], + "type": "string" + }, + "warnings": { + "description": "Warning messages, e.g., a deprecation warning.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "SecretEnvVar": { + "description": "Configuration for a secret environment variable. It has the information necessary to fetch the secret value from secret manager and expose it as an environment variable.", + "id": "SecretEnvVar", + "properties": { + "key": { + "description": "Name of the environment variable.", + "type": "string" + }, + "projectId": { + "description": "Project identifier (preferably project number but can also be the project ID) of the project that contains the secret. If not set, it is assumed that the secret is in the same project as the function.", + "type": "string" + }, + "secret": { + "description": "Name of the secret in secret manager (not the full resource name).", + "type": "string" + }, + "version": { + "description": "Version of the secret (version number or the string 'latest'). It is recommended to use a numeric version for secret environment variables as any updates to the secret value is not reflected until new instances start.", + "type": "string" + } + }, + "type": "object" + }, + "SecretVersion": { + "description": "Configuration for a single version.", + "id": "SecretVersion", + "properties": { + "path": { + "description": "Relative path of the file under the mount path where the secret value for this version will be fetched and made available. For example, setting the mount_path as '/etc/secrets' and path as `secret_foo` would mount the secret value file at `/etc/secrets/secret_foo`.", + "type": "string" + }, + "version": { + "description": "Version of the secret (version number or the string 'latest'). It is preferable to use `latest` version with secret volumes as secret value changes are reflected immediately.", + "type": "string" + } + }, + "type": "object" + }, + "SecretVolume": { + "description": "Configuration for a secret volume. It has the information necessary to fetch the secret value from secret manager and make it available as files mounted at the requested paths within the application container.", + "id": "SecretVolume", + "properties": { + "mountPath": { + "description": "The path within the container to mount the secret volume. For example, setting the mount_path as `/etc/secrets` would mount the secret value files under the `/etc/secrets` directory. This directory will also be completely shadowed and unavailable to mount any other secrets. Recommended mount path: /etc/secrets", + "type": "string" + }, + "projectId": { + "description": "Project identifier (preferably project number but can also be the project ID) of the project that contains the secret. If not set, it is assumed that the secret is in the same project as the function.", + "type": "string" + }, + "secret": { + "description": "Name of the secret in secret manager (not the full resource name).", + "type": "string" + }, + "versions": { + "description": "List of secret versions to mount for this secret. If empty, the `latest` version of the secret will be made available in a file named after the secret under the mount point.", + "items": { + "$ref": "SecretVersion" + }, + "type": "array" + } + }, + "type": "object" + }, + "ServiceConfig": { + "description": "Describes the Service being deployed. Currently Supported : Cloud Run (fully managed).", + "id": "ServiceConfig", + "properties": { + "allTrafficOnLatestRevision": { + "description": "Whether 100% of traffic is routed to the latest revision. On CreateFunction and UpdateFunction, when set to true, the revision being deployed will serve 100% of traffic, ignoring any traffic split settings, if any. On GetFunction, true will be returned if the latest revision is serving 100% of traffic.", + "type": "boolean" + }, + "availableMemory": { + "description": "The amount of memory available for a function. Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is supplied the value is interpreted as bytes. See https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go a full description.", + "type": "string" + }, + "environmentVariables": { + "additionalProperties": { + "type": "string" + }, + "description": "Environment variables that shall be available during function execution.", + "type": "object" + }, + "ingressSettings": { + "description": "The ingress settings for the function, controlling what traffic can reach it.", + "enum": [ + "INGRESS_SETTINGS_UNSPECIFIED", + "ALLOW_ALL", + "ALLOW_INTERNAL_ONLY", + "ALLOW_INTERNAL_AND_GCLB" + ], + "enumDescriptions": [ + "Unspecified.", + "Allow HTTP traffic from public and private sources.", + "Allow HTTP traffic from only private VPC sources.", + "Allow HTTP traffic from private VPC sources and through GCLB." + ], + "type": "string" + }, + "maxInstanceCount": { + "description": "The limit on the maximum number of function instances that may coexist at a given time. In some cases, such as rapid traffic surges, Cloud Functions may, for a short period of time, create more instances than the specified max instances limit. If your function cannot tolerate this temporary behavior, you may want to factor in a safety margin and set a lower max instances value than your function can tolerate. See the [Max Instances](https://cloud.google.com/functions/docs/max-instances) Guide for more details.", + "format": "int32", + "type": "integer" + }, + "minInstanceCount": { + "description": "The limit on the minimum number of function instances that may coexist at a given time. Function instances are kept in idle state for a short period after they finished executing the request to reduce cold start time for subsequent requests. Setting a minimum instance count will ensure that the given number of instances are kept running in idle state always. This can help with cold start times when jump in incoming request count occurs after the idle instance would have been stopped in the default case.", + "format": "int32", + "type": "integer" + }, + "revision": { + "description": "Output only. The name of service revision.", + "readOnly": true, + "type": "string" + }, + "secretEnvironmentVariables": { + "description": "Secret environment variables configuration.", + "items": { + "$ref": "SecretEnvVar" + }, + "type": "array" + }, + "secretVolumes": { + "description": "Secret volumes configuration.", + "items": { + "$ref": "SecretVolume" + }, + "type": "array" + }, + "service": { + "description": "Output only. Name of the service associated with a Function. The format of this field is `projects/{project}/locations/{region}/services/{service}`", + "readOnly": true, + "type": "string" + }, + "serviceAccountEmail": { + "description": "The email of the service's service account. If empty, defaults to `{project_number}-compute@developer.gserviceaccount.com`.", + "type": "string" + }, + "timeoutSeconds": { + "description": "The function execution timeout. Execution is considered failed and can be terminated if the function is not completed at the end of the timeout period. Defaults to 60 seconds.", + "format": "int32", + "type": "integer" + }, + "uri": { + "description": "Output only. URI of the Service deployed.", + "readOnly": true, + "type": "string" + }, + "vpcConnector": { + "description": "The Serverless VPC Access connector that this cloud function can connect to. The format of this field is `projects/*/locations/*/connectors/*`.", + "type": "string" + }, + "vpcConnectorEgressSettings": { + "description": "The egress settings for the connector, controlling what traffic is diverted through it.", + "enum": [ + "VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED", + "PRIVATE_RANGES_ONLY", + "ALL_TRAFFIC" + ], + "enumDescriptions": [ + "Unspecified.", + "Use the VPC Access Connector only for private IP space from RFC1918.", + "Force the use of VPC Access Connector for all egress traffic from the function." + ], + "type": "string" + } + }, + "type": "object" + }, "SetIamPolicyRequest": { "description": "Request message for `SetIamPolicy` method.", "id": "SetIamPolicyRequest", @@ -917,6 +1854,36 @@ }, "type": "object" }, + "Source": { + "description": "The location of the function source code.", + "id": "Source", + "properties": { + "repoSource": { + "$ref": "RepoSource", + "description": "If provided, get the source from this location in a Cloud Source Repository." + }, + "storageSource": { + "$ref": "StorageSource", + "description": "If provided, get the source from this location in Google Cloud Storage." + } + }, + "type": "object" + }, + "SourceProvenance": { + "description": "Provenance of the source. Ways to find the original source, or verify that some source was used for this build.", + "id": "SourceProvenance", + "properties": { + "resolvedRepoSource": { + "$ref": "RepoSource", + "description": "A copy of the build's `source.repo_source`, if exists, with any revisions resolved." + }, + "resolvedStorageSource": { + "$ref": "StorageSource", + "description": "A copy of the build's `source.storage_source`, if exists, with any generations resolved." + } + }, + "type": "object" + }, "Status": { "description": "The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).", "id": "Status", @@ -944,6 +1911,26 @@ }, "type": "object" }, + "StorageSource": { + "description": "Location of the source in an archive file in Google Cloud Storage.", + "id": "StorageSource", + "properties": { + "bucket": { + "description": "Google Cloud Storage bucket containing the source (see [Bucket Name Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).", + "type": "string" + }, + "generation": { + "description": "Google Cloud Storage generation for the object. If the generation is omitted, the latest generation will be used.", + "format": "int64", + "type": "string" + }, + "object": { + "description": "Google Cloud Storage object containing the source. This object must be a gzipped archive file (`.tar.gz`) containing source to build.", + "type": "string" + } + }, + "type": "object" + }, "TestIamPermissionsRequest": { "description": "Request message for `TestIamPermissions` method.", "id": "TestIamPermissionsRequest", diff --git a/cloudfunctions/v2/cloudfunctions-gen.go b/cloudfunctions/v2/cloudfunctions-gen.go index b6890dea299..a00b2ac1f33 100644 --- a/cloudfunctions/v2/cloudfunctions-gen.go +++ b/cloudfunctions/v2/cloudfunctions-gen.go @@ -153,6 +153,7 @@ func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { rs := &ProjectsLocationsService{s: s} rs.Functions = NewProjectsLocationsFunctionsService(s) rs.Operations = NewProjectsLocationsOperationsService(s) + rs.Runtimes = NewProjectsLocationsRuntimesService(s) return rs } @@ -162,6 +163,8 @@ type ProjectsLocationsService struct { Functions *ProjectsLocationsFunctionsService Operations *ProjectsLocationsOperationsService + + Runtimes *ProjectsLocationsRuntimesService } func NewProjectsLocationsFunctionsService(s *Service) *ProjectsLocationsFunctionsService { @@ -182,6 +185,15 @@ type ProjectsLocationsOperationsService struct { s *Service } +func NewProjectsLocationsRuntimesService(s *Service) *ProjectsLocationsRuntimesService { + rs := &ProjectsLocationsRuntimesService{s: s} + return rs +} + +type ProjectsLocationsRuntimesService struct { + s *Service +} + // 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 @@ -352,6 +364,201 @@ func (s *Binding) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// BuildConfig: Describes the Build step of the function that builds a +// container from the given source. +type BuildConfig struct { + // Build: Output only. The Cloud Build name of the latest successful + // deployment of the function. + Build string `json:"build,omitempty"` + + // DockerRepository: Optional. User managed repository created in + // Artifact Registry optionally with a customer managed encryption key. + // This is the repository to which the function docker image will be + // pushed after it is built by Cloud Build. If unspecified, GCF will + // create and use a repository named 'gcf-artifacts' for every deployed + // region. It must match the pattern + // `projects/{project}/locations/{location}/repositories/{repository}`. + // Cross-project repositories are not supported. Cross-location + // repositories are not supported. Repository format must be 'DOCKER'. + DockerRepository string `json:"dockerRepository,omitempty"` + + // EntryPoint: The name of the function (as defined in source code) that + // will be executed. Defaults to the resource name suffix, if not + // specified. For backward compatibility, if function with given name is + // not found, then the system will try to use function named "function". + // For Node.js this is name of a function exported by the module + // specified in `source_location`. + EntryPoint string `json:"entryPoint,omitempty"` + + // EnvironmentVariables: User-provided build-time environment variables + // for the function + EnvironmentVariables map[string]string `json:"environmentVariables,omitempty"` + + // Runtime: The runtime in which to run the function. Required when + // deploying a new function, optional when updating an existing + // function. For a complete list of possible choices, see the `gcloud` + // command reference + // (https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime). + Runtime string `json:"runtime,omitempty"` + + // Source: The location of the function source code. + Source *Source `json:"source,omitempty"` + + // SourceProvenance: Output only. A permanent fixed identifier for + // source. + SourceProvenance *SourceProvenance `json:"sourceProvenance,omitempty"` + + // WorkerPool: 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. + WorkerPool string `json:"workerPool,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Build") 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. "Build") 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 *BuildConfig) MarshalJSON() ([]byte, error) { + type NoMethod BuildConfig + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// EventFilter: Filters events based on exact matches on the CloudEvents +// attributes. +type EventFilter struct { + // Attribute: Required. The name of a CloudEvents attribute. + Attribute string `json:"attribute,omitempty"` + + // Operator: Optional. The operator used for matching the events with + // the value of the filter. If not specified, only events that have an + // exact key-value pair specified in the filter are matched. The only + // allowed value is `match-path-pattern`. + Operator string `json:"operator,omitempty"` + + // Value: Required. The value for the attribute. + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Attribute") 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. "Attribute") 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 *EventFilter) MarshalJSON() ([]byte, error) { + type NoMethod EventFilter + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// EventTrigger: Describes EventTrigger, used to request events to be +// sent from another service. +type EventTrigger struct { + // Channel: Optional. The name of the channel associated with the + // trigger in + // `projects/{project}/locations/{location}/channels/{channel}` format. + // You must provide a channel to receive events from Eventarc SaaS + // partners. + Channel string `json:"channel,omitempty"` + + // EventFilters: Criteria used to filter events. + EventFilters []*EventFilter `json:"eventFilters,omitempty"` + + // EventType: Required. The type of event to observe. For example: + // `google.cloud.audit.log.v1.written` or + // `google.cloud.pubsub.topic.v1.messagePublished`. + EventType string `json:"eventType,omitempty"` + + // PubsubTopic: Optional. The name of a Pub/Sub topic in the same + // project that will be used as the transport topic for the event + // delivery. Format: `projects/{project}/topics/{topic}`. This is only + // valid for events of type + // `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided + // here will not be deleted at function deletion. + PubsubTopic string `json:"pubsubTopic,omitempty"` + + // RetryPolicy: Optional. If unset, then defaults to ignoring failures + // (i.e. not retrying them). + // + // Possible values: + // "RETRY_POLICY_UNSPECIFIED" - Not specified. + // "RETRY_POLICY_DO_NOT_RETRY" - Do not retry. + // "RETRY_POLICY_RETRY" - Retry on any failure, retry up to 7 days + // with an exponential backoff (capped at 10 seconds). + RetryPolicy string `json:"retryPolicy,omitempty"` + + // ServiceAccountEmail: Optional. The email of the trigger's service + // account. The service account must have permission to invoke Cloud Run + // services, the permission is `run.routes.invoke`. If empty, defaults + // to the Compute Engine default service account: + // `{project_number}-compute@developer.gserviceaccount.com`. + ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"` + + // Trigger: Output only. The resource name of the Eventarc trigger. The + // format of this field is + // `projects/{project}/locations/{region}/triggers/{trigger}`. + Trigger string `json:"trigger,omitempty"` + + // TriggerRegion: The region that the trigger will be in. The trigger + // will only receive events originating in this region. It can be the + // same region as the function, a different region or multi-region, or + // the global region. If not provided, defaults to the same region as + // the function. + TriggerRegion string `json:"triggerRegion,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Channel") 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. "Channel") 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 *EventTrigger) MarshalJSON() ([]byte, error) { + type NoMethod EventTrigger + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // Expr: Represents a textual expression in the Common Expression // Language (CEL) syntax. CEL is a C-like expression language. The // syntax and semantics of CEL are documented at @@ -412,9 +619,178 @@ func (s *Expr) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudFunctionsV2alphaOperationMetadata: Represents the metadata -// of the long-running operation. -type GoogleCloudFunctionsV2alphaOperationMetadata struct { +// Function: Describes a Cloud Function that contains user computation +// executed in response to an event. It encapsulates function and +// trigger configurations. +type Function struct { + // BuildConfig: Describes the Build step of the function that builds a + // container from the given source. + BuildConfig *BuildConfig `json:"buildConfig,omitempty"` + + // Description: User-provided description of a function. + Description string `json:"description,omitempty"` + + // Environment: Describe whether the function is gen1 or gen2. + // + // Possible values: + // "ENVIRONMENT_UNSPECIFIED" - Unspecified + // "GEN_1" - Gen 1 + // "GEN_2" - Gen 2 + Environment string `json:"environment,omitempty"` + + // EventTrigger: An Eventarc trigger managed by Google Cloud Functions + // that fires events in response to a condition in another service. + EventTrigger *EventTrigger `json:"eventTrigger,omitempty"` + + // Labels: Labels associated with this Cloud Function. + Labels map[string]string `json:"labels,omitempty"` + + // Name: A user-defined name of the function. Function names must be + // unique globally and match pattern + // `projects/*/locations/*/functions/*` + Name string `json:"name,omitempty"` + + // ServiceConfig: Describes the Service being deployed. Currently + // deploys services to Cloud Run (fully managed). + ServiceConfig *ServiceConfig `json:"serviceConfig,omitempty"` + + // State: Output only. State of the function. + // + // Possible values: + // "STATE_UNSPECIFIED" - Not specified. Invalid state. + // "ACTIVE" - Function has been successfully deployed and is serving. + // "FAILED" - Function deployment failed and the function is not + // serving. + // "DEPLOYING" - Function is being created or updated. + // "DELETING" - Function is being deleted. + // "UNKNOWN" - Function deployment failed and the function serving + // state is undefined. The function should be updated or deleted to move + // it out of this state. + State string `json:"state,omitempty"` + + // StateMessages: Output only. State Messages for this Cloud Function. + StateMessages []*GoogleCloudFunctionsV2StateMessage `json:"stateMessages,omitempty"` + + // UpdateTime: Output only. The last update timestamp of a Cloud + // Function. + UpdateTime string `json:"updateTime,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // 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 *Function) MarshalJSON() ([]byte, error) { + type NoMethod Function + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GenerateDownloadUrlRequest: Request of `GenerateDownloadUrl` method. +type GenerateDownloadUrlRequest struct { +} + +// GenerateDownloadUrlResponse: Response of `GenerateDownloadUrl` +// method. +type GenerateDownloadUrlResponse struct { + // DownloadUrl: The generated Google Cloud Storage signed URL that + // should be used for function source code download. + DownloadUrl string `json:"downloadUrl,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "DownloadUrl") 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. "DownloadUrl") 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 *GenerateDownloadUrlResponse) MarshalJSON() ([]byte, error) { + type NoMethod GenerateDownloadUrlResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GenerateUploadUrlRequest: Request of `GenerateSourceUploadUrl` +// method. +type GenerateUploadUrlRequest struct { +} + +// GenerateUploadUrlResponse: Response of `GenerateSourceUploadUrl` +// method. +type GenerateUploadUrlResponse struct { + // StorageSource: The location of the source code in the upload bucket. + // Once the archive is uploaded using the `upload_url` use this field to + // set the `function.build_config.source.storage_source` during + // CreateFunction and UpdateFunction. Generation defaults to 0, as Cloud + // Storage provides a new generation only upon uploading a new object or + // version of an object. + StorageSource *StorageSource `json:"storageSource,omitempty"` + + // UploadUrl: The generated Google Cloud Storage signed URL that should + // be used for a function source code upload. The uploaded file should + // be a zip archive which contains a function. + UploadUrl string `json:"uploadUrl,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "StorageSource") 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. "StorageSource") 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 *GenerateUploadUrlResponse) MarshalJSON() ([]byte, error) { + type NoMethod GenerateUploadUrlResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudFunctionsV2OperationMetadata: Represents the metadata of +// the long-running operation. +type GoogleCloudFunctionsV2OperationMetadata struct { // ApiVersion: API version used to start the operation. ApiVersion string `json:"apiVersion,omitempty"` @@ -434,7 +810,7 @@ type GoogleCloudFunctionsV2alphaOperationMetadata struct { RequestResource googleapi.RawMessage `json:"requestResource,omitempty"` // Stages: Mechanism for reporting in-progress stages - Stages []*GoogleCloudFunctionsV2alphaStage `json:"stages,omitempty"` + Stages []*GoogleCloudFunctionsV2Stage `json:"stages,omitempty"` // StatusDetail: Human-readable status of the operation, if any. StatusDetail string `json:"statusDetail,omitempty"` @@ -462,15 +838,14 @@ type GoogleCloudFunctionsV2alphaOperationMetadata struct { NullFields []string `json:"-"` } -func (s *GoogleCloudFunctionsV2alphaOperationMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudFunctionsV2alphaOperationMetadata +func (s *GoogleCloudFunctionsV2OperationMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudFunctionsV2OperationMetadata raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudFunctionsV2alphaStage: Each Stage of the deployment -// process -type GoogleCloudFunctionsV2alphaStage struct { +// GoogleCloudFunctionsV2Stage: Each Stage of the deployment process +type GoogleCloudFunctionsV2Stage struct { // Message: Message describing the Stage Message string `json:"message,omitempty"` @@ -502,7 +877,7 @@ type GoogleCloudFunctionsV2alphaStage struct { State string `json:"state,omitempty"` // StateMessages: State messages from the current Stage. - StateMessages []*GoogleCloudFunctionsV2alphaStateMessage `json:"stateMessages,omitempty"` + StateMessages []*GoogleCloudFunctionsV2StateMessage `json:"stateMessages,omitempty"` // ForceSendFields is a list of field names (e.g. "Message") to // unconditionally include in API requests. By default, fields with @@ -521,15 +896,15 @@ type GoogleCloudFunctionsV2alphaStage struct { NullFields []string `json:"-"` } -func (s *GoogleCloudFunctionsV2alphaStage) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudFunctionsV2alphaStage +func (s *GoogleCloudFunctionsV2Stage) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudFunctionsV2Stage raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudFunctionsV2alphaStateMessage: Informational messages about -// the state of the Cloud Function or Operation. -type GoogleCloudFunctionsV2alphaStateMessage struct { +// GoogleCloudFunctionsV2StateMessage: Informational messages about the +// state of the Cloud Function or Operation. +type GoogleCloudFunctionsV2StateMessage struct { // Message: The message. Message string `json:"message,omitempty"` @@ -562,15 +937,15 @@ type GoogleCloudFunctionsV2alphaStateMessage struct { NullFields []string `json:"-"` } -func (s *GoogleCloudFunctionsV2alphaStateMessage) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudFunctionsV2alphaStateMessage +func (s *GoogleCloudFunctionsV2StateMessage) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudFunctionsV2StateMessage raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudFunctionsV2betaOperationMetadata: Represents the metadata +// GoogleCloudFunctionsV2alphaOperationMetadata: Represents the metadata // of the long-running operation. -type GoogleCloudFunctionsV2betaOperationMetadata struct { +type GoogleCloudFunctionsV2alphaOperationMetadata struct { // ApiVersion: API version used to start the operation. ApiVersion string `json:"apiVersion,omitempty"` @@ -590,7 +965,7 @@ type GoogleCloudFunctionsV2betaOperationMetadata struct { RequestResource googleapi.RawMessage `json:"requestResource,omitempty"` // Stages: Mechanism for reporting in-progress stages - Stages []*GoogleCloudFunctionsV2betaStage `json:"stages,omitempty"` + Stages []*GoogleCloudFunctionsV2alphaStage `json:"stages,omitempty"` // StatusDetail: Human-readable status of the operation, if any. StatusDetail string `json:"statusDetail,omitempty"` @@ -618,14 +993,15 @@ type GoogleCloudFunctionsV2betaOperationMetadata struct { NullFields []string `json:"-"` } -func (s *GoogleCloudFunctionsV2betaOperationMetadata) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudFunctionsV2betaOperationMetadata +func (s *GoogleCloudFunctionsV2alphaOperationMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudFunctionsV2alphaOperationMetadata raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudFunctionsV2betaStage: Each Stage of the deployment process -type GoogleCloudFunctionsV2betaStage struct { +// GoogleCloudFunctionsV2alphaStage: Each Stage of the deployment +// process +type GoogleCloudFunctionsV2alphaStage struct { // Message: Message describing the Stage Message string `json:"message,omitempty"` @@ -657,7 +1033,7 @@ type GoogleCloudFunctionsV2betaStage struct { State string `json:"state,omitempty"` // StateMessages: State messages from the current Stage. - StateMessages []*GoogleCloudFunctionsV2betaStateMessage `json:"stateMessages,omitempty"` + StateMessages []*GoogleCloudFunctionsV2alphaStateMessage `json:"stateMessages,omitempty"` // ForceSendFields is a list of field names (e.g. "Message") to // unconditionally include in API requests. By default, fields with @@ -676,15 +1052,15 @@ type GoogleCloudFunctionsV2betaStage struct { NullFields []string `json:"-"` } -func (s *GoogleCloudFunctionsV2betaStage) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudFunctionsV2betaStage +func (s *GoogleCloudFunctionsV2alphaStage) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudFunctionsV2alphaStage raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// GoogleCloudFunctionsV2betaStateMessage: Informational messages about +// GoogleCloudFunctionsV2alphaStateMessage: Informational messages about // the state of the Cloud Function or Operation. -type GoogleCloudFunctionsV2betaStateMessage struct { +type GoogleCloudFunctionsV2alphaStateMessage struct { // Message: The message. Message string `json:"message,omitempty"` @@ -717,27 +1093,223 @@ type GoogleCloudFunctionsV2betaStateMessage struct { NullFields []string `json:"-"` } -func (s *GoogleCloudFunctionsV2betaStateMessage) MarshalJSON() ([]byte, error) { - type NoMethod GoogleCloudFunctionsV2betaStateMessage +func (s *GoogleCloudFunctionsV2alphaStateMessage) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudFunctionsV2alphaStateMessage raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// ListLocationsResponse: The response message for -// Locations.ListLocations. -type ListLocationsResponse struct { - // Locations: A list of locations that matches the specified filter in - // the request. - Locations []*Location `json:"locations,omitempty"` +// GoogleCloudFunctionsV2betaOperationMetadata: Represents the metadata +// of the long-running operation. +type GoogleCloudFunctionsV2betaOperationMetadata struct { + // ApiVersion: API version used to start the operation. + ApiVersion string `json:"apiVersion,omitempty"` - // NextPageToken: The standard List next-page token. - NextPageToken string `json:"nextPageToken,omitempty"` + // CancelRequested: Identifies whether the user has requested + // cancellation of the operation. Operations that have successfully been + // cancelled have Operation.error value with a google.rpc.Status.code of + // 1, corresponding to `Code.CANCELLED`. + CancelRequested bool `json:"cancelRequested,omitempty"` - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` + // CreateTime: The time the operation was created. + CreateTime string `json:"createTime,omitempty"` - // ForceSendFields is a list of field names (e.g. "Locations") to + // EndTime: The time the operation finished running. + EndTime string `json:"endTime,omitempty"` + + // RequestResource: The original request that started the operation. + RequestResource googleapi.RawMessage `json:"requestResource,omitempty"` + + // Stages: Mechanism for reporting in-progress stages + Stages []*GoogleCloudFunctionsV2betaStage `json:"stages,omitempty"` + + // StatusDetail: Human-readable status of the operation, if any. + StatusDetail string `json:"statusDetail,omitempty"` + + // Target: Server-defined resource path for the target of the operation. + Target string `json:"target,omitempty"` + + // Verb: Name of the verb executed by the operation. + Verb string `json:"verb,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ApiVersion") 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. "ApiVersion") 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 *GoogleCloudFunctionsV2betaOperationMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudFunctionsV2betaOperationMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudFunctionsV2betaStage: Each Stage of the deployment process +type GoogleCloudFunctionsV2betaStage struct { + // Message: Message describing the Stage + Message string `json:"message,omitempty"` + + // Name: Name of the Stage. This will be unique for each Stage. + // + // Possible values: + // "NAME_UNSPECIFIED" - Not specified. Invalid name. + // "ARTIFACT_REGISTRY" - Artifact Regsitry Stage + // "BUILD" - Build Stage + // "SERVICE" - Service Stage + // "TRIGGER" - Trigger Stage + // "SERVICE_ROLLBACK" - Service Rollback Stage + // "TRIGGER_ROLLBACK" - Trigger Rollback Stage + Name string `json:"name,omitempty"` + + // Resource: Resource of the Stage + Resource string `json:"resource,omitempty"` + + // ResourceUri: Link to the current Stage resource + ResourceUri string `json:"resourceUri,omitempty"` + + // State: Current state of the Stage + // + // Possible values: + // "STATE_UNSPECIFIED" - Not specified. Invalid state. + // "NOT_STARTED" - Stage has not started. + // "IN_PROGRESS" - Stage is in progress. + // "COMPLETE" - Stage has completed. + State string `json:"state,omitempty"` + + // StateMessages: State messages from the current Stage. + StateMessages []*GoogleCloudFunctionsV2betaStateMessage `json:"stateMessages,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 *GoogleCloudFunctionsV2betaStage) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudFunctionsV2betaStage + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudFunctionsV2betaStateMessage: Informational messages about +// the state of the Cloud Function or Operation. +type GoogleCloudFunctionsV2betaStateMessage struct { + // Message: The message. + Message string `json:"message,omitempty"` + + // Severity: Severity of the state message. + // + // Possible values: + // "SEVERITY_UNSPECIFIED" - Not specified. Invalid severity. + // "ERROR" - ERROR-level severity. + // "WARNING" - WARNING-level severity. + // "INFO" - INFO-level severity. + Severity string `json:"severity,omitempty"` + + // Type: One-word CamelCase type of the state message. + Type string `json:"type,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 *GoogleCloudFunctionsV2betaStateMessage) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudFunctionsV2betaStateMessage + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ListFunctionsResponse: Response for the `ListFunctions` method. +type ListFunctionsResponse struct { + // Functions: The functions that match the request. + Functions []*Function `json:"functions,omitempty"` + + // NextPageToken: A token, which can be sent as `page_token` to retrieve + // the next page. If this field is omitted, there are no subsequent + // pages. + NextPageToken string `json:"nextPageToken,omitempty"` + + // Unreachable: Locations that could not be reached. The response does + // not include any functions from these locations. + Unreachable []string `json:"unreachable,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Functions") 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. "Functions") 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 *ListFunctionsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListFunctionsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ListLocationsResponse: The response message for +// Locations.ListLocations. +type ListLocationsResponse struct { + // Locations: A list of locations that matches the specified filter in + // the request. + Locations []*Location `json:"locations,omitempty"` + + // NextPageToken: The standard List next-page token. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Locations") 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 @@ -797,6 +1369,38 @@ func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// ListRuntimesResponse: Response for the `ListRuntimes` method. +type ListRuntimesResponse struct { + // Runtimes: The runtimes that match the request. + Runtimes []*Runtime `json:"runtimes,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Runtimes") 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. "Runtimes") 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 *ListRuntimesResponse) MarshalJSON() ([]byte, error) { + type NoMethod ListRuntimesResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // Location: A resource that represents Google Cloud Platform location. type Location struct { // DisplayName: The friendly name for this location, typically a nearby @@ -1077,21 +1681,40 @@ func (s *Policy) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// SetIamPolicyRequest: Request message for `SetIamPolicy` method. -type SetIamPolicyRequest struct { - // Policy: REQUIRED: The complete policy to be applied to the - // `resource`. The size of the policy is limited to a few 10s of KB. An - // empty policy is a valid policy but certain Google Cloud services - // (such as Projects) might reject them. - Policy *Policy `json:"policy,omitempty"` +// RepoSource: Location of the source in a Google Cloud Source +// Repository. +type RepoSource struct { + // BranchName: Regex matching branches to build. The syntax of the + // regular expressions accepted is the syntax accepted by RE2 and + // described at https://github.com/google/re2/wiki/Syntax + BranchName string `json:"branchName,omitempty"` - // UpdateMask: OPTIONAL: A FieldMask specifying which fields of the - // policy to modify. Only the fields in the mask will be modified. If no - // mask is provided, the following default mask is used: `paths: - // "bindings, etag" - UpdateMask string `json:"updateMask,omitempty"` + // CommitSha: Explicit commit SHA to build. + CommitSha string `json:"commitSha,omitempty"` - // ForceSendFields is a list of field names (e.g. "Policy") to + // Dir: Directory, relative to the source root, in which to run the + // build. This must be a relative path. If a step's `dir` is specified + // and is an absolute path, this value is ignored for that step's + // execution. eg. helloworld (no leading slash allowed) + Dir string `json:"dir,omitempty"` + + // InvertRegex: Only trigger a build if the revision regex does NOT + // match the revision regex. + InvertRegex bool `json:"invertRegex,omitempty"` + + // ProjectId: ID of the project that owns the Cloud Source Repository. + // If omitted, the project ID requesting the build is assumed. + ProjectId string `json:"projectId,omitempty"` + + // RepoName: Name of the Cloud Source Repository. + RepoName string `json:"repoName,omitempty"` + + // TagName: Regex matching tags to build. The syntax of the regular + // expressions accepted is the syntax accepted by RE2 and described at + // https://github.com/google/re2/wiki/Syntax + TagName string `json:"tagName,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BranchName") 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 @@ -1099,8 +1722,8 @@ type SetIamPolicyRequest struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Policy") to include in API - // requests with the JSON null value. By default, fields with empty + // NullFields is a list of field names (e.g. "BranchName") 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. @@ -1108,34 +1731,45 @@ type SetIamPolicyRequest struct { NullFields []string `json:"-"` } -func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) { - type NoMethod SetIamPolicyRequest +func (s *RepoSource) MarshalJSON() ([]byte, error) { + type NoMethod RepoSource raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// Status: The `Status` type defines a logical error model that is -// suitable for different programming environments, including REST APIs -// and RPC APIs. It is used by gRPC (https://github.com/grpc). Each -// `Status` message contains three pieces of data: error code, error -// message, and error details. You can find out more about this error -// model and how to work with it in the API Design Guide -// (https://cloud.google.com/apis/design/errors). -type Status struct { - // Code: The status code, which should be an enum value of - // google.rpc.Code. - Code int64 `json:"code,omitempty"` +// Runtime: Describes a runtime and any special information (e.g., +// deprecation status) related to it. +type Runtime struct { + // DisplayName: The user facing name, eg 'Go 1.13', 'Node.js 12', etc. + DisplayName string `json:"displayName,omitempty"` - // Details: A list of messages that carry the error details. There is a - // common set of message types for APIs to use. - Details []googleapi.RawMessage `json:"details,omitempty"` + // Environment: The environment for the runtime. + // + // Possible values: + // "ENVIRONMENT_UNSPECIFIED" - Unspecified + // "GEN_1" - Gen 1 + // "GEN_2" - Gen 2 + Environment string `json:"environment,omitempty"` - // Message: A developer-facing error message, which should be in - // English. Any user-facing error message should be localized and sent - // in the google.rpc.Status.details field, or localized by the client. - Message string `json:"message,omitempty"` + // Name: The name of the runtime, e.g., 'go113', 'nodejs12', etc. + Name string `json:"name,omitempty"` - // ForceSendFields is a list of field names (e.g. "Code") to + // Stage: The stage of life this runtime is in, e.g., BETA, GA, etc. + // + // Possible values: + // "RUNTIME_STAGE_UNSPECIFIED" - Not specified. + // "DEVELOPMENT" - The runtime is in development. + // "ALPHA" - The runtime is in the Alpha stage. + // "BETA" - The runtime is in the Beta stage. + // "GA" - The runtime is generally available. + // "DEPRECATED" - The runtime is deprecated. + // "DECOMMISSIONED" - The runtime is no longer supported. + Stage string `json:"stage,omitempty"` + + // Warnings: Warning messages, e.g., a deprecation warning. + Warnings []string `json:"warnings,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DisplayName") 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 @@ -1143,30 +1777,475 @@ type Status struct { // This may be used to include empty fields in Patch requests. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "Code") 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. "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 // 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 *Status) MarshalJSON() ([]byte, error) { - type NoMethod Status +func (s *Runtime) MarshalJSON() ([]byte, error) { + type NoMethod Runtime raw := NoMethod(*s) return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } -// TestIamPermissionsRequest: Request message for `TestIamPermissions` -// method. -type TestIamPermissionsRequest struct { - // Permissions: The set of permissions to check for the `resource`. - // Permissions with wildcards (such as `*` or `storage.*`) are not - // allowed. For more information see IAM Overview - // (https://cloud.google.com/iam/docs/overview#permissions). - Permissions []string `json:"permissions,omitempty"` - +// SecretEnvVar: Configuration for a secret environment variable. It has +// the information necessary to fetch the secret value from secret +// manager and expose it as an environment variable. +type SecretEnvVar struct { + // Key: Name of the environment variable. + Key string `json:"key,omitempty"` + + // ProjectId: Project identifier (preferably project number but can also + // be the project ID) of the project that contains the secret. If not + // set, it is assumed that the secret is in the same project as the + // function. + ProjectId string `json:"projectId,omitempty"` + + // Secret: Name of the secret in secret manager (not the full resource + // name). + Secret string `json:"secret,omitempty"` + + // Version: Version of the secret (version number or the string + // 'latest'). It is recommended to use a numeric version for secret + // environment variables as any updates to the secret value is not + // reflected until new instances start. + Version string `json:"version,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") 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. "Key") 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 *SecretEnvVar) MarshalJSON() ([]byte, error) { + type NoMethod SecretEnvVar + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// SecretVersion: Configuration for a single version. +type SecretVersion struct { + // Path: Relative path of the file under the mount path where the secret + // value for this version will be fetched and made available. For + // example, setting the mount_path as '/etc/secrets' and path as + // `secret_foo` would mount the secret value file at + // `/etc/secrets/secret_foo`. + Path string `json:"path,omitempty"` + + // Version: Version of the secret (version number or the string + // 'latest'). It is preferable to use `latest` version with secret + // volumes as secret value changes are reflected immediately. + Version string `json:"version,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Path") 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. "Path") 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 *SecretVersion) MarshalJSON() ([]byte, error) { + type NoMethod SecretVersion + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// SecretVolume: Configuration for a secret volume. It has the +// information necessary to fetch the secret value from secret manager +// and make it available as files mounted at the requested paths within +// the application container. +type SecretVolume struct { + // MountPath: The path within the container to mount the secret volume. + // For example, setting the mount_path as `/etc/secrets` would mount the + // secret value files under the `/etc/secrets` directory. This directory + // will also be completely shadowed and unavailable to mount any other + // secrets. Recommended mount path: /etc/secrets + MountPath string `json:"mountPath,omitempty"` + + // ProjectId: Project identifier (preferably project number but can also + // be the project ID) of the project that contains the secret. If not + // set, it is assumed that the secret is in the same project as the + // function. + ProjectId string `json:"projectId,omitempty"` + + // Secret: Name of the secret in secret manager (not the full resource + // name). + Secret string `json:"secret,omitempty"` + + // Versions: List of secret versions to mount for this secret. If empty, + // the `latest` version of the secret will be made available in a file + // named after the secret under the mount point. + Versions []*SecretVersion `json:"versions,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MountPath") 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. "MountPath") 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 *SecretVolume) MarshalJSON() ([]byte, error) { + type NoMethod SecretVolume + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ServiceConfig: Describes the Service being deployed. Currently +// Supported : Cloud Run (fully managed). +type ServiceConfig struct { + // AllTrafficOnLatestRevision: Whether 100% of traffic is routed to the + // latest revision. On CreateFunction and UpdateFunction, when set to + // true, the revision being deployed will serve 100% of traffic, + // ignoring any traffic split settings, if any. On GetFunction, true + // will be returned if the latest revision is serving 100% of traffic. + AllTrafficOnLatestRevision bool `json:"allTrafficOnLatestRevision,omitempty"` + + // AvailableMemory: The amount of memory available for a function. + // Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is + // supplied the value is interpreted as bytes. See + // https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go + // a full description. + AvailableMemory string `json:"availableMemory,omitempty"` + + // EnvironmentVariables: Environment variables that shall be available + // during function execution. + EnvironmentVariables map[string]string `json:"environmentVariables,omitempty"` + + // IngressSettings: The ingress settings for the function, controlling + // what traffic can reach it. + // + // Possible values: + // "INGRESS_SETTINGS_UNSPECIFIED" - Unspecified. + // "ALLOW_ALL" - Allow HTTP traffic from public and private sources. + // "ALLOW_INTERNAL_ONLY" - Allow HTTP traffic from only private VPC + // sources. + // "ALLOW_INTERNAL_AND_GCLB" - Allow HTTP traffic from private VPC + // sources and through GCLB. + IngressSettings string `json:"ingressSettings,omitempty"` + + // MaxInstanceCount: The limit on the maximum number of function + // instances that may coexist at a given time. In some cases, such as + // rapid traffic surges, Cloud Functions may, for a short period of + // time, create more instances than the specified max instances limit. + // If your function cannot tolerate this temporary behavior, you may + // want to factor in a safety margin and set a lower max instances value + // than your function can tolerate. See the Max Instances + // (https://cloud.google.com/functions/docs/max-instances) Guide for + // more details. + MaxInstanceCount int64 `json:"maxInstanceCount,omitempty"` + + // MinInstanceCount: The limit on the minimum number of function + // instances that may coexist at a given time. Function instances are + // kept in idle state for a short period after they finished executing + // the request to reduce cold start time for subsequent requests. + // Setting a minimum instance count will ensure that the given number of + // instances are kept running in idle state always. This can help with + // cold start times when jump in incoming request count occurs after the + // idle instance would have been stopped in the default case. + MinInstanceCount int64 `json:"minInstanceCount,omitempty"` + + // Revision: Output only. The name of service revision. + Revision string `json:"revision,omitempty"` + + // SecretEnvironmentVariables: Secret environment variables + // configuration. + SecretEnvironmentVariables []*SecretEnvVar `json:"secretEnvironmentVariables,omitempty"` + + // SecretVolumes: Secret volumes configuration. + SecretVolumes []*SecretVolume `json:"secretVolumes,omitempty"` + + // Service: Output only. Name of the service associated with a Function. + // The format of this field is + // `projects/{project}/locations/{region}/services/{service}` + Service string `json:"service,omitempty"` + + // ServiceAccountEmail: The email of the service's service account. If + // empty, defaults to + // `{project_number}-compute@developer.gserviceaccount.com`. + ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"` + + // TimeoutSeconds: The function execution timeout. Execution is + // considered failed and can be terminated if the function is not + // completed at the end of the timeout period. Defaults to 60 seconds. + TimeoutSeconds int64 `json:"timeoutSeconds,omitempty"` + + // Uri: Output only. URI of the Service deployed. + Uri string `json:"uri,omitempty"` + + // VpcConnector: The Serverless VPC Access connector that this cloud + // function can connect to. The format of this field is + // `projects/*/locations/*/connectors/*`. + VpcConnector string `json:"vpcConnector,omitempty"` + + // VpcConnectorEgressSettings: The egress settings for the connector, + // controlling what traffic is diverted through it. + // + // Possible values: + // "VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED" - Unspecified. + // "PRIVATE_RANGES_ONLY" - Use the VPC Access Connector only for + // private IP space from RFC1918. + // "ALL_TRAFFIC" - Force the use of VPC Access Connector for all + // egress traffic from the function. + VpcConnectorEgressSettings string `json:"vpcConnectorEgressSettings,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "AllTrafficOnLatestRevision") 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. + // "AllTrafficOnLatestRevision") 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 *ServiceConfig) MarshalJSON() ([]byte, error) { + type NoMethod ServiceConfig + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// SetIamPolicyRequest: Request message for `SetIamPolicy` method. +type SetIamPolicyRequest struct { + // Policy: REQUIRED: The complete policy to be applied to the + // `resource`. The size of the policy is limited to a few 10s of KB. An + // empty policy is a valid policy but certain Google Cloud services + // (such as Projects) might reject them. + Policy *Policy `json:"policy,omitempty"` + + // UpdateMask: OPTIONAL: A FieldMask specifying which fields of the + // policy to modify. Only the fields in the mask will be modified. If no + // mask is provided, the following default mask is used: `paths: + // "bindings, etag" + UpdateMask string `json:"updateMask,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Policy") 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. "Policy") 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 *SetIamPolicyRequest) MarshalJSON() ([]byte, error) { + type NoMethod SetIamPolicyRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// Source: The location of the function source code. +type Source struct { + // RepoSource: If provided, get the source from this location in a Cloud + // Source Repository. + RepoSource *RepoSource `json:"repoSource,omitempty"` + + // StorageSource: If provided, get the source from this location in + // Google Cloud Storage. + StorageSource *StorageSource `json:"storageSource,omitempty"` + + // ForceSendFields is a list of field names (e.g. "RepoSource") 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. "RepoSource") 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 *Source) MarshalJSON() ([]byte, error) { + type NoMethod Source + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// SourceProvenance: Provenance of the source. Ways to find the original +// source, or verify that some source was used for this build. +type SourceProvenance struct { + // ResolvedRepoSource: A copy of the build's `source.repo_source`, if + // exists, with any revisions resolved. + ResolvedRepoSource *RepoSource `json:"resolvedRepoSource,omitempty"` + + // ResolvedStorageSource: A copy of the build's `source.storage_source`, + // if exists, with any generations resolved. + ResolvedStorageSource *StorageSource `json:"resolvedStorageSource,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ResolvedRepoSource") + // 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. "ResolvedRepoSource") 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 *SourceProvenance) MarshalJSON() ([]byte, error) { + type NoMethod SourceProvenance + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// Status: The `Status` type defines a logical error model that is +// suitable for different programming environments, including REST APIs +// and RPC APIs. It is used by gRPC (https://github.com/grpc). Each +// `Status` message contains three pieces of data: error code, error +// message, and error details. You can find out more about this error +// model and how to work with it in the API Design Guide +// (https://cloud.google.com/apis/design/errors). +type Status struct { + // Code: The status code, which should be an enum value of + // google.rpc.Code. + Code int64 `json:"code,omitempty"` + + // Details: A list of messages that carry the error details. There is a + // common set of message types for APIs to use. + Details []googleapi.RawMessage `json:"details,omitempty"` + + // Message: A developer-facing error message, which should be in + // English. Any user-facing error message should be localized and sent + // in the google.rpc.Status.details field, or localized by the client. + Message string `json:"message,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Code") 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. "Code") 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 *Status) MarshalJSON() ([]byte, error) { + type NoMethod Status + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// StorageSource: Location of the source in an archive file in Google +// Cloud Storage. +type StorageSource struct { + // Bucket: Google Cloud Storage bucket containing the source (see Bucket + // Name Requirements + // (https://cloud.google.com/storage/docs/bucket-naming#requirements)). + Bucket string `json:"bucket,omitempty"` + + // Generation: Google Cloud Storage generation for the object. If the + // generation is omitted, the latest generation will be used. + Generation int64 `json:"generation,omitempty,string"` + + // Object: Google Cloud Storage object containing the source. This + // object must be a gzipped archive file (`.tar.gz`) containing source + // to build. + Object string `json:"object,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Bucket") 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. "Bucket") 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 *StorageSource) MarshalJSON() ([]byte, error) { + type NoMethod StorageSource + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// TestIamPermissionsRequest: Request message for `TestIamPermissions` +// method. +type TestIamPermissionsRequest struct { + // Permissions: The set of permissions to check for the `resource`. + // Permissions with wildcards (such as `*` or `storage.*`) are not + // allowed. For more information see IAM Overview + // (https://cloud.google.com/iam/docs/overview#permissions). + Permissions []string `json:"permissions,omitempty"` + // ForceSendFields is a list of field names (e.g. "Permissions") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any @@ -1298,14 +2377,1157 @@ func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocati // Header returns an http.Header that can be modified by the caller to // add HTTP headers to the request. -func (c *ProjectsLocationsListCall) Header() http.Header { +func (c *ProjectsLocationsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsListCall) 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}/locations") + 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.list" call. +// Exactly one of *ListLocationsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListLocationsResponse.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 *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, 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, &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, err + } + ret := &ListLocationsResponse{ + 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 information about the supported locations for this service.", + // "flatPath": "v2/projects/{projectsId}/locations", + // "httpMethod": "GET", + // "id": "cloudfunctions.projects.locations.list", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "filter": { + // "description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like `\"displayName=tokyo\"`, and is documented in more detail in [AIP-160](https://google.aip.dev/160).", + // "location": "query", + // "type": "string" + // }, + // "name": { + // "description": "The resource that owns the locations collection, if applicable.", + // "location": "path", + // "pattern": "^projects/[^/]+$", + // "required": true, + // "type": "string" + // }, + // "pageSize": { + // "description": "The maximum number of results to return. If not set, the service selects a default.", + // "format": "int32", + // "location": "query", + // "type": "integer" + // }, + // "pageToken": { + // "description": "A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "v2/{+name}/locations", + // "response": { + // "$ref": "ListLocationsResponse" + // }, + // "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 *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) 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.create": + +type ProjectsLocationsFunctionsCreateCall struct { + s *Service + parent string + function *Function + 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. +// +// - 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 *ProjectsLocationsFunctionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsCreateCall { + 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 *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 *ProjectsLocationsFunctionsCreateCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +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_ { + 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/{+parent}/functions") + 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 "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 { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, 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 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.create", + // "parameterOrder": [ + // "parent" + // ], + // "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/*`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+parent}/functions", + // "request": { + // "$ref": "Function" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudfunctions.projects.locations.functions.delete": + +type ProjectsLocationsFunctionsDeleteCall struct { + s *Service + name string + 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. +// +// - 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 *ProjectsLocationsFunctionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsDeleteCall { + 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 *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 *ProjectsLocationsFunctionsDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +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_ { + 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, "v2/{+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 "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 { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, 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": "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": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The name of the function which should be deleted.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/functions/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+name}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudfunctions.projects.locations.functions.generateDownloadUrl": + +type ProjectsLocationsFunctionsGenerateDownloadUrlCall struct { + s *Service + name string + generatedownloadurlrequest *GenerateDownloadUrlRequest + 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 +// +// - 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 *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGenerateDownloadUrlCall { + 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 *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 *ProjectsLocationsFunctionsGenerateDownloadUrlCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +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()) + 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}:generateDownloadUrl") + 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.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 { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &GenerateDownloadUrlResponse{ + 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 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 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}:generateDownloadUrl", + // "request": { + // "$ref": "GenerateDownloadUrlRequest" + // }, + // "response": { + // "$ref": "GenerateDownloadUrlResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudfunctions.projects.locations.functions.generateUploadUrl": + +type ProjectsLocationsFunctionsGenerateUploadUrlCall struct { + s *Service + parent string + generateuploadurlrequest *GenerateUploadUrlRequest + 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, these two headers need to be specified: * `content-type: +// application/zip` And this header SHOULD NOT be specified: * +// `Authorization: Bearer YOUR_TOKEN` +// +// - 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 *ProjectsLocationsFunctionsGenerateUploadUrlCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGenerateUploadUrlCall { + 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 *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 *ProjectsLocationsFunctionsGenerateUploadUrlCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +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()) + 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 += "?" + 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 "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 { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &GenerateUploadUrlResponse{ + 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 signed URL for uploading a function source code. For more information about the signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls. Once the function source code upload is complete, the used signed URL should be provided in CreateFunction or UpdateFunction request as a reference to the function source code. When uploading source code to the generated signed URL, please follow these restrictions: * Source file type should be a zip file. * No credentials should be attached - the signed URLs provide access to the target bucket using internal service identity; if credentials were attached, the identity from the credentials would be used, but that identity does not have permissions to upload files to the URL. When making a HTTP PUT request, these two headers need to be specified: * `content-type: application/zip` And this header SHOULD NOT be specified: * `Authorization: Bearer YOUR_TOKEN`", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions:generateUploadUrl", + // "httpMethod": "POST", + // "id": "cloudfunctions.projects.locations.functions.generateUploadUrl", + // "parameterOrder": [ + // "parent" + // ], + // "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/*`.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+parent}/functions:generateUploadUrl", + // "request": { + // "$ref": "GenerateUploadUrlRequest" + // }, + // "response": { + // "$ref": "GenerateUploadUrlResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + +// method id "cloudfunctions.projects.locations.functions.get": + +type ProjectsLocationsFunctionsGetCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Returns a function with the given name from the requested +// project. +// +// - 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 *ProjectsLocationsFunctionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGetCall { + 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 { + 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, &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, 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, &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, 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. +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 *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) { +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_ { @@ -1318,7 +3540,7 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/functions") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -1326,19 +3548,19 @@ func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error } 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.list" call. -// Exactly one of *ListLocationsResponse or error will be non-nil. Any +// 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 -// *ListLocationsResponse.ServerResponse.Header or (if a response was +// *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 *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) { +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 { @@ -1357,7 +3579,7 @@ func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocat if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &ListLocationsResponse{ + ret := &ListFunctionsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -1369,41 +3591,46 @@ func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocat } return ret, nil // { - // "description": "Lists information about the supported locations for this service.", - // "flatPath": "v2/projects/{projectsId}/locations", + // "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.list", + // "id": "cloudfunctions.projects.locations.functions.list", // "parameterOrder": [ - // "name" + // "parent" // ], // "parameters": { // "filter": { - // "description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like `\"displayName=tokyo\"`, and is documented in more detail in [AIP-160](https://google.aip.dev/160).", + // "description": "The filter for Functions that match the filter expression, following the syntax outlined in https://google.aip.dev/160.", // "location": "query", // "type": "string" // }, - // "name": { - // "description": "The resource that owns the locations collection, if applicable.", - // "location": "path", - // "pattern": "^projects/[^/]+$", - // "required": true, + // "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": "The maximum number of results to return. If not set, the service selects a default.", + // "description": "Maximum number of functions to return per call.", // "format": "int32", // "location": "query", // "type": "integer" // }, // "pageToken": { - // "description": "A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page.", + // "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/{+name}/locations", + // "path": "v2/{+parent}/functions", // "response": { - // "$ref": "ListLocationsResponse" + // "$ref": "ListFunctionsResponse" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -1415,7 +3642,7 @@ func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocat // 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 *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error { +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 { @@ -1433,118 +3660,98 @@ func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocat } } -// method id "cloudfunctions.projects.locations.functions.getIamPolicy": +// method id "cloudfunctions.projects.locations.functions.patch": -type ProjectsLocationsFunctionsGetIamPolicyCall struct { - s *Service - resource string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsLocationsFunctionsPatchCall struct { + s *Service + name string + function *Function + 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. +// Patch: Updates existing function. // -// - 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 +// - 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 } -// 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)) +// 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 *ProjectsLocationsFunctionsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsGetIamPolicyCall { +func (c *ProjectsLocationsFunctionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsFunctionsPatchCall { 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 *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 *ProjectsLocationsFunctionsGetIamPolicyCall) Header() http.Header { +func (c *ProjectsLocationsFunctionsPatchCall) 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 *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()) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } 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/{+resource}:getIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "resource": c.resource, + "name": c.name, }) 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.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 { @@ -1563,7 +3770,7 @@ func (c *ProjectsLocationsFunctionsGetIamPolicyCall) Do(opts ...googleapi.CallOp if err := googleapi.CheckResponse(res); err != nil { return nil, err } - ret := &Policy{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -1575,31 +3782,34 @@ 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": "Updates existing function.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/functions/{functionsId}", + // "httpMethod": "PATCH", + // "id": "cloudfunctions.projects.locations.functions.patch", // "parameterOrder": [ - // "resource" + // "name" // ], // "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.", + // "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/{+resource}:getIamPolicy", + // "path": "v2/{+name}", + // "request": { + // "$ref": "Function" + // }, // "response": { - // "$ref": "Policy" + // "$ref": "Operation" // }, // "scopes": [ // "https://www.googleapis.com/auth/cloud-platform" @@ -2272,3 +4482,164 @@ func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func( c.PageToken(x.NextPageToken) } } + +// method id "cloudfunctions.projects.locations.runtimes.list": + +type ProjectsLocationsRuntimesListCall struct { + s *Service + parent string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Returns a list of runtimes that are supported for the requested +// project. +// +// - parent: The project and location from which the runtimes should be +// listed, specified in the format `projects/*/locations/*`. +func (r *ProjectsLocationsRuntimesService) List(parent string) *ProjectsLocationsRuntimesListCall { + c := &ProjectsLocationsRuntimesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.parent = parent + return c +} + +// Filter sets the optional parameter "filter": The filter for Runtimes +// that match the filter expression, following the syntax outlined in +// https://google.aip.dev/160. +func (c *ProjectsLocationsRuntimesListCall) Filter(filter string) *ProjectsLocationsRuntimesListCall { + c.urlParams_.Set("filter", filter) + 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 *ProjectsLocationsRuntimesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsRuntimesListCall { + 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 *ProjectsLocationsRuntimesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsRuntimesListCall { + 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 *ProjectsLocationsRuntimesListCall) Context(ctx context.Context) *ProjectsLocationsRuntimesListCall { + 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 *ProjectsLocationsRuntimesListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsRuntimesListCall) 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}/runtimes") + 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.runtimes.list" call. +// Exactly one of *ListRuntimesResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ListRuntimesResponse.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 *ProjectsLocationsRuntimesListCall) Do(opts ...googleapi.CallOption) (*ListRuntimesResponse, 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, &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, err + } + ret := &ListRuntimesResponse{ + 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 runtimes that are supported for the requested project.", + // "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/runtimes", + // "httpMethod": "GET", + // "id": "cloudfunctions.projects.locations.runtimes.list", + // "parameterOrder": [ + // "parent" + // ], + // "parameters": { + // "filter": { + // "description": "The filter for Runtimes that match the filter expression, following the syntax outlined in https://google.aip.dev/160.", + // "location": "query", + // "type": "string" + // }, + // "parent": { + // "description": "Required. The project and location from which the runtimes should be listed, specified in the format `projects/*/locations/*`", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2/{+parent}/runtimes", + // "response": { + // "$ref": "ListRuntimesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} diff --git a/cloudfunctions/v2alpha/cloudfunctions-api.json b/cloudfunctions/v2alpha/cloudfunctions-api.json index c4fd724219d..315ad0ec316 100644 --- a/cloudfunctions/v2alpha/cloudfunctions-api.json +++ b/cloudfunctions/v2alpha/cloudfunctions-api.json @@ -571,7 +571,7 @@ } } }, - "revision": "20220622", + "revision": "20220707", "rootUrl": "https://cloudfunctions.googleapis.com/", "schemas": { "AuditConfig": { @@ -904,6 +904,153 @@ }, "type": "object" }, + "GoogleCloudFunctionsV2OperationMetadata": { + "description": "Represents the metadata of the long-running operation.", + "id": "GoogleCloudFunctionsV2OperationMetadata", + "properties": { + "apiVersion": { + "description": "API version used to start the operation.", + "type": "string" + }, + "cancelRequested": { + "description": "Identifies whether the user has requested cancellation of the operation. Operations that have successfully been cancelled have Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.", + "type": "boolean" + }, + "createTime": { + "description": "The time the operation was created.", + "format": "google-datetime", + "type": "string" + }, + "endTime": { + "description": "The time the operation finished running.", + "format": "google-datetime", + "type": "string" + }, + "requestResource": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "The original request that started the operation.", + "type": "object" + }, + "stages": { + "description": "Mechanism for reporting in-progress stages", + "items": { + "$ref": "GoogleCloudFunctionsV2Stage" + }, + "type": "array" + }, + "statusDetail": { + "description": "Human-readable status of the operation, if any.", + "type": "string" + }, + "target": { + "description": "Server-defined resource path for the target of the operation.", + "type": "string" + }, + "verb": { + "description": "Name of the verb executed by the operation.", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudFunctionsV2Stage": { + "description": "Each Stage of the deployment process", + "id": "GoogleCloudFunctionsV2Stage", + "properties": { + "message": { + "description": "Message describing the Stage", + "type": "string" + }, + "name": { + "description": "Name of the Stage. This will be unique for each Stage.", + "enum": [ + "NAME_UNSPECIFIED", + "ARTIFACT_REGISTRY", + "BUILD", + "SERVICE", + "TRIGGER", + "SERVICE_ROLLBACK", + "TRIGGER_ROLLBACK" + ], + "enumDescriptions": [ + "Not specified. Invalid name.", + "Artifact Regsitry Stage", + "Build Stage", + "Service Stage", + "Trigger Stage", + "Service Rollback Stage", + "Trigger Rollback Stage" + ], + "type": "string" + }, + "resource": { + "description": "Resource of the Stage", + "type": "string" + }, + "resourceUri": { + "description": "Link to the current Stage resource", + "type": "string" + }, + "state": { + "description": "Current state of the Stage", + "enum": [ + "STATE_UNSPECIFIED", + "NOT_STARTED", + "IN_PROGRESS", + "COMPLETE" + ], + "enumDescriptions": [ + "Not specified. Invalid state.", + "Stage has not started.", + "Stage is in progress.", + "Stage has completed." + ], + "type": "string" + }, + "stateMessages": { + "description": "State messages from the current Stage.", + "items": { + "$ref": "GoogleCloudFunctionsV2StateMessage" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudFunctionsV2StateMessage": { + "description": "Informational messages about the state of the Cloud Function or Operation.", + "id": "GoogleCloudFunctionsV2StateMessage", + "properties": { + "message": { + "description": "The message.", + "type": "string" + }, + "severity": { + "description": "Severity of the state message.", + "enum": [ + "SEVERITY_UNSPECIFIED", + "ERROR", + "WARNING", + "INFO" + ], + "enumDescriptions": [ + "Not specified. Invalid severity.", + "ERROR-level severity.", + "WARNING-level severity.", + "INFO-level severity." + ], + "type": "string" + }, + "type": { + "description": "One-word CamelCase type of the state message.", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudFunctionsV2alphaOperationMetadata": { "description": "Represents the metadata of the long-running operation.", "id": "GoogleCloudFunctionsV2alphaOperationMetadata", diff --git a/cloudfunctions/v2alpha/cloudfunctions-gen.go b/cloudfunctions/v2alpha/cloudfunctions-gen.go index fc03febdfe1..4ce649879d5 100644 --- a/cloudfunctions/v2alpha/cloudfunctions-gen.go +++ b/cloudfunctions/v2alpha/cloudfunctions-gen.go @@ -788,6 +788,161 @@ func (s *GenerateUploadUrlResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudFunctionsV2OperationMetadata: Represents the metadata of +// the long-running operation. +type GoogleCloudFunctionsV2OperationMetadata struct { + // ApiVersion: API version used to start the operation. + ApiVersion string `json:"apiVersion,omitempty"` + + // CancelRequested: Identifies whether the user has requested + // cancellation of the operation. Operations that have successfully been + // cancelled have Operation.error value with a google.rpc.Status.code of + // 1, corresponding to `Code.CANCELLED`. + CancelRequested bool `json:"cancelRequested,omitempty"` + + // CreateTime: The time the operation was created. + CreateTime string `json:"createTime,omitempty"` + + // EndTime: The time the operation finished running. + EndTime string `json:"endTime,omitempty"` + + // RequestResource: The original request that started the operation. + RequestResource googleapi.RawMessage `json:"requestResource,omitempty"` + + // Stages: Mechanism for reporting in-progress stages + Stages []*GoogleCloudFunctionsV2Stage `json:"stages,omitempty"` + + // StatusDetail: Human-readable status of the operation, if any. + StatusDetail string `json:"statusDetail,omitempty"` + + // Target: Server-defined resource path for the target of the operation. + Target string `json:"target,omitempty"` + + // Verb: Name of the verb executed by the operation. + Verb string `json:"verb,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ApiVersion") 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. "ApiVersion") 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 *GoogleCloudFunctionsV2OperationMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudFunctionsV2OperationMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudFunctionsV2Stage: Each Stage of the deployment process +type GoogleCloudFunctionsV2Stage struct { + // Message: Message describing the Stage + Message string `json:"message,omitempty"` + + // Name: Name of the Stage. This will be unique for each Stage. + // + // Possible values: + // "NAME_UNSPECIFIED" - Not specified. Invalid name. + // "ARTIFACT_REGISTRY" - Artifact Regsitry Stage + // "BUILD" - Build Stage + // "SERVICE" - Service Stage + // "TRIGGER" - Trigger Stage + // "SERVICE_ROLLBACK" - Service Rollback Stage + // "TRIGGER_ROLLBACK" - Trigger Rollback Stage + Name string `json:"name,omitempty"` + + // Resource: Resource of the Stage + Resource string `json:"resource,omitempty"` + + // ResourceUri: Link to the current Stage resource + ResourceUri string `json:"resourceUri,omitempty"` + + // State: Current state of the Stage + // + // Possible values: + // "STATE_UNSPECIFIED" - Not specified. Invalid state. + // "NOT_STARTED" - Stage has not started. + // "IN_PROGRESS" - Stage is in progress. + // "COMPLETE" - Stage has completed. + State string `json:"state,omitempty"` + + // StateMessages: State messages from the current Stage. + StateMessages []*GoogleCloudFunctionsV2StateMessage `json:"stateMessages,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 *GoogleCloudFunctionsV2Stage) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudFunctionsV2Stage + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudFunctionsV2StateMessage: Informational messages about the +// state of the Cloud Function or Operation. +type GoogleCloudFunctionsV2StateMessage struct { + // Message: The message. + Message string `json:"message,omitempty"` + + // Severity: Severity of the state message. + // + // Possible values: + // "SEVERITY_UNSPECIFIED" - Not specified. Invalid severity. + // "ERROR" - ERROR-level severity. + // "WARNING" - WARNING-level severity. + // "INFO" - INFO-level severity. + Severity string `json:"severity,omitempty"` + + // Type: One-word CamelCase type of the state message. + Type string `json:"type,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 *GoogleCloudFunctionsV2StateMessage) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudFunctionsV2StateMessage + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudFunctionsV2alphaOperationMetadata: Represents the metadata // of the long-running operation. type GoogleCloudFunctionsV2alphaOperationMetadata struct { diff --git a/cloudfunctions/v2beta/cloudfunctions-api.json b/cloudfunctions/v2beta/cloudfunctions-api.json index a779b59fa80..b4acb572a4a 100644 --- a/cloudfunctions/v2beta/cloudfunctions-api.json +++ b/cloudfunctions/v2beta/cloudfunctions-api.json @@ -571,7 +571,7 @@ } } }, - "revision": "20220622", + "revision": "20220707", "rootUrl": "https://cloudfunctions.googleapis.com/", "schemas": { "AuditConfig": { @@ -904,6 +904,153 @@ }, "type": "object" }, + "GoogleCloudFunctionsV2OperationMetadata": { + "description": "Represents the metadata of the long-running operation.", + "id": "GoogleCloudFunctionsV2OperationMetadata", + "properties": { + "apiVersion": { + "description": "API version used to start the operation.", + "type": "string" + }, + "cancelRequested": { + "description": "Identifies whether the user has requested cancellation of the operation. Operations that have successfully been cancelled have Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.", + "type": "boolean" + }, + "createTime": { + "description": "The time the operation was created.", + "format": "google-datetime", + "type": "string" + }, + "endTime": { + "description": "The time the operation finished running.", + "format": "google-datetime", + "type": "string" + }, + "requestResource": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "The original request that started the operation.", + "type": "object" + }, + "stages": { + "description": "Mechanism for reporting in-progress stages", + "items": { + "$ref": "GoogleCloudFunctionsV2Stage" + }, + "type": "array" + }, + "statusDetail": { + "description": "Human-readable status of the operation, if any.", + "type": "string" + }, + "target": { + "description": "Server-defined resource path for the target of the operation.", + "type": "string" + }, + "verb": { + "description": "Name of the verb executed by the operation.", + "type": "string" + } + }, + "type": "object" + }, + "GoogleCloudFunctionsV2Stage": { + "description": "Each Stage of the deployment process", + "id": "GoogleCloudFunctionsV2Stage", + "properties": { + "message": { + "description": "Message describing the Stage", + "type": "string" + }, + "name": { + "description": "Name of the Stage. This will be unique for each Stage.", + "enum": [ + "NAME_UNSPECIFIED", + "ARTIFACT_REGISTRY", + "BUILD", + "SERVICE", + "TRIGGER", + "SERVICE_ROLLBACK", + "TRIGGER_ROLLBACK" + ], + "enumDescriptions": [ + "Not specified. Invalid name.", + "Artifact Regsitry Stage", + "Build Stage", + "Service Stage", + "Trigger Stage", + "Service Rollback Stage", + "Trigger Rollback Stage" + ], + "type": "string" + }, + "resource": { + "description": "Resource of the Stage", + "type": "string" + }, + "resourceUri": { + "description": "Link to the current Stage resource", + "type": "string" + }, + "state": { + "description": "Current state of the Stage", + "enum": [ + "STATE_UNSPECIFIED", + "NOT_STARTED", + "IN_PROGRESS", + "COMPLETE" + ], + "enumDescriptions": [ + "Not specified. Invalid state.", + "Stage has not started.", + "Stage is in progress.", + "Stage has completed." + ], + "type": "string" + }, + "stateMessages": { + "description": "State messages from the current Stage.", + "items": { + "$ref": "GoogleCloudFunctionsV2StateMessage" + }, + "type": "array" + } + }, + "type": "object" + }, + "GoogleCloudFunctionsV2StateMessage": { + "description": "Informational messages about the state of the Cloud Function or Operation.", + "id": "GoogleCloudFunctionsV2StateMessage", + "properties": { + "message": { + "description": "The message.", + "type": "string" + }, + "severity": { + "description": "Severity of the state message.", + "enum": [ + "SEVERITY_UNSPECIFIED", + "ERROR", + "WARNING", + "INFO" + ], + "enumDescriptions": [ + "Not specified. Invalid severity.", + "ERROR-level severity.", + "WARNING-level severity.", + "INFO-level severity." + ], + "type": "string" + }, + "type": { + "description": "One-word CamelCase type of the state message.", + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudFunctionsV2alphaOperationMetadata": { "description": "Represents the metadata of the long-running operation.", "id": "GoogleCloudFunctionsV2alphaOperationMetadata", diff --git a/cloudfunctions/v2beta/cloudfunctions-gen.go b/cloudfunctions/v2beta/cloudfunctions-gen.go index f2f98ac00c7..8dd3ebf8881 100644 --- a/cloudfunctions/v2beta/cloudfunctions-gen.go +++ b/cloudfunctions/v2beta/cloudfunctions-gen.go @@ -788,6 +788,161 @@ func (s *GenerateUploadUrlResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudFunctionsV2OperationMetadata: Represents the metadata of +// the long-running operation. +type GoogleCloudFunctionsV2OperationMetadata struct { + // ApiVersion: API version used to start the operation. + ApiVersion string `json:"apiVersion,omitempty"` + + // CancelRequested: Identifies whether the user has requested + // cancellation of the operation. Operations that have successfully been + // cancelled have Operation.error value with a google.rpc.Status.code of + // 1, corresponding to `Code.CANCELLED`. + CancelRequested bool `json:"cancelRequested,omitempty"` + + // CreateTime: The time the operation was created. + CreateTime string `json:"createTime,omitempty"` + + // EndTime: The time the operation finished running. + EndTime string `json:"endTime,omitempty"` + + // RequestResource: The original request that started the operation. + RequestResource googleapi.RawMessage `json:"requestResource,omitempty"` + + // Stages: Mechanism for reporting in-progress stages + Stages []*GoogleCloudFunctionsV2Stage `json:"stages,omitempty"` + + // StatusDetail: Human-readable status of the operation, if any. + StatusDetail string `json:"statusDetail,omitempty"` + + // Target: Server-defined resource path for the target of the operation. + Target string `json:"target,omitempty"` + + // Verb: Name of the verb executed by the operation. + Verb string `json:"verb,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ApiVersion") 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. "ApiVersion") 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 *GoogleCloudFunctionsV2OperationMetadata) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudFunctionsV2OperationMetadata + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudFunctionsV2Stage: Each Stage of the deployment process +type GoogleCloudFunctionsV2Stage struct { + // Message: Message describing the Stage + Message string `json:"message,omitempty"` + + // Name: Name of the Stage. This will be unique for each Stage. + // + // Possible values: + // "NAME_UNSPECIFIED" - Not specified. Invalid name. + // "ARTIFACT_REGISTRY" - Artifact Regsitry Stage + // "BUILD" - Build Stage + // "SERVICE" - Service Stage + // "TRIGGER" - Trigger Stage + // "SERVICE_ROLLBACK" - Service Rollback Stage + // "TRIGGER_ROLLBACK" - Trigger Rollback Stage + Name string `json:"name,omitempty"` + + // Resource: Resource of the Stage + Resource string `json:"resource,omitempty"` + + // ResourceUri: Link to the current Stage resource + ResourceUri string `json:"resourceUri,omitempty"` + + // State: Current state of the Stage + // + // Possible values: + // "STATE_UNSPECIFIED" - Not specified. Invalid state. + // "NOT_STARTED" - Stage has not started. + // "IN_PROGRESS" - Stage is in progress. + // "COMPLETE" - Stage has completed. + State string `json:"state,omitempty"` + + // StateMessages: State messages from the current Stage. + StateMessages []*GoogleCloudFunctionsV2StateMessage `json:"stateMessages,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 *GoogleCloudFunctionsV2Stage) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudFunctionsV2Stage + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GoogleCloudFunctionsV2StateMessage: Informational messages about the +// state of the Cloud Function or Operation. +type GoogleCloudFunctionsV2StateMessage struct { + // Message: The message. + Message string `json:"message,omitempty"` + + // Severity: Severity of the state message. + // + // Possible values: + // "SEVERITY_UNSPECIFIED" - Not specified. Invalid severity. + // "ERROR" - ERROR-level severity. + // "WARNING" - WARNING-level severity. + // "INFO" - INFO-level severity. + Severity string `json:"severity,omitempty"` + + // Type: One-word CamelCase type of the state message. + Type string `json:"type,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 *GoogleCloudFunctionsV2StateMessage) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudFunctionsV2StateMessage + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudFunctionsV2alphaOperationMetadata: Represents the metadata // of the long-running operation. type GoogleCloudFunctionsV2alphaOperationMetadata struct { diff --git a/cloudtasks/v2beta2/cloudtasks-api.json b/cloudtasks/v2beta2/cloudtasks-api.json index 250b2c00a80..d2cdb780fd9 100644 --- a/cloudtasks/v2beta2/cloudtasks-api.json +++ b/cloudtasks/v2beta2/cloudtasks-api.json @@ -179,6 +179,34 @@ "resources": { "queues": { "methods": { + "buffer": { + "description": "Creates and buffers a new task without the need to explicitly define a Task message. The queue must be an http queue (i.e., must have HTTP target). This method is used for a simplified application of Cloud Tasks queues in buffer and rate limitting HTTP requests.", + "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}:buffer", + "httpMethod": "POST", + "id": "cloudtasks.projects.locations.queues.buffer", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` The queue must already exist.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2beta2/{+name}:buffer", + "request": { + "$ref": "BufferQueueRequest" + }, + "response": { + "$ref": "BufferQueueResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, "create": { "description": "Creates a queue. Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not. WARNING: Using this method may have unintended side effects if you are using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method.", "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues", @@ -809,7 +837,7 @@ } } }, - "revision": "20220520", + "revision": "20220713", "rootUrl": "https://cloudtasks.googleapis.com/", "schemas": { "AcknowledgeTaskRequest": { @@ -953,6 +981,28 @@ }, "type": "object" }, + "BufferQueueRequest": { + "description": "Request message for BufferQueue.", + "id": "BufferQueueRequest", + "properties": { + "body": { + "$ref": "HttpBody", + "description": "Body of the HTTP request. The body can take any generic value. The value will be written to the HttpRequest of the [Task]." + } + }, + "type": "object" + }, + "BufferQueueResponse": { + "description": "Response message for BufferQueue.", + "id": "BufferQueueResponse", + "properties": { + "task": { + "description": "The name of the created task. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. TASK_ID is randomly generated and is unique within the queue.", + "type": "string" + } + }, + "type": "object" + }, "CancelLeaseRequest": { "description": "Request message for canceling a lease using CancelLease.", "id": "CancelLeaseRequest", @@ -1056,6 +1106,156 @@ }, "type": "object" }, + "Header": { + "description": "Defines a header message. A header can have a key and a value.", + "id": "Header", + "properties": { + "key": { + "format": "byte", + "type": "string" + }, + "value": { + "format": "byte", + "type": "string" + } + }, + "type": "object" + }, + "HeaderOverride": { + "description": "Wraps the Header object.", + "id": "HeaderOverride", + "properties": { + "header": { + "$ref": "Header", + "description": "header embodying a key and a value." + } + }, + "type": "object" + }, + "HttpBody": { + "description": "Message that represents an arbitrary HTTP body. It should only be used for payload formats that can't be represented as JSON, such as raw binary or an HTML page. This message can be used both in streaming and non-streaming API methods in the request as well as the response. It can be used as a top-level request field, which is convenient if one wants to extract parameters from either the URL or HTTP template into the request fields and also want access to the raw HTTP body. Example: message GetResourceRequest { // A unique request id. string request_id = 1; // The raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; } service ResourceService { rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } Example with streaming methods: service CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns (stream google.api.HttpBody); } Use of this type only changes how the request and response bodies are handled, all other features will continue to work unchanged.", + "id": "HttpBody", + "properties": { + "contentType": { + "description": "The HTTP Content-Type header value specifying the content type of the body.", + "type": "string" + }, + "data": { + "description": "The HTTP request/response body as raw binary.", + "format": "byte", + "type": "string" + }, + "extensions": { + "description": "Application specific response metadata. Must be set in the first response for streaming APIs.", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "HttpRequest": { + "description": "HTTP request. The task will be pushed to the worker as an HTTP request. An HTTP request embodies a url, an http method, headers, body and authorization for the http task.", + "id": "HttpRequest", + "properties": { + "body": { + "description": "HTTP request body. A request body is allowed only if the HTTP method is POST, PUT, or PATCH. It is an error to set body on a task with an incompatible HttpMethod.", + "format": "byte", + "type": "string" + }, + "headers": { + "additionalProperties": { + "type": "string" + }, + "description": "HTTP request headers. This map contains the header field names and values. Headers can be set when running the task is created or task is created. These headers represent a subset of the headers that will accompany the task's HTTP request. Some HTTP request headers will be ignored or replaced. A partial list of headers that will be ignored or replaced is: * Any header that is prefixed with \"X-Google-Cloud-Tasks-\" will be treated as service header. Service headers define properties of the task and are predefined in CloudTask. * Host: This will be computed by Cloud Tasks and derived from HttpRequest.url. * Content-Length: This will be computed by Cloud Tasks. * User-Agent: This will be set to `\"Google-Cloud-Tasks\"`. * `X-Google-*`: Google use only. * `X-AppEngine-*`: Google use only. `Content-Type` won't be set by Cloud Tasks. You can explicitly set `Content-Type` to a media type when the task is created. For example, `Content-Type` can be set to `\"application/octet-stream\"` or `\"application/json\"`. Headers which can have multiple values (according to RFC2616) can be specified using comma-separated values. The size of the headers must be less than 80KB.", + "type": "object" + }, + "httpMethod": { + "description": "The HTTP method to use for the request. The default is POST.", + "enum": [ + "HTTP_METHOD_UNSPECIFIED", + "POST", + "GET", + "HEAD", + "PUT", + "DELETE" + ], + "enumDescriptions": [ + "HTTP method unspecified", + "HTTP POST", + "HTTP GET", + "HTTP HEAD", + "HTTP PUT", + "HTTP DELETE" + ], + "type": "string" + }, + "oauthToken": { + "$ref": "OAuthToken", + "description": "If specified, an [OAuth token](https://developers.google.com/identity/protocols/OAuth2) will be generated and attached as an `Authorization` header in the HTTP request. This type of authorization should generally only be used when calling Google APIs hosted on *.googleapis.com." + }, + "oidcToken": { + "$ref": "OidcToken", + "description": "If specified, an [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) token will be generated and attached as an `Authorization` header in the HTTP request. This type of authorization can be used for many scenarios, including calling Cloud Run, or endpoints where you intend to validate the token yourself." + }, + "url": { + "description": "Required. The full url path that the request will be sent to. This string must begin with either \"http://\" or \"https://\". Some examples are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will encode some characters for safety and compatibility. The maximum allowed URL length is 2083 characters after encoding. The `Location` header response from a redirect response [`300` - `399`] may be followed. The redirect is not counted as a separate attempt.", + "type": "string" + } + }, + "type": "object" + }, + "HttpTarget": { + "description": "HTTP target. When specified as a Queue, all the tasks with [HttpRequest] will be overridden according to the target.", + "id": "HttpTarget", + "properties": { + "headerOverrides": { + "description": "HTTP target headers. This map contains the header field names and values. Headers will be set when running the task is created and/or task is created. These headers represent a subset of the headers that will accompany the task's HTTP request. Some HTTP request headers will be ignored or replaced. A partial list of headers that will be ignored or replaced is: * Any header that is prefixed with \"X-Google-Cloud-Tasks-\" will be treated as service header. Service headers define properties of the task and are predefined in CloudTask. * Host: This will be computed by Cloud Tasks and derived from HttpRequest.url. * Content-Length: This will be computed by Cloud Tasks. * User-Agent: This will be set to `\"Google-Cloud-Tasks\"`. * `X-Google-*`: Google use only. * `X-AppEngine-*`: Google use only. `Content-Type` won't be set by Cloud Tasks. You can explicitly set `Content-Type` to a media type when the task is created. For example, `Content-Type` can be set to `\"application/octet-stream\"` or `\"application/json\"`. Headers which can have multiple values (according to RFC2616) can be specified using comma-separated values. The size of the headers must be less than 80KB. Queue-level headers to override headers of all the tasks in the queue.", + "items": { + "$ref": "HeaderOverride" + }, + "type": "array" + }, + "httpMethod": { + "description": "The HTTP method to use for the request. When specified, it will override HttpRequest for the task. Note that if the value is set to HttpMethod the HttpRequest of the task will be ignored at execution time.", + "enum": [ + "HTTP_METHOD_UNSPECIFIED", + "POST", + "GET", + "HEAD", + "PUT", + "DELETE" + ], + "enumDescriptions": [ + "HTTP method unspecified", + "HTTP POST", + "HTTP GET", + "HTTP HEAD", + "HTTP PUT", + "HTTP DELETE" + ], + "type": "string" + }, + "oauthToken": { + "$ref": "OAuthToken", + "description": "If specified, an [OAuth token](https://developers.google.com/identity/protocols/OAuth2) will be generated and attached as an `Authorization` header in the HTTP request. This type of authorization should generally only be used when calling Google APIs hosted on *.googleapis.com." + }, + "oidcToken": { + "$ref": "OidcToken", + "description": "If specified, an [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) token will be generated and attached as an `Authorization` header in the HTTP request. This type of authorization can be used for many scenarios, including calling Cloud Run, or endpoints where you intend to validate the token yourself." + }, + "uriOverride": { + "$ref": "UriOverride", + "description": "Uri override. When specified modifies the execution Uri for all the tasks in the queue." + } + }, + "type": "object" + }, "LeaseTasksRequest": { "description": "Request message for leasing tasks using LeaseTasks.", "id": "LeaseTasksRequest", @@ -1193,6 +1393,36 @@ }, "type": "object" }, + "OAuthToken": { + "description": "Contains information needed for generating an [OAuth token](https://developers.google.com/identity/protocols/OAuth2). This type of authorization should generally only be used when calling Google APIs hosted on *.googleapis.com.", + "id": "OAuthToken", + "properties": { + "scope": { + "description": "OAuth scope to be used for generating OAuth access token. If not specified, \"https://www.googleapis.com/auth/cloud-platform\" will be used.", + "type": "string" + }, + "serviceAccountEmail": { + "description": "[Service account email](https://cloud.google.com/iam/docs/service-accounts) to be used for generating OAuth token. The service account must be within the same project as the queue. The caller must have iam.serviceAccounts.actAs permission for the service account.", + "type": "string" + } + }, + "type": "object" + }, + "OidcToken": { + "description": "Contains information needed for generating an [OpenID Connect token](https://developers.google.com/identity/protocols/OpenIDConnect). This type of authorization can be used for many scenarios, including calling Cloud Run, or endpoints where you intend to validate the token yourself.", + "id": "OidcToken", + "properties": { + "audience": { + "description": "Audience to be used when generating OIDC token. If not specified, the URI specified in target will be used.", + "type": "string" + }, + "serviceAccountEmail": { + "description": "[Service account email](https://cloud.google.com/iam/docs/service-accounts) to be used for generating OIDC token. The service account must be within the same project as the queue. The caller must have iam.serviceAccounts.actAs permission for the service account.", + "type": "string" + } + }, + "type": "object" + }, "PauseQueueRequest": { "description": "Request message for PauseQueue.", "id": "PauseQueueRequest", @@ -1259,6 +1489,10 @@ "$ref": "AppEngineHttpTarget", "description": "App Engine HTTP target. An App Engine queue is a queue that has an AppEngineHttpTarget." }, + "httpTarget": { + "$ref": "HttpTarget", + "description": "An http_target is used to override the target values for HTTP tasks." + }, "name": { "description": "Caller-specified and required in CreateQueue, after which it becomes output only. The queue name. The queue name must have the following format: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), hyphens (-), colons (:), or periods (.). For more information, see [Identifying projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) * `LOCATION_ID` is the canonical ID for the queue's location. The list of available locations can be obtained by calling ListLocations. For more information, see https://cloud.google.com/about/locations/. * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or hyphens (-). The maximum length is 100 characters.", "type": "string" @@ -1518,6 +1752,10 @@ "format": "google-datetime", "type": "string" }, + "httpRequest": { + "$ref": "HttpRequest", + "description": "HTTP request that is sent to the task's target. An HTTP task is a task that has HttpRequest set." + }, "name": { "description": "Optionally caller-specified in CreateTask. The task name. The task name must have the following format: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), hyphens (-), colons (:), or periods (.). For more information, see [Identifying projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) * `LOCATION_ID` is the canonical ID for the task's location. The list of available locations can be obtained by calling ListLocations. For more information, see https://cloud.google.com/about/locations/. * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or hyphens (-). The maximum length is 100 characters. * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), hyphens (-), or underscores (_). The maximum length is 500 characters.", "type": "string" @@ -1604,6 +1842,44 @@ } }, "type": "object" + }, + "UriOverride": { + "description": "Uri Override. When specified, all the HTTP tasks inside the queue will be partially or fully overridden depending on the configured values.", + "id": "UriOverride", + "properties": { + "host": { + "description": "Host override. When specified, the host part of url will be overridden. For example, if the original Uri is \"https://www.google.com\", and host is set to \"example.net\", the overridden Uri will be \"https://example.net\".", + "type": "string" + }, + "path": { + "description": "Uri path. Will be used as the path for the current Uri (replaces any existing path of the task url).", + "type": "string" + }, + "port": { + "description": "Port override. When specified, the port part of Uri will be replaced by the provided value. For instance, for a Uri http://www.google.com/foo and port=123 the overridden Uri becomes http://www.google.com:123/foo.", + "format": "int64", + "type": "string" + }, + "query": { + "description": "Uri Query. Will replace the query part of the task uri.", + "type": "string" + }, + "scheme": { + "description": "Scheme override. When specified, the Uri scheme is replaced by the provided value.", + "enum": [ + "SCHEME_UNSPECIFIED", + "HTTP", + "HTTPS" + ], + "enumDescriptions": [ + "Scheme unspecified. Defaults to HTTPS.", + "Convert the scheme to HTTP, e.g., https://www.google.ca will change to http://www.google.ca.", + "Convert the scheme to HTTPS, e.g., http://www.google.ca will change to https://www.google.ca." + ], + "type": "string" + } + }, + "type": "object" } }, "servicePath": "", diff --git a/cloudtasks/v2beta2/cloudtasks-gen.go b/cloudtasks/v2beta2/cloudtasks-gen.go index 156edb0ff2e..93fb361352b 100644 --- a/cloudtasks/v2beta2/cloudtasks-gen.go +++ b/cloudtasks/v2beta2/cloudtasks-gen.go @@ -596,6 +596,69 @@ func (s *Binding) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// BufferQueueRequest: Request message for BufferQueue. +type BufferQueueRequest struct { + // Body: Body of the HTTP request. The body can take any generic value. + // The value will be written to the HttpRequest of the [Task]. + Body *HttpBody `json:"body,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Body") 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. "Body") 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 *BufferQueueRequest) MarshalJSON() ([]byte, error) { + type NoMethod BufferQueueRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// BufferQueueResponse: Response message for BufferQueue. +type BufferQueueResponse struct { + // Task: The name of the created task. For example: + // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ + // ID`. TASK_ID is randomly generated and is unique within the queue. + Task string `json:"task,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Task") 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. "Task") 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 *BufferQueueResponse) MarshalJSON() ([]byte, error) { + type NoMethod BufferQueueResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // CancelLeaseRequest: Request message for canceling a lease using // CancelLease. type CancelLeaseRequest struct { @@ -864,6 +927,288 @@ func (s *GetPolicyOptions) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// Header: Defines a header message. A header can have a key and a +// value. +type Header struct { + Key string `json:"key,omitempty"` + + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Key") 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. "Key") 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 *Header) MarshalJSON() ([]byte, error) { + type NoMethod Header + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// HeaderOverride: Wraps the Header object. +type HeaderOverride struct { + // Header: header embodying a key and a value. + Header *Header `json:"header,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Header") 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. "Header") 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 *HeaderOverride) MarshalJSON() ([]byte, error) { + type NoMethod HeaderOverride + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// HttpBody: Message that represents an arbitrary HTTP body. It should +// only be used for payload formats that can't be represented as JSON, +// such as raw binary or an HTML page. This message can be used both in +// streaming and non-streaming API methods in the request as well as the +// response. It can be used as a top-level request field, which is +// convenient if one wants to extract parameters from either the URL or +// HTTP template into the request fields and also want access to the raw +// HTTP body. Example: message GetResourceRequest { // A unique request +// id. string request_id = 1; // The raw HTTP body is bound to this +// field. google.api.HttpBody http_body = 2; } service ResourceService { +// rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); +// rpc UpdateResource(google.api.HttpBody) returns +// (google.protobuf.Empty); } Example with streaming methods: service +// CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns +// (stream google.api.HttpBody); rpc UpdateCalendar(stream +// google.api.HttpBody) returns (stream google.api.HttpBody); } Use of +// this type only changes how the request and response bodies are +// handled, all other features will continue to work unchanged. +type HttpBody struct { + // ContentType: The HTTP Content-Type header value specifying the + // content type of the body. + ContentType string `json:"contentType,omitempty"` + + // Data: The HTTP request/response body as raw binary. + Data string `json:"data,omitempty"` + + // Extensions: Application specific response metadata. Must be set in + // the first response for streaming APIs. + Extensions []googleapi.RawMessage `json:"extensions,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ContentType") 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. "ContentType") 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 *HttpBody) MarshalJSON() ([]byte, error) { + type NoMethod HttpBody + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// HttpRequest: HTTP request. The task will be pushed to the worker as +// an HTTP request. An HTTP request embodies a url, an http method, +// headers, body and authorization for the http task. +type HttpRequest struct { + // Body: HTTP request body. A request body is allowed only if the HTTP + // method is POST, PUT, or PATCH. It is an error to set body on a task + // with an incompatible HttpMethod. + Body string `json:"body,omitempty"` + + // Headers: HTTP request headers. This map contains the header field + // names and values. Headers can be set when running the task is created + // or task is created. These headers represent a subset of the headers + // that will accompany the task's HTTP request. Some HTTP request + // headers will be ignored or replaced. A partial list of headers that + // will be ignored or replaced is: * Any header that is prefixed with + // "X-Google-Cloud-Tasks-" will be treated as service header. Service + // headers define properties of the task and are predefined in + // CloudTask. * Host: This will be computed by Cloud Tasks and derived + // from HttpRequest.url. * Content-Length: This will be computed by + // Cloud Tasks. * User-Agent: This will be set to + // "Google-Cloud-Tasks". * `X-Google-*`: Google use only. * + // `X-AppEngine-*`: Google use only. `Content-Type` won't be set by + // Cloud Tasks. You can explicitly set `Content-Type` to a media type + // when the task is created. For example, `Content-Type` can be set to + // "application/octet-stream" or "application/json". Headers which + // can have multiple values (according to RFC2616) can be specified + // using comma-separated values. The size of the headers must be less + // than 80KB. + Headers map[string]string `json:"headers,omitempty"` + + // HttpMethod: The HTTP method to use for the request. The default is + // POST. + // + // Possible values: + // "HTTP_METHOD_UNSPECIFIED" - HTTP method unspecified + // "POST" - HTTP POST + // "GET" - HTTP GET + // "HEAD" - HTTP HEAD + // "PUT" - HTTP PUT + // "DELETE" - HTTP DELETE + HttpMethod string `json:"httpMethod,omitempty"` + + // OauthToken: If specified, an OAuth token + // (https://developers.google.com/identity/protocols/OAuth2) will be + // generated and attached as an `Authorization` header in the HTTP + // request. This type of authorization should generally only be used + // when calling Google APIs hosted on *.googleapis.com. + OauthToken *OAuthToken `json:"oauthToken,omitempty"` + + // OidcToken: If specified, an OIDC + // (https://developers.google.com/identity/protocols/OpenIDConnect) + // token will be generated and attached as an `Authorization` header in + // the HTTP request. This type of authorization can be used for many + // scenarios, including calling Cloud Run, or endpoints where you intend + // to validate the token yourself. + OidcToken *OidcToken `json:"oidcToken,omitempty"` + + // Url: Required. The full url path that the request will be sent to. + // This string must begin with either "http://" or "https://". Some + // examples are: `http://acme.com` and `https://acme.com/sales:8080`. + // Cloud Tasks will encode some characters for safety and compatibility. + // The maximum allowed URL length is 2083 characters after encoding. The + // `Location` header response from a redirect response [`300` - `399`] + // may be followed. The redirect is not counted as a separate attempt. + Url string `json:"url,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Body") 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. "Body") 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 *HttpRequest) MarshalJSON() ([]byte, error) { + type NoMethod HttpRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// HttpTarget: HTTP target. When specified as a Queue, all the tasks +// with [HttpRequest] will be overridden according to the target. +type HttpTarget struct { + // HeaderOverrides: HTTP target headers. This map contains the header + // field names and values. Headers will be set when running the task is + // created and/or task is created. These headers represent a subset of + // the headers that will accompany the task's HTTP request. Some HTTP + // request headers will be ignored or replaced. A partial list of + // headers that will be ignored or replaced is: * Any header that is + // prefixed with "X-Google-Cloud-Tasks-" will be treated as service + // header. Service headers define properties of the task and are + // predefined in CloudTask. * Host: This will be computed by Cloud Tasks + // and derived from HttpRequest.url. * Content-Length: This will be + // computed by Cloud Tasks. * User-Agent: This will be set to + // "Google-Cloud-Tasks". * `X-Google-*`: Google use only. * + // `X-AppEngine-*`: Google use only. `Content-Type` won't be set by + // Cloud Tasks. You can explicitly set `Content-Type` to a media type + // when the task is created. For example, `Content-Type` can be set to + // "application/octet-stream" or "application/json". Headers which + // can have multiple values (according to RFC2616) can be specified + // using comma-separated values. The size of the headers must be less + // than 80KB. Queue-level headers to override headers of all the tasks + // in the queue. + HeaderOverrides []*HeaderOverride `json:"headerOverrides,omitempty"` + + // HttpMethod: The HTTP method to use for the request. When specified, + // it will override HttpRequest for the task. Note that if the value is + // set to HttpMethod the HttpRequest of the task will be ignored at + // execution time. + // + // Possible values: + // "HTTP_METHOD_UNSPECIFIED" - HTTP method unspecified + // "POST" - HTTP POST + // "GET" - HTTP GET + // "HEAD" - HTTP HEAD + // "PUT" - HTTP PUT + // "DELETE" - HTTP DELETE + HttpMethod string `json:"httpMethod,omitempty"` + + // OauthToken: If specified, an OAuth token + // (https://developers.google.com/identity/protocols/OAuth2) will be + // generated and attached as an `Authorization` header in the HTTP + // request. This type of authorization should generally only be used + // when calling Google APIs hosted on *.googleapis.com. + OauthToken *OAuthToken `json:"oauthToken,omitempty"` + + // OidcToken: If specified, an OIDC + // (https://developers.google.com/identity/protocols/OpenIDConnect) + // token will be generated and attached as an `Authorization` header in + // the HTTP request. This type of authorization can be used for many + // scenarios, including calling Cloud Run, or endpoints where you intend + // to validate the token yourself. + OidcToken *OidcToken `json:"oidcToken,omitempty"` + + // UriOverride: Uri override. When specified modifies the execution Uri + // for all the tasks in the queue. + UriOverride *UriOverride `json:"uriOverride,omitempty"` + + // ForceSendFields is a list of field names (e.g. "HeaderOverrides") 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. "HeaderOverrides") 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 *HttpTarget) MarshalJSON() ([]byte, error) { + type NoMethod HttpTarget + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // LeaseTasksRequest: Request message for leasing tasks using // LeaseTasks. type LeaseTasksRequest struct { @@ -1144,6 +1489,87 @@ func (s *Location) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// OAuthToken: Contains information needed for generating an OAuth token +// (https://developers.google.com/identity/protocols/OAuth2). This type +// of authorization should generally only be used when calling Google +// APIs hosted on *.googleapis.com. +type OAuthToken struct { + // Scope: OAuth scope to be used for generating OAuth access token. If + // not specified, "https://www.googleapis.com/auth/cloud-platform" will + // be used. + Scope string `json:"scope,omitempty"` + + // ServiceAccountEmail: Service account email + // (https://cloud.google.com/iam/docs/service-accounts) to be used for + // generating OAuth token. The service account must be within the same + // project as the queue. The caller must have iam.serviceAccounts.actAs + // permission for the service account. + ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Scope") 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. "Scope") 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 *OAuthToken) MarshalJSON() ([]byte, error) { + type NoMethod OAuthToken + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// OidcToken: Contains information needed for generating an OpenID +// Connect token +// (https://developers.google.com/identity/protocols/OpenIDConnect). +// This type of authorization can be used for many scenarios, including +// calling Cloud Run, or endpoints where you intend to validate the +// token yourself. +type OidcToken struct { + // Audience: Audience to be used when generating OIDC token. If not + // specified, the URI specified in target will be used. + Audience string `json:"audience,omitempty"` + + // ServiceAccountEmail: Service account email + // (https://cloud.google.com/iam/docs/service-accounts) to be used for + // generating OIDC token. The service account must be within the same + // project as the queue. The caller must have iam.serviceAccounts.actAs + // permission for the service account. + ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Audience") 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. "Audience") 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 *OidcToken) MarshalJSON() ([]byte, error) { + type NoMethod OidcToken + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // PauseQueueRequest: Request message for PauseQueue. type PauseQueueRequest struct { } @@ -1314,6 +1740,10 @@ type Queue struct { // queue that has an AppEngineHttpTarget. AppEngineHttpTarget *AppEngineHttpTarget `json:"appEngineHttpTarget,omitempty"` + // HttpTarget: An http_target is used to override the target values for + // HTTP tasks. + HttpTarget *HttpTarget `json:"httpTarget,omitempty"` + // Name: Caller-specified and required in CreateQueue, after which it // becomes output only. The queue name. The queue name must have the // following format: @@ -1883,6 +2313,10 @@ type Task struct { // `create_time` will be truncated to the nearest second. CreateTime string `json:"createTime,omitempty"` + // HttpRequest: HTTP request that is sent to the task's target. An HTTP + // task is a task that has HttpRequest set. + HttpRequest *HttpRequest `json:"httpRequest,omitempty"` + // Name: Optionally caller-specified in CreateTask. The task name. The // task name must have the following format: // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ @@ -2073,6 +2507,63 @@ func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// UriOverride: Uri Override. When specified, all the HTTP tasks inside +// the queue will be partially or fully overridden depending on the +// configured values. +type UriOverride struct { + // Host: Host override. When specified, the host part of url will be + // overridden. For example, if the original Uri is + // "https://www.google.com", and host is set to "example.net", the + // overridden Uri will be "https://example.net". + Host string `json:"host,omitempty"` + + // Path: Uri path. Will be used as the path for the current Uri + // (replaces any existing path of the task url). + Path string `json:"path,omitempty"` + + // Port: Port override. When specified, the port part of Uri will be + // replaced by the provided value. For instance, for a Uri + // http://www.google.com/foo and port=123 the overridden Uri becomes + // http://www.google.com:123/foo. + Port int64 `json:"port,omitempty,string"` + + // Query: Uri Query. Will replace the query part of the task uri. + Query string `json:"query,omitempty"` + + // Scheme: Scheme override. When specified, the Uri scheme is replaced + // by the provided value. + // + // Possible values: + // "SCHEME_UNSPECIFIED" - Scheme unspecified. Defaults to HTTPS. + // "HTTP" - Convert the scheme to HTTP, e.g., https://www.google.ca + // will change to http://www.google.ca. + // "HTTPS" - Convert the scheme to HTTPS, e.g., http://www.google.ca + // will change to https://www.google.ca. + Scheme string `json:"scheme,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Host") 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. "Host") 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 *UriOverride) MarshalJSON() ([]byte, error) { + type NoMethod UriOverride + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // method id "cloudtasks.projects.locations.get": type ProjectsLocationsGetCall struct { @@ -2428,6 +2919,153 @@ func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocat } } +// method id "cloudtasks.projects.locations.queues.buffer": + +type ProjectsLocationsQueuesBufferCall struct { + s *Service + name string + bufferqueuerequest *BufferQueueRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Buffer: Creates and buffers a new task without the need to explicitly +// define a Task message. The queue must be an http queue (i.e., must +// have HTTP target). This method is used for a simplified application +// of Cloud Tasks queues in buffer and rate limitting HTTP requests. +// +// - name: The queue name. For example: +// `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` The +// queue must already exist. +func (r *ProjectsLocationsQueuesService) Buffer(name string, bufferqueuerequest *BufferQueueRequest) *ProjectsLocationsQueuesBufferCall { + c := &ProjectsLocationsQueuesBufferCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + c.bufferqueuerequest = bufferqueuerequest + 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 *ProjectsLocationsQueuesBufferCall) Fields(s ...googleapi.Field) *ProjectsLocationsQueuesBufferCall { + 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 *ProjectsLocationsQueuesBufferCall) Context(ctx context.Context) *ProjectsLocationsQueuesBufferCall { + 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 *ProjectsLocationsQueuesBufferCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsQueuesBufferCall) 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.bufferqueuerequest) + 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, "v2beta2/{+name}:buffer") + 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 "cloudtasks.projects.locations.queues.buffer" call. +// Exactly one of *BufferQueueResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *BufferQueueResponse.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 *ProjectsLocationsQueuesBufferCall) Do(opts ...googleapi.CallOption) (*BufferQueueResponse, 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, &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, err + } + ret := &BufferQueueResponse{ + 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 and buffers a new task without the need to explicitly define a Task message. The queue must be an http queue (i.e., must have HTTP target). This method is used for a simplified application of Cloud Tasks queues in buffer and rate limitting HTTP requests.", + // "flatPath": "v2beta2/projects/{projectsId}/locations/{locationsId}/queues/{queuesId}:buffer", + // "httpMethod": "POST", + // "id": "cloudtasks.projects.locations.queues.buffer", + // "parameterOrder": [ + // "name" + // ], + // "parameters": { + // "name": { + // "description": "Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` The queue must already exist.", + // "location": "path", + // "pattern": "^projects/[^/]+/locations/[^/]+/queues/[^/]+$", + // "required": true, + // "type": "string" + // } + // }, + // "path": "v2beta2/{+name}:buffer", + // "request": { + // "$ref": "BufferQueueRequest" + // }, + // "response": { + // "$ref": "BufferQueueResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform" + // ] + // } + +} + // method id "cloudtasks.projects.locations.queues.create": type ProjectsLocationsQueuesCreateCall struct { diff --git a/compute/v1/compute-api.json b/compute/v1/compute-api.json index b82961d0af4..5bfdda8ddd8 100644 --- a/compute/v1/compute-api.json +++ b/compute/v1/compute-api.json @@ -8765,7 +8765,7 @@ ] }, "bulkInsert": { - "description": "Creates multiple instances. Count specifies the number of instances to create.", + "description": "Creates multiple instances. Count specifies the number of instances to create. For more information, see About bulk creation of VMs.", "flatPath": "projects/{project}/zones/{zone}/instances/bulkInsert", "httpMethod": "POST", "id": "compute.instances.bulkInsert", @@ -31172,7 +31172,7 @@ } } }, - "revision": "20220621", + "revision": "20220705", "rootUrl": "https://compute.googleapis.com/", "schemas": { "AcceleratorConfig": { @@ -33292,7 +33292,7 @@ "type": "number" }, "maxUtilization": { - "description": "Optional parameter to define a target capacity for the UTILIZATIONbalancing mode. The valid range is [0.0, 1.0]. For usage guidelines, see Utilization balancing mode.", + "description": "Optional parameter to define a target capacity for the UTILIZATION balancing mode. The valid range is [0.0, 1.0]. For usage guidelines, see Utilization balancing mode.", "format": "float", "type": "number" } @@ -34790,7 +34790,7 @@ }, "locationPolicy": { "$ref": "LocationPolicy", - "description": "Policy for chosing target zone." + "description": "Policy for chosing target zone. For more information, see Create VMs in bulk ." }, "minCount": { "description": "The minimum number of instances to create. If no min_count is specified then count is used as the default value. If min_count instances cannot be created, then no instances will be created and instances already created will be deleted.", @@ -45558,7 +45558,7 @@ "description": "Constraints that the caller requires on the result distribution in this zone." }, "preference": { - "description": "Preference for a given location.", + "description": "Preference for a given location. Set to either ALLOW or DENY.", "enum": [ "ALLOW", "DENY", @@ -46683,6 +46683,10 @@ "description": "Enable ULA internal ipv6 on this network. Enabling this feature will assign a /48 from google defined ULA prefix fd20::/20. .", "type": "boolean" }, + "firewallPolicy": { + "description": "[Output Only] URL of the firewall policy the network is associated with.", + "type": "string" + }, "gatewayIPv4": { "description": "[Output Only] The gateway address for default routing out of the network, selected by GCP.", "pattern": "[0-9]{1,3}(?:\\.[0-9]{1,3}){3}", @@ -58611,6 +58615,14 @@ "description": "[Output Only] The ID value of the disk used to create this snapshot. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given disk name.", "type": "string" }, + "sourceSnapshotSchedulePolicy": { + "description": "[Output Only] URL of the resource policy which created this scheduled snapshot.", + "type": "string" + }, + "sourceSnapshotSchedulePolicyId": { + "description": "[Output Only] ID of the resource policy which created this scheduled snapshot.", + "type": "string" + }, "status": { "description": "[Output Only] The status of the snapshot. This can be CREATING, DELETING, FAILED, READY, or UPLOADING.", "enum": [ diff --git a/compute/v1/compute-gen.go b/compute/v1/compute-gen.go index 88629bccddd..22513cfbe81 100644 --- a/compute/v1/compute-gen.go +++ b/compute/v1/compute-gen.go @@ -4582,7 +4582,7 @@ type Backend struct { MaxRatePerInstance float64 `json:"maxRatePerInstance,omitempty"` // MaxUtilization: Optional parameter to define a target capacity for - // the UTILIZATIONbalancing mode. The valid range is [0.0, 1.0]. For + // the UTILIZATION balancing mode. The valid range is [0.0, 1.0]. For // usage guidelines, see Utilization balancing mode. MaxUtilization float64 `json:"maxUtilization,omitempty"` @@ -7093,7 +7093,8 @@ type BulkInsertInstanceResource struct { // to be created. Required if sourceInstanceTemplate is not provided. InstanceProperties *InstanceProperties `json:"instanceProperties,omitempty"` - // LocationPolicy: Policy for chosing target zone. + // LocationPolicy: Policy for chosing target zone. For more information, + // see Create VMs in bulk . LocationPolicy *LocationPolicy `json:"locationPolicy,omitempty"` // MinCount: The minimum number of instances to create. If no min_count @@ -24210,7 +24211,8 @@ type LocationPolicyLocation struct { // distribution in this zone. Constraints *LocationPolicyLocationConstraints `json:"constraints,omitempty"` - // Preference: Preference for a given location. + // Preference: Preference for a given location. Set to either ALLOW or + // DENY. // // Possible values: // "ALLOW" - Location is allowed for use. @@ -26040,6 +26042,10 @@ type Network struct { // prefix fd20::/20. . EnableUlaInternalIpv6 bool `json:"enableUlaInternalIpv6,omitempty"` + // FirewallPolicy: [Output Only] URL of the firewall policy the network + // is associated with. + FirewallPolicy string `json:"firewallPolicy,omitempty"` + // GatewayIPv4: [Output Only] The gateway address for default routing // out of the network, selected by GCP. GatewayIPv4 string `json:"gatewayIPv4,omitempty"` @@ -44345,6 +44351,14 @@ type Snapshot struct { // disk name. SourceDiskId string `json:"sourceDiskId,omitempty"` + // SourceSnapshotSchedulePolicy: [Output Only] URL of the resource + // policy which created this scheduled snapshot. + SourceSnapshotSchedulePolicy string `json:"sourceSnapshotSchedulePolicy,omitempty"` + + // SourceSnapshotSchedulePolicyId: [Output Only] ID of the resource + // policy which created this scheduled snapshot. + SourceSnapshotSchedulePolicyId string `json:"sourceSnapshotSchedulePolicyId,omitempty"` + // Status: [Output Only] The status of the snapshot. This can be // CREATING, DELETING, FAILED, READY, or UPLOADING. // @@ -93597,7 +93611,8 @@ type InstancesBulkInsertCall struct { } // BulkInsert: Creates multiple instances. Count specifies the number of -// instances to create. +// instances to create. For more information, see About bulk creation of +// VMs. // // - project: Project ID for this request. // - zone: The name of the zone for this request. @@ -93717,7 +93732,7 @@ func (c *InstancesBulkInsertCall) Do(opts ...googleapi.CallOption) (*Operation, } return ret, nil // { - // "description": "Creates multiple instances. Count specifies the number of instances to create.", + // "description": "Creates multiple instances. Count specifies the number of instances to create. For more information, see About bulk creation of VMs.", // "flatPath": "projects/{project}/zones/{zone}/instances/bulkInsert", // "httpMethod": "POST", // "id": "compute.instances.bulkInsert", diff --git a/datacatalog/v1/datacatalog-api.json b/datacatalog/v1/datacatalog-api.json index 7e93a0e1e15..26d0ce04969 100644 --- a/datacatalog/v1/datacatalog-api.json +++ b/datacatalog/v1/datacatalog-api.json @@ -1953,7 +1953,7 @@ } } }, - "revision": "20220530", + "revision": "20220707", "rootUrl": "https://datacatalog.googleapis.com/", "schemas": { "Binding": { @@ -2187,6 +2187,10 @@ "description": "Optional. Description of the column. Default value is an empty string. The description must be a UTF-8 string with the maximum size of 2000 bytes.", "type": "string" }, + "lookerColumnSpec": { + "$ref": "GoogleCloudDatacatalogV1ColumnSchemaLookerColumnSpec", + "description": "Looker specific column info of this column." + }, "mode": { "description": "Optional. A column's mode indicates whether values in this column are required, nullable, or repeated. Only `NULLABLE`, `REQUIRED`, and `REPEATED` values are supported. Default mode is `NULLABLE`.", "type": "string" @@ -2205,6 +2209,33 @@ }, "type": "object" }, + "GoogleCloudDatacatalogV1ColumnSchemaLookerColumnSpec": { + "description": "Column info specific to Looker System.", + "id": "GoogleCloudDatacatalogV1ColumnSchemaLookerColumnSpec", + "properties": { + "type": { + "description": "Looker specific column type of this column.", + "enum": [ + "LOOKER_COLUMN_TYPE_UNSPECIFIED", + "DIMENSION", + "DIMENSION_GROUP", + "FILTER", + "MEASURE", + "PAREMETER" + ], + "enumDescriptions": [ + "Unspecified.", + "Dimension.", + "Dimension group - parent for Dimension.", + "Filter.", + "Measure.", + "Parameter." + ], + "type": "string" + } + }, + "type": "object" + }, "GoogleCloudDatacatalogV1Contacts": { "description": "Contact people for the entry.", "id": "GoogleCloudDatacatalogV1Contacts", diff --git a/datacatalog/v1/datacatalog-gen.go b/datacatalog/v1/datacatalog-gen.go index 12245cf2761..ee6d612d318 100644 --- a/datacatalog/v1/datacatalog-gen.go +++ b/datacatalog/v1/datacatalog-gen.go @@ -751,6 +751,9 @@ type GoogleCloudDatacatalogV1ColumnSchema struct { // size of 2000 bytes. Description string `json:"description,omitempty"` + // LookerColumnSpec: Looker specific column info of this column. + LookerColumnSpec *GoogleCloudDatacatalogV1ColumnSchemaLookerColumnSpec `json:"lookerColumnSpec,omitempty"` + // Mode: Optional. A column's mode indicates whether values in this // column are required, nullable, or repeated. Only `NULLABLE`, // `REQUIRED`, and `REPEATED` values are supported. Default mode is @@ -788,6 +791,43 @@ func (s *GoogleCloudDatacatalogV1ColumnSchema) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// GoogleCloudDatacatalogV1ColumnSchemaLookerColumnSpec: Column info +// specific to Looker System. +type GoogleCloudDatacatalogV1ColumnSchemaLookerColumnSpec struct { + // Type: Looker specific column type of this column. + // + // Possible values: + // "LOOKER_COLUMN_TYPE_UNSPECIFIED" - Unspecified. + // "DIMENSION" - Dimension. + // "DIMENSION_GROUP" - Dimension group - parent for Dimension. + // "FILTER" - Filter. + // "MEASURE" - Measure. + // "PAREMETER" - Parameter. + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Type") 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. "Type") 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 *GoogleCloudDatacatalogV1ColumnSchemaLookerColumnSpec) MarshalJSON() ([]byte, error) { + type NoMethod GoogleCloudDatacatalogV1ColumnSchemaLookerColumnSpec + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // GoogleCloudDatacatalogV1Contacts: Contact people for the entry. type GoogleCloudDatacatalogV1Contacts struct { // People: The list of contact people for the entry. diff --git a/domains/v1/domains-api.json b/domains/v1/domains-api.json index 819f77762f6..6f07454af2f 100644 --- a/domains/v1/domains-api.json +++ b/domains/v1/domains-api.json @@ -843,7 +843,7 @@ } } }, - "revision": "20220616", + "revision": "20220712", "rootUrl": "https://domains.googleapis.com/", "schemas": { "AuditConfig": { @@ -1566,7 +1566,7 @@ "type": "object" }, "PostalAddress": { - "description": "Represents a postal address, e.g. for postal delivery or payments addresses. Given a postal address, a postal service can deliver items to a premise, P.O. Box or similar. It is not intended to model geographical locations (roads, towns, mountains). In typical usage an address would be created via user input or from importing existing data, depending on the type of process. Advice on address input / editing: - Use an i18n-ready address widget such as https://github.com/google/libaddressinput) - Users should not be presented with UI elements for input or editing of fields outside countries where that field is used. For more guidance on how to use this schema, please see: https://support.google.com/business/answer/6397478", + "description": "Represents a postal address, e.g. for postal delivery or payments addresses. Given a postal address, a postal service can deliver items to a premise, P.O. Box or similar. It is not intended to model geographical locations (roads, towns, mountains). In typical usage an address would be created via user input or from importing existing data, depending on the type of process. Advice on address input / editing: - Use an internationalization-ready address widget such as https://github.com/google/libaddressinput) - Users should not be presented with UI elements for input or editing of fields outside countries where that field is used. For more guidance on how to use this schema, please see: https://support.google.com/business/answer/6397478", "id": "PostalAddress", "properties": { "addressLines": { diff --git a/domains/v1/domains-gen.go b/domains/v1/domains-gen.go index 1bfc1214258..10b9b720f9d 100644 --- a/domains/v1/domains-gen.go +++ b/domains/v1/domains-gen.go @@ -1487,9 +1487,9 @@ func (s *Policy) MarshalJSON() ([]byte, error) { // to model geographical locations (roads, towns, mountains). In typical // usage an address would be created via user input or from importing // existing data, depending on the type of process. Advice on address -// input / editing: - Use an i18n-ready address widget such as -// https://github.com/google/libaddressinput) - Users should not be -// presented with UI elements for input or editing of fields outside +// input / editing: - Use an internationalization-ready address widget +// such as https://github.com/google/libaddressinput) - Users should not +// be presented with UI elements for input or editing of fields outside // countries where that field is used. For more guidance on how to use // this schema, please see: // https://support.google.com/business/answer/6397478 diff --git a/domains/v1beta1/domains-api.json b/domains/v1beta1/domains-api.json index 41e42bc5311..06d3c9e1f81 100644 --- a/domains/v1beta1/domains-api.json +++ b/domains/v1beta1/domains-api.json @@ -843,7 +843,7 @@ } } }, - "revision": "20220616", + "revision": "20220712", "rootUrl": "https://domains.googleapis.com/", "schemas": { "AuditConfig": { @@ -1566,7 +1566,7 @@ "type": "object" }, "PostalAddress": { - "description": "Represents a postal address, e.g. for postal delivery or payments addresses. Given a postal address, a postal service can deliver items to a premise, P.O. Box or similar. It is not intended to model geographical locations (roads, towns, mountains). In typical usage an address would be created via user input or from importing existing data, depending on the type of process. Advice on address input / editing: - Use an i18n-ready address widget such as https://github.com/google/libaddressinput) - Users should not be presented with UI elements for input or editing of fields outside countries where that field is used. For more guidance on how to use this schema, please see: https://support.google.com/business/answer/6397478", + "description": "Represents a postal address, e.g. for postal delivery or payments addresses. Given a postal address, a postal service can deliver items to a premise, P.O. Box or similar. It is not intended to model geographical locations (roads, towns, mountains). In typical usage an address would be created via user input or from importing existing data, depending on the type of process. Advice on address input / editing: - Use an internationalization-ready address widget such as https://github.com/google/libaddressinput) - Users should not be presented with UI elements for input or editing of fields outside countries where that field is used. For more guidance on how to use this schema, please see: https://support.google.com/business/answer/6397478", "id": "PostalAddress", "properties": { "addressLines": { diff --git a/domains/v1beta1/domains-gen.go b/domains/v1beta1/domains-gen.go index e6699949f9d..62610b71efc 100644 --- a/domains/v1beta1/domains-gen.go +++ b/domains/v1beta1/domains-gen.go @@ -1487,9 +1487,9 @@ func (s *Policy) MarshalJSON() ([]byte, error) { // to model geographical locations (roads, towns, mountains). In typical // usage an address would be created via user input or from importing // existing data, depending on the type of process. Advice on address -// input / editing: - Use an i18n-ready address widget such as -// https://github.com/google/libaddressinput) - Users should not be -// presented with UI elements for input or editing of fields outside +// input / editing: - Use an internationalization-ready address widget +// such as https://github.com/google/libaddressinput) - Users should not +// be presented with UI elements for input or editing of fields outside // countries where that field is used. For more guidance on how to use // this schema, please see: // https://support.google.com/business/answer/6397478 diff --git a/drive/v2/drive-api.json b/drive/v2/drive-api.json index 665fba0e2b7..062d654f3f2 100644 --- a/drive/v2/drive-api.json +++ b/drive/v2/drive-api.json @@ -38,7 +38,7 @@ "description": "Manages files in Drive including uploading, downloading, searching, detecting changes, and updating sharing permissions.", "discoveryVersion": "v1", "documentationLink": "https://developers.google.com/drive/", - "etag": "\"uWj2hSb4GVjzdDlAnRd2gbM1ZQ8/FJ_l9FpOo0745yxBh-UGhApXY3k\"", + "etag": "\"uWj2hSb4GVjzdDlAnRd2gbM1ZQ8/yvf5HwkC5GNTy86jNm4Q9l2g6tw\"", "icons": { "x16": "https://ssl.gstatic.com/docs/doclist/images/drive_icon_16.png", "x32": "https://ssl.gstatic.com/docs/doclist/images/drive_icon_32.png" @@ -327,6 +327,11 @@ "location": "query", "type": "boolean" }, + "includeLabels": { + "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + "location": "query", + "type": "string" + }, "includePermissionsForView": { "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", "location": "query", @@ -430,6 +435,11 @@ "location": "query", "type": "boolean" }, + "includeLabels": { + "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + "location": "query", + "type": "string" + }, "includePermissionsForView": { "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", "location": "query", @@ -1160,6 +1170,11 @@ "required": true, "type": "string" }, + "includeLabels": { + "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + "location": "query", + "type": "string" + }, "includePermissionsForView": { "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", "location": "query", @@ -1378,6 +1393,11 @@ "required": true, "type": "string" }, + "includeLabels": { + "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + "location": "query", + "type": "string" + }, "includePermissionsForView": { "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", "location": "query", @@ -1470,6 +1490,11 @@ "location": "query", "type": "boolean" }, + "includeLabels": { + "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + "location": "query", + "type": "string" + }, "includePermissionsForView": { "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", "location": "query", @@ -1585,6 +1610,11 @@ "location": "query", "type": "boolean" }, + "includeLabels": { + "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + "location": "query", + "type": "string" + }, "includePermissionsForView": { "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", "location": "query", @@ -1670,6 +1700,75 @@ "https://www.googleapis.com/auth/drive.readonly" ] }, + "listLabels": { + "description": "Lists the labels on a file.", + "httpMethod": "GET", + "id": "drive.files.listLabels", + "parameterOrder": [ + "fileId" + ], + "parameters": { + "fileId": { + "description": "The ID of the file.", + "location": "path", + "required": true, + "type": "string" + }, + "maxResults": { + "default": "100", + "description": "The maximum number of labels to return per page. When not set, this defaults to 100.", + "format": "int32", + "location": "query", + "maximum": "100", + "minimum": "1", + "type": "integer" + }, + "pageToken": { + "description": "The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response.", + "location": "query", + "type": "string" + } + }, + "path": "files/{fileId}/listLabels", + "response": { + "$ref": "LabelList" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.metadata", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.readonly" + ] + }, + "modifyLabels": { + "description": "Modifies the set of labels on a file.", + "httpMethod": "POST", + "id": "drive.files.modifyLabels", + "parameterOrder": [ + "fileId" + ], + "parameters": { + "fileId": { + "description": "The ID of the file for which the labels are modified.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "files/{fileId}/modifyLabels", + "request": { + "$ref": "ModifyLabelsRequest" + }, + "response": { + "$ref": "ModifyLabelsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.metadata" + ] + }, "patch": { "description": "Updates a file's metadata and/or content. When calling this method, only populate fields in the request that you want to modify. When updating fields, some fields might change automatically, such as modifiedDate. This method supports patch semantics.", "httpMethod": "PATCH", @@ -1701,6 +1800,11 @@ "required": true, "type": "string" }, + "includeLabels": { + "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + "location": "query", + "type": "string" + }, "includePermissionsForView": { "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", "location": "query", @@ -1826,6 +1930,11 @@ "required": true, "type": "string" }, + "includeLabels": { + "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + "location": "query", + "type": "string" + }, "includePermissionsForView": { "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", "location": "query", @@ -1870,6 +1979,11 @@ "required": true, "type": "string" }, + "includeLabels": { + "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + "location": "query", + "type": "string" + }, "includePermissionsForView": { "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", "location": "query", @@ -1913,6 +2027,11 @@ "required": true, "type": "string" }, + "includeLabels": { + "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + "location": "query", + "type": "string" + }, "includePermissionsForView": { "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", "location": "query", @@ -1989,6 +2108,11 @@ "required": true, "type": "string" }, + "includeLabels": { + "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + "location": "query", + "type": "string" + }, "includePermissionsForView": { "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", "location": "query", @@ -2121,6 +2245,11 @@ "required": true, "type": "string" }, + "includeLabels": { + "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + "location": "query", + "type": "string" + }, "includePermissionsForView": { "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", "location": "query", @@ -3539,7 +3668,7 @@ } } }, - "revision": "20220508", + "revision": "20220709", "rootUrl": "https://www.googleapis.com/", "schemas": { "About": { @@ -4720,6 +4849,10 @@ "description": "Whether the current user can modify restrictions on content of this file.", "type": "boolean" }, + "canModifyLabels": { + "description": "Whether the current user can modify the labels on this file.", + "type": "boolean" + }, "canMoveChildrenOutOfDrive": { "description": "Whether the current user can move children of this folder outside of the shared drive. This is false when the item is not a folder. Only populated for items in shared drives.", "type": "boolean" @@ -4764,6 +4897,10 @@ "description": "Whether the current user can read the shared drive to which this file belongs. Only populated for items in shared drives.", "type": "boolean" }, + "canReadLabels": { + "description": "Whether the current user can read the labels on this file.", + "type": "boolean" + }, "canReadRevisions": { "description": "Whether the current user can read the revisions resource of this file. For a shared drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read.", "type": "boolean" @@ -5037,6 +5174,19 @@ "description": "The type of file. This is always drive#file.", "type": "string" }, + "labelInfo": { + "description": "An overview of the labels on the file.", + "properties": { + "labels": { + "description": "The set of labels on the file as requested by the label IDs in the includeLabels parameter. By default, no labels are returned.", + "items": { + "$ref": "Label" + }, + "type": "array" + } + }, + "type": "object" + }, "labels": { "description": "A group of labels for the file.", "properties": { @@ -5377,6 +5527,240 @@ }, "type": "object" }, + "Label": { + "description": "Representation of a label and its fields.", + "id": "Label", + "properties": { + "fields": { + "additionalProperties": { + "$ref": "LabelField" + }, + "description": "A map of the label's fields keyed by the field ID.", + "type": "object" + }, + "id": { + "description": "The ID of the label.", + "type": "string" + }, + "kind": { + "default": "drive#label", + "description": "This is always drive#label", + "type": "string" + }, + "revisionId": { + "description": "The revision ID of the label.", + "type": "string" + } + }, + "type": "object" + }, + "LabelField": { + "description": "Representation of a label field.", + "id": "LabelField", + "properties": { + "dateString": { + "description": "Only present if valueType is dateString. RFC 3339 formatted date: YYYY-MM-DD.", + "items": { + "format": "date", + "type": "string" + }, + "type": "array" + }, + "id": { + "description": "The identifier of this field.", + "type": "string" + }, + "integer": { + "description": "Only present if valueType is integer.", + "items": { + "format": "int64", + "type": "string" + }, + "type": "array" + }, + "kind": { + "default": "drive#labelField", + "description": "This is always drive#labelField.", + "type": "string" + }, + "selection": { + "description": "Only present if valueType is selection.", + "items": { + "type": "string" + }, + "type": "array" + }, + "text": { + "description": "Only present if valueType is text.", + "items": { + "type": "string" + }, + "type": "array" + }, + "user": { + "description": "Only present if valueType is user.", + "items": { + "$ref": "User" + }, + "type": "array" + }, + "valueType": { + "description": "The field type. While new values may be supported in the future, the following are currently allowed: \n- dateString \n- integer \n- selection \n- text \n- user", + "type": "string" + } + }, + "type": "object" + }, + "LabelFieldModification": { + "description": "A modification to a label's field.", + "id": "LabelFieldModification", + "properties": { + "fieldId": { + "description": "The ID of the field to be modified.", + "type": "string" + }, + "kind": { + "default": "drive#labelFieldModification", + "description": "This is always drive#labelFieldModification.", + "type": "string" + }, + "setDateValues": { + "description": "Replaces a dateString field with these new values. The values must be strings in the RFC 3339 full-date format: YYYY-MM-DD.", + "items": { + "format": "date", + "type": "string" + }, + "type": "array" + }, + "setIntegerValues": { + "description": "Replaces an integer field with these new values.", + "items": { + "format": "int64", + "type": "string" + }, + "type": "array" + }, + "setSelectionValues": { + "description": "Replaces a selection field with these new values.", + "items": { + "type": "string" + }, + "type": "array" + }, + "setTextValues": { + "description": "Replaces a text field with these new values.", + "items": { + "type": "string" + }, + "type": "array" + }, + "setUserValues": { + "description": "Replaces a user field with these new values. The values must be valid email addresses.", + "items": { + "type": "string" + }, + "type": "array" + }, + "unsetValues": { + "description": "Unsets the values for this field.", + "type": "boolean" + } + }, + "type": "object" + }, + "LabelList": { + "description": "A list of labels.", + "id": "LabelList", + "properties": { + "items": { + "description": "The list of labels.", + "items": { + "$ref": "Label" + }, + "type": "array" + }, + "kind": { + "default": "drive#labelList", + "description": "This is always drive#labelList", + "type": "string" + }, + "nextPageToken": { + "description": "The page token for the next page of labels. This field will be absent if the end of the list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results.", + "type": "string" + } + }, + "type": "object" + }, + "LabelModification": { + "description": "A modification to a label on a file. A LabelModification can be used to apply a label to a file, update an existing label on a file, or remove a label from a file.", + "id": "LabelModification", + "properties": { + "fieldModifications": { + "description": "The list of modifications to this label's fields.", + "items": { + "$ref": "LabelFieldModification" + }, + "type": "array" + }, + "kind": { + "default": "drive#labelModification", + "description": "This is always drive#labelModification.", + "type": "string" + }, + "labelId": { + "annotations": { + "required": [ + "drive.files.modifyLabels" + ] + }, + "description": "The ID of the label to modify.", + "type": "string" + }, + "removeLabel": { + "description": "If true, the label will be removed from the file.", + "type": "boolean" + } + }, + "type": "object" + }, + "ModifyLabelsRequest": { + "description": "A request to modify the set of labels on a file. This request may contain many modifications that will either all succeed or all fail transactionally.", + "id": "ModifyLabelsRequest", + "properties": { + "kind": { + "default": "drive#modifyLabelsRequest", + "description": "This is always drive#modifyLabelsRequest", + "type": "string" + }, + "labelModifications": { + "description": "The list of modifications to apply to the labels on the file.", + "items": { + "$ref": "LabelModification" + }, + "type": "array" + } + }, + "type": "object" + }, + "ModifyLabelsResponse": { + "description": "Response to a ModifyLabels request. This contains only those labels which were added or updated by the request.", + "id": "ModifyLabelsResponse", + "properties": { + "kind": { + "default": "drive#modifyLabelsResponse", + "description": "This is always drive#modifyLabelsResponse", + "type": "string" + }, + "modifiedLabels": { + "description": "The list of labels which were added or updated by the request.", + "items": { + "$ref": "Label" + }, + "type": "array" + } + }, + "type": "object" + }, "ParentList": { "description": "A list of a file's parents.", "id": "ParentList", diff --git a/drive/v2/drive-gen.go b/drive/v2/drive-gen.go index b5b89bd3397..94ef27dd138 100644 --- a/drive/v2/drive-gen.go +++ b/drive/v2/drive-gen.go @@ -2071,6 +2071,9 @@ type File struct { // Kind: The type of file. This is always drive#file. Kind string `json:"kind,omitempty"` + // LabelInfo: An overview of the labels on the file. + LabelInfo *FileLabelInfo `json:"labelInfo,omitempty"` + // Labels: A group of labels for the file. Labels *FileLabels `json:"labels,omitempty"` @@ -2342,6 +2345,10 @@ type FileCapabilities struct { // restrictions on content of this file. CanModifyContentRestriction bool `json:"canModifyContentRestriction,omitempty"` + // CanModifyLabels: Whether the current user can modify the labels on + // this file. + CanModifyLabels bool `json:"canModifyLabels,omitempty"` + // CanMoveChildrenOutOfDrive: Whether the current user can move children // of this folder outside of the shared drive. This is false when the // item is not a folder. Only populated for items in shared drives. @@ -2394,6 +2401,10 @@ type FileCapabilities struct { // which this file belongs. Only populated for items in shared drives. CanReadDrive bool `json:"canReadDrive,omitempty"` + // CanReadLabels: Whether the current user can read the labels on this + // file. + CanReadLabels bool `json:"canReadLabels,omitempty"` + // CanReadRevisions: Whether the current user can read the revisions // resource of this file. For a shared drive item, whether revisions of // non-folder descendants of this item, or this item itself if it is not @@ -2654,6 +2665,35 @@ func (s *FileIndexableText) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// FileLabelInfo: An overview of the labels on the file. +type FileLabelInfo struct { + // Labels: The set of labels on the file as requested by the label IDs + // in the includeLabels parameter. By default, no labels are returned. + Labels []*Label `json:"labels,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Labels") 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. "Labels") 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 *FileLabelInfo) MarshalJSON() ([]byte, error) { + type NoMethod FileLabelInfo + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // FileLabels: A group of labels for the file. type FileLabels struct { // Hidden: Deprecated. @@ -2945,6 +2985,303 @@ func (s *GeneratedIds) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// Label: Representation of a label and its fields. +type Label struct { + // Fields: A map of the label's fields keyed by the field ID. + Fields map[string]LabelField `json:"fields,omitempty"` + + // Id: The ID of the label. + Id string `json:"id,omitempty"` + + // Kind: This is always drive#label + Kind string `json:"kind,omitempty"` + + // RevisionId: The revision ID of the label. + RevisionId string `json:"revisionId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Fields") 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. "Fields") 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 *Label) MarshalJSON() ([]byte, error) { + type NoMethod Label + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// LabelField: Representation of a label field. +type LabelField struct { + // DateString: Only present if valueType is dateString. RFC 3339 + // formatted date: YYYY-MM-DD. + DateString []string `json:"dateString,omitempty"` + + // Id: The identifier of this field. + Id string `json:"id,omitempty"` + + // Integer: Only present if valueType is integer. + Integer googleapi.Int64s `json:"integer,omitempty"` + + // Kind: This is always drive#labelField. + Kind string `json:"kind,omitempty"` + + // Selection: Only present if valueType is selection. + Selection []string `json:"selection,omitempty"` + + // Text: Only present if valueType is text. + Text []string `json:"text,omitempty"` + + // User: Only present if valueType is user. + User []*User `json:"user,omitempty"` + + // ValueType: The field type. While new values may be supported in the + // future, the following are currently allowed: + // - dateString + // - integer + // - selection + // - text + // - user + ValueType string `json:"valueType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DateString") 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. "DateString") 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 *LabelField) MarshalJSON() ([]byte, error) { + type NoMethod LabelField + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// LabelFieldModification: A modification to a label's field. +type LabelFieldModification struct { + // FieldId: The ID of the field to be modified. + FieldId string `json:"fieldId,omitempty"` + + // Kind: This is always drive#labelFieldModification. + Kind string `json:"kind,omitempty"` + + // SetDateValues: Replaces a dateString field with these new values. The + // values must be strings in the RFC 3339 full-date format: YYYY-MM-DD. + SetDateValues []string `json:"setDateValues,omitempty"` + + // SetIntegerValues: Replaces an integer field with these new values. + SetIntegerValues googleapi.Int64s `json:"setIntegerValues,omitempty"` + + // SetSelectionValues: Replaces a selection field with these new values. + SetSelectionValues []string `json:"setSelectionValues,omitempty"` + + // SetTextValues: Replaces a text field with these new values. + SetTextValues []string `json:"setTextValues,omitempty"` + + // SetUserValues: Replaces a user field with these new values. The + // values must be valid email addresses. + SetUserValues []string `json:"setUserValues,omitempty"` + + // UnsetValues: Unsets the values for this field. + UnsetValues bool `json:"unsetValues,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FieldId") 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. "FieldId") 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 *LabelFieldModification) MarshalJSON() ([]byte, error) { + type NoMethod LabelFieldModification + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// LabelList: A list of labels. +type LabelList struct { + // Items: The list of labels. + Items []*Label `json:"items,omitempty"` + + // Kind: This is always drive#labelList + Kind string `json:"kind,omitempty"` + + // NextPageToken: The page token for the next page of labels. This field + // will be absent if the end of the list has been reached. If the token + // is rejected for any reason, it should be discarded, and pagination + // should be restarted from the first page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Items") 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. "Items") 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 *LabelList) MarshalJSON() ([]byte, error) { + type NoMethod LabelList + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// LabelModification: A modification to a label on a file. A +// LabelModification can be used to apply a label to a file, update an +// existing label on a file, or remove a label from a file. +type LabelModification struct { + // FieldModifications: The list of modifications to this label's fields. + FieldModifications []*LabelFieldModification `json:"fieldModifications,omitempty"` + + // Kind: This is always drive#labelModification. + Kind string `json:"kind,omitempty"` + + // LabelId: The ID of the label to modify. + LabelId string `json:"labelId,omitempty"` + + // RemoveLabel: If true, the label will be removed from the file. + RemoveLabel bool `json:"removeLabel,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FieldModifications") + // 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. "FieldModifications") 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 *LabelModification) MarshalJSON() ([]byte, error) { + type NoMethod LabelModification + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ModifyLabelsRequest: A request to modify the set of labels on a file. +// This request may contain many modifications that will either all +// succeed or all fail transactionally. +type ModifyLabelsRequest struct { + // Kind: This is always drive#modifyLabelsRequest + Kind string `json:"kind,omitempty"` + + // LabelModifications: The list of modifications to apply to the labels + // on the file. + LabelModifications []*LabelModification `json:"labelModifications,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Kind") 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. "Kind") 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 *ModifyLabelsRequest) MarshalJSON() ([]byte, error) { + type NoMethod ModifyLabelsRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ModifyLabelsResponse: Response to a ModifyLabels request. This +// contains only those labels which were added or updated by the +// request. +type ModifyLabelsResponse struct { + // Kind: This is always drive#modifyLabelsResponse + Kind string `json:"kind,omitempty"` + + // ModifiedLabels: The list of labels which were added or updated by the + // request. + ModifiedLabels []*Label `json:"modifiedLabels,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") 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. "Kind") 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 *ModifyLabelsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ModifyLabelsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // ParentList: A list of a file's parents. type ParentList struct { // Etag: The ETag of the list. @@ -4986,6 +5323,14 @@ func (c *ChangesListCall) IncludeItemsFromAllDrives(includeItemsFromAllDrives bo return c } +// IncludeLabels sets the optional parameter "includeLabels": A +// comma-separated list of IDs of labels to include in the labelInfo +// part of the response. +func (c *ChangesListCall) IncludeLabels(includeLabels string) *ChangesListCall { + c.urlParams_.Set("includeLabels", includeLabels) + return c +} + // IncludePermissionsForView sets the optional parameter // "includePermissionsForView": Specifies which additional view's // permissions to include in the response. Only 'published' is @@ -5189,6 +5534,11 @@ func (c *ChangesListCall) Do(opts ...googleapi.CallOption) (*ChangeList, error) // "location": "query", // "type": "boolean" // }, + // "includeLabels": { + // "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + // "location": "query", + // "type": "string" + // }, // "includePermissionsForView": { // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", // "location": "query", @@ -5340,6 +5690,14 @@ func (c *ChangesWatchCall) IncludeItemsFromAllDrives(includeItemsFromAllDrives b return c } +// IncludeLabels sets the optional parameter "includeLabels": A +// comma-separated list of IDs of labels to include in the labelInfo +// part of the response. +func (c *ChangesWatchCall) IncludeLabels(includeLabels string) *ChangesWatchCall { + c.urlParams_.Set("includeLabels", includeLabels) + return c +} + // IncludePermissionsForView sets the optional parameter // "includePermissionsForView": Specifies which additional view's // permissions to include in the response. Only 'published' is @@ -5535,6 +5893,11 @@ func (c *ChangesWatchCall) Do(opts ...googleapi.CallOption) (*Channel, error) { // "location": "query", // "type": "boolean" // }, + // "includeLabels": { + // "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + // "location": "query", + // "type": "string" + // }, // "includePermissionsForView": { // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", // "location": "query", @@ -8465,6 +8828,14 @@ func (c *FilesCopyCall) EnforceSingleParent(enforceSingleParent bool) *FilesCopy return c } +// IncludeLabels sets the optional parameter "includeLabels": A +// comma-separated list of IDs of labels to include in the labelInfo +// part of the response. +func (c *FilesCopyCall) IncludeLabels(includeLabels string) *FilesCopyCall { + c.urlParams_.Set("includeLabels", includeLabels) + return c +} + // IncludePermissionsForView sets the optional parameter // "includePermissionsForView": Specifies which additional view's // permissions to include in the response. Only 'published' is @@ -8654,6 +9025,11 @@ func (c *FilesCopyCall) Do(opts ...googleapi.CallOption) (*File, error) { // "required": true, // "type": "string" // }, + // "includeLabels": { + // "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + // "location": "query", + // "type": "string" + // }, // "includePermissionsForView": { // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", // "location": "query", @@ -9330,6 +9706,14 @@ func (c *FilesGetCall) AcknowledgeAbuse(acknowledgeAbuse bool) *FilesGetCall { return c } +// IncludeLabels sets the optional parameter "includeLabels": A +// comma-separated list of IDs of labels to include in the labelInfo +// part of the response. +func (c *FilesGetCall) IncludeLabels(includeLabels string) *FilesGetCall { + c.urlParams_.Set("includeLabels", includeLabels) + return c +} + // IncludePermissionsForView sets the optional parameter // "includePermissionsForView": Specifies which additional view's // permissions to include in the response. Only 'published' is @@ -9515,6 +9899,11 @@ func (c *FilesGetCall) Do(opts ...googleapi.CallOption) (*File, error) { // "required": true, // "type": "string" // }, + // "includeLabels": { + // "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + // "location": "query", + // "type": "string" + // }, // "includePermissionsForView": { // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", // "location": "query", @@ -9610,6 +9999,14 @@ func (c *FilesInsertCall) EnforceSingleParent(enforceSingleParent bool) *FilesIn return c } +// IncludeLabels sets the optional parameter "includeLabels": A +// comma-separated list of IDs of labels to include in the labelInfo +// part of the response. +func (c *FilesInsertCall) IncludeLabels(includeLabels string) *FilesInsertCall { + c.urlParams_.Set("includeLabels", includeLabels) + return c +} + // IncludePermissionsForView sets the optional parameter // "includePermissionsForView": Specifies which additional view's // permissions to include in the response. Only 'published' is @@ -9877,6 +10274,11 @@ func (c *FilesInsertCall) Do(opts ...googleapi.CallOption) (*File, error) { // "location": "query", // "type": "boolean" // }, + // "includeLabels": { + // "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + // "location": "query", + // "type": "string" + // }, // "includePermissionsForView": { // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", // "location": "query", @@ -10017,6 +10419,14 @@ func (c *FilesListCall) IncludeItemsFromAllDrives(includeItemsFromAllDrives bool return c } +// IncludeLabels sets the optional parameter "includeLabels": A +// comma-separated list of IDs of labels to include in the labelInfo +// part of the response. +func (c *FilesListCall) IncludeLabels(includeLabels string) *FilesListCall { + c.urlParams_.Set("includeLabels", includeLabels) + return c +} + // IncludePermissionsForView sets the optional parameter // "includePermissionsForView": Specifies which additional view's // permissions to include in the response. Only 'published' is @@ -10238,6 +10648,11 @@ func (c *FilesListCall) Do(opts ...googleapi.CallOption) (*FileList, error) { // "location": "query", // "type": "boolean" // }, + // "includeLabels": { + // "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + // "location": "query", + // "type": "string" + // }, // "includePermissionsForView": { // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", // "location": "query", @@ -10347,10 +10762,351 @@ func (c *FilesListCall) Pages(ctx context.Context, f func(*FileList) error) erro } } -// method id "drive.files.patch": +// method id "drive.files.listLabels": -type FilesPatchCall struct { - s *Service +type FilesListLabelsCall struct { + s *Service + fileId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// ListLabels: Lists the labels on a file. +// +// - fileId: The ID of the file. +func (r *FilesService) ListLabels(fileId string) *FilesListLabelsCall { + c := &FilesListLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.fileId = fileId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of labels to return per page. When not set, this defaults to +// 100. +func (c *FilesListLabelsCall) MaxResults(maxResults int64) *FilesListLabelsCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// PageToken sets the optional parameter "pageToken": The token for +// continuing a previous list request on the next page. This should be +// set to the value of 'nextPageToken' from the previous response. +func (c *FilesListLabelsCall) PageToken(pageToken string) *FilesListLabelsCall { + 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 *FilesListLabelsCall) Fields(s ...googleapi.Field) *FilesListLabelsCall { + 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 *FilesListLabelsCall) IfNoneMatch(entityTag string) *FilesListLabelsCall { + 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 *FilesListLabelsCall) Context(ctx context.Context) *FilesListLabelsCall { + 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 *FilesListLabelsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *FilesListLabelsCall) 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, "files/{fileId}/listLabels") + 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{ + "fileId": c.fileId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "drive.files.listLabels" call. +// Exactly one of *LabelList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LabelList.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 *FilesListLabelsCall) Do(opts ...googleapi.CallOption) (*LabelList, 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, &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, err + } + ret := &LabelList{ + 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 the labels on a file.", + // "httpMethod": "GET", + // "id": "drive.files.listLabels", + // "parameterOrder": [ + // "fileId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID of the file.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "The maximum number of labels to return per page. When not set, this defaults to 100.", + // "format": "int32", + // "location": "query", + // "maximum": "100", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "files/{fileId}/listLabels", + // "response": { + // "$ref": "LabelList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.metadata", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.readonly" + // ] + // } + +} + +// 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 *FilesListLabelsCall) Pages(ctx context.Context, f func(*LabelList) 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 "drive.files.modifyLabels": + +type FilesModifyLabelsCall struct { + s *Service + fileId string + modifylabelsrequest *ModifyLabelsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// ModifyLabels: Modifies the set of labels on a file. +// +// - fileId: The ID of the file for which the labels are modified. +func (r *FilesService) ModifyLabels(fileId string, modifylabelsrequest *ModifyLabelsRequest) *FilesModifyLabelsCall { + c := &FilesModifyLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.fileId = fileId + c.modifylabelsrequest = modifylabelsrequest + 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 *FilesModifyLabelsCall) Fields(s ...googleapi.Field) *FilesModifyLabelsCall { + 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 *FilesModifyLabelsCall) Context(ctx context.Context) *FilesModifyLabelsCall { + 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 *FilesModifyLabelsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *FilesModifyLabelsCall) 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.modifylabelsrequest) + 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, "files/{fileId}/modifyLabels") + 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{ + "fileId": c.fileId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "drive.files.modifyLabels" call. +// Exactly one of *ModifyLabelsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ModifyLabelsResponse.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 *FilesModifyLabelsCall) Do(opts ...googleapi.CallOption) (*ModifyLabelsResponse, 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, &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, err + } + ret := &ModifyLabelsResponse{ + 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": "Modifies the set of labels on a file.", + // "httpMethod": "POST", + // "id": "drive.files.modifyLabels", + // "parameterOrder": [ + // "fileId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID of the file for which the labels are modified.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}/modifyLabels", + // "request": { + // "$ref": "ModifyLabelsRequest" + // }, + // "response": { + // "$ref": "ModifyLabelsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.metadata" + // ] + // } + +} + +// method id "drive.files.patch": + +type FilesPatchCall struct { + s *Service fileId string file *File urlParams_ gensupport.URLParams @@ -10393,6 +11149,14 @@ func (c *FilesPatchCall) EnforceSingleParent(enforceSingleParent bool) *FilesPat return c } +// IncludeLabels sets the optional parameter "includeLabels": A +// comma-separated list of IDs of labels to include in the labelInfo +// part of the response. +func (c *FilesPatchCall) IncludeLabels(includeLabels string) *FilesPatchCall { + c.urlParams_.Set("includeLabels", includeLabels) + return c +} + // IncludePermissionsForView sets the optional parameter // "includePermissionsForView": Specifies which additional view's // permissions to include in the response. Only 'published' is @@ -10641,6 +11405,11 @@ func (c *FilesPatchCall) Do(opts ...googleapi.CallOption) (*File, error) { // "required": true, // "type": "string" // }, + // "includeLabels": { + // "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + // "location": "query", + // "type": "string" + // }, // "includePermissionsForView": { // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", // "location": "query", @@ -10774,6 +11543,14 @@ func (r *FilesService) Touch(fileId string) *FilesTouchCall { return c } +// IncludeLabels sets the optional parameter "includeLabels": A +// comma-separated list of IDs of labels to include in the labelInfo +// part of the response. +func (c *FilesTouchCall) IncludeLabels(includeLabels string) *FilesTouchCall { + c.urlParams_.Set("includeLabels", includeLabels) + return c +} + // IncludePermissionsForView sets the optional parameter // "includePermissionsForView": Specifies which additional view's // permissions to include in the response. Only 'published' is @@ -10897,6 +11674,11 @@ func (c *FilesTouchCall) Do(opts ...googleapi.CallOption) (*File, error) { // "required": true, // "type": "string" // }, + // "includeLabels": { + // "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + // "location": "query", + // "type": "string" + // }, // "includePermissionsForView": { // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", // "location": "query", @@ -10955,6 +11737,14 @@ func (r *FilesService) Trash(fileId string) *FilesTrashCall { return c } +// IncludeLabels sets the optional parameter "includeLabels": A +// comma-separated list of IDs of labels to include in the labelInfo +// part of the response. +func (c *FilesTrashCall) IncludeLabels(includeLabels string) *FilesTrashCall { + c.urlParams_.Set("includeLabels", includeLabels) + return c +} + // IncludePermissionsForView sets the optional parameter // "includePermissionsForView": Specifies which additional view's // permissions to include in the response. Only 'published' is @@ -11078,6 +11868,11 @@ func (c *FilesTrashCall) Do(opts ...googleapi.CallOption) (*File, error) { // "required": true, // "type": "string" // }, + // "includeLabels": { + // "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + // "location": "query", + // "type": "string" + // }, // "includePermissionsForView": { // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", // "location": "query", @@ -11131,6 +11926,14 @@ func (r *FilesService) Untrash(fileId string) *FilesUntrashCall { return c } +// IncludeLabels sets the optional parameter "includeLabels": A +// comma-separated list of IDs of labels to include in the labelInfo +// part of the response. +func (c *FilesUntrashCall) IncludeLabels(includeLabels string) *FilesUntrashCall { + c.urlParams_.Set("includeLabels", includeLabels) + return c +} + // IncludePermissionsForView sets the optional parameter // "includePermissionsForView": Specifies which additional view's // permissions to include in the response. Only 'published' is @@ -11254,6 +12057,11 @@ func (c *FilesUntrashCall) Do(opts ...googleapi.CallOption) (*File, error) { // "required": true, // "type": "string" // }, + // "includeLabels": { + // "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + // "location": "query", + // "type": "string" + // }, // "includePermissionsForView": { // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", // "location": "query", @@ -11333,6 +12141,14 @@ func (c *FilesUpdateCall) EnforceSingleParent(enforceSingleParent bool) *FilesUp return c } +// IncludeLabels sets the optional parameter "includeLabels": A +// comma-separated list of IDs of labels to include in the labelInfo +// part of the response. +func (c *FilesUpdateCall) IncludeLabels(includeLabels string) *FilesUpdateCall { + c.urlParams_.Set("includeLabels", includeLabels) + return c +} + // IncludePermissionsForView sets the optional parameter // "includePermissionsForView": Specifies which additional view's // permissions to include in the response. Only 'published' is @@ -11664,6 +12480,11 @@ func (c *FilesUpdateCall) Do(opts ...googleapi.CallOption) (*File, error) { // "required": true, // "type": "string" // }, + // "includeLabels": { + // "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + // "location": "query", + // "type": "string" + // }, // "includePermissionsForView": { // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", // "location": "query", @@ -11810,6 +12631,14 @@ func (c *FilesWatchCall) AcknowledgeAbuse(acknowledgeAbuse bool) *FilesWatchCall return c } +// IncludeLabels sets the optional parameter "includeLabels": A +// comma-separated list of IDs of labels to include in the labelInfo +// part of the response. +func (c *FilesWatchCall) IncludeLabels(includeLabels string) *FilesWatchCall { + c.urlParams_.Set("includeLabels", includeLabels) + return c +} + // IncludePermissionsForView sets the optional parameter // "includePermissionsForView": Specifies which additional view's // permissions to include in the response. Only 'published' is @@ -11987,6 +12816,11 @@ func (c *FilesWatchCall) Do(opts ...googleapi.CallOption) (*Channel, error) { // "required": true, // "type": "string" // }, + // "includeLabels": { + // "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + // "location": "query", + // "type": "string" + // }, // "includePermissionsForView": { // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", // "location": "query", diff --git a/drive/v3/drive-api.json b/drive/v3/drive-api.json index 5c0ab76fdca..55999ba85f5 100644 --- a/drive/v3/drive-api.json +++ b/drive/v3/drive-api.json @@ -35,7 +35,7 @@ "description": "Manages files in Drive including uploading, downloading, searching, detecting changes, and updating sharing permissions.", "discoveryVersion": "v1", "documentationLink": "https://developers.google.com/drive/", - "etag": "\"uWj2hSb4GVjzdDlAnRd2gbM1ZQ8/DjxGwbwcG0aMN4JG40B35nyJYNc\"", + "etag": "\"uWj2hSb4GVjzdDlAnRd2gbM1ZQ8/w7NrSVvAsjGozhSi_2XXg55ifjM\"", "icons": { "x16": "https://ssl.gstatic.com/docs/doclist/images/drive_icon_16.png", "x32": "https://ssl.gstatic.com/docs/doclist/images/drive_icon_32.png" @@ -183,6 +183,11 @@ "location": "query", "type": "boolean" }, + "includeLabels": { + "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + "location": "query", + "type": "string" + }, "includePermissionsForView": { "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", "location": "query", @@ -285,6 +290,11 @@ "location": "query", "type": "boolean" }, + "includeLabels": { + "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + "location": "query", + "type": "string" + }, "includePermissionsForView": { "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", "location": "query", @@ -810,6 +820,11 @@ "location": "query", "type": "boolean" }, + "includeLabels": { + "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + "location": "query", + "type": "string" + }, "includePermissionsForView": { "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", "location": "query", @@ -886,6 +901,11 @@ "location": "query", "type": "boolean" }, + "includeLabels": { + "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + "location": "query", + "type": "string" + }, "includePermissionsForView": { "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", "location": "query", @@ -1080,6 +1100,11 @@ "required": true, "type": "string" }, + "includeLabels": { + "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + "location": "query", + "type": "string" + }, "includePermissionsForView": { "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", "location": "query", @@ -1149,6 +1174,11 @@ "location": "query", "type": "boolean" }, + "includeLabels": { + "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + "location": "query", + "type": "string" + }, "includePermissionsForView": { "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", "location": "query", @@ -1222,6 +1252,75 @@ "https://www.googleapis.com/auth/drive.readonly" ] }, + "listLabels": { + "description": "Lists the labels on a file.", + "httpMethod": "GET", + "id": "drive.files.listLabels", + "parameterOrder": [ + "fileId" + ], + "parameters": { + "fileId": { + "description": "The ID of the file.", + "location": "path", + "required": true, + "type": "string" + }, + "maxResults": { + "default": "100", + "description": "The maximum number of labels to return per page. When not set, this defaults to 100.", + "format": "int32", + "location": "query", + "maximum": "100", + "minimum": "1", + "type": "integer" + }, + "pageToken": { + "description": "The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response.", + "location": "query", + "type": "string" + } + }, + "path": "files/{fileId}/listLabels", + "response": { + "$ref": "LabelList" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.metadata", + "https://www.googleapis.com/auth/drive.metadata.readonly", + "https://www.googleapis.com/auth/drive.readonly" + ] + }, + "modifyLabels": { + "description": "Modifies the set of labels on a file.", + "httpMethod": "POST", + "id": "drive.files.modifyLabels", + "parameterOrder": [ + "fileId" + ], + "parameters": { + "fileId": { + "description": "The ID of the file for which the labels are modified.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "files/{fileId}/modifyLabels", + "request": { + "$ref": "ModifyLabelsRequest" + }, + "response": { + "$ref": "ModifyLabelsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/drive", + "https://www.googleapis.com/auth/drive.file", + "https://www.googleapis.com/auth/drive.metadata" + ] + }, "update": { "description": "Updates a file's metadata and/or content. When calling this method, only populate fields in the request that you want to modify. When updating fields, some fields might change automatically, such as modifiedDate. This method supports patch semantics.", "httpMethod": "PATCH", @@ -1263,6 +1362,11 @@ "required": true, "type": "string" }, + "includeLabels": { + "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + "location": "query", + "type": "string" + }, "includePermissionsForView": { "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", "location": "query", @@ -1339,6 +1443,11 @@ "required": true, "type": "string" }, + "includeLabels": { + "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + "location": "query", + "type": "string" + }, "includePermissionsForView": { "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", "location": "query", @@ -2203,7 +2312,7 @@ } } }, - "revision": "20220508", + "revision": "20220709", "rootUrl": "https://www.googleapis.com/", "schemas": { "About": { @@ -2883,6 +2992,10 @@ "description": "Whether the current user can modify restrictions on content of this file.", "type": "boolean" }, + "canModifyLabels": { + "description": "Whether the current user can modify the labels on this file.", + "type": "boolean" + }, "canMoveChildrenOutOfDrive": { "description": "Whether the current user can move children of this folder outside of the shared drive. This is false when the item is not a folder. Only populated for items in shared drives.", "type": "boolean" @@ -2927,6 +3040,10 @@ "description": "Whether the current user can read the shared drive to which this file belongs. Only populated for items in shared drives.", "type": "boolean" }, + "canReadLabels": { + "description": "Whether the current user can read the labels on this file.", + "type": "boolean" + }, "canReadRevisions": { "description": "Whether the current user can read the revisions resource of this file. For a shared drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read.", "type": "boolean" @@ -3186,6 +3303,19 @@ "description": "Identifies what kind of resource this is. Value: the fixed string \"drive#file\".", "type": "string" }, + "labelInfo": { + "description": "An overview of the labels on the file.", + "properties": { + "labels": { + "description": "The set of labels on the file as requested by the label IDs in the includeLabels parameter. By default, no labels are returned.", + "items": { + "$ref": "Label" + }, + "type": "array" + } + }, + "type": "object" + }, "lastModifyingUser": { "$ref": "User", "description": "The last user to modify the file." @@ -3459,6 +3589,240 @@ }, "type": "object" }, + "Label": { + "description": "Representation of a label and its fields.", + "id": "Label", + "properties": { + "fields": { + "additionalProperties": { + "$ref": "LabelField" + }, + "description": "A map of the label's fields keyed by the field ID.", + "type": "object" + }, + "id": { + "description": "The ID of the label.", + "type": "string" + }, + "kind": { + "default": "drive#label", + "description": "This is always drive#label", + "type": "string" + }, + "revisionId": { + "description": "The revision ID of the label.", + "type": "string" + } + }, + "type": "object" + }, + "LabelField": { + "description": "Representation of a label field.", + "id": "LabelField", + "properties": { + "dateString": { + "description": "Only present if valueType is dateString. RFC 3339 formatted date: YYYY-MM-DD.", + "items": { + "format": "date", + "type": "string" + }, + "type": "array" + }, + "id": { + "description": "The identifier of this field.", + "type": "string" + }, + "integer": { + "description": "Only present if valueType is integer.", + "items": { + "format": "int64", + "type": "string" + }, + "type": "array" + }, + "kind": { + "default": "drive#labelField", + "description": "This is always drive#labelField.", + "type": "string" + }, + "selection": { + "description": "Only present if valueType is selection.", + "items": { + "type": "string" + }, + "type": "array" + }, + "text": { + "description": "Only present if valueType is text.", + "items": { + "type": "string" + }, + "type": "array" + }, + "user": { + "description": "Only present if valueType is user.", + "items": { + "$ref": "User" + }, + "type": "array" + }, + "valueType": { + "description": "The field type. While new values may be supported in the future, the following are currently allowed: \n- dateString \n- integer \n- selection \n- text \n- user", + "type": "string" + } + }, + "type": "object" + }, + "LabelFieldModification": { + "description": "A modification to a label's field.", + "id": "LabelFieldModification", + "properties": { + "fieldId": { + "description": "The ID of the Field to be modified.", + "type": "string" + }, + "kind": { + "default": "drive#labelFieldModification", + "description": "This is always drive#labelFieldModification.", + "type": "string" + }, + "setDateValues": { + "description": "Replaces a dateString field with these new values. The values must be strings in the RFC 3339 full-date format: YYYY-MM-DD.", + "items": { + "format": "date", + "type": "string" + }, + "type": "array" + }, + "setIntegerValues": { + "description": "Replaces an integer field with these new values.", + "items": { + "format": "int64", + "type": "string" + }, + "type": "array" + }, + "setSelectionValues": { + "description": "Replaces a selection field with these new values.", + "items": { + "type": "string" + }, + "type": "array" + }, + "setTextValues": { + "description": "Replaces a text field with these new values.", + "items": { + "type": "string" + }, + "type": "array" + }, + "setUserValues": { + "description": "Replaces a user field with these new values. The values must be valid email addresses.", + "items": { + "type": "string" + }, + "type": "array" + }, + "unsetValues": { + "description": "Unsets the values for this field.", + "type": "boolean" + } + }, + "type": "object" + }, + "LabelList": { + "description": "A list of labels.", + "id": "LabelList", + "properties": { + "kind": { + "default": "drive#labelList", + "description": "This is always drive#labelList", + "type": "string" + }, + "labels": { + "description": "The list of labels.", + "items": { + "$ref": "Label" + }, + "type": "array" + }, + "nextPageToken": { + "description": "The page token for the next page of labels. This field will be absent if the end of the list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results.", + "type": "string" + } + }, + "type": "object" + }, + "LabelModification": { + "description": "A modification to a label on a file. A LabelModification can be used to apply a label to a file, update an existing label on a file, or remove a label from a file.", + "id": "LabelModification", + "properties": { + "fieldModifications": { + "description": "The list of modifications to this label's fields.", + "items": { + "$ref": "LabelFieldModification" + }, + "type": "array" + }, + "kind": { + "default": "drive#labelModification", + "description": "This is always drive#labelModification.", + "type": "string" + }, + "labelId": { + "annotations": { + "required": [ + "drive.files.modifyLabels" + ] + }, + "description": "The ID of the label to modify.", + "type": "string" + }, + "removeLabel": { + "description": "If true, the label will be removed from the file.", + "type": "boolean" + } + }, + "type": "object" + }, + "ModifyLabelsRequest": { + "description": "A request to modify the set of labels on a file. This request may contain many modifications that will either all succeed or all fail transactionally.", + "id": "ModifyLabelsRequest", + "properties": { + "kind": { + "default": "drive#modifyLabelsRequest", + "description": "This is always drive#modifyLabelsRequest", + "type": "string" + }, + "labelModifications": { + "description": "The list of modifications to apply to the labels on the file.", + "items": { + "$ref": "LabelModification" + }, + "type": "array" + } + }, + "type": "object" + }, + "ModifyLabelsResponse": { + "description": "Response to a ModifyLabels request. This contains only those labels which were added or updated by the request.", + "id": "ModifyLabelsResponse", + "properties": { + "kind": { + "default": "drive#modifyLabelsResponse", + "description": "This is always drive#modifyLabelsResponse", + "type": "string" + }, + "modifiedLabels": { + "description": "The list of labels which were added or updated by the request.", + "items": { + "$ref": "Label" + }, + "type": "array" + } + }, + "type": "object" + }, "Permission": { "description": "A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.", "id": "Permission", diff --git a/drive/v3/drive-gen.go b/drive/v3/drive-gen.go index 15efd7008af..4b3fec474a6 100644 --- a/drive/v3/drive-gen.go +++ b/drive/v3/drive-gen.go @@ -1301,6 +1301,9 @@ type File struct { // string "drive#file". Kind string `json:"kind,omitempty"` + // LabelInfo: An overview of the labels on the file. + LabelInfo *FileLabelInfo `json:"labelInfo,omitempty"` + // LastModifyingUser: The last user to modify the file. LastModifyingUser *User `json:"lastModifyingUser,omitempty"` @@ -1572,6 +1575,10 @@ type FileCapabilities struct { // restrictions on content of this file. CanModifyContentRestriction bool `json:"canModifyContentRestriction,omitempty"` + // CanModifyLabels: Whether the current user can modify the labels on + // this file. + CanModifyLabels bool `json:"canModifyLabels,omitempty"` + // CanMoveChildrenOutOfDrive: Whether the current user can move children // of this folder outside of the shared drive. This is false when the // item is not a folder. Only populated for items in shared drives. @@ -1624,6 +1631,10 @@ type FileCapabilities struct { // which this file belongs. Only populated for items in shared drives. CanReadDrive bool `json:"canReadDrive,omitempty"` + // CanReadLabels: Whether the current user can read the labels on this + // file. + CanReadLabels bool `json:"canReadLabels,omitempty"` + // CanReadRevisions: Whether the current user can read the revisions // resource of this file. For a shared drive item, whether revisions of // non-folder descendants of this item, or this item itself if it is not @@ -1922,6 +1933,35 @@ func (s *FileImageMediaMetadataLocation) UnmarshalJSON(data []byte) error { return nil } +// FileLabelInfo: An overview of the labels on the file. +type FileLabelInfo struct { + // Labels: The set of labels on the file as requested by the label IDs + // in the includeLabels parameter. By default, no labels are returned. + Labels []*Label `json:"labels,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Labels") 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. "Labels") 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 *FileLabelInfo) MarshalJSON() ([]byte, error) { + type NoMethod FileLabelInfo + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // FileLinkShareMetadata: Contains details about the link URLs that // clients are using to refer to this item. type FileLinkShareMetadata struct { @@ -2125,6 +2165,303 @@ func (s *GeneratedIds) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// Label: Representation of a label and its fields. +type Label struct { + // Fields: A map of the label's fields keyed by the field ID. + Fields map[string]LabelField `json:"fields,omitempty"` + + // Id: The ID of the label. + Id string `json:"id,omitempty"` + + // Kind: This is always drive#label + Kind string `json:"kind,omitempty"` + + // RevisionId: The revision ID of the label. + RevisionId string `json:"revisionId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Fields") 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. "Fields") 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 *Label) MarshalJSON() ([]byte, error) { + type NoMethod Label + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// LabelField: Representation of a label field. +type LabelField struct { + // DateString: Only present if valueType is dateString. RFC 3339 + // formatted date: YYYY-MM-DD. + DateString []string `json:"dateString,omitempty"` + + // Id: The identifier of this field. + Id string `json:"id,omitempty"` + + // Integer: Only present if valueType is integer. + Integer googleapi.Int64s `json:"integer,omitempty"` + + // Kind: This is always drive#labelField. + Kind string `json:"kind,omitempty"` + + // Selection: Only present if valueType is selection. + Selection []string `json:"selection,omitempty"` + + // Text: Only present if valueType is text. + Text []string `json:"text,omitempty"` + + // User: Only present if valueType is user. + User []*User `json:"user,omitempty"` + + // ValueType: The field type. While new values may be supported in the + // future, the following are currently allowed: + // - dateString + // - integer + // - selection + // - text + // - user + ValueType string `json:"valueType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DateString") 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. "DateString") 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 *LabelField) MarshalJSON() ([]byte, error) { + type NoMethod LabelField + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// LabelFieldModification: A modification to a label's field. +type LabelFieldModification struct { + // FieldId: The ID of the Field to be modified. + FieldId string `json:"fieldId,omitempty"` + + // Kind: This is always drive#labelFieldModification. + Kind string `json:"kind,omitempty"` + + // SetDateValues: Replaces a dateString field with these new values. The + // values must be strings in the RFC 3339 full-date format: YYYY-MM-DD. + SetDateValues []string `json:"setDateValues,omitempty"` + + // SetIntegerValues: Replaces an integer field with these new values. + SetIntegerValues googleapi.Int64s `json:"setIntegerValues,omitempty"` + + // SetSelectionValues: Replaces a selection field with these new values. + SetSelectionValues []string `json:"setSelectionValues,omitempty"` + + // SetTextValues: Replaces a text field with these new values. + SetTextValues []string `json:"setTextValues,omitempty"` + + // SetUserValues: Replaces a user field with these new values. The + // values must be valid email addresses. + SetUserValues []string `json:"setUserValues,omitempty"` + + // UnsetValues: Unsets the values for this field. + UnsetValues bool `json:"unsetValues,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FieldId") 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. "FieldId") 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 *LabelFieldModification) MarshalJSON() ([]byte, error) { + type NoMethod LabelFieldModification + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// LabelList: A list of labels. +type LabelList struct { + // Kind: This is always drive#labelList + Kind string `json:"kind,omitempty"` + + // Labels: The list of labels. + Labels []*Label `json:"labels,omitempty"` + + // NextPageToken: The page token for the next page of labels. This field + // will be absent if the end of the list has been reached. If the token + // is rejected for any reason, it should be discarded, and pagination + // should be restarted from the first page of results. + NextPageToken string `json:"nextPageToken,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") 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. "Kind") 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 *LabelList) MarshalJSON() ([]byte, error) { + type NoMethod LabelList + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// LabelModification: A modification to a label on a file. A +// LabelModification can be used to apply a label to a file, update an +// existing label on a file, or remove a label from a file. +type LabelModification struct { + // FieldModifications: The list of modifications to this label's fields. + FieldModifications []*LabelFieldModification `json:"fieldModifications,omitempty"` + + // Kind: This is always drive#labelModification. + Kind string `json:"kind,omitempty"` + + // LabelId: The ID of the label to modify. + LabelId string `json:"labelId,omitempty"` + + // RemoveLabel: If true, the label will be removed from the file. + RemoveLabel bool `json:"removeLabel,omitempty"` + + // ForceSendFields is a list of field names (e.g. "FieldModifications") + // 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. "FieldModifications") 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 *LabelModification) MarshalJSON() ([]byte, error) { + type NoMethod LabelModification + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ModifyLabelsRequest: A request to modify the set of labels on a file. +// This request may contain many modifications that will either all +// succeed or all fail transactionally. +type ModifyLabelsRequest struct { + // Kind: This is always drive#modifyLabelsRequest + Kind string `json:"kind,omitempty"` + + // LabelModifications: The list of modifications to apply to the labels + // on the file. + LabelModifications []*LabelModification `json:"labelModifications,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Kind") 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. "Kind") 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 *ModifyLabelsRequest) MarshalJSON() ([]byte, error) { + type NoMethod ModifyLabelsRequest + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ModifyLabelsResponse: Response to a ModifyLabels request. This +// contains only those labels which were added or updated by the +// request. +type ModifyLabelsResponse struct { + // Kind: This is always drive#modifyLabelsResponse + Kind string `json:"kind,omitempty"` + + // ModifiedLabels: The list of labels which were added or updated by the + // request. + ModifiedLabels []*Label `json:"modifiedLabels,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Kind") 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. "Kind") 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 *ModifyLabelsResponse) MarshalJSON() ([]byte, error) { + type NoMethod ModifyLabelsResponse + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // Permission: A permission for a file. A permission grants a user, // group, domain or the world access to a file or a folder hierarchy. type Permission struct { @@ -3413,6 +3750,14 @@ func (c *ChangesListCall) IncludeItemsFromAllDrives(includeItemsFromAllDrives bo return c } +// IncludeLabels sets the optional parameter "includeLabels": A +// comma-separated list of IDs of labels to include in the labelInfo +// part of the response. +func (c *ChangesListCall) IncludeLabels(includeLabels string) *ChangesListCall { + c.urlParams_.Set("includeLabels", includeLabels) + return c +} + // IncludePermissionsForView sets the optional parameter // "includePermissionsForView": Specifies which additional view's // permissions to include in the response. Only 'published' is @@ -3605,6 +3950,11 @@ func (c *ChangesListCall) Do(opts ...googleapi.CallOption) (*ChangeList, error) // "location": "query", // "type": "boolean" // }, + // "includeLabels": { + // "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + // "location": "query", + // "type": "string" + // }, // "includePermissionsForView": { // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", // "location": "query", @@ -3735,6 +4085,14 @@ func (c *ChangesWatchCall) IncludeItemsFromAllDrives(includeItemsFromAllDrives b return c } +// IncludeLabels sets the optional parameter "includeLabels": A +// comma-separated list of IDs of labels to include in the labelInfo +// part of the response. +func (c *ChangesWatchCall) IncludeLabels(includeLabels string) *ChangesWatchCall { + c.urlParams_.Set("includeLabels", includeLabels) + return c +} + // IncludePermissionsForView sets the optional parameter // "includePermissionsForView": Specifies which additional view's // permissions to include in the response. Only 'published' is @@ -3919,6 +4277,11 @@ func (c *ChangesWatchCall) Do(opts ...googleapi.CallOption) (*Channel, error) { // "location": "query", // "type": "boolean" // }, + // "includeLabels": { + // "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + // "location": "query", + // "type": "string" + // }, // "includePermissionsForView": { // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", // "location": "query", @@ -6000,6 +6363,14 @@ func (c *FilesCopyCall) IgnoreDefaultVisibility(ignoreDefaultVisibility bool) *F return c } +// IncludeLabels sets the optional parameter "includeLabels": A +// comma-separated list of IDs of labels to include in the labelInfo +// part of the response. +func (c *FilesCopyCall) IncludeLabels(includeLabels string) *FilesCopyCall { + c.urlParams_.Set("includeLabels", includeLabels) + return c +} + // IncludePermissionsForView sets the optional parameter // "includePermissionsForView": Specifies which additional view's // permissions to include in the response. Only 'published' is @@ -6157,6 +6528,11 @@ func (c *FilesCopyCall) Do(opts ...googleapi.CallOption) (*File, error) { // "location": "query", // "type": "boolean" // }, + // "includeLabels": { + // "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + // "location": "query", + // "type": "string" + // }, // "includePermissionsForView": { // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", // "location": "query", @@ -6240,6 +6616,14 @@ func (c *FilesCreateCall) IgnoreDefaultVisibility(ignoreDefaultVisibility bool) return c } +// IncludeLabels sets the optional parameter "includeLabels": A +// comma-separated list of IDs of labels to include in the labelInfo +// part of the response. +func (c *FilesCreateCall) IncludeLabels(includeLabels string) *FilesCreateCall { + c.urlParams_.Set("includeLabels", includeLabels) + return c +} + // IncludePermissionsForView sets the optional parameter // "includePermissionsForView": Specifies which additional view's // permissions to include in the response. Only 'published' is @@ -6476,6 +6860,11 @@ func (c *FilesCreateCall) Do(opts ...googleapi.CallOption) (*File, error) { // "location": "query", // "type": "boolean" // }, + // "includeLabels": { + // "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + // "location": "query", + // "type": "string" + // }, // "includePermissionsForView": { // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", // "location": "query", @@ -7130,6 +7519,14 @@ func (c *FilesGetCall) AcknowledgeAbuse(acknowledgeAbuse bool) *FilesGetCall { return c } +// IncludeLabels sets the optional parameter "includeLabels": A +// comma-separated list of IDs of labels to include in the labelInfo +// part of the response. +func (c *FilesGetCall) IncludeLabels(includeLabels string) *FilesGetCall { + c.urlParams_.Set("includeLabels", includeLabels) + return c +} + // IncludePermissionsForView sets the optional parameter // "includePermissionsForView": Specifies which additional view's // permissions to include in the response. Only 'published' is @@ -7288,6 +7685,11 @@ func (c *FilesGetCall) Do(opts ...googleapi.CallOption) (*File, error) { // "required": true, // "type": "string" // }, + // "includeLabels": { + // "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + // "location": "query", + // "type": "string" + // }, // "includePermissionsForView": { // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", // "location": "query", @@ -7383,6 +7785,14 @@ func (c *FilesListCall) IncludeItemsFromAllDrives(includeItemsFromAllDrives bool return c } +// IncludeLabels sets the optional parameter "includeLabels": A +// comma-separated list of IDs of labels to include in the labelInfo +// part of the response. +func (c *FilesListCall) IncludeLabels(includeLabels string) *FilesListCall { + c.urlParams_.Set("includeLabels", includeLabels) + return c +} + // IncludePermissionsForView sets the optional parameter // "includePermissionsForView": Specifies which additional view's // permissions to include in the response. Only 'published' is @@ -7596,6 +8006,11 @@ func (c *FilesListCall) Do(opts ...googleapi.CallOption) (*FileList, error) { // "location": "query", // "type": "boolean" // }, + // "includeLabels": { + // "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + // "location": "query", + // "type": "string" + // }, // "includePermissionsForView": { // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", // "location": "query", @@ -7693,10 +8108,351 @@ func (c *FilesListCall) Pages(ctx context.Context, f func(*FileList) error) erro } } -// method id "drive.files.update": +// method id "drive.files.listLabels": -type FilesUpdateCall struct { - s *Service +type FilesListLabelsCall struct { + s *Service + fileId string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// ListLabels: Lists the labels on a file. +// +// - fileId: The ID of the file. +func (r *FilesService) ListLabels(fileId string) *FilesListLabelsCall { + c := &FilesListLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.fileId = fileId + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum +// number of labels to return per page. When not set, this defaults to +// 100. +func (c *FilesListLabelsCall) MaxResults(maxResults int64) *FilesListLabelsCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// PageToken sets the optional parameter "pageToken": The token for +// continuing a previous list request on the next page. This should be +// set to the value of 'nextPageToken' from the previous response. +func (c *FilesListLabelsCall) PageToken(pageToken string) *FilesListLabelsCall { + 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 *FilesListLabelsCall) Fields(s ...googleapi.Field) *FilesListLabelsCall { + 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 *FilesListLabelsCall) IfNoneMatch(entityTag string) *FilesListLabelsCall { + 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 *FilesListLabelsCall) Context(ctx context.Context) *FilesListLabelsCall { + 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 *FilesListLabelsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *FilesListLabelsCall) 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, "files/{fileId}/listLabels") + 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{ + "fileId": c.fileId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "drive.files.listLabels" call. +// Exactly one of *LabelList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *LabelList.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 *FilesListLabelsCall) Do(opts ...googleapi.CallOption) (*LabelList, 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, &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, err + } + ret := &LabelList{ + 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 the labels on a file.", + // "httpMethod": "GET", + // "id": "drive.files.listLabels", + // "parameterOrder": [ + // "fileId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID of the file.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "100", + // "description": "The maximum number of labels to return per page. When not set, this defaults to 100.", + // "format": "int32", + // "location": "query", + // "maximum": "100", + // "minimum": "1", + // "type": "integer" + // }, + // "pageToken": { + // "description": "The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response.", + // "location": "query", + // "type": "string" + // } + // }, + // "path": "files/{fileId}/listLabels", + // "response": { + // "$ref": "LabelList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.metadata", + // "https://www.googleapis.com/auth/drive.metadata.readonly", + // "https://www.googleapis.com/auth/drive.readonly" + // ] + // } + +} + +// 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 *FilesListLabelsCall) Pages(ctx context.Context, f func(*LabelList) 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 "drive.files.modifyLabels": + +type FilesModifyLabelsCall struct { + s *Service + fileId string + modifylabelsrequest *ModifyLabelsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// ModifyLabels: Modifies the set of labels on a file. +// +// - fileId: The ID of the file for which the labels are modified. +func (r *FilesService) ModifyLabels(fileId string, modifylabelsrequest *ModifyLabelsRequest) *FilesModifyLabelsCall { + c := &FilesModifyLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.fileId = fileId + c.modifylabelsrequest = modifylabelsrequest + 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 *FilesModifyLabelsCall) Fields(s ...googleapi.Field) *FilesModifyLabelsCall { + 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 *FilesModifyLabelsCall) Context(ctx context.Context) *FilesModifyLabelsCall { + 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 *FilesModifyLabelsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *FilesModifyLabelsCall) 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.modifylabelsrequest) + 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, "files/{fileId}/modifyLabels") + 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{ + "fileId": c.fileId, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "drive.files.modifyLabels" call. +// Exactly one of *ModifyLabelsResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ModifyLabelsResponse.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 *FilesModifyLabelsCall) Do(opts ...googleapi.CallOption) (*ModifyLabelsResponse, 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, &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, err + } + ret := &ModifyLabelsResponse{ + 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": "Modifies the set of labels on a file.", + // "httpMethod": "POST", + // "id": "drive.files.modifyLabels", + // "parameterOrder": [ + // "fileId" + // ], + // "parameters": { + // "fileId": { + // "description": "The ID of the file for which the labels are modified.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "files/{fileId}/modifyLabels", + // "request": { + // "$ref": "ModifyLabelsRequest" + // }, + // "response": { + // "$ref": "ModifyLabelsResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/drive", + // "https://www.googleapis.com/auth/drive.file", + // "https://www.googleapis.com/auth/drive.metadata" + // ] + // } + +} + +// method id "drive.files.update": + +type FilesUpdateCall struct { + s *Service fileId string file *File urlParams_ gensupport.URLParams @@ -7733,6 +8489,14 @@ func (c *FilesUpdateCall) EnforceSingleParent(enforceSingleParent bool) *FilesUp return c } +// IncludeLabels sets the optional parameter "includeLabels": A +// comma-separated list of IDs of labels to include in the labelInfo +// part of the response. +func (c *FilesUpdateCall) IncludeLabels(includeLabels string) *FilesUpdateCall { + c.urlParams_.Set("includeLabels", includeLabels) + return c +} + // IncludePermissionsForView sets the optional parameter // "includePermissionsForView": Specifies which additional view's // permissions to include in the response. Only 'published' is @@ -7987,6 +8751,11 @@ func (c *FilesUpdateCall) Do(opts ...googleapi.CallOption) (*File, error) { // "required": true, // "type": "string" // }, + // "includeLabels": { + // "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + // "location": "query", + // "type": "string" + // }, // "includePermissionsForView": { // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", // "location": "query", @@ -8078,6 +8847,14 @@ func (c *FilesWatchCall) AcknowledgeAbuse(acknowledgeAbuse bool) *FilesWatchCall return c } +// IncludeLabels sets the optional parameter "includeLabels": A +// comma-separated list of IDs of labels to include in the labelInfo +// part of the response. +func (c *FilesWatchCall) IncludeLabels(includeLabels string) *FilesWatchCall { + c.urlParams_.Set("includeLabels", includeLabels) + return c +} + // IncludePermissionsForView sets the optional parameter // "includePermissionsForView": Specifies which additional view's // permissions to include in the response. Only 'published' is @@ -8228,6 +9005,11 @@ func (c *FilesWatchCall) Do(opts ...googleapi.CallOption) (*Channel, error) { // "required": true, // "type": "string" // }, + // "includeLabels": { + // "description": "A comma-separated list of IDs of labels to include in the labelInfo part of the response.", + // "location": "query", + // "type": "string" + // }, // "includePermissionsForView": { // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", // "location": "query", diff --git a/memcache/v1beta2/memcache-api.json b/memcache/v1beta2/memcache-api.json index 168314c78ad..fba10017bfb 100644 --- a/memcache/v1beta2/memcache-api.json +++ b/memcache/v1beta2/memcache-api.json @@ -584,7 +584,7 @@ } } }, - "revision": "20220419", + "revision": "20220709", "rootUrl": "https://memcache.googleapis.com/", "schemas": { "ApplyParametersRequest": { @@ -814,7 +814,7 @@ "additionalProperties": { "type": "string" }, - "description": "Deprecated. The MaintenancePolicies that have been attached to the instance. The key must be of the type name of the oneof policy name defined in MaintenancePolicy, and the referenced policy must define the same policy type. For complete details of MaintenancePolicy, please refer to go/cloud-saas-mw-ug.", + "description": "Optional. Deprecated. The MaintenancePolicies that have been attached to the instance. The key must be of the type name of the oneof policy name defined in MaintenancePolicy, and the referenced policy must define the same policy type. For complete details of MaintenancePolicy, please refer to go/cloud-saas-mw-ug.", "type": "object" }, "maintenanceSchedules": { @@ -954,7 +954,7 @@ "additionalProperties": { "$ref": "MaintenancePolicy" }, - "description": "Optional. The MaintenancePolicies that have been attached to the instance. The key must be of the type name of the oneof policy name defined in MaintenancePolicy, and the embedded policy must define the same policy type. For complete details of MaintenancePolicy, please refer to go/cloud-saas-mw-ug. If only the name is needed (like in the deprecated Instance.maintenance_policy_names field) then only populate MaintenancePolicy.name.", + "description": "Optional. The MaintenancePolicies that have been attached to the instance. The key must be of the type name of the oneof policy name defined in MaintenancePolicy, and the embedded policy must define the same policy type. For complete details of MaintenancePolicy, please refer to go/cloud-saas-mw-ug. If only the name is needed, then only populate MaintenancePolicy.name.", "type": "object" } }, diff --git a/memcache/v1beta2/memcache-gen.go b/memcache/v1beta2/memcache-gen.go index 8415362dafe..10c4cfdcadd 100644 --- a/memcache/v1beta2/memcache-gen.go +++ b/memcache/v1beta2/memcache-gen.go @@ -545,9 +545,9 @@ type GoogleCloudSaasacceleratorManagementProvidersV1Instance struct { // value are arbitrary strings provided by the user. Labels map[string]string `json:"labels,omitempty"` - // MaintenancePolicyNames: Deprecated. The MaintenancePolicies that have - // been attached to the instance. The key must be of the type name of - // the oneof policy name defined in MaintenancePolicy, and the + // MaintenancePolicyNames: Optional. Deprecated. The MaintenancePolicies + // that have been attached to the instance. The key must be of the type + // name of the oneof policy name defined in MaintenancePolicy, and the // referenced policy must define the same policy type. For complete // details of MaintenancePolicy, please refer to go/cloud-saas-mw-ug. MaintenancePolicyNames map[string]string `json:"maintenancePolicyNames,omitempty"` @@ -718,9 +718,7 @@ type GoogleCloudSaasacceleratorManagementProvidersV1MaintenanceSettings struct { // oneof policy name defined in MaintenancePolicy, and the embedded // policy must define the same policy type. For complete details of // MaintenancePolicy, please refer to go/cloud-saas-mw-ug. If only the - // name is needed (like in the deprecated - // Instance.maintenance_policy_names field) then only populate - // MaintenancePolicy.name. + // name is needed, then only populate MaintenancePolicy.name. MaintenancePolicies map[string]MaintenancePolicy `json:"maintenancePolicies,omitempty"` // ForceSendFields is a list of field names (e.g. "Exclude") to diff --git a/ondemandscanning/v1/ondemandscanning-api.json b/ondemandscanning/v1/ondemandscanning-api.json index c0802a7da75..784d9ee4dca 100644 --- a/ondemandscanning/v1/ondemandscanning-api.json +++ b/ondemandscanning/v1/ondemandscanning-api.json @@ -339,7 +339,7 @@ } } }, - "revision": "20220612", + "revision": "20220711", "rootUrl": "https://ondemandscanning.googleapis.com/", "schemas": { "AliasContext": { @@ -369,6 +369,19 @@ }, "type": "object" }, + "AnalysisCompleted": { + "description": "Indicates which analysis completed successfully. Multiple types of analysis can be performed on a single resource.", + "id": "AnalysisCompleted", + "properties": { + "analysisType": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, "AnalyzePackagesMetadata": { "description": "AnalyzePackagesMetadata contains metadata for an active scan of a container image.", "id": "AnalyzePackagesMetadata", @@ -927,6 +940,16 @@ "description": "Provides information about the analysis status of a discovered resource.", "id": "DiscoveryOccurrence", "properties": { + "analysisCompleted": { + "$ref": "AnalysisCompleted" + }, + "analysisError": { + "description": "Indicates any errors encountered during analysis of a resource. There could be 0 or more of these errors.", + "items": { + "$ref": "Status" + }, + "type": "array" + }, "analysisStatus": { "description": "The status of discovery for the resource.", "enum": [ @@ -934,6 +957,7 @@ "PENDING", "SCANNING", "FINISHED_SUCCESS", + "COMPLETE", "FINISHED_FAILED", "FINISHED_UNSUPPORTED" ], @@ -942,8 +966,9 @@ "Resource is known but no action has been taken yet.", "Resource is being analyzed.", "Analysis has finished successfully.", + "Analysis has completed", "Analysis has finished unsuccessfully, the analysis itself is in a bad state.", - "The resource is known not to be supported" + "The resource is known not to be supported." ], "type": "string" }, diff --git a/ondemandscanning/v1/ondemandscanning-gen.go b/ondemandscanning/v1/ondemandscanning-gen.go index 99042b0d664..30c5ac6218c 100644 --- a/ondemandscanning/v1/ondemandscanning-gen.go +++ b/ondemandscanning/v1/ondemandscanning-gen.go @@ -232,6 +232,34 @@ func (s *AliasContext) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// AnalysisCompleted: Indicates which analysis completed successfully. +// Multiple types of analysis can be performed on a single resource. +type AnalysisCompleted struct { + AnalysisType []string `json:"analysisType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AnalysisType") 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. "AnalysisType") 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 *AnalysisCompleted) MarshalJSON() ([]byte, error) { + type NoMethod AnalysisCompleted + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // AnalyzePackagesMetadata: AnalyzePackagesMetadata contains metadata // for an active scan of a container image. type AnalyzePackagesMetadata struct { @@ -1033,6 +1061,12 @@ func (s *DeploymentOccurrence) MarshalJSON() ([]byte, error) { // DiscoveryOccurrence: Provides information about the analysis status // of a discovered resource. type DiscoveryOccurrence struct { + AnalysisCompleted *AnalysisCompleted `json:"analysisCompleted,omitempty"` + + // AnalysisError: Indicates any errors encountered during analysis of a + // resource. There could be 0 or more of these errors. + AnalysisError []*Status `json:"analysisError,omitempty"` + // AnalysisStatus: The status of discovery for the resource. // // Possible values: @@ -1040,9 +1074,10 @@ type DiscoveryOccurrence struct { // "PENDING" - Resource is known but no action has been taken yet. // "SCANNING" - Resource is being analyzed. // "FINISHED_SUCCESS" - Analysis has finished successfully. + // "COMPLETE" - Analysis has completed // "FINISHED_FAILED" - Analysis has finished unsuccessfully, the // analysis itself is in a bad state. - // "FINISHED_UNSUPPORTED" - The resource is known not to be supported + // "FINISHED_UNSUPPORTED" - The resource is known not to be supported. AnalysisStatus string `json:"analysisStatus,omitempty"` // AnalysisStatusError: When an error is encountered this will contain a @@ -1068,15 +1103,15 @@ type DiscoveryOccurrence struct { // LastScanTime: The last time this resource was scanned. LastScanTime string `json:"lastScanTime,omitempty"` - // ForceSendFields is a list of field names (e.g. "AnalysisStatus") to - // unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "AnalysisCompleted") + // 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. "AnalysisStatus") to + // NullFields is a list of field names (e.g. "AnalysisCompleted") 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/ondemandscanning/v1beta1/ondemandscanning-api.json b/ondemandscanning/v1beta1/ondemandscanning-api.json index 4f1a0f39f7d..6208752485f 100644 --- a/ondemandscanning/v1beta1/ondemandscanning-api.json +++ b/ondemandscanning/v1beta1/ondemandscanning-api.json @@ -339,7 +339,7 @@ } } }, - "revision": "20220612", + "revision": "20220711", "rootUrl": "https://ondemandscanning.googleapis.com/", "schemas": { "AliasContext": { @@ -369,6 +369,19 @@ }, "type": "object" }, + "AnalysisCompleted": { + "description": "Indicates which analysis completed successfully. Multiple types of analysis can be performed on a single resource.", + "id": "AnalysisCompleted", + "properties": { + "analysisType": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, "AnalyzePackagesMetadata": { "description": "AnalyzePackagesMetadata contains metadata for an active scan of a container image.", "id": "AnalyzePackagesMetadata", @@ -923,6 +936,16 @@ "description": "Provides information about the analysis status of a discovered resource.", "id": "DiscoveryOccurrence", "properties": { + "analysisCompleted": { + "$ref": "AnalysisCompleted" + }, + "analysisError": { + "description": "Indicates any errors encountered during analysis of a resource. There could be 0 or more of these errors.", + "items": { + "$ref": "Status" + }, + "type": "array" + }, "analysisStatus": { "description": "The status of discovery for the resource.", "enum": [ @@ -930,6 +953,7 @@ "PENDING", "SCANNING", "FINISHED_SUCCESS", + "COMPLETE", "FINISHED_FAILED", "FINISHED_UNSUPPORTED" ], @@ -938,8 +962,9 @@ "Resource is known but no action has been taken yet.", "Resource is being analyzed.", "Analysis has finished successfully.", + "Analysis has completed", "Analysis has finished unsuccessfully, the analysis itself is in a bad state.", - "The resource is known not to be supported" + "The resource is known not to be supported." ], "type": "string" }, diff --git a/ondemandscanning/v1beta1/ondemandscanning-gen.go b/ondemandscanning/v1beta1/ondemandscanning-gen.go index 384d55ca72d..f71aaaf0e3b 100644 --- a/ondemandscanning/v1beta1/ondemandscanning-gen.go +++ b/ondemandscanning/v1beta1/ondemandscanning-gen.go @@ -232,6 +232,34 @@ func (s *AliasContext) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) } +// AnalysisCompleted: Indicates which analysis completed successfully. +// Multiple types of analysis can be performed on a single resource. +type AnalysisCompleted struct { + AnalysisType []string `json:"analysisType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AnalysisType") 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. "AnalysisType") 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 *AnalysisCompleted) MarshalJSON() ([]byte, error) { + type NoMethod AnalysisCompleted + raw := NoMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + // AnalyzePackagesMetadata: AnalyzePackagesMetadata contains metadata // for an active scan of a container image. type AnalyzePackagesMetadata struct { @@ -1027,6 +1055,12 @@ func (s *DeploymentOccurrence) MarshalJSON() ([]byte, error) { // DiscoveryOccurrence: Provides information about the analysis status // of a discovered resource. type DiscoveryOccurrence struct { + AnalysisCompleted *AnalysisCompleted `json:"analysisCompleted,omitempty"` + + // AnalysisError: Indicates any errors encountered during analysis of a + // resource. There could be 0 or more of these errors. + AnalysisError []*Status `json:"analysisError,omitempty"` + // AnalysisStatus: The status of discovery for the resource. // // Possible values: @@ -1034,9 +1068,10 @@ type DiscoveryOccurrence struct { // "PENDING" - Resource is known but no action has been taken yet. // "SCANNING" - Resource is being analyzed. // "FINISHED_SUCCESS" - Analysis has finished successfully. + // "COMPLETE" - Analysis has completed // "FINISHED_FAILED" - Analysis has finished unsuccessfully, the // analysis itself is in a bad state. - // "FINISHED_UNSUPPORTED" - The resource is known not to be supported + // "FINISHED_UNSUPPORTED" - The resource is known not to be supported. AnalysisStatus string `json:"analysisStatus,omitempty"` // AnalysisStatusError: When an error is encountered this will contain a @@ -1062,15 +1097,15 @@ type DiscoveryOccurrence struct { // LastScanTime: The last time this resource was scanned. LastScanTime string `json:"lastScanTime,omitempty"` - // ForceSendFields is a list of field names (e.g. "AnalysisStatus") to - // unconditionally include in API requests. By default, fields with + // ForceSendFields is a list of field names (e.g. "AnalysisCompleted") + // 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. "AnalysisStatus") to + // NullFields is a list of field names (e.g. "AnalysisCompleted") 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/retail/v2/retail-api.json b/retail/v2/retail-api.json index cd6d969dac8..b12588abd8f 100644 --- a/retail/v2/retail-api.json +++ b/retail/v2/retail-api.json @@ -1193,7 +1193,7 @@ } } }, - "revision": "20220630", + "revision": "20220707", "rootUrl": "https://retail.googleapis.com/", "schemas": { "GoogleApiHttpBody": { @@ -1994,7 +1994,7 @@ "type": "integer" }, "pageToken": { - "description": "The previous PredictResponse.next_page_token.", + "description": "This field is not used for now, please leave it unset.", "type": "string" }, "params": { diff --git a/retail/v2/retail-gen.go b/retail/v2/retail-gen.go index 29034e52b4b..0771be5ec8d 100644 --- a/retail/v2/retail-gen.go +++ b/retail/v2/retail-gen.go @@ -1936,7 +1936,7 @@ type GoogleCloudRetailV2PredictRequest struct { // is 100. Values above 100 will be coerced to 100. PageSize int64 `json:"pageSize,omitempty"` - // PageToken: The previous PredictResponse.next_page_token. + // PageToken: This field is not used for now, please leave it unset. PageToken string `json:"pageToken,omitempty"` // Params: Additional domain specific parameters for the predictions. diff --git a/retail/v2alpha/retail-api.json b/retail/v2alpha/retail-api.json index 6862c98495e..56a4238210f 100644 --- a/retail/v2alpha/retail-api.json +++ b/retail/v2alpha/retail-api.json @@ -1803,7 +1803,7 @@ } } }, - "revision": "20220630", + "revision": "20220707", "rootUrl": "https://retail.googleapis.com/", "schemas": { "GoogleApiHttpBody": { @@ -2397,7 +2397,7 @@ "type": "string" }, "inUse": { - "description": "Output only. Indicates whether this attribute has been used by any products. `True` if at least one Product is using this attribute in Product.attributes. Otherwise, this field is `False`. CatalogAttribute can be pre-loaded by using CatalogService.AddCatalogAttribute, CatalogService.ImportCatalogAttributes, or CatalogService.UpdateAttributesConfig APIs. This field is `False` for pre-loaded CatalogAttributes. Only CatalogAttributes that are not in use by products can be deleted. CatalogAttributes that are in use by products cannot be deleted; however, their configuration properties will reset to default values upon removal request. After catalog changes, it takes about 10 minutes for this field to update.", + "description": "Output only. Indicates whether this attribute has been used by any products. `True` if at least one Product is using this attribute in Product.attributes. Otherwise, this field is `False`. CatalogAttribute can be pre-loaded by using CatalogService.AddCatalogAttribute, CatalogService.ImportCatalogAttributes, or CatalogService.UpdateAttributesConfig APIs. This field is `False` for pre-loaded CatalogAttributes. Only pre-loaded CatalogAttributes that are neither in use by products nor predefined can be deleted. CatalogAttributes that are either in use by products or are predefined cannot be deleted; however, their configuration properties will reset to default values upon removal request. After catalog changes, it takes about 10 minutes for this field to update.", "readOnly": true, "type": "boolean" }, @@ -3277,7 +3277,7 @@ "type": "integer" }, "pageToken": { - "description": "The previous PredictResponse.next_page_token.", + "description": "This field is not used for now, please leave it unset.", "type": "string" }, "params": { diff --git a/retail/v2alpha/retail-gen.go b/retail/v2alpha/retail-gen.go index 7fcdcb70990..b8025f712c4 100644 --- a/retail/v2alpha/retail-gen.go +++ b/retail/v2alpha/retail-gen.go @@ -1429,9 +1429,10 @@ type GoogleCloudRetailV2alphaCatalogAttribute struct { // CatalogService.AddCatalogAttribute, // CatalogService.ImportCatalogAttributes, or // CatalogService.UpdateAttributesConfig APIs. This field is `False` for - // pre-loaded CatalogAttributes. Only CatalogAttributes that are not in - // use by products can be deleted. CatalogAttributes that are in use by - // products cannot be deleted; however, their configuration properties + // pre-loaded CatalogAttributes. Only pre-loaded CatalogAttributes that + // are neither in use by products nor predefined can be deleted. + // CatalogAttributes that are either in use by products or are + // predefined cannot be deleted; however, their configuration properties // will reset to default values upon removal request. After catalog // changes, it takes about 10 minutes for this field to update. InUse bool `json:"inUse,omitempty"` @@ -3169,7 +3170,7 @@ type GoogleCloudRetailV2alphaPredictRequest struct { // is 100. Values above 100 will be coerced to 100. PageSize int64 `json:"pageSize,omitempty"` - // PageToken: The previous PredictResponse.next_page_token. + // PageToken: This field is not used for now, please leave it unset. PageToken string `json:"pageToken,omitempty"` // Params: Additional domain specific parameters for the predictions. diff --git a/retail/v2beta/retail-api.json b/retail/v2beta/retail-api.json index 3d7cda40131..9ce63cd6ba3 100644 --- a/retail/v2beta/retail-api.json +++ b/retail/v2beta/retail-api.json @@ -1770,7 +1770,7 @@ } } }, - "revision": "20220630", + "revision": "20220707", "rootUrl": "https://retail.googleapis.com/", "schemas": { "GoogleApiHttpBody": { @@ -2687,7 +2687,7 @@ "type": "string" }, "inUse": { - "description": "Output only. Indicates whether this attribute has been used by any products. `True` if at least one Product is using this attribute in Product.attributes. Otherwise, this field is `False`. CatalogAttribute can be pre-loaded by using CatalogService.AddCatalogAttribute, CatalogService.ImportCatalogAttributes, or CatalogService.UpdateAttributesConfig APIs. This field is `False` for pre-loaded CatalogAttributes. Only CatalogAttributes that are not in use by products can be deleted. CatalogAttributes that are in use by products cannot be deleted; however, their configuration properties will reset to default values upon removal request. After catalog changes, it takes about 10 minutes for this field to update.", + "description": "Output only. Indicates whether this attribute has been used by any products. `True` if at least one Product is using this attribute in Product.attributes. Otherwise, this field is `False`. CatalogAttribute can be pre-loaded by using CatalogService.AddCatalogAttribute, CatalogService.ImportCatalogAttributes, or CatalogService.UpdateAttributesConfig APIs. This field is `False` for pre-loaded CatalogAttributes. Only pre-loaded CatalogAttributes that are neither in use by products nor predefined can be deleted. CatalogAttributes that are either in use by products or are predefined cannot be deleted; however, their configuration properties will reset to default values upon removal request. After catalog changes, it takes about 10 minutes for this field to update.", "readOnly": true, "type": "boolean" }, @@ -3558,7 +3558,7 @@ "type": "integer" }, "pageToken": { - "description": "The previous PredictResponse.next_page_token.", + "description": "This field is not used for now, please leave it unset.", "type": "string" }, "params": { diff --git a/retail/v2beta/retail-gen.go b/retail/v2beta/retail-gen.go index 4fa1997f91d..d47e6ab5bdb 100644 --- a/retail/v2beta/retail-gen.go +++ b/retail/v2beta/retail-gen.go @@ -2019,9 +2019,10 @@ type GoogleCloudRetailV2betaCatalogAttribute struct { // CatalogService.AddCatalogAttribute, // CatalogService.ImportCatalogAttributes, or // CatalogService.UpdateAttributesConfig APIs. This field is `False` for - // pre-loaded CatalogAttributes. Only CatalogAttributes that are not in - // use by products can be deleted. CatalogAttributes that are in use by - // products cannot be deleted; however, their configuration properties + // pre-loaded CatalogAttributes. Only pre-loaded CatalogAttributes that + // are neither in use by products nor predefined can be deleted. + // CatalogAttributes that are either in use by products or are + // predefined cannot be deleted; however, their configuration properties // will reset to default values upon removal request. After catalog // changes, it takes about 10 minutes for this field to update. InUse bool `json:"inUse,omitempty"` @@ -3744,7 +3745,7 @@ type GoogleCloudRetailV2betaPredictRequest struct { // is 100. Values above 100 will be coerced to 100. PageSize int64 `json:"pageSize,omitempty"` - // PageToken: The previous PredictResponse.next_page_token. + // PageToken: This field is not used for now, please leave it unset. PageToken string `json:"pageToken,omitempty"` // Params: Additional domain specific parameters for the predictions. diff --git a/run/v1/run-api.json b/run/v1/run-api.json index 1408dde5fc3..226e2ca9e92 100644 --- a/run/v1/run-api.json +++ b/run/v1/run-api.json @@ -2261,7 +2261,7 @@ } } }, - "revision": "20220617", + "revision": "20220710", "rootUrl": "https://run.googleapis.com/", "schemas": { "Addressable": { @@ -3986,7 +3986,7 @@ "id": "SecretVolumeSource", "properties": { "defaultMode": { - "description": "Integer representation of mode bits to use on created files by default. Must be a value between 01 and 0777 (octal). If 0 or not set, it will default to 0644. Directories within the path are not affected by this setting. Notes * Internally, a umask of 0222 will be applied to any non-zero value. * This is an integer representation of the mode bits. So, the octal integer value should look exactly as the chmod numeric notation with a leading zero. Some examples: for chmod 777 (a=rwx), set to 0777 (octal) or 511 (base-10). For chmod 640 (u=rw,g=r), set to 0640 (octal) or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or 493 (base-10). * This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", + "description": "Integer representation of mode bits to use on created files by default. Must be a value between 01 and 0777 (octal). If 0 or not set, it will default to 0444. Directories within the path are not affected by this setting. Notes * Internally, a umask of 0222 will be applied to any non-zero value. * This is an integer representation of the mode bits. So, the octal integer value should look exactly as the chmod numeric notation with a leading zero. Some examples: for chmod 777 (a=rwx), set to 0777 (octal) or 511 (base-10). For chmod 640 (u=rw,g=r), set to 0640 (octal) or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or 493 (base-10). * This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", "format": "int32", "type": "integer" }, diff --git a/run/v1/run-gen.go b/run/v1/run-gen.go index 313e2021f8f..18a79e478f4 100644 --- a/run/v1/run-gen.go +++ b/run/v1/run-gen.go @@ -3576,7 +3576,7 @@ func (s *SecretKeySelector) MarshalJSON() ([]byte, error) { type SecretVolumeSource struct { // DefaultMode: Integer representation of mode bits to use on created // files by default. Must be a value between 01 and 0777 (octal). If 0 - // or not set, it will default to 0644. Directories within the path are + // or not set, it will default to 0444. Directories within the path are // not affected by this setting. Notes * Internally, a umask of 0222 // will be applied to any non-zero value. * This is an integer // representation of the mode bits. So, the octal integer value should diff --git a/run/v2/run-api.json b/run/v2/run-api.json index 3225cdb48b2..fb137c514e4 100644 --- a/run/v2/run-api.json +++ b/run/v2/run-api.json @@ -1064,7 +1064,7 @@ } } }, - "revision": "20220603", + "revision": "20220710", "rootUrl": "https://run.googleapis.com/", "schemas": { "GoogleCloudRunV2BinaryAuthorization": { @@ -1105,12 +1105,14 @@ "enum": [ "EXECUTION_REASON_UNDEFINED", "JOB_STATUS_SERVICE_POLLING_ERROR", - "NON_ZERO_EXIT_CODE" + "NON_ZERO_EXIT_CODE", + "CANCELLED" ], "enumDescriptions": [ "Default value.", "Internal system error getting execution status. System will retry.", - "A task reached its retry limit and the last attempt failed due to the user container exiting with a non-zero exit code." + "A task reached its retry limit and the last attempt failed due to the user container exiting with a non-zero exit code.", + "The execution was cancelled by users." ], "type": "string" }, @@ -1284,6 +1286,10 @@ "$ref": "GoogleCloudRunV2VolumeMount" }, "type": "array" + }, + "workingDir": { + "description": "Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image.", + "type": "string" } }, "type": "object" @@ -2113,7 +2119,7 @@ "id": "GoogleCloudRunV2SecretVolumeSource", "properties": { "defaultMode": { - "description": "Integer representation of mode bits to use on created files by default. Must be a value between 0000 and 0777 (octal), defaulting to 0644. Directories within the path are not affected by this setting. Notes * Internally, a umask of 0222 will be applied to any non-zero value. * This is an integer representation of the mode bits. So, the octal integer value should look exactly as the chmod numeric notation with a leading zero. Some examples: for chmod 777 (a=rwx), set to 0777 (octal) or 511 (base-10). For chmod 640 (u=rw,g=r), set to 0640 (octal) or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or 493 (base-10). * This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. This might be in conflict with other options that affect the file mode, like fsGroup, and as a result, other mode bits could be set.", + "description": "Integer representation of mode bits to use on created files by default. Must be a value between 0000 and 0777 (octal), defaulting to 0444. Directories within the path are not affected by this setting. Notes * Internally, a umask of 0222 will be applied to any non-zero value. * This is an integer representation of the mode bits. So, the octal integer value should look exactly as the chmod numeric notation with a leading zero. Some examples: for chmod 777 (a=rwx), set to 0777 (octal) or 511 (base-10). For chmod 640 (u=rw,g=r), set to 0640 (octal) or 416 (base-10). For chmod 755 (u=rwx,g=rx,o=rx), set to 0755 (octal) or 493 (base-10). * This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. This might be in conflict with other options that affect the file mode, like fsGroup, and as a result, other mode bits could be set.", "format": "int32", "type": "integer" }, diff --git a/run/v2/run-gen.go b/run/v2/run-gen.go index a86616adf91..85eb0a2c3bf 100644 --- a/run/v2/run-gen.go +++ b/run/v2/run-gen.go @@ -313,6 +313,7 @@ type GoogleCloudRunV2Condition struct { // "NON_ZERO_EXIT_CODE" - A task reached its retry limit and the last // attempt failed due to the user container exiting with a non-zero exit // code. + // "CANCELLED" - The execution was cancelled by users. ExecutionReason string `json:"executionReason,omitempty"` // LastTransitionTime: Last time the condition transitioned from one @@ -485,6 +486,11 @@ type GoogleCloudRunV2Container struct { // VolumeMounts: Volume to mount into the container's filesystem. VolumeMounts []*GoogleCloudRunV2VolumeMount `json:"volumeMounts,omitempty"` + // WorkingDir: Container's working directory. If not specified, the + // container runtime's default will be used, which might be configured + // in the container image. + WorkingDir string `json:"workingDir,omitempty"` + // ForceSendFields is a list of field names (e.g. "Args") to // unconditionally include in API requests. By default, fields with // empty or default values are omitted from API requests. However, any @@ -1666,7 +1672,7 @@ func (s *GoogleCloudRunV2SecretKeySelector) MarshalJSON() ([]byte, error) { type GoogleCloudRunV2SecretVolumeSource struct { // DefaultMode: Integer representation of mode bits to use on created // files by default. Must be a value between 0000 and 0777 (octal), - // defaulting to 0644. Directories within the path are not affected by + // defaulting to 0444. Directories within the path are not affected by // this setting. Notes * Internally, a umask of 0222 will be applied to // any non-zero value. * This is an integer representation of the mode // bits. So, the octal integer value should look exactly as the chmod